From 6b1c88d0b9f805993e658d3a17c199e66d577ffb Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Sun, 3 Apr 2022 15:03:19 +0800 Subject: [PATCH] build --- 19.24729045.async.js | 242 +- 20.cc291365.async.js | 466 +- 21.2329b082.async.js | 4954 +- 22.ef8b9ab5.async.js | 5002 +- 23.2f1b1a41.async.js | 5234 +- 25.a0d109f5.async.js | 188 +- 26.7c7e7071.async.js | 568 +- 27.166a58e7.async.js | 110 +- 28.14f5abf9.async.js | 192 +- 29.1d8bc06c.async.js | 220 +- 30.0ee59578.async.js | 1524 +- 31.d5887f1d.async.js | 340 +- 32.1c6f1c5b.async.js | 368 +- 33.21ecd820.async.js | 110 +- 34.86718798.async.js | 342 +- 35.26c1d613.async.js | 218 +- 36.da74844c.async.js | 276 +- 37.116cf847.async.js | 340 +- 38.b1f00a5a.async.js | 258 +- 39.b873d6bc.async.js | 388 +- 40.f9c606df.async.js | 342 +- 41.9b68c58c.async.js | 136 +- 42.0d599b54.async.js | 270 +- 43.0857e569.async.js | 290 +- 44.20714cf8.async.js | 288 +- 45.d8ceb50b.async.js | 230 +- 46.f4f5b960.async.js | 356 +- 47.75071b0c.async.js | 260 +- 48.54c266f1.async.js | 336 +- 49.12456089.async.js | 426 +- 5.b1988a56.async.js | 644 +- 50.3dc853a7.async.js | 362 +- 51.7678861a.async.js | 262 +- 52.e8a9d73d.async.js | 222 +- 53.4ea7154f.async.js | 1226 +- 54.90dff04d.async.js | 498 +- 55.7d590261.async.js | 556 +- 56.71f7538d.async.js | 1224 +- 57.ac4386ae.async.js | 1812 +- 58.ec19ab72.async.js | 342 +- 59.ca985166.async.js | 454 +- 60.d8871b82.async.js | 486 +- 61.2b2b47b1.async.js | 436 +- 62.abc7fdbc.async.js | 544 +- 63.18f4eca2.async.js | 242 +- 64.ed263a8e.async.js | 414 +- 65.7ee1997b.async.js | 286 +- 66.e1af0246.async.js | 782 +- 67.57a1150f.async.js | 308 +- 68.8e7aba91.async.js | 192 +- 69.beaabd0e.async.js | 212 +- 70.e079ddd4.async.js | 486 +- 71.91f85ec9.async.js | 414 +- 72.7628894b.async.js | 336 +- 73.d0496dcc.async.js | 312 +- 74.21aa9877.async.js | 2272 +- 75.16c67ba8.async.js | 474 +- 76.c1878604.async.js | 318 +- 77.ca974cf1.async.js | 262 +- 78.04ce4d1b.async.js | 546 +- 79.a7f6af09.async.js | 398 +- 80.ea1e44e5.async.js | 326 +- 81.8f9c49fe.async.js | 178 +- 82.ba554fab.async.js | 374 +- 83.c048402c.async.js | 2308 +- css.worker.js | 20206 +- editor.worker.js | 16290 +- html.worker.js | 20188 +- json.worker.js | 20194 +- p__Competitions__Detail.0c4058f4.async.js | 94 +- static/charpter-white.5fa14f93.svg | 34 +- static/choose.4ad1045f.svg | 50 +- static/lockclose.365036e8.svg | 22 +- ts.worker.js | 16730 +- umi.c4dd2590.js | 2136 +- vendors~monaco-editor.d82723f9.chunk.css | 8942 +- vendors~monaco-editor.e6eb62db.async.js | 243612 +++++++-------- ..._Competitions__Exports__.ed2c916e.async.js | 176 +- 78 files changed, 196728 insertions(+), 196728 deletions(-) diff --git a/19.24729045.async.js b/19.24729045.async.js index bbe496353..686478051 100644 --- a/19.24729045.async.js +++ b/19.24729045.async.js @@ -894,11 +894,11 @@ __webpack_require__.r(__webpack_exports__); -/** - * Options preset for `OffscreenCanvas`. - * @param config - Preset requirements. - * @param config.DOMParser - XML/HTML parser from string into DOM Document. - * @returns Preset object. +/** + * Options preset for `OffscreenCanvas`. + * @param config - Preset requirements. + * @param config.DOMParser - XML/HTML parser from string into DOM Document. + * @returns Preset object. */ function offscreen() { var { @@ -932,13 +932,13 @@ function offscreen() { return preset; } -/** - * Options preset for `node-canvas`. - * @param config - Preset requirements. - * @param config.DOMParser - XML/HTML parser from string into DOM Document. - * @param config.canvas - `node-canvas` exports. - * @param config.fetch - WHATWG-compatible `fetch` function. - * @returns Preset object. +/** + * Options preset for `node-canvas`. + * @param config - Preset requirements. + * @param config.DOMParser - XML/HTML parser from string into DOM Document. + * @param config.canvas - `node-canvas` exports. + * @param config.fetch - WHATWG-compatible `fetch` function. + * @returns Preset object. */ function node(_ref) { var { @@ -963,36 +963,36 @@ var index = /*#__PURE__*/Object.freeze({ node: node }); -/** - * HTML-safe compress white-spaces. - * @param str - String to compress. - * @returns String. +/** + * HTML-safe compress white-spaces. + * @param str - String to compress. + * @returns String. */ function compressSpaces(str) { return str.replace(/(?!\u3000)\s+/gm, ' '); } -/** - * HTML-safe left trim. - * @param str - String to trim. - * @returns String. +/** + * HTML-safe left trim. + * @param str - String to trim. + * @returns String. */ function trimLeft(str) { return str.replace(/^[\n \t]+/, ''); } -/** - * HTML-safe right trim. - * @param str - String to trim. - * @returns String. +/** + * HTML-safe right trim. + * @param str - String to trim. + * @returns String. */ function trimRight(str) { return str.replace(/[\n \t]+$/, ''); } -/** - * String to numbers array. - * @param str - Numbers string. - * @returns Numbers array. +/** + * String to numbers array. + * @param str - Numbers string. + * @returns Numbers array. */ function toNumbers(str) { @@ -1001,10 +1001,10 @@ function toNumbers(str) { } // Microsoft Edge fix var allUppercase = /^[A-Z-]+$/; -/** - * Normalize attribute name. - * @param name - Attribute name. - * @returns Normalized attribute name. +/** + * Normalize attribute name. + * @param name - Attribute name. + * @returns Normalized attribute name. */ function normalizeAttributeName(name) { @@ -1014,10 +1014,10 @@ function normalizeAttributeName(name) { return name; } -/** - * Parse external URL. - * @param url - CSS url string. - * @returns Parsed URL. +/** + * Parse external URL. + * @param url - CSS url string. + * @returns Parsed URL. */ function parseExternalUrl(url) { @@ -1028,10 +1028,10 @@ function parseExternalUrl(url) { var urlMatch = /url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(url) || []; return urlMatch[2] || urlMatch[3] || urlMatch[4]; } -/** - * Transform floats to integers in rgb colors. - * @param color - Color to normalize. - * @returns Normalized color. +/** + * Transform floats to integers in rgb colors. + * @param color - Color to normalize. + * @returns Normalized color. */ function normalizeColor(color) { @@ -1062,10 +1062,10 @@ function findSelectorMatch(selector, regex) { return [selector.replace(regex, ' '), matches.length]; } -/** - * Measure selector specificity. - * @param selector - Selector to measure. - * @returns Specificity. +/** + * Measure selector specificity. + * @param selector - Selector to measure. + * @returns Specificity. */ @@ -1093,30 +1093,30 @@ function getSelectorSpecificity(selector) { } var PSEUDO_ZERO = .00000001; -/** - * Vector magnitude. - * @param v - * @returns Number result. +/** + * Vector magnitude. + * @param v + * @returns Number result. */ function vectorMagnitude(v) { return Math.sqrt(Math.pow(v[0], 2) + Math.pow(v[1], 2)); } -/** - * Ratio between two vectors. - * @param u - * @param v - * @returns Number result. +/** + * Ratio between two vectors. + * @param u + * @param v + * @returns Number result. */ function vectorsRatio(u, v) { return (u[0] * v[0] + u[1] * v[1]) / (vectorMagnitude(u) * vectorMagnitude(v)); } -/** - * Angle between two vectors. - * @param u - * @param v - * @returns Number result. +/** + * Angle between two vectors. + * @param u + * @param v + * @returns Number result. */ function vectorsAngle(u, v) { @@ -2807,10 +2807,10 @@ function wrapFontFamily(fontFamily) { function prepareFontFamily(fontFamily) { return typeof process === 'undefined' ? fontFamily : fontFamily.trim().split(',').map(wrapFontFamily).join(','); } -/** - * https://developer.mozilla.org/en-US/docs/Web/CSS/font-style - * @param fontStyle - * @returns CSS font style. +/** + * https://developer.mozilla.org/en-US/docs/Web/CSS/font-style + * @param fontStyle + * @returns CSS font style. */ @@ -2838,10 +2838,10 @@ function prepareFontStyle(fontStyle) { return ''; } } -/** - * https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight - * @param fontWeight - * @returns CSS font weight. +/** + * https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight + * @param fontWeight + * @returns CSS font weight. */ @@ -4545,11 +4545,11 @@ class SVGElement extends RenderedElement { super.clearContext(ctx); this.document.screen.viewPort.removeCurrent(); } - /** - * Resize SVG to fit in given size. - * @param width - * @param height - * @param preserveAspectRatio + /** + * Resize SVG to fit in given size. + * @param width + * @param height + * @param preserveAspectRatio */ @@ -7201,16 +7201,16 @@ Document.elementTypes = elements; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_7___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } -/** - * SVG renderer on canvas. +/** + * SVG renderer on canvas. */ class Canvg { - /** - * Main constructor. - * @param ctx - Rendering context. - * @param svg - SVG Document. - * @param options - Rendering options. + /** + * Main constructor. + * @param ctx - Rendering context. + * @param svg - SVG Document. + * @param options - Rendering options. */ constructor(ctx, svg) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; @@ -7222,12 +7222,12 @@ class Canvg { this.document = document; this.documentElement = documentElement; } - /** - * Create Canvg instance from SVG source string or URL. - * @param ctx - Rendering context. - * @param svg - SVG source string or URL. - * @param options - Rendering options. - * @returns Canvg instance. + /** + * Create Canvg instance from SVG source string or URL. + * @param ctx - Rendering context. + * @param svg - SVG source string or URL. + * @param options - Rendering options. + * @returns Canvg instance. */ @@ -7240,12 +7240,12 @@ class Canvg { return new Canvg(ctx, svgDocument, options); })(); } - /** - * Create Canvg instance from SVG source string. - * @param ctx - Rendering context. - * @param svg - SVG source string. - * @param options - Rendering options. - * @returns Canvg instance. + /** + * Create Canvg instance from SVG source string. + * @param ctx - Rendering context. + * @param svg - SVG source string. + * @param options - Rendering options. + * @returns Canvg instance. */ @@ -7255,12 +7255,12 @@ class Canvg { var svgDocument = parser.parseFromString(svg); return new Canvg(ctx, svgDocument, options); } - /** - * Create new Canvg instance with inherited options. - * @param ctx - Rendering context. - * @param svg - SVG source string or URL. - * @param options - Rendering options. - * @returns Canvg instance. + /** + * Create new Canvg instance with inherited options. + * @param ctx - Rendering context. + * @param svg - SVG source string or URL. + * @param options - Rendering options. + * @returns Canvg instance. */ @@ -7268,12 +7268,12 @@ class Canvg { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; return Canvg.from(ctx, svg, _objectSpread(_objectSpread({}, this.options), options)); } - /** - * Create new Canvg instance with inherited options. - * @param ctx - Rendering context. - * @param svg - SVG source string. - * @param options - Rendering options. - * @returns Canvg instance. + /** + * Create new Canvg instance with inherited options. + * @param ctx - Rendering context. + * @param svg - SVG source string. + * @param options - Rendering options. + * @returns Canvg instance. */ @@ -7281,27 +7281,27 @@ class Canvg { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; return Canvg.fromString(ctx, svg, _objectSpread(_objectSpread({}, this.options), options)); } - /** - * Document is ready promise. - * @returns Ready promise. + /** + * Document is ready promise. + * @returns Ready promise. */ ready() { return this.screen.ready(); } - /** - * Document is ready value. - * @returns Is ready or not. + /** + * Document is ready value. + * @returns Is ready or not. */ isReady() { return this.screen.isReady(); } - /** - * Render only first frame, ignoring animations and mouse. - * @param options - Rendering options. + /** + * Render only first frame, ignoring animations and mouse. + * @param options - Rendering options. */ @@ -7323,9 +7323,9 @@ class Canvg { _this.stop(); })(); } - /** - * Start rendering. - * @param options - Render options. + /** + * Start rendering. + * @param options - Render options. */ @@ -7340,19 +7340,19 @@ class Canvg { enableRedraw: true }, baseOptions), options)); } - /** - * Stop rendering. + /** + * Stop rendering. */ stop() { this.screen.stop(); } - /** - * Resize SVG to fit in given size. - * @param width - * @param height - * @param preserveAspectRatio + /** + * Resize SVG to fit in given size. + * @param width + * @param height + * @param preserveAspectRatio */ diff --git a/20.cc291365.async.js b/20.cc291365.async.js index 47389c88c..2da20f59f 100644 --- a/20.cc291365.async.js +++ b/20.cc291365.async.js @@ -14,40 +14,40 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); /* harmony import */ var _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../typescript/typescript.js */ "87dK"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -// Allow for running under nodejs/requirejs in tests -var _monaco = (typeof monaco === 'undefined' ? self.monaco : monaco); -var conf = _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["conf"]; -var language = { - // Set defaultToken to invalid to see what you do not tokenize yet - defaultToken: 'invalid', - tokenPostfix: '.js', - keywords: [ - 'break', 'case', 'catch', 'class', 'continue', 'const', - 'constructor', 'debugger', 'default', 'delete', 'do', 'else', - 'export', 'extends', 'false', 'finally', 'for', 'from', 'function', - 'get', 'if', 'import', 'in', 'instanceof', 'let', 'new', 'null', - 'return', 'set', 'super', 'switch', 'symbol', 'this', 'throw', 'true', - 'try', 'typeof', 'undefined', 'var', 'void', 'while', 'with', 'yield', - 'async', 'await', 'of' - ], - typeKeywords: [], - operators: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].operators, - symbols: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].symbols, - escapes: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].escapes, - digits: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].digits, - octaldigits: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].octaldigits, - binarydigits: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].binarydigits, - hexdigits: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].hexdigits, - regexpctl: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].regexpctl, - regexpesc: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].regexpesc, - tokenizer: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].tokenizer, -}; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + +// Allow for running under nodejs/requirejs in tests +var _monaco = (typeof monaco === 'undefined' ? self.monaco : monaco); +var conf = _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["conf"]; +var language = { + // Set defaultToken to invalid to see what you do not tokenize yet + defaultToken: 'invalid', + tokenPostfix: '.js', + keywords: [ + 'break', 'case', 'catch', 'class', 'continue', 'const', + 'constructor', 'debugger', 'default', 'delete', 'do', 'else', + 'export', 'extends', 'false', 'finally', 'for', 'from', 'function', + 'get', 'if', 'import', 'in', 'instanceof', 'let', 'new', 'null', + 'return', 'set', 'super', 'switch', 'symbol', 'this', 'throw', 'true', + 'try', 'typeof', 'undefined', 'var', 'void', 'while', 'with', 'yield', + 'async', 'await', 'of' + ], + typeKeywords: [], + operators: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].operators, + symbols: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].symbols, + escapes: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].escapes, + digits: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].digits, + octaldigits: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].octaldigits, + binarydigits: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].binarydigits, + hexdigits: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].hexdigits, + regexpctl: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].regexpctl, + regexpesc: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].regexpesc, + tokenizer: _typescript_typescript_js__WEBPACK_IMPORTED_MODULE_0__["language"].tokenizer, +}; /***/ }), @@ -65,205 +65,205 @@ var language = { __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -// Allow for running under nodejs/requirejs in tests -var _monaco = (typeof monaco === 'undefined' ? self.monaco : monaco); -var conf = { - wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, - comments: { - lineComment: '//', - blockComment: ['/*', '*/'] - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - onEnterRules: [ - { - // e.g. /** | */ - beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, - afterText: /^\s*\*\/$/, - action: { indentAction: _monaco.languages.IndentAction.IndentOutdent, appendText: ' * ' } - }, - { - // e.g. /** ...| - beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, - action: { indentAction: _monaco.languages.IndentAction.None, appendText: ' * ' } - }, - { - // e.g. * ...| - beforeText: /^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/, - action: { indentAction: _monaco.languages.IndentAction.None, appendText: '* ' } - }, - { - // e.g. */| - beforeText: /^(\t|(\ \ ))*\ \*\/\s*$/, - action: { indentAction: _monaco.languages.IndentAction.None, removeText: 1 } - } - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"', notIn: ['string'] }, - { open: '\'', close: '\'', notIn: ['string', 'comment'] }, - { open: '`', close: '`', notIn: ['string', 'comment'] }, - { open: "/**", close: " */", notIn: ["string"] } - ], - folding: { - markers: { - start: new RegExp("^\\s*//\\s*#?region\\b"), - end: new RegExp("^\\s*//\\s*#?endregion\\b") - } - } -}; -var language = { - // Set defaultToken to invalid to see what you do not tokenize yet - defaultToken: 'invalid', - tokenPostfix: '.ts', - keywords: [ - 'abstract', 'as', 'break', 'case', 'catch', 'class', 'continue', 'const', - 'constructor', 'debugger', 'declare', 'default', 'delete', 'do', 'else', - 'enum', 'export', 'extends', 'false', 'finally', 'for', 'from', 'function', - 'get', 'if', 'implements', 'import', 'in', 'infer', 'instanceof', 'interface', - 'is', 'keyof', 'let', 'module', 'namespace', 'never', 'new', 'null', 'package', - 'private', 'protected', 'public', 'readonly', 'require', 'global', 'return', - 'set', 'static', 'super', 'switch', 'symbol', 'this', 'throw', 'true', 'try', - 'type', 'typeof', 'unique', 'var', 'void', 'while', 'with', 'yield', 'async', - 'await', 'of' - ], - typeKeywords: [ - 'any', 'boolean', 'number', 'object', 'string', 'undefined' - ], - operators: [ - '<=', '>=', '==', '!=', '===', '!==', '=>', '+', '-', '**', - '*', '/', '%', '++', '--', '<<', '>', '>>>', '&', - '|', '^', '!', '~', '&&', '||', '??', '?', ':', '=', '+=', '-=', - '*=', '**=', '/=', '%=', '<<=', '>>=', '>>>=', '&=', '|=', - '^=', '@', - ], - // we include these common regular expressions - symbols: /[=>](?!@symbols)/, '@brackets'], - [/!(?=([^=]|$))/, 'delimiter'], - [/@symbols/, { - cases: { - '@operators': 'delimiter', - '@default': '' - } - }], - // numbers - [/(@digits)[eE]([\-+]?(@digits))?/, 'number.float'], - [/(@digits)\.(@digits)([eE][\-+]?(@digits))?/, 'number.float'], - [/0[xX](@hexdigits)n?/, 'number.hex'], - [/0[oO]?(@octaldigits)n?/, 'number.octal'], - [/0[bB](@binarydigits)n?/, 'number.binary'], - [/(@digits)n?/, 'number'], - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - // strings - [/"([^"\\]|\\.)*$/, 'string.invalid'], - [/'([^'\\]|\\.)*$/, 'string.invalid'], - [/"/, 'string', '@string_double'], - [/'/, 'string', '@string_single'], - [/`/, 'string', '@string_backtick'], - ], - whitespace: [ - [/[ \t\r\n]+/, ''], - [/\/\*\*(?!\/)/, 'comment.doc', '@jsdoc'], - [/\/\*/, 'comment', '@comment'], - [/\/\/.*$/, 'comment'], - ], - comment: [ - [/[^\/*]+/, 'comment'], - [/\*\//, 'comment', '@pop'], - [/[\/*]/, 'comment'] - ], - jsdoc: [ - [/[^\/*]+/, 'comment.doc'], - [/\*\//, 'comment.doc', '@pop'], - [/[\/*]/, 'comment.doc'] - ], - // We match regular expression quite precisely - regexp: [ - [/(\{)(\d+(?:,\d*)?)(\})/, ['regexp.escape.control', 'regexp.escape.control', 'regexp.escape.control']], - [/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/, ['regexp.escape.control', { token: 'regexp.escape.control', next: '@regexrange' }]], - [/(\()(\?:|\?=|\?!)/, ['regexp.escape.control', 'regexp.escape.control']], - [/[()]/, 'regexp.escape.control'], - [/@regexpctl/, 'regexp.escape.control'], - [/[^\\\/]/, 'regexp'], - [/@regexpesc/, 'regexp.escape'], - [/\\\./, 'regexp.invalid'], - [/(\/)([gimsuy]*)/, [{ token: 'regexp', bracket: '@close', next: '@pop' }, 'keyword.other']], - ], - regexrange: [ - [/-/, 'regexp.escape.control'], - [/\^/, 'regexp.invalid'], - [/@regexpesc/, 'regexp.escape'], - [/[^\]]/, 'regexp'], - [/\]/, { token: 'regexp.escape.control', next: '@pop', bracket: '@close' }] - ], - string_double: [ - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, 'string', '@pop'] - ], - string_single: [ - [/[^\\']+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/'/, 'string', '@pop'] - ], - string_backtick: [ - [/\$\{/, { token: 'delimiter.bracket', next: '@bracketCounting' }], - [/[^\\`$]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/`/, 'string', '@pop'] - ], - bracketCounting: [ - [/\{/, 'delimiter.bracket', '@bracketCounting'], - [/\}/, 'delimiter.bracket', '@pop'], - { include: 'common' } - ], - }, -}; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +// Allow for running under nodejs/requirejs in tests +var _monaco = (typeof monaco === 'undefined' ? self.monaco : monaco); +var conf = { + wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, + comments: { + lineComment: '//', + blockComment: ['/*', '*/'] + }, + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'] + ], + onEnterRules: [ + { + // e.g. /** | */ + beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, + afterText: /^\s*\*\/$/, + action: { indentAction: _monaco.languages.IndentAction.IndentOutdent, appendText: ' * ' } + }, + { + // e.g. /** ...| + beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, + action: { indentAction: _monaco.languages.IndentAction.None, appendText: ' * ' } + }, + { + // e.g. * ...| + beforeText: /^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/, + action: { indentAction: _monaco.languages.IndentAction.None, appendText: '* ' } + }, + { + // e.g. */| + beforeText: /^(\t|(\ \ ))*\ \*\/\s*$/, + action: { indentAction: _monaco.languages.IndentAction.None, removeText: 1 } + } + ], + autoClosingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"', close: '"', notIn: ['string'] }, + { open: '\'', close: '\'', notIn: ['string', 'comment'] }, + { open: '`', close: '`', notIn: ['string', 'comment'] }, + { open: "/**", close: " */", notIn: ["string"] } + ], + folding: { + markers: { + start: new RegExp("^\\s*//\\s*#?region\\b"), + end: new RegExp("^\\s*//\\s*#?endregion\\b") + } + } +}; +var language = { + // Set defaultToken to invalid to see what you do not tokenize yet + defaultToken: 'invalid', + tokenPostfix: '.ts', + keywords: [ + 'abstract', 'as', 'break', 'case', 'catch', 'class', 'continue', 'const', + 'constructor', 'debugger', 'declare', 'default', 'delete', 'do', 'else', + 'enum', 'export', 'extends', 'false', 'finally', 'for', 'from', 'function', + 'get', 'if', 'implements', 'import', 'in', 'infer', 'instanceof', 'interface', + 'is', 'keyof', 'let', 'module', 'namespace', 'never', 'new', 'null', 'package', + 'private', 'protected', 'public', 'readonly', 'require', 'global', 'return', + 'set', 'static', 'super', 'switch', 'symbol', 'this', 'throw', 'true', 'try', + 'type', 'typeof', 'unique', 'var', 'void', 'while', 'with', 'yield', 'async', + 'await', 'of' + ], + typeKeywords: [ + 'any', 'boolean', 'number', 'object', 'string', 'undefined' + ], + operators: [ + '<=', '>=', '==', '!=', '===', '!==', '=>', '+', '-', '**', + '*', '/', '%', '++', '--', '<<', '>', '>>>', '&', + '|', '^', '!', '~', '&&', '||', '??', '?', ':', '=', '+=', '-=', + '*=', '**=', '/=', '%=', '<<=', '>>=', '>>>=', '&=', '|=', + '^=', '@', + ], + // we include these common regular expressions + symbols: /[=>](?!@symbols)/, '@brackets'], + [/!(?=([^=]|$))/, 'delimiter'], + [/@symbols/, { + cases: { + '@operators': 'delimiter', + '@default': '' + } + }], + // numbers + [/(@digits)[eE]([\-+]?(@digits))?/, 'number.float'], + [/(@digits)\.(@digits)([eE][\-+]?(@digits))?/, 'number.float'], + [/0[xX](@hexdigits)n?/, 'number.hex'], + [/0[oO]?(@octaldigits)n?/, 'number.octal'], + [/0[bB](@binarydigits)n?/, 'number.binary'], + [/(@digits)n?/, 'number'], + // delimiter: after number because of .\d floats + [/[;,.]/, 'delimiter'], + // strings + [/"([^"\\]|\\.)*$/, 'string.invalid'], + [/'([^'\\]|\\.)*$/, 'string.invalid'], + [/"/, 'string', '@string_double'], + [/'/, 'string', '@string_single'], + [/`/, 'string', '@string_backtick'], + ], + whitespace: [ + [/[ \t\r\n]+/, ''], + [/\/\*\*(?!\/)/, 'comment.doc', '@jsdoc'], + [/\/\*/, 'comment', '@comment'], + [/\/\/.*$/, 'comment'], + ], + comment: [ + [/[^\/*]+/, 'comment'], + [/\*\//, 'comment', '@pop'], + [/[\/*]/, 'comment'] + ], + jsdoc: [ + [/[^\/*]+/, 'comment.doc'], + [/\*\//, 'comment.doc', '@pop'], + [/[\/*]/, 'comment.doc'] + ], + // We match regular expression quite precisely + regexp: [ + [/(\{)(\d+(?:,\d*)?)(\})/, ['regexp.escape.control', 'regexp.escape.control', 'regexp.escape.control']], + [/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/, ['regexp.escape.control', { token: 'regexp.escape.control', next: '@regexrange' }]], + [/(\()(\?:|\?=|\?!)/, ['regexp.escape.control', 'regexp.escape.control']], + [/[()]/, 'regexp.escape.control'], + [/@regexpctl/, 'regexp.escape.control'], + [/[^\\\/]/, 'regexp'], + [/@regexpesc/, 'regexp.escape'], + [/\\\./, 'regexp.invalid'], + [/(\/)([gimsuy]*)/, [{ token: 'regexp', bracket: '@close', next: '@pop' }, 'keyword.other']], + ], + regexrange: [ + [/-/, 'regexp.escape.control'], + [/\^/, 'regexp.invalid'], + [/@regexpesc/, 'regexp.escape'], + [/[^\]]/, 'regexp'], + [/\]/, { token: 'regexp.escape.control', next: '@pop', bracket: '@close' }] + ], + string_double: [ + [/[^\\"]+/, 'string'], + [/@escapes/, 'string.escape'], + [/\\./, 'string.escape.invalid'], + [/"/, 'string', '@pop'] + ], + string_single: [ + [/[^\\']+/, 'string'], + [/@escapes/, 'string.escape'], + [/\\./, 'string.escape.invalid'], + [/'/, 'string', '@pop'] + ], + string_backtick: [ + [/\$\{/, { token: 'delimiter.bracket', next: '@bracketCounting' }], + [/[^\\`$]+/, 'string'], + [/@escapes/, 'string.escape'], + [/\\./, 'string.escape.invalid'], + [/`/, 'string', '@pop'] + ], + bracketCounting: [ + [/\{/, 'delimiter.bracket', '@bracketCounting'], + [/\}/, 'delimiter.bracket', '@pop'], + { include: 'common' } + ], + }, +}; /***/ }) diff --git a/21.2329b082.async.js b/21.2329b082.async.js index 0987dcbb9..1073f82e4 100644 --- a/21.2329b082.async.js +++ b/21.2329b082.async.js @@ -17,75 +17,75 @@ __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "setupMode", function() { return /* binding */ setupMode; }); // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/workerManager.js -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var STOP_WHEN_IDLE_FOR = 2 * 60 * 1000; // 2min -var WorkerManager = /** @class */ (function () { - function WorkerManager(defaults) { - var _this = this; - this._defaults = defaults; - this._worker = null; - this._idleCheckInterval = window.setInterval(function () { return _this._checkIfIdle(); }, 30 * 1000); - this._lastUsedTime = 0; - this._configChangeListener = this._defaults.onDidChange(function () { return _this._stopWorker(); }); - } - WorkerManager.prototype._stopWorker = function () { - if (this._worker) { - this._worker.dispose(); - this._worker = null; - } - this._client = null; - }; - WorkerManager.prototype.dispose = function () { - clearInterval(this._idleCheckInterval); - this._configChangeListener.dispose(); - this._stopWorker(); - }; - WorkerManager.prototype._checkIfIdle = function () { - if (!this._worker) { - return; - } - var timePassedSinceLastUsed = Date.now() - this._lastUsedTime; - if (timePassedSinceLastUsed > STOP_WHEN_IDLE_FOR) { - this._stopWorker(); - } - }; - WorkerManager.prototype._getClient = function () { - this._lastUsedTime = Date.now(); - if (!this._client) { - this._worker = monaco.editor.createWebWorker({ - // module that exports the create() method and returns a `CSSWorker` instance - moduleId: 'vs/language/css/cssWorker', - label: this._defaults.languageId, - // passed in to the create() method - createData: { - languageSettings: this._defaults.diagnosticsOptions, - languageId: this._defaults.languageId - } - }); - this._client = this._worker.getProxy(); - } - return this._client; - }; - WorkerManager.prototype.getLanguageServiceWorker = function () { - var _this = this; - var resources = []; - for (var _i = 0; _i < arguments.length; _i++) { - resources[_i] = arguments[_i]; - } - var _client; - return this._getClient().then(function (client) { - _client = client; - }).then(function (_) { - return _this._worker.withSyncedResources(resources); - }).then(function (_) { return _client; }); - }; - return WorkerManager; -}()); - +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var STOP_WHEN_IDLE_FOR = 2 * 60 * 1000; // 2min +var WorkerManager = /** @class */ (function () { + function WorkerManager(defaults) { + var _this = this; + this._defaults = defaults; + this._worker = null; + this._idleCheckInterval = window.setInterval(function () { return _this._checkIfIdle(); }, 30 * 1000); + this._lastUsedTime = 0; + this._configChangeListener = this._defaults.onDidChange(function () { return _this._stopWorker(); }); + } + WorkerManager.prototype._stopWorker = function () { + if (this._worker) { + this._worker.dispose(); + this._worker = null; + } + this._client = null; + }; + WorkerManager.prototype.dispose = function () { + clearInterval(this._idleCheckInterval); + this._configChangeListener.dispose(); + this._stopWorker(); + }; + WorkerManager.prototype._checkIfIdle = function () { + if (!this._worker) { + return; + } + var timePassedSinceLastUsed = Date.now() - this._lastUsedTime; + if (timePassedSinceLastUsed > STOP_WHEN_IDLE_FOR) { + this._stopWorker(); + } + }; + WorkerManager.prototype._getClient = function () { + this._lastUsedTime = Date.now(); + if (!this._client) { + this._worker = monaco.editor.createWebWorker({ + // module that exports the create() method and returns a `CSSWorker` instance + moduleId: 'vs/language/css/cssWorker', + label: this._defaults.languageId, + // passed in to the create() method + createData: { + languageSettings: this._defaults.diagnosticsOptions, + languageId: this._defaults.languageId + } + }); + this._client = this._worker.getProxy(); + } + return this._client; + }; + WorkerManager.prototype.getLanguageServiceWorker = function () { + var _this = this; + var resources = []; + for (var _i = 0; _i < arguments.length; _i++) { + resources[_i] = arguments[_i]; + } + var _client; + return this._getClient().then(function (client) { + _client = client; + }).then(function (_) { + return _this._worker.withSyncedResources(resources); + }).then(function (_) { return _client; }); + }; + return WorkerManager; +}()); + // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssScanner.js /*--------------------------------------------------------------------------------------------- @@ -2569,36 +2569,36 @@ var ParseErrorCollector = /** @class */ (function () { // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/fillers/vscode-nls.js -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function format(message, args) { - var result; - if (args.length === 0) { - result = message; - } - else { - result = message.replace(/\{(\d+)\}/g, function (match, rest) { - var index = rest[0]; - return typeof args[index] !== 'undefined' ? args[index] : match; - }); - } - return result; -} -function localize(key, message) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - return format(message, args); -} -function loadMessageBundle(file) { - return localize; -} -function config(opt) { - return loadMessageBundle; -} +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +function format(message, args) { + var result; + if (args.length === 0) { + result = message; + } + else { + result = message.replace(/\{(\d+)\}/g, function (match, rest) { + var index = rest[0]; + return typeof args[index] !== 'undefined' ? args[index] : match; + }); + } + return result; +} +function localize(key, message) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + return format(message, args); +} +function loadMessageBundle(file) { + return localize; +} +function config(opt) { + return loadMessageBundle; +} // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssErrors.js /*--------------------------------------------------------------------------------------------- @@ -25961,1800 +25961,1800 @@ function getLimitedString(str, ellipsis) { } // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-languageserver-types/main.js -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -/** - * The Position namespace provides helper functions to work with - * [Position](#Position) literals. - */ -var Position; -(function (Position) { - /** - * Creates a new Position literal from the given line and character. - * @param line The position's line. - * @param character The position's character. - */ - function create(line, character) { - return { line: line, character: character }; - } - Position.create = create; - /** - * Checks whether the given liternal conforms to the [Position](#Position) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character); - } - Position.is = is; -})(Position || (Position = {})); -/** - * The Range namespace provides helper functions to work with - * [Range](#Range) literals. - */ -var Range; -(function (Range) { - function create(one, two, three, four) { - if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) { - return { start: Position.create(one, two), end: Position.create(three, four) }; - } - else if (Position.is(one) && Position.is(two)) { - return { start: one, end: two }; - } - else { - throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]"); - } - } - Range.create = create; - /** - * Checks whether the given literal conforms to the [Range](#Range) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); - } - Range.is = is; -})(Range || (Range = {})); -/** - * The Location namespace provides helper functions to work with - * [Location](#Location) literals. - */ -var Location; -(function (Location) { - /** - * Creates a Location literal. - * @param uri The location's uri. - * @param range The location's range. - */ - function create(uri, range) { - return { uri: uri, range: range }; - } - Location.create = create; - /** - * Checks whether the given literal conforms to the [Location](#Location) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); - } - Location.is = is; -})(Location || (Location = {})); -/** - * The LocationLink namespace provides helper functions to work with - * [LocationLink](#LocationLink) literals. - */ -var LocationLink; -(function (LocationLink) { - /** - * Creates a LocationLink literal. - * @param targetUri The definition's uri. - * @param targetRange The full range of the definition. - * @param targetSelectionRange The span of the symbol definition at the target. - * @param originSelectionRange The span of the symbol being defined in the originating source file. - */ - function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) { - return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange }; - } - LocationLink.create = create; - /** - * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) - && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) - && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); - } - LocationLink.is = is; -})(LocationLink || (LocationLink = {})); -/** - * The Color namespace provides helper functions to work with - * [Color](#Color) literals. - */ -var Color; -(function (Color) { - /** - * Creates a new Color literal. - */ - function create(red, green, blue, alpha) { - return { - red: red, - green: green, - blue: blue, - alpha: alpha, - }; - } - Color.create = create; - /** - * Checks whether the given literal conforms to the [Color](#Color) interface. - */ - function is(value) { - var candidate = value; - return Is.number(candidate.red) - && Is.number(candidate.green) - && Is.number(candidate.blue) - && Is.number(candidate.alpha); - } - Color.is = is; -})(Color || (Color = {})); -/** - * The ColorInformation namespace provides helper functions to work with - * [ColorInformation](#ColorInformation) literals. - */ -var ColorInformation; -(function (ColorInformation) { - /** - * Creates a new ColorInformation literal. - */ - function create(range, color) { - return { - range: range, - color: color, - }; - } - ColorInformation.create = create; - /** - * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. - */ - function is(value) { - var candidate = value; - return Range.is(candidate.range) && Color.is(candidate.color); - } - ColorInformation.is = is; -})(ColorInformation || (ColorInformation = {})); -/** - * The Color namespace provides helper functions to work with - * [ColorPresentation](#ColorPresentation) literals. - */ -var ColorPresentation; -(function (ColorPresentation) { - /** - * Creates a new ColorInformation literal. - */ - function create(label, textEdit, additionalTextEdits) { - return { - label: label, - textEdit: textEdit, - additionalTextEdits: additionalTextEdits, - }; - } - ColorPresentation.create = create; - /** - * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. - */ - function is(value) { - var candidate = value; - return Is.string(candidate.label) - && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) - && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is)); - } - ColorPresentation.is = is; -})(ColorPresentation || (ColorPresentation = {})); -/** - * Enum of known range kinds - */ -var FoldingRangeKind; -(function (FoldingRangeKind) { - /** - * Folding range for a comment - */ - FoldingRangeKind["Comment"] = "comment"; - /** - * Folding range for a imports or includes - */ - FoldingRangeKind["Imports"] = "imports"; - /** - * Folding range for a region (e.g. `#region`) - */ - FoldingRangeKind["Region"] = "region"; -})(FoldingRangeKind || (FoldingRangeKind = {})); -/** - * The folding range namespace provides helper functions to work with - * [FoldingRange](#FoldingRange) literals. - */ -var FoldingRange; -(function (FoldingRange) { - /** - * Creates a new FoldingRange literal. - */ - function create(startLine, endLine, startCharacter, endCharacter, kind) { - var result = { - startLine: startLine, - endLine: endLine - }; - if (Is.defined(startCharacter)) { - result.startCharacter = startCharacter; - } - if (Is.defined(endCharacter)) { - result.endCharacter = endCharacter; - } - if (Is.defined(kind)) { - result.kind = kind; - } - return result; - } - FoldingRange.create = create; - /** - * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface. - */ - function is(value) { - var candidate = value; - return Is.number(candidate.startLine) && Is.number(candidate.startLine) - && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter)) - && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter)) - && (Is.undefined(candidate.kind) || Is.string(candidate.kind)); - } - FoldingRange.is = is; -})(FoldingRange || (FoldingRange = {})); -/** - * The DiagnosticRelatedInformation namespace provides helper functions to work with - * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals. - */ -var DiagnosticRelatedInformation; -(function (DiagnosticRelatedInformation) { - /** - * Creates a new DiagnosticRelatedInformation literal. - */ - function create(location, message) { - return { - location: location, - message: message - }; - } - DiagnosticRelatedInformation.create = create; - /** - * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message); - } - DiagnosticRelatedInformation.is = is; -})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {})); -/** - * The diagnostic's severity. - */ -var DiagnosticSeverity; -(function (DiagnosticSeverity) { - /** - * Reports an error. - */ - DiagnosticSeverity.Error = 1; - /** - * Reports a warning. - */ - DiagnosticSeverity.Warning = 2; - /** - * Reports an information. - */ - DiagnosticSeverity.Information = 3; - /** - * Reports a hint. - */ - DiagnosticSeverity.Hint = 4; -})(DiagnosticSeverity || (DiagnosticSeverity = {})); -/** - * The diagnostic tags. - * - * @since 3.15.0 - */ -var DiagnosticTag; -(function (DiagnosticTag) { - /** - * Unused or unnecessary code. - * - * Clients are allowed to render diagnostics with this tag faded out instead of having - * an error squiggle. - */ - DiagnosticTag.Unnecessary = 1; - /** - * Deprecated or obsolete code. - * - * Clients are allowed to rendered diagnostics with this tag strike through. - */ - DiagnosticTag.Deprecated = 2; -})(DiagnosticTag || (DiagnosticTag = {})); -/** - * The Diagnostic namespace provides helper functions to work with - * [Diagnostic](#Diagnostic) literals. - */ -var Diagnostic; -(function (Diagnostic) { - /** - * Creates a new Diagnostic literal. - */ - function create(range, message, severity, code, source, relatedInformation) { - var result = { range: range, message: message }; - if (Is.defined(severity)) { - result.severity = severity; - } - if (Is.defined(code)) { - result.code = code; - } - if (Is.defined(source)) { - result.source = source; - } - if (Is.defined(relatedInformation)) { - result.relatedInformation = relatedInformation; - } - return result; - } - Diagnostic.create = create; - /** - * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) - && Range.is(candidate.range) - && Is.string(candidate.message) - && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) - && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) - && (Is.string(candidate.source) || Is.undefined(candidate.source)) - && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is)); - } - Diagnostic.is = is; -})(Diagnostic || (Diagnostic = {})); -/** - * The Command namespace provides helper functions to work with - * [Command](#Command) literals. - */ -var Command; -(function (Command) { - /** - * Creates a new Command literal. - */ - function create(title, command) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - var result = { title: title, command: command }; - if (Is.defined(args) && args.length > 0) { - result.arguments = args; - } - return result; - } - Command.create = create; - /** - * Checks whether the given literal conforms to the [Command](#Command) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command); - } - Command.is = is; -})(Command || (Command = {})); -/** - * The TextEdit namespace provides helper function to create replace, - * insert and delete edits more easily. - */ -var TextEdit; -(function (TextEdit) { - /** - * Creates a replace text edit. - * @param range The range of text to be replaced. - * @param newText The new text. - */ - function replace(range, newText) { - return { range: range, newText: newText }; - } - TextEdit.replace = replace; - /** - * Creates a insert text edit. - * @param position The position to insert the text at. - * @param newText The text to be inserted. - */ - function insert(position, newText) { - return { range: { start: position, end: position }, newText: newText }; - } - TextEdit.insert = insert; - /** - * Creates a delete text edit. - * @param range The range of text to be deleted. - */ - function del(range) { - return { range: range, newText: '' }; - } - TextEdit.del = del; - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) - && Is.string(candidate.newText) - && Range.is(candidate.range); - } - TextEdit.is = is; -})(TextEdit || (TextEdit = {})); -/** - * The TextDocumentEdit namespace provides helper function to create - * an edit that manipulates a text document. - */ -var TextDocumentEdit; -(function (TextDocumentEdit) { - /** - * Creates a new `TextDocumentEdit` - */ - function create(textDocument, edits) { - return { textDocument: textDocument, edits: edits }; - } - TextDocumentEdit.create = create; - function is(value) { - var candidate = value; - return Is.defined(candidate) - && VersionedTextDocumentIdentifier.is(candidate.textDocument) - && Array.isArray(candidate.edits); - } - TextDocumentEdit.is = is; -})(TextDocumentEdit || (TextDocumentEdit = {})); -var CreateFile; -(function (CreateFile) { - function create(uri, options) { - var result = { - kind: 'create', - uri: uri - }; - if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { - result.options = options; - } - return result; - } - CreateFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && - (candidate.options === void 0 || - ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); - } - CreateFile.is = is; -})(CreateFile || (CreateFile = {})); -var RenameFile; -(function (RenameFile) { - function create(oldUri, newUri, options) { - var result = { - kind: 'rename', - oldUri: oldUri, - newUri: newUri - }; - if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { - result.options = options; - } - return result; - } - RenameFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && - (candidate.options === void 0 || - ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); - } - RenameFile.is = is; -})(RenameFile || (RenameFile = {})); -var DeleteFile; -(function (DeleteFile) { - function create(uri, options) { - var result = { - kind: 'delete', - uri: uri - }; - if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) { - result.options = options; - } - return result; - } - DeleteFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && - (candidate.options === void 0 || - ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists)))); - } - DeleteFile.is = is; -})(DeleteFile || (DeleteFile = {})); -var WorkspaceEdit; -(function (WorkspaceEdit) { - function is(value) { - var candidate = value; - return candidate && - (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && - (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) { - if (Is.string(change.kind)) { - return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change); - } - else { - return TextDocumentEdit.is(change); - } - })); - } - WorkspaceEdit.is = is; -})(WorkspaceEdit || (WorkspaceEdit = {})); -var TextEditChangeImpl = /** @class */ (function () { - function TextEditChangeImpl(edits) { - this.edits = edits; - } - TextEditChangeImpl.prototype.insert = function (position, newText) { - this.edits.push(TextEdit.insert(position, newText)); - }; - TextEditChangeImpl.prototype.replace = function (range, newText) { - this.edits.push(TextEdit.replace(range, newText)); - }; - TextEditChangeImpl.prototype.delete = function (range) { - this.edits.push(TextEdit.del(range)); - }; - TextEditChangeImpl.prototype.add = function (edit) { - this.edits.push(edit); - }; - TextEditChangeImpl.prototype.all = function () { - return this.edits; - }; - TextEditChangeImpl.prototype.clear = function () { - this.edits.splice(0, this.edits.length); - }; - return TextEditChangeImpl; -}()); -/** - * A workspace change helps constructing changes to a workspace. - */ -var WorkspaceChange = /** @class */ (function () { - function WorkspaceChange(workspaceEdit) { - var _this = this; - this._textEditChanges = Object.create(null); - if (workspaceEdit) { - this._workspaceEdit = workspaceEdit; - if (workspaceEdit.documentChanges) { - workspaceEdit.documentChanges.forEach(function (change) { - if (TextDocumentEdit.is(change)) { - var textEditChange = new TextEditChangeImpl(change.edits); - _this._textEditChanges[change.textDocument.uri] = textEditChange; - } - }); - } - else if (workspaceEdit.changes) { - Object.keys(workspaceEdit.changes).forEach(function (key) { - var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]); - _this._textEditChanges[key] = textEditChange; - }); - } - } - } - Object.defineProperty(WorkspaceChange.prototype, "edit", { - /** - * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal - * use to be returned from a workspace edit operation like rename. - */ - get: function () { - return this._workspaceEdit; - }, - enumerable: true, - configurable: true - }); - WorkspaceChange.prototype.getTextEditChange = function (key) { - if (VersionedTextDocumentIdentifier.is(key)) { - if (!this._workspaceEdit) { - this._workspaceEdit = { - documentChanges: [] - }; - } - if (!this._workspaceEdit.documentChanges) { - throw new Error('Workspace edit is not configured for document changes.'); - } - var textDocument = key; - var result = this._textEditChanges[textDocument.uri]; - if (!result) { - var edits = []; - var textDocumentEdit = { - textDocument: textDocument, - edits: edits - }; - this._workspaceEdit.documentChanges.push(textDocumentEdit); - result = new TextEditChangeImpl(edits); - this._textEditChanges[textDocument.uri] = result; - } - return result; - } - else { - if (!this._workspaceEdit) { - this._workspaceEdit = { - changes: Object.create(null) - }; - } - if (!this._workspaceEdit.changes) { - throw new Error('Workspace edit is not configured for normal text edit changes.'); - } - var result = this._textEditChanges[key]; - if (!result) { - var edits = []; - this._workspaceEdit.changes[key] = edits; - result = new TextEditChangeImpl(edits); - this._textEditChanges[key] = result; - } - return result; - } - }; - WorkspaceChange.prototype.createFile = function (uri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options)); - }; - WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options)); - }; - WorkspaceChange.prototype.deleteFile = function (uri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options)); - }; - WorkspaceChange.prototype.checkDocumentChanges = function () { - if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) { - throw new Error('Workspace edit is not configured for document changes.'); - } - }; - return WorkspaceChange; -}()); - -/** - * The TextDocumentIdentifier namespace provides helper functions to work with - * [TextDocumentIdentifier](#TextDocumentIdentifier) literals. - */ -var TextDocumentIdentifier; -(function (TextDocumentIdentifier) { - /** - * Creates a new TextDocumentIdentifier literal. - * @param uri The document's uri. - */ - function create(uri) { - return { uri: uri }; - } - TextDocumentIdentifier.create = create; - /** - * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri); - } - TextDocumentIdentifier.is = is; -})(TextDocumentIdentifier || (TextDocumentIdentifier = {})); -/** - * The VersionedTextDocumentIdentifier namespace provides helper functions to work with - * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals. - */ -var VersionedTextDocumentIdentifier; -(function (VersionedTextDocumentIdentifier) { - /** - * Creates a new VersionedTextDocumentIdentifier literal. - * @param uri The document's uri. - * @param uri The document's text. - */ - function create(uri, version) { - return { uri: uri, version: version }; - } - VersionedTextDocumentIdentifier.create = create; - /** - * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version)); - } - VersionedTextDocumentIdentifier.is = is; -})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {})); -/** - * The TextDocumentItem namespace provides helper functions to work with - * [TextDocumentItem](#TextDocumentItem) literals. - */ -var TextDocumentItem; -(function (TextDocumentItem) { - /** - * Creates a new TextDocumentItem literal. - * @param uri The document's uri. - * @param languageId The document's language identifier. - * @param version The document's version number. - * @param text The document's text. - */ - function create(uri, languageId, version, text) { - return { uri: uri, languageId: languageId, version: version, text: text }; - } - TextDocumentItem.create = create; - /** - * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text); - } - TextDocumentItem.is = is; -})(TextDocumentItem || (TextDocumentItem = {})); -/** - * Describes the content type that a client supports in various - * result literals like `Hover`, `ParameterInfo` or `CompletionItem`. - * - * Please note that `MarkupKinds` must not start with a `$`. This kinds - * are reserved for internal usage. - */ -var MarkupKind; -(function (MarkupKind) { - /** - * Plain text is supported as a content format - */ - MarkupKind.PlainText = 'plaintext'; - /** - * Markdown is supported as a content format - */ - MarkupKind.Markdown = 'markdown'; -})(MarkupKind || (MarkupKind = {})); -(function (MarkupKind) { - /** - * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type. - */ - function is(value) { - var candidate = value; - return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown; - } - MarkupKind.is = is; -})(MarkupKind || (MarkupKind = {})); -var MarkupContent; -(function (MarkupContent) { - /** - * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); - } - MarkupContent.is = is; -})(MarkupContent || (MarkupContent = {})); -/** - * The kind of a completion entry. - */ -var CompletionItemKind; -(function (CompletionItemKind) { - CompletionItemKind.Text = 1; - CompletionItemKind.Method = 2; - CompletionItemKind.Function = 3; - CompletionItemKind.Constructor = 4; - CompletionItemKind.Field = 5; - CompletionItemKind.Variable = 6; - CompletionItemKind.Class = 7; - CompletionItemKind.Interface = 8; - CompletionItemKind.Module = 9; - CompletionItemKind.Property = 10; - CompletionItemKind.Unit = 11; - CompletionItemKind.Value = 12; - CompletionItemKind.Enum = 13; - CompletionItemKind.Keyword = 14; - CompletionItemKind.Snippet = 15; - CompletionItemKind.Color = 16; - CompletionItemKind.File = 17; - CompletionItemKind.Reference = 18; - CompletionItemKind.Folder = 19; - CompletionItemKind.EnumMember = 20; - CompletionItemKind.Constant = 21; - CompletionItemKind.Struct = 22; - CompletionItemKind.Event = 23; - CompletionItemKind.Operator = 24; - CompletionItemKind.TypeParameter = 25; -})(CompletionItemKind || (CompletionItemKind = {})); -/** - * Defines whether the insert text in a completion item should be interpreted as - * plain text or a snippet. - */ -var InsertTextFormat; -(function (InsertTextFormat) { - /** - * The primary text to be inserted is treated as a plain string. - */ - InsertTextFormat.PlainText = 1; - /** - * The primary text to be inserted is treated as a snippet. - * - * A snippet can define tab stops and placeholders with `$1`, `$2` - * and `${3:foo}`. `$0` defines the final tab stop, it defaults to - * the end of the snippet. Placeholders with equal identifiers are linked, - * that is typing in one will update others too. - * - * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md - */ - InsertTextFormat.Snippet = 2; -})(InsertTextFormat || (InsertTextFormat = {})); -/** - * Completion item tags are extra annotations that tweak the rendering of a completion - * item. - * - * @since 3.15.0 - */ -var CompletionItemTag; -(function (CompletionItemTag) { - /** - * Render a completion as obsolete, usually using a strike-out. - */ - CompletionItemTag.Deprecated = 1; -})(CompletionItemTag || (CompletionItemTag = {})); -/** - * The CompletionItem namespace provides functions to deal with - * completion items. - */ -var CompletionItem; -(function (CompletionItem) { - /** - * Create a completion item and seed it with a label. - * @param label The completion item's label - */ - function create(label) { - return { label: label }; - } - CompletionItem.create = create; -})(CompletionItem || (CompletionItem = {})); -/** - * The CompletionList namespace provides functions to deal with - * completion lists. - */ -var CompletionList; -(function (CompletionList) { - /** - * Creates a new completion list. - * - * @param items The completion items. - * @param isIncomplete The list is not complete. - */ - function create(items, isIncomplete) { - return { items: items ? items : [], isIncomplete: !!isIncomplete }; - } - CompletionList.create = create; -})(CompletionList || (CompletionList = {})); -var MarkedString; -(function (MarkedString) { - /** - * Creates a marked string from plain text. - * - * @param plainText The plain text. - */ - function fromPlainText(plainText) { - return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash - } - MarkedString.fromPlainText = fromPlainText; - /** - * Checks whether the given value conforms to the [MarkedString](#MarkedString) type. - */ - function is(value) { - var candidate = value; - return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value)); - } - MarkedString.is = is; -})(MarkedString || (MarkedString = {})); -var Hover; -(function (Hover) { - /** - * Checks whether the given value conforms to the [Hover](#Hover) interface. - */ - function is(value) { - var candidate = value; - return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || - MarkedString.is(candidate.contents) || - Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range)); - } - Hover.is = is; -})(Hover || (Hover = {})); -/** - * The ParameterInformation namespace provides helper functions to work with - * [ParameterInformation](#ParameterInformation) literals. - */ -var ParameterInformation; -(function (ParameterInformation) { - /** - * Creates a new parameter information literal. - * - * @param label A label string. - * @param documentation A doc string. - */ - function create(label, documentation) { - return documentation ? { label: label, documentation: documentation } : { label: label }; - } - ParameterInformation.create = create; -})(ParameterInformation || (ParameterInformation = {})); -/** - * The SignatureInformation namespace provides helper functions to work with - * [SignatureInformation](#SignatureInformation) literals. - */ -var SignatureInformation; -(function (SignatureInformation) { - function create(label, documentation) { - var parameters = []; - for (var _i = 2; _i < arguments.length; _i++) { - parameters[_i - 2] = arguments[_i]; - } - var result = { label: label }; - if (Is.defined(documentation)) { - result.documentation = documentation; - } - if (Is.defined(parameters)) { - result.parameters = parameters; - } - else { - result.parameters = []; - } - return result; - } - SignatureInformation.create = create; -})(SignatureInformation || (SignatureInformation = {})); -/** - * A document highlight kind. - */ -var DocumentHighlightKind; -(function (DocumentHighlightKind) { - /** - * A textual occurrence. - */ - DocumentHighlightKind.Text = 1; - /** - * Read-access of a symbol, like reading a variable. - */ - DocumentHighlightKind.Read = 2; - /** - * Write-access of a symbol, like writing to a variable. - */ - DocumentHighlightKind.Write = 3; -})(DocumentHighlightKind || (DocumentHighlightKind = {})); -/** - * DocumentHighlight namespace to provide helper functions to work with - * [DocumentHighlight](#DocumentHighlight) literals. - */ -var DocumentHighlight; -(function (DocumentHighlight) { - /** - * Create a DocumentHighlight object. - * @param range The range the highlight applies to. - */ - function create(range, kind) { - var result = { range: range }; - if (Is.number(kind)) { - result.kind = kind; - } - return result; - } - DocumentHighlight.create = create; -})(DocumentHighlight || (DocumentHighlight = {})); -/** - * A symbol kind. - */ -var SymbolKind; -(function (SymbolKind) { - SymbolKind.File = 1; - SymbolKind.Module = 2; - SymbolKind.Namespace = 3; - SymbolKind.Package = 4; - SymbolKind.Class = 5; - SymbolKind.Method = 6; - SymbolKind.Property = 7; - SymbolKind.Field = 8; - SymbolKind.Constructor = 9; - SymbolKind.Enum = 10; - SymbolKind.Interface = 11; - SymbolKind.Function = 12; - SymbolKind.Variable = 13; - SymbolKind.Constant = 14; - SymbolKind.String = 15; - SymbolKind.Number = 16; - SymbolKind.Boolean = 17; - SymbolKind.Array = 18; - SymbolKind.Object = 19; - SymbolKind.Key = 20; - SymbolKind.Null = 21; - SymbolKind.EnumMember = 22; - SymbolKind.Struct = 23; - SymbolKind.Event = 24; - SymbolKind.Operator = 25; - SymbolKind.TypeParameter = 26; -})(SymbolKind || (SymbolKind = {})); -/** - * Symbol tags are extra annotations that tweak the rendering of a symbol. - * @since 3.15 - */ -var SymbolTag; -(function (SymbolTag) { - /** - * Render a symbol as obsolete, usually using a strike-out. - */ - SymbolTag.Deprecated = 1; -})(SymbolTag || (SymbolTag = {})); -var SymbolInformation; -(function (SymbolInformation) { - /** - * Creates a new symbol information literal. - * - * @param name The name of the symbol. - * @param kind The kind of the symbol. - * @param range The range of the location of the symbol. - * @param uri The resource of the location of symbol, defaults to the current document. - * @param containerName The name of the symbol containing the symbol. - */ - function create(name, kind, range, uri, containerName) { - var result = { - name: name, - kind: kind, - location: { uri: uri, range: range } - }; - if (containerName) { - result.containerName = containerName; - } - return result; - } - SymbolInformation.create = create; -})(SymbolInformation || (SymbolInformation = {})); -var DocumentSymbol; -(function (DocumentSymbol) { - /** - * Creates a new symbol information literal. - * - * @param name The name of the symbol. - * @param detail The detail of the symbol. - * @param kind The kind of the symbol. - * @param range The range of the symbol. - * @param selectionRange The selectionRange of the symbol. - * @param children Children of the symbol. - */ - function create(name, detail, kind, range, selectionRange, children) { - var result = { - name: name, - detail: detail, - kind: kind, - range: range, - selectionRange: selectionRange - }; - if (children !== void 0) { - result.children = children; - } - return result; - } - DocumentSymbol.create = create; - /** - * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface. - */ - function is(value) { - var candidate = value; - return candidate && - Is.string(candidate.name) && Is.number(candidate.kind) && - Range.is(candidate.range) && Range.is(candidate.selectionRange) && - (candidate.detail === void 0 || Is.string(candidate.detail)) && - (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && - (candidate.children === void 0 || Array.isArray(candidate.children)); - } - DocumentSymbol.is = is; -})(DocumentSymbol || (DocumentSymbol = {})); -/** - * A set of predefined code action kinds - */ -var CodeActionKind; -(function (CodeActionKind) { - /** - * Empty kind. - */ - CodeActionKind.Empty = ''; - /** - * Base kind for quickfix actions: 'quickfix' - */ - CodeActionKind.QuickFix = 'quickfix'; - /** - * Base kind for refactoring actions: 'refactor' - */ - CodeActionKind.Refactor = 'refactor'; - /** - * Base kind for refactoring extraction actions: 'refactor.extract' - * - * Example extract actions: - * - * - Extract method - * - Extract function - * - Extract variable - * - Extract interface from class - * - ... - */ - CodeActionKind.RefactorExtract = 'refactor.extract'; - /** - * Base kind for refactoring inline actions: 'refactor.inline' - * - * Example inline actions: - * - * - Inline function - * - Inline variable - * - Inline constant - * - ... - */ - CodeActionKind.RefactorInline = 'refactor.inline'; - /** - * Base kind for refactoring rewrite actions: 'refactor.rewrite' - * - * Example rewrite actions: - * - * - Convert JavaScript function to class - * - Add or remove parameter - * - Encapsulate field - * - Make method static - * - Move method to base class - * - ... - */ - CodeActionKind.RefactorRewrite = 'refactor.rewrite'; - /** - * Base kind for source actions: `source` - * - * Source code actions apply to the entire file. - */ - CodeActionKind.Source = 'source'; - /** - * Base kind for an organize imports source action: `source.organizeImports` - */ - CodeActionKind.SourceOrganizeImports = 'source.organizeImports'; - /** - * Base kind for auto-fix source actions: `source.fixAll`. - * - * Fix all actions automatically fix errors that have a clear fix that do not require user input. - * They should not suppress errors or perform unsafe fixes such as generating new types or classes. - * - * @since 3.15.0 - */ - CodeActionKind.SourceFixAll = 'source.fixAll'; -})(CodeActionKind || (CodeActionKind = {})); -/** - * The CodeActionContext namespace provides helper functions to work with - * [CodeActionContext](#CodeActionContext) literals. - */ -var CodeActionContext; -(function (CodeActionContext) { - /** - * Creates a new CodeActionContext literal. - */ - function create(diagnostics, only) { - var result = { diagnostics: diagnostics }; - if (only !== void 0 && only !== null) { - result.only = only; - } - return result; - } - CodeActionContext.create = create; - /** - * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)); - } - CodeActionContext.is = is; -})(CodeActionContext || (CodeActionContext = {})); -var CodeAction; -(function (CodeAction) { - function create(title, commandOrEdit, kind) { - var result = { title: title }; - if (Command.is(commandOrEdit)) { - result.command = commandOrEdit; - } - else { - result.edit = commandOrEdit; - } - if (kind !== void 0) { - result.kind = kind; - } - return result; - } - CodeAction.create = create; - function is(value) { - var candidate = value; - return candidate && Is.string(candidate.title) && - (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && - (candidate.kind === void 0 || Is.string(candidate.kind)) && - (candidate.edit !== void 0 || candidate.command !== void 0) && - (candidate.command === void 0 || Command.is(candidate.command)) && - (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && - (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit)); - } - CodeAction.is = is; -})(CodeAction || (CodeAction = {})); -/** - * The CodeLens namespace provides helper functions to work with - * [CodeLens](#CodeLens) literals. - */ -var CodeLens; -(function (CodeLens) { - /** - * Creates a new CodeLens literal. - */ - function create(range, data) { - var result = { range: range }; - if (Is.defined(data)) { - result.data = data; - } - return result; - } - CodeLens.create = create; - /** - * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); - } - CodeLens.is = is; -})(CodeLens || (CodeLens = {})); -/** - * The FormattingOptions namespace provides helper functions to work with - * [FormattingOptions](#FormattingOptions) literals. - */ -var FormattingOptions; -(function (FormattingOptions) { - /** - * Creates a new FormattingOptions literal. - */ - function create(tabSize, insertSpaces) { - return { tabSize: tabSize, insertSpaces: insertSpaces }; - } - FormattingOptions.create = create; - /** - * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces); - } - FormattingOptions.is = is; -})(FormattingOptions || (FormattingOptions = {})); -/** - * The DocumentLink namespace provides helper functions to work with - * [DocumentLink](#DocumentLink) literals. - */ -var DocumentLink; -(function (DocumentLink) { - /** - * Creates a new DocumentLink literal. - */ - function create(range, target, data) { - return { range: range, target: target, data: data }; - } - DocumentLink.create = create; - /** - * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); - } - DocumentLink.is = is; -})(DocumentLink || (DocumentLink = {})); -/** - * The SelectionRange namespace provides helper function to work with - * SelectionRange literals. - */ -var SelectionRange; -(function (SelectionRange) { - /** - * Creates a new SelectionRange - * @param range the range. - * @param parent an optional parent. - */ - function create(range, parent) { - return { range: range, parent: parent }; - } - SelectionRange.create = create; - function is(value) { - var candidate = value; - return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent)); - } - SelectionRange.is = is; -})(SelectionRange || (SelectionRange = {})); -var EOL = ['\n', '\r\n', '\r']; -/** - * @deprecated Use the text document from the new vscode-languageserver-textdocument package. - */ -var TextDocument; -(function (TextDocument) { - /** - * Creates a new ITextDocument literal from the given uri and content. - * @param uri The document's uri. - * @param languageId The document's language Id. - * @param content The document's content. - */ - function create(uri, languageId, version, content) { - return new FullTextDocument(uri, languageId, version, content); - } - TextDocument.create = create; - /** - * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount) - && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; - } - TextDocument.is = is; - function applyEdits(document, edits) { - var text = document.getText(); - var sortedEdits = mergeSort(edits, function (a, b) { - var diff = a.range.start.line - b.range.start.line; - if (diff === 0) { - return a.range.start.character - b.range.start.character; - } - return diff; - }); - var lastModifiedOffset = text.length; - for (var i = sortedEdits.length - 1; i >= 0; i--) { - var e = sortedEdits[i]; - var startOffset = document.offsetAt(e.range.start); - var endOffset = document.offsetAt(e.range.end); - if (endOffset <= lastModifiedOffset) { - text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); - } - else { - throw new Error('Overlapping edit'); - } - lastModifiedOffset = startOffset; - } - return text; - } - TextDocument.applyEdits = applyEdits; - function mergeSort(data, compare) { - if (data.length <= 1) { - // sorted - return data; - } - var p = (data.length / 2) | 0; - var left = data.slice(0, p); - var right = data.slice(p); - mergeSort(left, compare); - mergeSort(right, compare); - var leftIdx = 0; - var rightIdx = 0; - var i = 0; - while (leftIdx < left.length && rightIdx < right.length) { - var ret = compare(left[leftIdx], right[rightIdx]); - if (ret <= 0) { - // smaller_equal -> take left to preserve order - data[i++] = left[leftIdx++]; - } - else { - // greater -> take right - data[i++] = right[rightIdx++]; - } - } - while (leftIdx < left.length) { - data[i++] = left[leftIdx++]; - } - while (rightIdx < right.length) { - data[i++] = right[rightIdx++]; - } - return data; - } -})(TextDocument || (TextDocument = {})); -var FullTextDocument = /** @class */ (function () { - function FullTextDocument(uri, languageId, version, content) { - this._uri = uri; - this._languageId = languageId; - this._version = version; - this._content = content; - this._lineOffsets = undefined; - } - Object.defineProperty(FullTextDocument.prototype, "uri", { - get: function () { - return this._uri; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "languageId", { - get: function () { - return this._languageId; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "version", { - get: function () { - return this._version; - }, - enumerable: true, - configurable: true - }); - FullTextDocument.prototype.getText = function (range) { - if (range) { - var start = this.offsetAt(range.start); - var end = this.offsetAt(range.end); - return this._content.substring(start, end); - } - return this._content; - }; - FullTextDocument.prototype.update = function (event, version) { - this._content = event.text; - this._version = version; - this._lineOffsets = undefined; - }; - FullTextDocument.prototype.getLineOffsets = function () { - if (this._lineOffsets === undefined) { - var lineOffsets = []; - var text = this._content; - var isLineStart = true; - for (var i = 0; i < text.length; i++) { - if (isLineStart) { - lineOffsets.push(i); - isLineStart = false; - } - var ch = text.charAt(i); - isLineStart = (ch === '\r' || ch === '\n'); - if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') { - i++; - } - } - if (isLineStart && text.length > 0) { - lineOffsets.push(text.length); - } - this._lineOffsets = lineOffsets; - } - return this._lineOffsets; - }; - FullTextDocument.prototype.positionAt = function (offset) { - offset = Math.max(Math.min(offset, this._content.length), 0); - var lineOffsets = this.getLineOffsets(); - var low = 0, high = lineOffsets.length; - if (high === 0) { - return Position.create(0, offset); - } - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (lineOffsets[mid] > offset) { - high = mid; - } - else { - low = mid + 1; - } - } - // low is the least x for which the line offset is larger than the current offset - // or array.length if no line offset is larger than the current offset - var line = low - 1; - return Position.create(line, offset - lineOffsets[line]); - }; - FullTextDocument.prototype.offsetAt = function (position) { - var lineOffsets = this.getLineOffsets(); - if (position.line >= lineOffsets.length) { - return this._content.length; - } - else if (position.line < 0) { - return 0; - } - var lineOffset = lineOffsets[position.line]; - var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; - return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); - }; - Object.defineProperty(FullTextDocument.prototype, "lineCount", { - get: function () { - return this.getLineOffsets().length; - }, - enumerable: true, - configurable: true - }); - return FullTextDocument; -}()); -var Is; -(function (Is) { - var toString = Object.prototype.toString; - function defined(value) { - return typeof value !== 'undefined'; - } - Is.defined = defined; - function undefined(value) { - return typeof value === 'undefined'; - } - Is.undefined = undefined; - function boolean(value) { - return value === true || value === false; - } - Is.boolean = boolean; - function string(value) { - return toString.call(value) === '[object String]'; - } - Is.string = string; - function number(value) { - return toString.call(value) === '[object Number]'; - } - Is.number = number; - function func(value) { - return toString.call(value) === '[object Function]'; - } - Is.func = func; - function objectLiteral(value) { - // Strictly speaking class instances pass this check as well. Since the LSP - // doesn't use classes we ignore this for now. If we do we need to add something - // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null` - return value !== null && typeof value === 'object'; - } - Is.objectLiteral = objectLiteral; - function typedArray(value, check) { - return Array.isArray(value) && value.every(check); - } - Is.typedArray = typedArray; -})(Is || (Is = {})); +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + +/** + * The Position namespace provides helper functions to work with + * [Position](#Position) literals. + */ +var Position; +(function (Position) { + /** + * Creates a new Position literal from the given line and character. + * @param line The position's line. + * @param character The position's character. + */ + function create(line, character) { + return { line: line, character: character }; + } + Position.create = create; + /** + * Checks whether the given liternal conforms to the [Position](#Position) interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character); + } + Position.is = is; +})(Position || (Position = {})); +/** + * The Range namespace provides helper functions to work with + * [Range](#Range) literals. + */ +var Range; +(function (Range) { + function create(one, two, three, four) { + if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) { + return { start: Position.create(one, two), end: Position.create(three, four) }; + } + else if (Position.is(one) && Position.is(two)) { + return { start: one, end: two }; + } + else { + throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]"); + } + } + Range.create = create; + /** + * Checks whether the given literal conforms to the [Range](#Range) interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); + } + Range.is = is; +})(Range || (Range = {})); +/** + * The Location namespace provides helper functions to work with + * [Location](#Location) literals. + */ +var Location; +(function (Location) { + /** + * Creates a Location literal. + * @param uri The location's uri. + * @param range The location's range. + */ + function create(uri, range) { + return { uri: uri, range: range }; + } + Location.create = create; + /** + * Checks whether the given literal conforms to the [Location](#Location) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); + } + Location.is = is; +})(Location || (Location = {})); +/** + * The LocationLink namespace provides helper functions to work with + * [LocationLink](#LocationLink) literals. + */ +var LocationLink; +(function (LocationLink) { + /** + * Creates a LocationLink literal. + * @param targetUri The definition's uri. + * @param targetRange The full range of the definition. + * @param targetSelectionRange The span of the symbol definition at the target. + * @param originSelectionRange The span of the symbol being defined in the originating source file. + */ + function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) { + return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange }; + } + LocationLink.create = create; + /** + * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) + && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) + && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); + } + LocationLink.is = is; +})(LocationLink || (LocationLink = {})); +/** + * The Color namespace provides helper functions to work with + * [Color](#Color) literals. + */ +var Color; +(function (Color) { + /** + * Creates a new Color literal. + */ + function create(red, green, blue, alpha) { + return { + red: red, + green: green, + blue: blue, + alpha: alpha, + }; + } + Color.create = create; + /** + * Checks whether the given literal conforms to the [Color](#Color) interface. + */ + function is(value) { + var candidate = value; + return Is.number(candidate.red) + && Is.number(candidate.green) + && Is.number(candidate.blue) + && Is.number(candidate.alpha); + } + Color.is = is; +})(Color || (Color = {})); +/** + * The ColorInformation namespace provides helper functions to work with + * [ColorInformation](#ColorInformation) literals. + */ +var ColorInformation; +(function (ColorInformation) { + /** + * Creates a new ColorInformation literal. + */ + function create(range, color) { + return { + range: range, + color: color, + }; + } + ColorInformation.create = create; + /** + * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. + */ + function is(value) { + var candidate = value; + return Range.is(candidate.range) && Color.is(candidate.color); + } + ColorInformation.is = is; +})(ColorInformation || (ColorInformation = {})); +/** + * The Color namespace provides helper functions to work with + * [ColorPresentation](#ColorPresentation) literals. + */ +var ColorPresentation; +(function (ColorPresentation) { + /** + * Creates a new ColorInformation literal. + */ + function create(label, textEdit, additionalTextEdits) { + return { + label: label, + textEdit: textEdit, + additionalTextEdits: additionalTextEdits, + }; + } + ColorPresentation.create = create; + /** + * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. + */ + function is(value) { + var candidate = value; + return Is.string(candidate.label) + && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) + && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is)); + } + ColorPresentation.is = is; +})(ColorPresentation || (ColorPresentation = {})); +/** + * Enum of known range kinds + */ +var FoldingRangeKind; +(function (FoldingRangeKind) { + /** + * Folding range for a comment + */ + FoldingRangeKind["Comment"] = "comment"; + /** + * Folding range for a imports or includes + */ + FoldingRangeKind["Imports"] = "imports"; + /** + * Folding range for a region (e.g. `#region`) + */ + FoldingRangeKind["Region"] = "region"; +})(FoldingRangeKind || (FoldingRangeKind = {})); +/** + * The folding range namespace provides helper functions to work with + * [FoldingRange](#FoldingRange) literals. + */ +var FoldingRange; +(function (FoldingRange) { + /** + * Creates a new FoldingRange literal. + */ + function create(startLine, endLine, startCharacter, endCharacter, kind) { + var result = { + startLine: startLine, + endLine: endLine + }; + if (Is.defined(startCharacter)) { + result.startCharacter = startCharacter; + } + if (Is.defined(endCharacter)) { + result.endCharacter = endCharacter; + } + if (Is.defined(kind)) { + result.kind = kind; + } + return result; + } + FoldingRange.create = create; + /** + * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface. + */ + function is(value) { + var candidate = value; + return Is.number(candidate.startLine) && Is.number(candidate.startLine) + && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter)) + && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter)) + && (Is.undefined(candidate.kind) || Is.string(candidate.kind)); + } + FoldingRange.is = is; +})(FoldingRange || (FoldingRange = {})); +/** + * The DiagnosticRelatedInformation namespace provides helper functions to work with + * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals. + */ +var DiagnosticRelatedInformation; +(function (DiagnosticRelatedInformation) { + /** + * Creates a new DiagnosticRelatedInformation literal. + */ + function create(location, message) { + return { + location: location, + message: message + }; + } + DiagnosticRelatedInformation.create = create; + /** + * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message); + } + DiagnosticRelatedInformation.is = is; +})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {})); +/** + * The diagnostic's severity. + */ +var DiagnosticSeverity; +(function (DiagnosticSeverity) { + /** + * Reports an error. + */ + DiagnosticSeverity.Error = 1; + /** + * Reports a warning. + */ + DiagnosticSeverity.Warning = 2; + /** + * Reports an information. + */ + DiagnosticSeverity.Information = 3; + /** + * Reports a hint. + */ + DiagnosticSeverity.Hint = 4; +})(DiagnosticSeverity || (DiagnosticSeverity = {})); +/** + * The diagnostic tags. + * + * @since 3.15.0 + */ +var DiagnosticTag; +(function (DiagnosticTag) { + /** + * Unused or unnecessary code. + * + * Clients are allowed to render diagnostics with this tag faded out instead of having + * an error squiggle. + */ + DiagnosticTag.Unnecessary = 1; + /** + * Deprecated or obsolete code. + * + * Clients are allowed to rendered diagnostics with this tag strike through. + */ + DiagnosticTag.Deprecated = 2; +})(DiagnosticTag || (DiagnosticTag = {})); +/** + * The Diagnostic namespace provides helper functions to work with + * [Diagnostic](#Diagnostic) literals. + */ +var Diagnostic; +(function (Diagnostic) { + /** + * Creates a new Diagnostic literal. + */ + function create(range, message, severity, code, source, relatedInformation) { + var result = { range: range, message: message }; + if (Is.defined(severity)) { + result.severity = severity; + } + if (Is.defined(code)) { + result.code = code; + } + if (Is.defined(source)) { + result.source = source; + } + if (Is.defined(relatedInformation)) { + result.relatedInformation = relatedInformation; + } + return result; + } + Diagnostic.create = create; + /** + * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) + && Range.is(candidate.range) + && Is.string(candidate.message) + && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) + && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) + && (Is.string(candidate.source) || Is.undefined(candidate.source)) + && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is)); + } + Diagnostic.is = is; +})(Diagnostic || (Diagnostic = {})); +/** + * The Command namespace provides helper functions to work with + * [Command](#Command) literals. + */ +var Command; +(function (Command) { + /** + * Creates a new Command literal. + */ + function create(title, command) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + var result = { title: title, command: command }; + if (Is.defined(args) && args.length > 0) { + result.arguments = args; + } + return result; + } + Command.create = create; + /** + * Checks whether the given literal conforms to the [Command](#Command) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command); + } + Command.is = is; +})(Command || (Command = {})); +/** + * The TextEdit namespace provides helper function to create replace, + * insert and delete edits more easily. + */ +var TextEdit; +(function (TextEdit) { + /** + * Creates a replace text edit. + * @param range The range of text to be replaced. + * @param newText The new text. + */ + function replace(range, newText) { + return { range: range, newText: newText }; + } + TextEdit.replace = replace; + /** + * Creates a insert text edit. + * @param position The position to insert the text at. + * @param newText The text to be inserted. + */ + function insert(position, newText) { + return { range: { start: position, end: position }, newText: newText }; + } + TextEdit.insert = insert; + /** + * Creates a delete text edit. + * @param range The range of text to be deleted. + */ + function del(range) { + return { range: range, newText: '' }; + } + TextEdit.del = del; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) + && Is.string(candidate.newText) + && Range.is(candidate.range); + } + TextEdit.is = is; +})(TextEdit || (TextEdit = {})); +/** + * The TextDocumentEdit namespace provides helper function to create + * an edit that manipulates a text document. + */ +var TextDocumentEdit; +(function (TextDocumentEdit) { + /** + * Creates a new `TextDocumentEdit` + */ + function create(textDocument, edits) { + return { textDocument: textDocument, edits: edits }; + } + TextDocumentEdit.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) + && VersionedTextDocumentIdentifier.is(candidate.textDocument) + && Array.isArray(candidate.edits); + } + TextDocumentEdit.is = is; +})(TextDocumentEdit || (TextDocumentEdit = {})); +var CreateFile; +(function (CreateFile) { + function create(uri, options) { + var result = { + kind: 'create', + uri: uri + }; + if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { + result.options = options; + } + return result; + } + CreateFile.create = create; + function is(value) { + var candidate = value; + return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && + (candidate.options === void 0 || + ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); + } + CreateFile.is = is; +})(CreateFile || (CreateFile = {})); +var RenameFile; +(function (RenameFile) { + function create(oldUri, newUri, options) { + var result = { + kind: 'rename', + oldUri: oldUri, + newUri: newUri + }; + if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { + result.options = options; + } + return result; + } + RenameFile.create = create; + function is(value) { + var candidate = value; + return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && + (candidate.options === void 0 || + ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); + } + RenameFile.is = is; +})(RenameFile || (RenameFile = {})); +var DeleteFile; +(function (DeleteFile) { + function create(uri, options) { + var result = { + kind: 'delete', + uri: uri + }; + if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) { + result.options = options; + } + return result; + } + DeleteFile.create = create; + function is(value) { + var candidate = value; + return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && + (candidate.options === void 0 || + ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists)))); + } + DeleteFile.is = is; +})(DeleteFile || (DeleteFile = {})); +var WorkspaceEdit; +(function (WorkspaceEdit) { + function is(value) { + var candidate = value; + return candidate && + (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && + (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) { + if (Is.string(change.kind)) { + return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change); + } + else { + return TextDocumentEdit.is(change); + } + })); + } + WorkspaceEdit.is = is; +})(WorkspaceEdit || (WorkspaceEdit = {})); +var TextEditChangeImpl = /** @class */ (function () { + function TextEditChangeImpl(edits) { + this.edits = edits; + } + TextEditChangeImpl.prototype.insert = function (position, newText) { + this.edits.push(TextEdit.insert(position, newText)); + }; + TextEditChangeImpl.prototype.replace = function (range, newText) { + this.edits.push(TextEdit.replace(range, newText)); + }; + TextEditChangeImpl.prototype.delete = function (range) { + this.edits.push(TextEdit.del(range)); + }; + TextEditChangeImpl.prototype.add = function (edit) { + this.edits.push(edit); + }; + TextEditChangeImpl.prototype.all = function () { + return this.edits; + }; + TextEditChangeImpl.prototype.clear = function () { + this.edits.splice(0, this.edits.length); + }; + return TextEditChangeImpl; +}()); +/** + * A workspace change helps constructing changes to a workspace. + */ +var WorkspaceChange = /** @class */ (function () { + function WorkspaceChange(workspaceEdit) { + var _this = this; + this._textEditChanges = Object.create(null); + if (workspaceEdit) { + this._workspaceEdit = workspaceEdit; + if (workspaceEdit.documentChanges) { + workspaceEdit.documentChanges.forEach(function (change) { + if (TextDocumentEdit.is(change)) { + var textEditChange = new TextEditChangeImpl(change.edits); + _this._textEditChanges[change.textDocument.uri] = textEditChange; + } + }); + } + else if (workspaceEdit.changes) { + Object.keys(workspaceEdit.changes).forEach(function (key) { + var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]); + _this._textEditChanges[key] = textEditChange; + }); + } + } + } + Object.defineProperty(WorkspaceChange.prototype, "edit", { + /** + * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal + * use to be returned from a workspace edit operation like rename. + */ + get: function () { + return this._workspaceEdit; + }, + enumerable: true, + configurable: true + }); + WorkspaceChange.prototype.getTextEditChange = function (key) { + if (VersionedTextDocumentIdentifier.is(key)) { + if (!this._workspaceEdit) { + this._workspaceEdit = { + documentChanges: [] + }; + } + if (!this._workspaceEdit.documentChanges) { + throw new Error('Workspace edit is not configured for document changes.'); + } + var textDocument = key; + var result = this._textEditChanges[textDocument.uri]; + if (!result) { + var edits = []; + var textDocumentEdit = { + textDocument: textDocument, + edits: edits + }; + this._workspaceEdit.documentChanges.push(textDocumentEdit); + result = new TextEditChangeImpl(edits); + this._textEditChanges[textDocument.uri] = result; + } + return result; + } + else { + if (!this._workspaceEdit) { + this._workspaceEdit = { + changes: Object.create(null) + }; + } + if (!this._workspaceEdit.changes) { + throw new Error('Workspace edit is not configured for normal text edit changes.'); + } + var result = this._textEditChanges[key]; + if (!result) { + var edits = []; + this._workspaceEdit.changes[key] = edits; + result = new TextEditChangeImpl(edits); + this._textEditChanges[key] = result; + } + return result; + } + }; + WorkspaceChange.prototype.createFile = function (uri, options) { + this.checkDocumentChanges(); + this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options)); + }; + WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) { + this.checkDocumentChanges(); + this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options)); + }; + WorkspaceChange.prototype.deleteFile = function (uri, options) { + this.checkDocumentChanges(); + this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options)); + }; + WorkspaceChange.prototype.checkDocumentChanges = function () { + if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) { + throw new Error('Workspace edit is not configured for document changes.'); + } + }; + return WorkspaceChange; +}()); + +/** + * The TextDocumentIdentifier namespace provides helper functions to work with + * [TextDocumentIdentifier](#TextDocumentIdentifier) literals. + */ +var TextDocumentIdentifier; +(function (TextDocumentIdentifier) { + /** + * Creates a new TextDocumentIdentifier literal. + * @param uri The document's uri. + */ + function create(uri) { + return { uri: uri }; + } + TextDocumentIdentifier.create = create; + /** + * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri); + } + TextDocumentIdentifier.is = is; +})(TextDocumentIdentifier || (TextDocumentIdentifier = {})); +/** + * The VersionedTextDocumentIdentifier namespace provides helper functions to work with + * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals. + */ +var VersionedTextDocumentIdentifier; +(function (VersionedTextDocumentIdentifier) { + /** + * Creates a new VersionedTextDocumentIdentifier literal. + * @param uri The document's uri. + * @param uri The document's text. + */ + function create(uri, version) { + return { uri: uri, version: version }; + } + VersionedTextDocumentIdentifier.create = create; + /** + * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version)); + } + VersionedTextDocumentIdentifier.is = is; +})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {})); +/** + * The TextDocumentItem namespace provides helper functions to work with + * [TextDocumentItem](#TextDocumentItem) literals. + */ +var TextDocumentItem; +(function (TextDocumentItem) { + /** + * Creates a new TextDocumentItem literal. + * @param uri The document's uri. + * @param languageId The document's language identifier. + * @param version The document's version number. + * @param text The document's text. + */ + function create(uri, languageId, version, text) { + return { uri: uri, languageId: languageId, version: version, text: text }; + } + TextDocumentItem.create = create; + /** + * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text); + } + TextDocumentItem.is = is; +})(TextDocumentItem || (TextDocumentItem = {})); +/** + * Describes the content type that a client supports in various + * result literals like `Hover`, `ParameterInfo` or `CompletionItem`. + * + * Please note that `MarkupKinds` must not start with a `$`. This kinds + * are reserved for internal usage. + */ +var MarkupKind; +(function (MarkupKind) { + /** + * Plain text is supported as a content format + */ + MarkupKind.PlainText = 'plaintext'; + /** + * Markdown is supported as a content format + */ + MarkupKind.Markdown = 'markdown'; +})(MarkupKind || (MarkupKind = {})); +(function (MarkupKind) { + /** + * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type. + */ + function is(value) { + var candidate = value; + return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown; + } + MarkupKind.is = is; +})(MarkupKind || (MarkupKind = {})); +var MarkupContent; +(function (MarkupContent) { + /** + * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); + } + MarkupContent.is = is; +})(MarkupContent || (MarkupContent = {})); +/** + * The kind of a completion entry. + */ +var CompletionItemKind; +(function (CompletionItemKind) { + CompletionItemKind.Text = 1; + CompletionItemKind.Method = 2; + CompletionItemKind.Function = 3; + CompletionItemKind.Constructor = 4; + CompletionItemKind.Field = 5; + CompletionItemKind.Variable = 6; + CompletionItemKind.Class = 7; + CompletionItemKind.Interface = 8; + CompletionItemKind.Module = 9; + CompletionItemKind.Property = 10; + CompletionItemKind.Unit = 11; + CompletionItemKind.Value = 12; + CompletionItemKind.Enum = 13; + CompletionItemKind.Keyword = 14; + CompletionItemKind.Snippet = 15; + CompletionItemKind.Color = 16; + CompletionItemKind.File = 17; + CompletionItemKind.Reference = 18; + CompletionItemKind.Folder = 19; + CompletionItemKind.EnumMember = 20; + CompletionItemKind.Constant = 21; + CompletionItemKind.Struct = 22; + CompletionItemKind.Event = 23; + CompletionItemKind.Operator = 24; + CompletionItemKind.TypeParameter = 25; +})(CompletionItemKind || (CompletionItemKind = {})); +/** + * Defines whether the insert text in a completion item should be interpreted as + * plain text or a snippet. + */ +var InsertTextFormat; +(function (InsertTextFormat) { + /** + * The primary text to be inserted is treated as a plain string. + */ + InsertTextFormat.PlainText = 1; + /** + * The primary text to be inserted is treated as a snippet. + * + * A snippet can define tab stops and placeholders with `$1`, `$2` + * and `${3:foo}`. `$0` defines the final tab stop, it defaults to + * the end of the snippet. Placeholders with equal identifiers are linked, + * that is typing in one will update others too. + * + * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md + */ + InsertTextFormat.Snippet = 2; +})(InsertTextFormat || (InsertTextFormat = {})); +/** + * Completion item tags are extra annotations that tweak the rendering of a completion + * item. + * + * @since 3.15.0 + */ +var CompletionItemTag; +(function (CompletionItemTag) { + /** + * Render a completion as obsolete, usually using a strike-out. + */ + CompletionItemTag.Deprecated = 1; +})(CompletionItemTag || (CompletionItemTag = {})); +/** + * The CompletionItem namespace provides functions to deal with + * completion items. + */ +var CompletionItem; +(function (CompletionItem) { + /** + * Create a completion item and seed it with a label. + * @param label The completion item's label + */ + function create(label) { + return { label: label }; + } + CompletionItem.create = create; +})(CompletionItem || (CompletionItem = {})); +/** + * The CompletionList namespace provides functions to deal with + * completion lists. + */ +var CompletionList; +(function (CompletionList) { + /** + * Creates a new completion list. + * + * @param items The completion items. + * @param isIncomplete The list is not complete. + */ + function create(items, isIncomplete) { + return { items: items ? items : [], isIncomplete: !!isIncomplete }; + } + CompletionList.create = create; +})(CompletionList || (CompletionList = {})); +var MarkedString; +(function (MarkedString) { + /** + * Creates a marked string from plain text. + * + * @param plainText The plain text. + */ + function fromPlainText(plainText) { + return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash + } + MarkedString.fromPlainText = fromPlainText; + /** + * Checks whether the given value conforms to the [MarkedString](#MarkedString) type. + */ + function is(value) { + var candidate = value; + return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value)); + } + MarkedString.is = is; +})(MarkedString || (MarkedString = {})); +var Hover; +(function (Hover) { + /** + * Checks whether the given value conforms to the [Hover](#Hover) interface. + */ + function is(value) { + var candidate = value; + return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || + MarkedString.is(candidate.contents) || + Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range)); + } + Hover.is = is; +})(Hover || (Hover = {})); +/** + * The ParameterInformation namespace provides helper functions to work with + * [ParameterInformation](#ParameterInformation) literals. + */ +var ParameterInformation; +(function (ParameterInformation) { + /** + * Creates a new parameter information literal. + * + * @param label A label string. + * @param documentation A doc string. + */ + function create(label, documentation) { + return documentation ? { label: label, documentation: documentation } : { label: label }; + } + ParameterInformation.create = create; +})(ParameterInformation || (ParameterInformation = {})); +/** + * The SignatureInformation namespace provides helper functions to work with + * [SignatureInformation](#SignatureInformation) literals. + */ +var SignatureInformation; +(function (SignatureInformation) { + function create(label, documentation) { + var parameters = []; + for (var _i = 2; _i < arguments.length; _i++) { + parameters[_i - 2] = arguments[_i]; + } + var result = { label: label }; + if (Is.defined(documentation)) { + result.documentation = documentation; + } + if (Is.defined(parameters)) { + result.parameters = parameters; + } + else { + result.parameters = []; + } + return result; + } + SignatureInformation.create = create; +})(SignatureInformation || (SignatureInformation = {})); +/** + * A document highlight kind. + */ +var DocumentHighlightKind; +(function (DocumentHighlightKind) { + /** + * A textual occurrence. + */ + DocumentHighlightKind.Text = 1; + /** + * Read-access of a symbol, like reading a variable. + */ + DocumentHighlightKind.Read = 2; + /** + * Write-access of a symbol, like writing to a variable. + */ + DocumentHighlightKind.Write = 3; +})(DocumentHighlightKind || (DocumentHighlightKind = {})); +/** + * DocumentHighlight namespace to provide helper functions to work with + * [DocumentHighlight](#DocumentHighlight) literals. + */ +var DocumentHighlight; +(function (DocumentHighlight) { + /** + * Create a DocumentHighlight object. + * @param range The range the highlight applies to. + */ + function create(range, kind) { + var result = { range: range }; + if (Is.number(kind)) { + result.kind = kind; + } + return result; + } + DocumentHighlight.create = create; +})(DocumentHighlight || (DocumentHighlight = {})); +/** + * A symbol kind. + */ +var SymbolKind; +(function (SymbolKind) { + SymbolKind.File = 1; + SymbolKind.Module = 2; + SymbolKind.Namespace = 3; + SymbolKind.Package = 4; + SymbolKind.Class = 5; + SymbolKind.Method = 6; + SymbolKind.Property = 7; + SymbolKind.Field = 8; + SymbolKind.Constructor = 9; + SymbolKind.Enum = 10; + SymbolKind.Interface = 11; + SymbolKind.Function = 12; + SymbolKind.Variable = 13; + SymbolKind.Constant = 14; + SymbolKind.String = 15; + SymbolKind.Number = 16; + SymbolKind.Boolean = 17; + SymbolKind.Array = 18; + SymbolKind.Object = 19; + SymbolKind.Key = 20; + SymbolKind.Null = 21; + SymbolKind.EnumMember = 22; + SymbolKind.Struct = 23; + SymbolKind.Event = 24; + SymbolKind.Operator = 25; + SymbolKind.TypeParameter = 26; +})(SymbolKind || (SymbolKind = {})); +/** + * Symbol tags are extra annotations that tweak the rendering of a symbol. + * @since 3.15 + */ +var SymbolTag; +(function (SymbolTag) { + /** + * Render a symbol as obsolete, usually using a strike-out. + */ + SymbolTag.Deprecated = 1; +})(SymbolTag || (SymbolTag = {})); +var SymbolInformation; +(function (SymbolInformation) { + /** + * Creates a new symbol information literal. + * + * @param name The name of the symbol. + * @param kind The kind of the symbol. + * @param range The range of the location of the symbol. + * @param uri The resource of the location of symbol, defaults to the current document. + * @param containerName The name of the symbol containing the symbol. + */ + function create(name, kind, range, uri, containerName) { + var result = { + name: name, + kind: kind, + location: { uri: uri, range: range } + }; + if (containerName) { + result.containerName = containerName; + } + return result; + } + SymbolInformation.create = create; +})(SymbolInformation || (SymbolInformation = {})); +var DocumentSymbol; +(function (DocumentSymbol) { + /** + * Creates a new symbol information literal. + * + * @param name The name of the symbol. + * @param detail The detail of the symbol. + * @param kind The kind of the symbol. + * @param range The range of the symbol. + * @param selectionRange The selectionRange of the symbol. + * @param children Children of the symbol. + */ + function create(name, detail, kind, range, selectionRange, children) { + var result = { + name: name, + detail: detail, + kind: kind, + range: range, + selectionRange: selectionRange + }; + if (children !== void 0) { + result.children = children; + } + return result; + } + DocumentSymbol.create = create; + /** + * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface. + */ + function is(value) { + var candidate = value; + return candidate && + Is.string(candidate.name) && Is.number(candidate.kind) && + Range.is(candidate.range) && Range.is(candidate.selectionRange) && + (candidate.detail === void 0 || Is.string(candidate.detail)) && + (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && + (candidate.children === void 0 || Array.isArray(candidate.children)); + } + DocumentSymbol.is = is; +})(DocumentSymbol || (DocumentSymbol = {})); +/** + * A set of predefined code action kinds + */ +var CodeActionKind; +(function (CodeActionKind) { + /** + * Empty kind. + */ + CodeActionKind.Empty = ''; + /** + * Base kind for quickfix actions: 'quickfix' + */ + CodeActionKind.QuickFix = 'quickfix'; + /** + * Base kind for refactoring actions: 'refactor' + */ + CodeActionKind.Refactor = 'refactor'; + /** + * Base kind for refactoring extraction actions: 'refactor.extract' + * + * Example extract actions: + * + * - Extract method + * - Extract function + * - Extract variable + * - Extract interface from class + * - ... + */ + CodeActionKind.RefactorExtract = 'refactor.extract'; + /** + * Base kind for refactoring inline actions: 'refactor.inline' + * + * Example inline actions: + * + * - Inline function + * - Inline variable + * - Inline constant + * - ... + */ + CodeActionKind.RefactorInline = 'refactor.inline'; + /** + * Base kind for refactoring rewrite actions: 'refactor.rewrite' + * + * Example rewrite actions: + * + * - Convert JavaScript function to class + * - Add or remove parameter + * - Encapsulate field + * - Make method static + * - Move method to base class + * - ... + */ + CodeActionKind.RefactorRewrite = 'refactor.rewrite'; + /** + * Base kind for source actions: `source` + * + * Source code actions apply to the entire file. + */ + CodeActionKind.Source = 'source'; + /** + * Base kind for an organize imports source action: `source.organizeImports` + */ + CodeActionKind.SourceOrganizeImports = 'source.organizeImports'; + /** + * Base kind for auto-fix source actions: `source.fixAll`. + * + * Fix all actions automatically fix errors that have a clear fix that do not require user input. + * They should not suppress errors or perform unsafe fixes such as generating new types or classes. + * + * @since 3.15.0 + */ + CodeActionKind.SourceFixAll = 'source.fixAll'; +})(CodeActionKind || (CodeActionKind = {})); +/** + * The CodeActionContext namespace provides helper functions to work with + * [CodeActionContext](#CodeActionContext) literals. + */ +var CodeActionContext; +(function (CodeActionContext) { + /** + * Creates a new CodeActionContext literal. + */ + function create(diagnostics, only) { + var result = { diagnostics: diagnostics }; + if (only !== void 0 && only !== null) { + result.only = only; + } + return result; + } + CodeActionContext.create = create; + /** + * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)); + } + CodeActionContext.is = is; +})(CodeActionContext || (CodeActionContext = {})); +var CodeAction; +(function (CodeAction) { + function create(title, commandOrEdit, kind) { + var result = { title: title }; + if (Command.is(commandOrEdit)) { + result.command = commandOrEdit; + } + else { + result.edit = commandOrEdit; + } + if (kind !== void 0) { + result.kind = kind; + } + return result; + } + CodeAction.create = create; + function is(value) { + var candidate = value; + return candidate && Is.string(candidate.title) && + (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && + (candidate.kind === void 0 || Is.string(candidate.kind)) && + (candidate.edit !== void 0 || candidate.command !== void 0) && + (candidate.command === void 0 || Command.is(candidate.command)) && + (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && + (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit)); + } + CodeAction.is = is; +})(CodeAction || (CodeAction = {})); +/** + * The CodeLens namespace provides helper functions to work with + * [CodeLens](#CodeLens) literals. + */ +var CodeLens; +(function (CodeLens) { + /** + * Creates a new CodeLens literal. + */ + function create(range, data) { + var result = { range: range }; + if (Is.defined(data)) { + result.data = data; + } + return result; + } + CodeLens.create = create; + /** + * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); + } + CodeLens.is = is; +})(CodeLens || (CodeLens = {})); +/** + * The FormattingOptions namespace provides helper functions to work with + * [FormattingOptions](#FormattingOptions) literals. + */ +var FormattingOptions; +(function (FormattingOptions) { + /** + * Creates a new FormattingOptions literal. + */ + function create(tabSize, insertSpaces) { + return { tabSize: tabSize, insertSpaces: insertSpaces }; + } + FormattingOptions.create = create; + /** + * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces); + } + FormattingOptions.is = is; +})(FormattingOptions || (FormattingOptions = {})); +/** + * The DocumentLink namespace provides helper functions to work with + * [DocumentLink](#DocumentLink) literals. + */ +var DocumentLink; +(function (DocumentLink) { + /** + * Creates a new DocumentLink literal. + */ + function create(range, target, data) { + return { range: range, target: target, data: data }; + } + DocumentLink.create = create; + /** + * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); + } + DocumentLink.is = is; +})(DocumentLink || (DocumentLink = {})); +/** + * The SelectionRange namespace provides helper function to work with + * SelectionRange literals. + */ +var SelectionRange; +(function (SelectionRange) { + /** + * Creates a new SelectionRange + * @param range the range. + * @param parent an optional parent. + */ + function create(range, parent) { + return { range: range, parent: parent }; + } + SelectionRange.create = create; + function is(value) { + var candidate = value; + return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent)); + } + SelectionRange.is = is; +})(SelectionRange || (SelectionRange = {})); +var EOL = ['\n', '\r\n', '\r']; +/** + * @deprecated Use the text document from the new vscode-languageserver-textdocument package. + */ +var TextDocument; +(function (TextDocument) { + /** + * Creates a new ITextDocument literal from the given uri and content. + * @param uri The document's uri. + * @param languageId The document's language Id. + * @param content The document's content. + */ + function create(uri, languageId, version, content) { + return new FullTextDocument(uri, languageId, version, content); + } + TextDocument.create = create; + /** + * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount) + && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; + } + TextDocument.is = is; + function applyEdits(document, edits) { + var text = document.getText(); + var sortedEdits = mergeSort(edits, function (a, b) { + var diff = a.range.start.line - b.range.start.line; + if (diff === 0) { + return a.range.start.character - b.range.start.character; + } + return diff; + }); + var lastModifiedOffset = text.length; + for (var i = sortedEdits.length - 1; i >= 0; i--) { + var e = sortedEdits[i]; + var startOffset = document.offsetAt(e.range.start); + var endOffset = document.offsetAt(e.range.end); + if (endOffset <= lastModifiedOffset) { + text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); + } + else { + throw new Error('Overlapping edit'); + } + lastModifiedOffset = startOffset; + } + return text; + } + TextDocument.applyEdits = applyEdits; + function mergeSort(data, compare) { + if (data.length <= 1) { + // sorted + return data; + } + var p = (data.length / 2) | 0; + var left = data.slice(0, p); + var right = data.slice(p); + mergeSort(left, compare); + mergeSort(right, compare); + var leftIdx = 0; + var rightIdx = 0; + var i = 0; + while (leftIdx < left.length && rightIdx < right.length) { + var ret = compare(left[leftIdx], right[rightIdx]); + if (ret <= 0) { + // smaller_equal -> take left to preserve order + data[i++] = left[leftIdx++]; + } + else { + // greater -> take right + data[i++] = right[rightIdx++]; + } + } + while (leftIdx < left.length) { + data[i++] = left[leftIdx++]; + } + while (rightIdx < right.length) { + data[i++] = right[rightIdx++]; + } + return data; + } +})(TextDocument || (TextDocument = {})); +var FullTextDocument = /** @class */ (function () { + function FullTextDocument(uri, languageId, version, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version; + this._content = content; + this._lineOffsets = undefined; + } + Object.defineProperty(FullTextDocument.prototype, "uri", { + get: function () { + return this._uri; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, "languageId", { + get: function () { + return this._languageId; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, "version", { + get: function () { + return this._version; + }, + enumerable: true, + configurable: true + }); + FullTextDocument.prototype.getText = function (range) { + if (range) { + var start = this.offsetAt(range.start); + var end = this.offsetAt(range.end); + return this._content.substring(start, end); + } + return this._content; + }; + FullTextDocument.prototype.update = function (event, version) { + this._content = event.text; + this._version = version; + this._lineOffsets = undefined; + }; + FullTextDocument.prototype.getLineOffsets = function () { + if (this._lineOffsets === undefined) { + var lineOffsets = []; + var text = this._content; + var isLineStart = true; + for (var i = 0; i < text.length; i++) { + if (isLineStart) { + lineOffsets.push(i); + isLineStart = false; + } + var ch = text.charAt(i); + isLineStart = (ch === '\r' || ch === '\n'); + if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') { + i++; + } + } + if (isLineStart && text.length > 0) { + lineOffsets.push(text.length); + } + this._lineOffsets = lineOffsets; + } + return this._lineOffsets; + }; + FullTextDocument.prototype.positionAt = function (offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + var lineOffsets = this.getLineOffsets(); + var low = 0, high = lineOffsets.length; + if (high === 0) { + return Position.create(0, offset); + } + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } + else { + low = mid + 1; + } + } + // low is the least x for which the line offset is larger than the current offset + // or array.length if no line offset is larger than the current offset + var line = low - 1; + return Position.create(line, offset - lineOffsets[line]); + }; + FullTextDocument.prototype.offsetAt = function (position) { + var lineOffsets = this.getLineOffsets(); + if (position.line >= lineOffsets.length) { + return this._content.length; + } + else if (position.line < 0) { + return 0; + } + var lineOffset = lineOffsets[position.line]; + var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; + return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); + }; + Object.defineProperty(FullTextDocument.prototype, "lineCount", { + get: function () { + return this.getLineOffsets().length; + }, + enumerable: true, + configurable: true + }); + return FullTextDocument; +}()); +var Is; +(function (Is) { + var toString = Object.prototype.toString; + function defined(value) { + return typeof value !== 'undefined'; + } + Is.defined = defined; + function undefined(value) { + return typeof value === 'undefined'; + } + Is.undefined = undefined; + function boolean(value) { + return value === true || value === false; + } + Is.boolean = boolean; + function string(value) { + return toString.call(value) === '[object String]'; + } + Is.string = string; + function number(value) { + return toString.call(value) === '[object Number]'; + } + Is.number = number; + function func(value) { + return toString.call(value) === '[object Function]'; + } + Is.func = func; + function objectLiteral(value) { + // Strictly speaking class instances pass this check as well. Since the LSP + // doesn't use classes we ignore this for now. If we do we need to add something + // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null` + return value !== null && typeof value === 'object'; + } + Is.objectLiteral = objectLiteral; + function typedArray(value, check) { + return Array.isArray(value) && value.every(check); + } + Is.typedArray = typedArray; +})(Is || (Is = {})); // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/_deps/vscode-languageserver-textdocument/lib/esm/main.js -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -var main_FullTextDocument = /** @class */ (function () { - function FullTextDocument(uri, languageId, version, content) { - this._uri = uri; - this._languageId = languageId; - this._version = version; - this._content = content; - this._lineOffsets = undefined; - } - Object.defineProperty(FullTextDocument.prototype, "uri", { - get: function () { - return this._uri; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "languageId", { - get: function () { - return this._languageId; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "version", { - get: function () { - return this._version; - }, - enumerable: true, - configurable: true - }); - FullTextDocument.prototype.getText = function (range) { - if (range) { - var start = this.offsetAt(range.start); - var end = this.offsetAt(range.end); - return this._content.substring(start, end); - } - return this._content; - }; - FullTextDocument.prototype.update = function (changes, version) { - for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) { - var change = changes_1[_i]; - if (FullTextDocument.isIncremental(change)) { - // makes sure start is before end - var range = getWellformedRange(change.range); - // update content - var startOffset = this.offsetAt(range.start); - var endOffset = this.offsetAt(range.end); - this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length); - // update the offsets - var startLine = Math.max(range.start.line, 0); - var endLine = Math.max(range.end.line, 0); - var lineOffsets = this._lineOffsets; - var addedLineOffsets = computeLineOffsets(change.text, false, startOffset); - if (endLine - startLine === addedLineOffsets.length) { - for (var i = 0, len = addedLineOffsets.length; i < len; i++) { - lineOffsets[i + startLine + 1] = addedLineOffsets[i]; - } - } - else { - if (addedLineOffsets.length < 10000) { - lineOffsets.splice.apply(lineOffsets, [startLine + 1, endLine - startLine].concat(addedLineOffsets)); - } - else { // avoid too many arguments for splice - this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1)); - } - } - var diff = change.text.length - (endOffset - startOffset); - if (diff !== 0) { - for (var i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) { - lineOffsets[i] = lineOffsets[i] + diff; - } - } - } - else if (FullTextDocument.isFull(change)) { - this._content = change.text; - this._lineOffsets = undefined; - } - else { - throw new Error('Unknown change event received'); - } - } - this._version = version; - }; - FullTextDocument.prototype.getLineOffsets = function () { - if (this._lineOffsets === undefined) { - this._lineOffsets = computeLineOffsets(this._content, true); - } - return this._lineOffsets; - }; - FullTextDocument.prototype.positionAt = function (offset) { - offset = Math.max(Math.min(offset, this._content.length), 0); - var lineOffsets = this.getLineOffsets(); - var low = 0, high = lineOffsets.length; - if (high === 0) { - return { line: 0, character: offset }; - } - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (lineOffsets[mid] > offset) { - high = mid; - } - else { - low = mid + 1; - } - } - // low is the least x for which the line offset is larger than the current offset - // or array.length if no line offset is larger than the current offset - var line = low - 1; - return { line: line, character: offset - lineOffsets[line] }; - }; - FullTextDocument.prototype.offsetAt = function (position) { - var lineOffsets = this.getLineOffsets(); - if (position.line >= lineOffsets.length) { - return this._content.length; - } - else if (position.line < 0) { - return 0; - } - var lineOffset = lineOffsets[position.line]; - var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; - return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); - }; - Object.defineProperty(FullTextDocument.prototype, "lineCount", { - get: function () { - return this.getLineOffsets().length; - }, - enumerable: true, - configurable: true - }); - FullTextDocument.isIncremental = function (event) { - var candidate = event; - return candidate !== undefined && candidate !== null && - typeof candidate.text === 'string' && candidate.range !== undefined && - (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number'); - }; - FullTextDocument.isFull = function (event) { - var candidate = event; - return candidate !== undefined && candidate !== null && - typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined; - }; - return FullTextDocument; -}()); -var main_TextDocument; -(function (TextDocument) { - /** - * Creates a new text document. - * - * @param uri The document's uri. - * @param languageId The document's language Id. - * @param version The document's initial version number. - * @param content The document's content. - */ - function create(uri, languageId, version, content) { - return new main_FullTextDocument(uri, languageId, version, content); - } - TextDocument.create = create; - /** - * Updates a TextDocument by modifing its content. - * - * @param document the document to update. Only documents created by TextDocument.create are valid inputs. - * @param changes the changes to apply to the document. - * @returns The updated TextDocument. Note: That's the same document instance passed in as first parameter. - * - */ - function update(document, changes, version) { - if (document instanceof main_FullTextDocument) { - document.update(changes, version); - return document; - } - else { - throw new Error('TextDocument.update: document must be created by TextDocument.create'); - } - } - TextDocument.update = update; - function applyEdits(document, edits) { - var text = document.getText(); - var sortedEdits = mergeSort(edits.map(getWellformedEdit), function (a, b) { - var diff = a.range.start.line - b.range.start.line; - if (diff === 0) { - return a.range.start.character - b.range.start.character; - } - return diff; - }); - var lastModifiedOffset = text.length; - for (var i = sortedEdits.length - 1; i >= 0; i--) { - var e = sortedEdits[i]; - var startOffset = document.offsetAt(e.range.start); - var endOffset = document.offsetAt(e.range.end); - if (endOffset <= lastModifiedOffset) { - text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); - } - else { - throw new Error('Overlapping edit'); - } - lastModifiedOffset = startOffset; - } - return text; - } - TextDocument.applyEdits = applyEdits; -})(main_TextDocument || (main_TextDocument = {})); -function mergeSort(data, compare) { - if (data.length <= 1) { - // sorted - return data; - } - var p = (data.length / 2) | 0; - var left = data.slice(0, p); - var right = data.slice(p); - mergeSort(left, compare); - mergeSort(right, compare); - var leftIdx = 0; - var rightIdx = 0; - var i = 0; - while (leftIdx < left.length && rightIdx < right.length) { - var ret = compare(left[leftIdx], right[rightIdx]); - if (ret <= 0) { - // smaller_equal -> take left to preserve order - data[i++] = left[leftIdx++]; - } - else { - // greater -> take right - data[i++] = right[rightIdx++]; - } - } - while (leftIdx < left.length) { - data[i++] = left[leftIdx++]; - } - while (rightIdx < right.length) { - data[i++] = right[rightIdx++]; - } - return data; -} -function computeLineOffsets(text, isAtLineStart, textOffset) { - if (textOffset === void 0) { textOffset = 0; } - var result = isAtLineStart ? [textOffset] : []; - for (var i = 0; i < text.length; i++) { - var ch = text.charCodeAt(i); - if (ch === 13 /* CarriageReturn */ || ch === 10 /* LineFeed */) { - if (ch === 13 /* CarriageReturn */ && i + 1 < text.length && text.charCodeAt(i + 1) === 10 /* LineFeed */) { - i++; - } - result.push(textOffset + i + 1); - } - } - return result; -} -function getWellformedRange(range) { - var start = range.start; - var end = range.end; - if (start.line > end.line || (start.line === end.line && start.character > end.character)) { - return { start: end, end: start }; - } - return range; -} -function getWellformedEdit(textEdit) { - var range = getWellformedRange(textEdit.range); - if (range !== textEdit.range) { - return { newText: textEdit.newText, range: range }; - } - return textEdit; -} +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + +var main_FullTextDocument = /** @class */ (function () { + function FullTextDocument(uri, languageId, version, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version; + this._content = content; + this._lineOffsets = undefined; + } + Object.defineProperty(FullTextDocument.prototype, "uri", { + get: function () { + return this._uri; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, "languageId", { + get: function () { + return this._languageId; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, "version", { + get: function () { + return this._version; + }, + enumerable: true, + configurable: true + }); + FullTextDocument.prototype.getText = function (range) { + if (range) { + var start = this.offsetAt(range.start); + var end = this.offsetAt(range.end); + return this._content.substring(start, end); + } + return this._content; + }; + FullTextDocument.prototype.update = function (changes, version) { + for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) { + var change = changes_1[_i]; + if (FullTextDocument.isIncremental(change)) { + // makes sure start is before end + var range = getWellformedRange(change.range); + // update content + var startOffset = this.offsetAt(range.start); + var endOffset = this.offsetAt(range.end); + this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length); + // update the offsets + var startLine = Math.max(range.start.line, 0); + var endLine = Math.max(range.end.line, 0); + var lineOffsets = this._lineOffsets; + var addedLineOffsets = computeLineOffsets(change.text, false, startOffset); + if (endLine - startLine === addedLineOffsets.length) { + for (var i = 0, len = addedLineOffsets.length; i < len; i++) { + lineOffsets[i + startLine + 1] = addedLineOffsets[i]; + } + } + else { + if (addedLineOffsets.length < 10000) { + lineOffsets.splice.apply(lineOffsets, [startLine + 1, endLine - startLine].concat(addedLineOffsets)); + } + else { // avoid too many arguments for splice + this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1)); + } + } + var diff = change.text.length - (endOffset - startOffset); + if (diff !== 0) { + for (var i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) { + lineOffsets[i] = lineOffsets[i] + diff; + } + } + } + else if (FullTextDocument.isFull(change)) { + this._content = change.text; + this._lineOffsets = undefined; + } + else { + throw new Error('Unknown change event received'); + } + } + this._version = version; + }; + FullTextDocument.prototype.getLineOffsets = function () { + if (this._lineOffsets === undefined) { + this._lineOffsets = computeLineOffsets(this._content, true); + } + return this._lineOffsets; + }; + FullTextDocument.prototype.positionAt = function (offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + var lineOffsets = this.getLineOffsets(); + var low = 0, high = lineOffsets.length; + if (high === 0) { + return { line: 0, character: offset }; + } + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } + else { + low = mid + 1; + } + } + // low is the least x for which the line offset is larger than the current offset + // or array.length if no line offset is larger than the current offset + var line = low - 1; + return { line: line, character: offset - lineOffsets[line] }; + }; + FullTextDocument.prototype.offsetAt = function (position) { + var lineOffsets = this.getLineOffsets(); + if (position.line >= lineOffsets.length) { + return this._content.length; + } + else if (position.line < 0) { + return 0; + } + var lineOffset = lineOffsets[position.line]; + var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; + return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); + }; + Object.defineProperty(FullTextDocument.prototype, "lineCount", { + get: function () { + return this.getLineOffsets().length; + }, + enumerable: true, + configurable: true + }); + FullTextDocument.isIncremental = function (event) { + var candidate = event; + return candidate !== undefined && candidate !== null && + typeof candidate.text === 'string' && candidate.range !== undefined && + (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number'); + }; + FullTextDocument.isFull = function (event) { + var candidate = event; + return candidate !== undefined && candidate !== null && + typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined; + }; + return FullTextDocument; +}()); +var main_TextDocument; +(function (TextDocument) { + /** + * Creates a new text document. + * + * @param uri The document's uri. + * @param languageId The document's language Id. + * @param version The document's initial version number. + * @param content The document's content. + */ + function create(uri, languageId, version, content) { + return new main_FullTextDocument(uri, languageId, version, content); + } + TextDocument.create = create; + /** + * Updates a TextDocument by modifing its content. + * + * @param document the document to update. Only documents created by TextDocument.create are valid inputs. + * @param changes the changes to apply to the document. + * @returns The updated TextDocument. Note: That's the same document instance passed in as first parameter. + * + */ + function update(document, changes, version) { + if (document instanceof main_FullTextDocument) { + document.update(changes, version); + return document; + } + else { + throw new Error('TextDocument.update: document must be created by TextDocument.create'); + } + } + TextDocument.update = update; + function applyEdits(document, edits) { + var text = document.getText(); + var sortedEdits = mergeSort(edits.map(getWellformedEdit), function (a, b) { + var diff = a.range.start.line - b.range.start.line; + if (diff === 0) { + return a.range.start.character - b.range.start.character; + } + return diff; + }); + var lastModifiedOffset = text.length; + for (var i = sortedEdits.length - 1; i >= 0; i--) { + var e = sortedEdits[i]; + var startOffset = document.offsetAt(e.range.start); + var endOffset = document.offsetAt(e.range.end); + if (endOffset <= lastModifiedOffset) { + text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); + } + else { + throw new Error('Overlapping edit'); + } + lastModifiedOffset = startOffset; + } + return text; + } + TextDocument.applyEdits = applyEdits; +})(main_TextDocument || (main_TextDocument = {})); +function mergeSort(data, compare) { + if (data.length <= 1) { + // sorted + return data; + } + var p = (data.length / 2) | 0; + var left = data.slice(0, p); + var right = data.slice(p); + mergeSort(left, compare); + mergeSort(right, compare); + var leftIdx = 0; + var rightIdx = 0; + var i = 0; + while (leftIdx < left.length && rightIdx < right.length) { + var ret = compare(left[leftIdx], right[rightIdx]); + if (ret <= 0) { + // smaller_equal -> take left to preserve order + data[i++] = left[leftIdx++]; + } + else { + // greater -> take right + data[i++] = right[rightIdx++]; + } + } + while (leftIdx < left.length) { + data[i++] = left[leftIdx++]; + } + while (rightIdx < right.length) { + data[i++] = right[rightIdx++]; + } + return data; +} +function computeLineOffsets(text, isAtLineStart, textOffset) { + if (textOffset === void 0) { textOffset = 0; } + var result = isAtLineStart ? [textOffset] : []; + for (var i = 0; i < text.length; i++) { + var ch = text.charCodeAt(i); + if (ch === 13 /* CarriageReturn */ || ch === 10 /* LineFeed */) { + if (ch === 13 /* CarriageReturn */ && i + 1 < text.length && text.charCodeAt(i + 1) === 10 /* LineFeed */) { + i++; + } + result.push(textOffset + i + 1); + } + } + return result; +} +function getWellformedRange(range) { + var start = range.start; + var end = range.end; + if (start.line > end.line || (start.line === end.line && start.character > end.character)) { + return { start: end, end: start }; + } + return range; +} +function getWellformedEdit(textEdit) { + var range = getWellformedRange(textEdit.range); + if (range !== textEdit.range) { + return { newText: textEdit.newText, range: range }; + } + return textEdit; +} // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/cssLanguageTypes.js /*--------------------------------------------------------------------------------------------- @@ -33792,594 +33792,594 @@ function getLESSLanguageService(options) { } // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/languageFeatures.js -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -var Uri = monaco.Uri; -var languageFeatures_Range = monaco.Range; -// --- diagnostics --- --- -var DiagnosticsAdapter = /** @class */ (function () { - function DiagnosticsAdapter(_languageId, _worker, defaults) { - var _this = this; - this._languageId = _languageId; - this._worker = _worker; - this._disposables = []; - this._listener = Object.create(null); - var onModelAdd = function (model) { - var modeId = model.getModeId(); - if (modeId !== _this._languageId) { - return; - } - var handle; - _this._listener[model.uri.toString()] = model.onDidChangeContent(function () { - window.clearTimeout(handle); - handle = window.setTimeout(function () { return _this._doValidate(model.uri, modeId); }, 500); - }); - _this._doValidate(model.uri, modeId); - }; - var onModelRemoved = function (model) { - monaco.editor.setModelMarkers(model, _this._languageId, []); - var uriStr = model.uri.toString(); - var listener = _this._listener[uriStr]; - if (listener) { - listener.dispose(); - delete _this._listener[uriStr]; - } - }; - this._disposables.push(monaco.editor.onDidCreateModel(onModelAdd)); - this._disposables.push(monaco.editor.onWillDisposeModel(onModelRemoved)); - this._disposables.push(monaco.editor.onDidChangeModelLanguage(function (event) { - onModelRemoved(event.model); - onModelAdd(event.model); - })); - defaults.onDidChange(function (_) { - monaco.editor.getModels().forEach(function (model) { - if (model.getModeId() === _this._languageId) { - onModelRemoved(model); - onModelAdd(model); - } - }); - }); - this._disposables.push({ - dispose: function () { - for (var key in _this._listener) { - _this._listener[key].dispose(); - } - } - }); - monaco.editor.getModels().forEach(onModelAdd); - } - DiagnosticsAdapter.prototype.dispose = function () { - this._disposables.forEach(function (d) { return d && d.dispose(); }); - this._disposables = []; - }; - DiagnosticsAdapter.prototype._doValidate = function (resource, languageId) { - this._worker(resource).then(function (worker) { - return worker.doValidation(resource.toString()); - }).then(function (diagnostics) { - var markers = diagnostics.map(function (d) { return toDiagnostics(resource, d); }); - var model = monaco.editor.getModel(resource); - if (model.getModeId() === languageId) { - monaco.editor.setModelMarkers(model, languageId, markers); - } - }).then(undefined, function (err) { - console.error(err); - }); - }; - return DiagnosticsAdapter; -}()); - -function toSeverity(lsSeverity) { - switch (lsSeverity) { - case DiagnosticSeverity.Error: return monaco.MarkerSeverity.Error; - case DiagnosticSeverity.Warning: return monaco.MarkerSeverity.Warning; - case DiagnosticSeverity.Information: return monaco.MarkerSeverity.Info; - case DiagnosticSeverity.Hint: return monaco.MarkerSeverity.Hint; - default: - return monaco.MarkerSeverity.Info; - } -} -function toDiagnostics(resource, diag) { - var code = typeof diag.code === 'number' ? String(diag.code) : diag.code; - return { - severity: toSeverity(diag.severity), - startLineNumber: diag.range.start.line + 1, - startColumn: diag.range.start.character + 1, - endLineNumber: diag.range.end.line + 1, - endColumn: diag.range.end.character + 1, - message: diag.message, - code: code, - source: diag.source - }; -} -// --- completion ------ -function fromPosition(position) { - if (!position) { - return void 0; - } - return { character: position.column - 1, line: position.lineNumber - 1 }; -} -function fromRange(range) { - if (!range) { - return void 0; - } - return { start: { line: range.startLineNumber - 1, character: range.startColumn - 1 }, end: { line: range.endLineNumber - 1, character: range.endColumn - 1 } }; -} -function toRange(range) { - if (!range) { - return void 0; - } - return new monaco.Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1); -} -function toCompletionItemKind(kind) { - var mItemKind = monaco.languages.CompletionItemKind; - switch (kind) { - case CompletionItemKind.Text: return mItemKind.Text; - case CompletionItemKind.Method: return mItemKind.Method; - case CompletionItemKind.Function: return mItemKind.Function; - case CompletionItemKind.Constructor: return mItemKind.Constructor; - case CompletionItemKind.Field: return mItemKind.Field; - case CompletionItemKind.Variable: return mItemKind.Variable; - case CompletionItemKind.Class: return mItemKind.Class; - case CompletionItemKind.Interface: return mItemKind.Interface; - case CompletionItemKind.Module: return mItemKind.Module; - case CompletionItemKind.Property: return mItemKind.Property; - case CompletionItemKind.Unit: return mItemKind.Unit; - case CompletionItemKind.Value: return mItemKind.Value; - case CompletionItemKind.Enum: return mItemKind.Enum; - case CompletionItemKind.Keyword: return mItemKind.Keyword; - case CompletionItemKind.Snippet: return mItemKind.Snippet; - case CompletionItemKind.Color: return mItemKind.Color; - case CompletionItemKind.File: return mItemKind.File; - case CompletionItemKind.Reference: return mItemKind.Reference; - } - return mItemKind.Property; -} -function toTextEdit(textEdit) { - if (!textEdit) { - return void 0; - } - return { - range: toRange(textEdit.range), - text: textEdit.newText - }; -} -var languageFeatures_CompletionAdapter = /** @class */ (function () { - function CompletionAdapter(_worker) { - this._worker = _worker; - } - Object.defineProperty(CompletionAdapter.prototype, "triggerCharacters", { - get: function () { - return [' ', ':']; - }, - enumerable: true, - configurable: true - }); - CompletionAdapter.prototype.provideCompletionItems = function (model, position, context, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { - return worker.doComplete(resource.toString(), fromPosition(position)); - }).then(function (info) { - if (!info) { - return; - } - var wordInfo = model.getWordUntilPosition(position); - var wordRange = new languageFeatures_Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn); - var items = info.items.map(function (entry) { - var item = { - label: entry.label, - insertText: entry.insertText || entry.label, - sortText: entry.sortText, - filterText: entry.filterText, - documentation: entry.documentation, - detail: entry.detail, - range: wordRange, - kind: toCompletionItemKind(entry.kind), - }; - if (entry.textEdit) { - item.range = toRange(entry.textEdit.range); - item.insertText = entry.textEdit.newText; - } - if (entry.additionalTextEdits) { - item.additionalTextEdits = entry.additionalTextEdits.map(toTextEdit); - } - if (entry.insertTextFormat === InsertTextFormat.Snippet) { - item.insertTextRules = monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet; - } - return item; - }); - return { - isIncomplete: info.isIncomplete, - suggestions: items - }; - }); - }; - return CompletionAdapter; -}()); - -function isMarkupContent(thing) { - return thing && typeof thing === 'object' && typeof thing.kind === 'string'; -} -function toMarkdownString(entry) { - if (typeof entry === 'string') { - return { - value: entry - }; - } - if (isMarkupContent(entry)) { - if (entry.kind === 'plaintext') { - return { - value: entry.value.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&') - }; - } - return { - value: entry.value - }; - } - return { value: '```' + entry.language + '\n' + entry.value + '\n```\n' }; -} -function toMarkedStringArray(contents) { - if (!contents) { - return void 0; - } - if (Array.isArray(contents)) { - return contents.map(toMarkdownString); - } - return [toMarkdownString(contents)]; -} -// --- hover ------ -var HoverAdapter = /** @class */ (function () { - function HoverAdapter(_worker) { - this._worker = _worker; - } - HoverAdapter.prototype.provideHover = function (model, position, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { - return worker.doHover(resource.toString(), fromPosition(position)); - }).then(function (info) { - if (!info) { - return; - } - return { - range: toRange(info.range), - contents: toMarkedStringArray(info.contents) - }; - }); - }; - return HoverAdapter; -}()); - -// --- document highlights ------ -function toDocumentHighlightKind(kind) { - switch (kind) { - case DocumentHighlightKind.Read: return monaco.languages.DocumentHighlightKind.Read; - case DocumentHighlightKind.Write: return monaco.languages.DocumentHighlightKind.Write; - case DocumentHighlightKind.Text: return monaco.languages.DocumentHighlightKind.Text; - } - return monaco.languages.DocumentHighlightKind.Text; -} -var DocumentHighlightAdapter = /** @class */ (function () { - function DocumentHighlightAdapter(_worker) { - this._worker = _worker; - } - DocumentHighlightAdapter.prototype.provideDocumentHighlights = function (model, position, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { - return worker.findDocumentHighlights(resource.toString(), fromPosition(position)); - }).then(function (entries) { - if (!entries) { - return; - } - return entries.map(function (entry) { - return { - range: toRange(entry.range), - kind: toDocumentHighlightKind(entry.kind) - }; - }); - }); - }; - return DocumentHighlightAdapter; -}()); - -// --- definition ------ -function toLocation(location) { - return { - uri: Uri.parse(location.uri), - range: toRange(location.range) - }; -} -var DefinitionAdapter = /** @class */ (function () { - function DefinitionAdapter(_worker) { - this._worker = _worker; - } - DefinitionAdapter.prototype.provideDefinition = function (model, position, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { - return worker.findDefinition(resource.toString(), fromPosition(position)); - }).then(function (definition) { - if (!definition) { - return; - } - return [toLocation(definition)]; - }); - }; - return DefinitionAdapter; -}()); - -// --- references ------ -var ReferenceAdapter = /** @class */ (function () { - function ReferenceAdapter(_worker) { - this._worker = _worker; - } - ReferenceAdapter.prototype.provideReferences = function (model, position, context, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { - return worker.findReferences(resource.toString(), fromPosition(position)); - }).then(function (entries) { - if (!entries) { - return; - } - return entries.map(toLocation); - }); - }; - return ReferenceAdapter; -}()); - -// --- rename ------ -function toWorkspaceEdit(edit) { - if (!edit || !edit.changes) { - return void 0; - } - var resourceEdits = []; - for (var uri in edit.changes) { - var _uri = Uri.parse(uri); - // let edits: monaco.languages.TextEdit[] = []; - for (var _i = 0, _a = edit.changes[uri]; _i < _a.length; _i++) { - var e = _a[_i]; - resourceEdits.push({ - resource: _uri, - edit: { - range: toRange(e.range), - text: e.newText - } - }); - } - } - return { - edits: resourceEdits - }; -} -var RenameAdapter = /** @class */ (function () { - function RenameAdapter(_worker) { - this._worker = _worker; - } - RenameAdapter.prototype.provideRenameEdits = function (model, position, newName, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { - return worker.doRename(resource.toString(), fromPosition(position), newName); - }).then(function (edit) { - return toWorkspaceEdit(edit); - }); - }; - return RenameAdapter; -}()); - -// --- document symbols ------ -function toSymbolKind(kind) { - var mKind = monaco.languages.SymbolKind; - switch (kind) { - case SymbolKind.File: return mKind.Array; - case SymbolKind.Module: return mKind.Module; - case SymbolKind.Namespace: return mKind.Namespace; - case SymbolKind.Package: return mKind.Package; - case SymbolKind.Class: return mKind.Class; - case SymbolKind.Method: return mKind.Method; - case SymbolKind.Property: return mKind.Property; - case SymbolKind.Field: return mKind.Field; - case SymbolKind.Constructor: return mKind.Constructor; - case SymbolKind.Enum: return mKind.Enum; - case SymbolKind.Interface: return mKind.Interface; - case SymbolKind.Function: return mKind.Function; - case SymbolKind.Variable: return mKind.Variable; - case SymbolKind.Constant: return mKind.Constant; - case SymbolKind.String: return mKind.String; - case SymbolKind.Number: return mKind.Number; - case SymbolKind.Boolean: return mKind.Boolean; - case SymbolKind.Array: return mKind.Array; - } - return mKind.Function; -} -var DocumentSymbolAdapter = /** @class */ (function () { - function DocumentSymbolAdapter(_worker) { - this._worker = _worker; - } - DocumentSymbolAdapter.prototype.provideDocumentSymbols = function (model, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { return worker.findDocumentSymbols(resource.toString()); }).then(function (items) { - if (!items) { - return; - } - return items.map(function (item) { return ({ - name: item.name, - detail: '', - containerName: item.containerName, - kind: toSymbolKind(item.kind), - tags: [], - range: toRange(item.location.range), - selectionRange: toRange(item.location.range) - }); }); - }); - }; - return DocumentSymbolAdapter; -}()); - -var DocumentColorAdapter = /** @class */ (function () { - function DocumentColorAdapter(_worker) { - this._worker = _worker; - } - DocumentColorAdapter.prototype.provideDocumentColors = function (model, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { return worker.findDocumentColors(resource.toString()); }).then(function (infos) { - if (!infos) { - return; - } - return infos.map(function (item) { return ({ - color: item.color, - range: toRange(item.range) - }); }); - }); - }; - DocumentColorAdapter.prototype.provideColorPresentations = function (model, info, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { return worker.getColorPresentations(resource.toString(), info.color, fromRange(info.range)); }).then(function (presentations) { - if (!presentations) { - return; - } - return presentations.map(function (presentation) { - var item = { - label: presentation.label, - }; - if (presentation.textEdit) { - item.textEdit = toTextEdit(presentation.textEdit); - } - if (presentation.additionalTextEdits) { - item.additionalTextEdits = presentation.additionalTextEdits.map(toTextEdit); - } - return item; - }); - }); - }; - return DocumentColorAdapter; -}()); - -var FoldingRangeAdapter = /** @class */ (function () { - function FoldingRangeAdapter(_worker) { - this._worker = _worker; - } - FoldingRangeAdapter.prototype.provideFoldingRanges = function (model, context, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { return worker.getFoldingRanges(resource.toString(), context); }).then(function (ranges) { - if (!ranges) { - return; - } - return ranges.map(function (range) { - var result = { - start: range.startLine + 1, - end: range.endLine + 1 - }; - if (typeof range.kind !== 'undefined') { - result.kind = toFoldingRangeKind(range.kind); - } - return result; - }); - }); - }; - return FoldingRangeAdapter; -}()); - -function toFoldingRangeKind(kind) { - switch (kind) { - case FoldingRangeKind.Comment: return monaco.languages.FoldingRangeKind.Comment; - case FoldingRangeKind.Imports: return monaco.languages.FoldingRangeKind.Imports; - case FoldingRangeKind.Region: return monaco.languages.FoldingRangeKind.Region; - } -} -var SelectionRangeAdapter = /** @class */ (function () { - function SelectionRangeAdapter(_worker) { - this._worker = _worker; - } - SelectionRangeAdapter.prototype.provideSelectionRanges = function (model, positions, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { return worker.getSelectionRanges(resource.toString(), positions.map(fromPosition)); }).then(function (selectionRanges) { - if (!selectionRanges) { - return; - } - return selectionRanges.map(function (selectionRange) { - var result = []; - while (selectionRange) { - result.push({ range: toRange(selectionRange.range) }); - selectionRange = selectionRange.parent; - } - return result; - }); - }); - }; - return SelectionRangeAdapter; -}()); - +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + +var Uri = monaco.Uri; +var languageFeatures_Range = monaco.Range; +// --- diagnostics --- --- +var DiagnosticsAdapter = /** @class */ (function () { + function DiagnosticsAdapter(_languageId, _worker, defaults) { + var _this = this; + this._languageId = _languageId; + this._worker = _worker; + this._disposables = []; + this._listener = Object.create(null); + var onModelAdd = function (model) { + var modeId = model.getModeId(); + if (modeId !== _this._languageId) { + return; + } + var handle; + _this._listener[model.uri.toString()] = model.onDidChangeContent(function () { + window.clearTimeout(handle); + handle = window.setTimeout(function () { return _this._doValidate(model.uri, modeId); }, 500); + }); + _this._doValidate(model.uri, modeId); + }; + var onModelRemoved = function (model) { + monaco.editor.setModelMarkers(model, _this._languageId, []); + var uriStr = model.uri.toString(); + var listener = _this._listener[uriStr]; + if (listener) { + listener.dispose(); + delete _this._listener[uriStr]; + } + }; + this._disposables.push(monaco.editor.onDidCreateModel(onModelAdd)); + this._disposables.push(monaco.editor.onWillDisposeModel(onModelRemoved)); + this._disposables.push(monaco.editor.onDidChangeModelLanguage(function (event) { + onModelRemoved(event.model); + onModelAdd(event.model); + })); + defaults.onDidChange(function (_) { + monaco.editor.getModels().forEach(function (model) { + if (model.getModeId() === _this._languageId) { + onModelRemoved(model); + onModelAdd(model); + } + }); + }); + this._disposables.push({ + dispose: function () { + for (var key in _this._listener) { + _this._listener[key].dispose(); + } + } + }); + monaco.editor.getModels().forEach(onModelAdd); + } + DiagnosticsAdapter.prototype.dispose = function () { + this._disposables.forEach(function (d) { return d && d.dispose(); }); + this._disposables = []; + }; + DiagnosticsAdapter.prototype._doValidate = function (resource, languageId) { + this._worker(resource).then(function (worker) { + return worker.doValidation(resource.toString()); + }).then(function (diagnostics) { + var markers = diagnostics.map(function (d) { return toDiagnostics(resource, d); }); + var model = monaco.editor.getModel(resource); + if (model.getModeId() === languageId) { + monaco.editor.setModelMarkers(model, languageId, markers); + } + }).then(undefined, function (err) { + console.error(err); + }); + }; + return DiagnosticsAdapter; +}()); + +function toSeverity(lsSeverity) { + switch (lsSeverity) { + case DiagnosticSeverity.Error: return monaco.MarkerSeverity.Error; + case DiagnosticSeverity.Warning: return monaco.MarkerSeverity.Warning; + case DiagnosticSeverity.Information: return monaco.MarkerSeverity.Info; + case DiagnosticSeverity.Hint: return monaco.MarkerSeverity.Hint; + default: + return monaco.MarkerSeverity.Info; + } +} +function toDiagnostics(resource, diag) { + var code = typeof diag.code === 'number' ? String(diag.code) : diag.code; + return { + severity: toSeverity(diag.severity), + startLineNumber: diag.range.start.line + 1, + startColumn: diag.range.start.character + 1, + endLineNumber: diag.range.end.line + 1, + endColumn: diag.range.end.character + 1, + message: diag.message, + code: code, + source: diag.source + }; +} +// --- completion ------ +function fromPosition(position) { + if (!position) { + return void 0; + } + return { character: position.column - 1, line: position.lineNumber - 1 }; +} +function fromRange(range) { + if (!range) { + return void 0; + } + return { start: { line: range.startLineNumber - 1, character: range.startColumn - 1 }, end: { line: range.endLineNumber - 1, character: range.endColumn - 1 } }; +} +function toRange(range) { + if (!range) { + return void 0; + } + return new monaco.Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1); +} +function toCompletionItemKind(kind) { + var mItemKind = monaco.languages.CompletionItemKind; + switch (kind) { + case CompletionItemKind.Text: return mItemKind.Text; + case CompletionItemKind.Method: return mItemKind.Method; + case CompletionItemKind.Function: return mItemKind.Function; + case CompletionItemKind.Constructor: return mItemKind.Constructor; + case CompletionItemKind.Field: return mItemKind.Field; + case CompletionItemKind.Variable: return mItemKind.Variable; + case CompletionItemKind.Class: return mItemKind.Class; + case CompletionItemKind.Interface: return mItemKind.Interface; + case CompletionItemKind.Module: return mItemKind.Module; + case CompletionItemKind.Property: return mItemKind.Property; + case CompletionItemKind.Unit: return mItemKind.Unit; + case CompletionItemKind.Value: return mItemKind.Value; + case CompletionItemKind.Enum: return mItemKind.Enum; + case CompletionItemKind.Keyword: return mItemKind.Keyword; + case CompletionItemKind.Snippet: return mItemKind.Snippet; + case CompletionItemKind.Color: return mItemKind.Color; + case CompletionItemKind.File: return mItemKind.File; + case CompletionItemKind.Reference: return mItemKind.Reference; + } + return mItemKind.Property; +} +function toTextEdit(textEdit) { + if (!textEdit) { + return void 0; + } + return { + range: toRange(textEdit.range), + text: textEdit.newText + }; +} +var languageFeatures_CompletionAdapter = /** @class */ (function () { + function CompletionAdapter(_worker) { + this._worker = _worker; + } + Object.defineProperty(CompletionAdapter.prototype, "triggerCharacters", { + get: function () { + return [' ', ':']; + }, + enumerable: true, + configurable: true + }); + CompletionAdapter.prototype.provideCompletionItems = function (model, position, context, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { + return worker.doComplete(resource.toString(), fromPosition(position)); + }).then(function (info) { + if (!info) { + return; + } + var wordInfo = model.getWordUntilPosition(position); + var wordRange = new languageFeatures_Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn); + var items = info.items.map(function (entry) { + var item = { + label: entry.label, + insertText: entry.insertText || entry.label, + sortText: entry.sortText, + filterText: entry.filterText, + documentation: entry.documentation, + detail: entry.detail, + range: wordRange, + kind: toCompletionItemKind(entry.kind), + }; + if (entry.textEdit) { + item.range = toRange(entry.textEdit.range); + item.insertText = entry.textEdit.newText; + } + if (entry.additionalTextEdits) { + item.additionalTextEdits = entry.additionalTextEdits.map(toTextEdit); + } + if (entry.insertTextFormat === InsertTextFormat.Snippet) { + item.insertTextRules = monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet; + } + return item; + }); + return { + isIncomplete: info.isIncomplete, + suggestions: items + }; + }); + }; + return CompletionAdapter; +}()); + +function isMarkupContent(thing) { + return thing && typeof thing === 'object' && typeof thing.kind === 'string'; +} +function toMarkdownString(entry) { + if (typeof entry === 'string') { + return { + value: entry + }; + } + if (isMarkupContent(entry)) { + if (entry.kind === 'plaintext') { + return { + value: entry.value.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&') + }; + } + return { + value: entry.value + }; + } + return { value: '```' + entry.language + '\n' + entry.value + '\n```\n' }; +} +function toMarkedStringArray(contents) { + if (!contents) { + return void 0; + } + if (Array.isArray(contents)) { + return contents.map(toMarkdownString); + } + return [toMarkdownString(contents)]; +} +// --- hover ------ +var HoverAdapter = /** @class */ (function () { + function HoverAdapter(_worker) { + this._worker = _worker; + } + HoverAdapter.prototype.provideHover = function (model, position, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { + return worker.doHover(resource.toString(), fromPosition(position)); + }).then(function (info) { + if (!info) { + return; + } + return { + range: toRange(info.range), + contents: toMarkedStringArray(info.contents) + }; + }); + }; + return HoverAdapter; +}()); + +// --- document highlights ------ +function toDocumentHighlightKind(kind) { + switch (kind) { + case DocumentHighlightKind.Read: return monaco.languages.DocumentHighlightKind.Read; + case DocumentHighlightKind.Write: return monaco.languages.DocumentHighlightKind.Write; + case DocumentHighlightKind.Text: return monaco.languages.DocumentHighlightKind.Text; + } + return monaco.languages.DocumentHighlightKind.Text; +} +var DocumentHighlightAdapter = /** @class */ (function () { + function DocumentHighlightAdapter(_worker) { + this._worker = _worker; + } + DocumentHighlightAdapter.prototype.provideDocumentHighlights = function (model, position, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { + return worker.findDocumentHighlights(resource.toString(), fromPosition(position)); + }).then(function (entries) { + if (!entries) { + return; + } + return entries.map(function (entry) { + return { + range: toRange(entry.range), + kind: toDocumentHighlightKind(entry.kind) + }; + }); + }); + }; + return DocumentHighlightAdapter; +}()); + +// --- definition ------ +function toLocation(location) { + return { + uri: Uri.parse(location.uri), + range: toRange(location.range) + }; +} +var DefinitionAdapter = /** @class */ (function () { + function DefinitionAdapter(_worker) { + this._worker = _worker; + } + DefinitionAdapter.prototype.provideDefinition = function (model, position, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { + return worker.findDefinition(resource.toString(), fromPosition(position)); + }).then(function (definition) { + if (!definition) { + return; + } + return [toLocation(definition)]; + }); + }; + return DefinitionAdapter; +}()); + +// --- references ------ +var ReferenceAdapter = /** @class */ (function () { + function ReferenceAdapter(_worker) { + this._worker = _worker; + } + ReferenceAdapter.prototype.provideReferences = function (model, position, context, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { + return worker.findReferences(resource.toString(), fromPosition(position)); + }).then(function (entries) { + if (!entries) { + return; + } + return entries.map(toLocation); + }); + }; + return ReferenceAdapter; +}()); + +// --- rename ------ +function toWorkspaceEdit(edit) { + if (!edit || !edit.changes) { + return void 0; + } + var resourceEdits = []; + for (var uri in edit.changes) { + var _uri = Uri.parse(uri); + // let edits: monaco.languages.TextEdit[] = []; + for (var _i = 0, _a = edit.changes[uri]; _i < _a.length; _i++) { + var e = _a[_i]; + resourceEdits.push({ + resource: _uri, + edit: { + range: toRange(e.range), + text: e.newText + } + }); + } + } + return { + edits: resourceEdits + }; +} +var RenameAdapter = /** @class */ (function () { + function RenameAdapter(_worker) { + this._worker = _worker; + } + RenameAdapter.prototype.provideRenameEdits = function (model, position, newName, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { + return worker.doRename(resource.toString(), fromPosition(position), newName); + }).then(function (edit) { + return toWorkspaceEdit(edit); + }); + }; + return RenameAdapter; +}()); + +// --- document symbols ------ +function toSymbolKind(kind) { + var mKind = monaco.languages.SymbolKind; + switch (kind) { + case SymbolKind.File: return mKind.Array; + case SymbolKind.Module: return mKind.Module; + case SymbolKind.Namespace: return mKind.Namespace; + case SymbolKind.Package: return mKind.Package; + case SymbolKind.Class: return mKind.Class; + case SymbolKind.Method: return mKind.Method; + case SymbolKind.Property: return mKind.Property; + case SymbolKind.Field: return mKind.Field; + case SymbolKind.Constructor: return mKind.Constructor; + case SymbolKind.Enum: return mKind.Enum; + case SymbolKind.Interface: return mKind.Interface; + case SymbolKind.Function: return mKind.Function; + case SymbolKind.Variable: return mKind.Variable; + case SymbolKind.Constant: return mKind.Constant; + case SymbolKind.String: return mKind.String; + case SymbolKind.Number: return mKind.Number; + case SymbolKind.Boolean: return mKind.Boolean; + case SymbolKind.Array: return mKind.Array; + } + return mKind.Function; +} +var DocumentSymbolAdapter = /** @class */ (function () { + function DocumentSymbolAdapter(_worker) { + this._worker = _worker; + } + DocumentSymbolAdapter.prototype.provideDocumentSymbols = function (model, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { return worker.findDocumentSymbols(resource.toString()); }).then(function (items) { + if (!items) { + return; + } + return items.map(function (item) { return ({ + name: item.name, + detail: '', + containerName: item.containerName, + kind: toSymbolKind(item.kind), + tags: [], + range: toRange(item.location.range), + selectionRange: toRange(item.location.range) + }); }); + }); + }; + return DocumentSymbolAdapter; +}()); + +var DocumentColorAdapter = /** @class */ (function () { + function DocumentColorAdapter(_worker) { + this._worker = _worker; + } + DocumentColorAdapter.prototype.provideDocumentColors = function (model, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { return worker.findDocumentColors(resource.toString()); }).then(function (infos) { + if (!infos) { + return; + } + return infos.map(function (item) { return ({ + color: item.color, + range: toRange(item.range) + }); }); + }); + }; + DocumentColorAdapter.prototype.provideColorPresentations = function (model, info, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { return worker.getColorPresentations(resource.toString(), info.color, fromRange(info.range)); }).then(function (presentations) { + if (!presentations) { + return; + } + return presentations.map(function (presentation) { + var item = { + label: presentation.label, + }; + if (presentation.textEdit) { + item.textEdit = toTextEdit(presentation.textEdit); + } + if (presentation.additionalTextEdits) { + item.additionalTextEdits = presentation.additionalTextEdits.map(toTextEdit); + } + return item; + }); + }); + }; + return DocumentColorAdapter; +}()); + +var FoldingRangeAdapter = /** @class */ (function () { + function FoldingRangeAdapter(_worker) { + this._worker = _worker; + } + FoldingRangeAdapter.prototype.provideFoldingRanges = function (model, context, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { return worker.getFoldingRanges(resource.toString(), context); }).then(function (ranges) { + if (!ranges) { + return; + } + return ranges.map(function (range) { + var result = { + start: range.startLine + 1, + end: range.endLine + 1 + }; + if (typeof range.kind !== 'undefined') { + result.kind = toFoldingRangeKind(range.kind); + } + return result; + }); + }); + }; + return FoldingRangeAdapter; +}()); + +function toFoldingRangeKind(kind) { + switch (kind) { + case FoldingRangeKind.Comment: return monaco.languages.FoldingRangeKind.Comment; + case FoldingRangeKind.Imports: return monaco.languages.FoldingRangeKind.Imports; + case FoldingRangeKind.Region: return monaco.languages.FoldingRangeKind.Region; + } +} +var SelectionRangeAdapter = /** @class */ (function () { + function SelectionRangeAdapter(_worker) { + this._worker = _worker; + } + SelectionRangeAdapter.prototype.provideSelectionRanges = function (model, positions, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { return worker.getSelectionRanges(resource.toString(), positions.map(fromPosition)); }).then(function (selectionRanges) { + if (!selectionRanges) { + return; + } + return selectionRanges.map(function (selectionRange) { + var result = []; + while (selectionRange) { + result.push({ range: toRange(selectionRange.range) }); + selectionRange = selectionRange.parent; + } + return result; + }); + }); + }; + return SelectionRangeAdapter; +}()); + // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/cssMode.js -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -function setupMode(defaults) { - var disposables = []; - var providers = []; - var client = new WorkerManager(defaults); - disposables.push(client); - var worker = function () { - var uris = []; - for (var _i = 0; _i < arguments.length; _i++) { - uris[_i] = arguments[_i]; - } - return client.getLanguageServiceWorker.apply(client, uris); - }; - function registerProviders() { - var languageId = defaults.languageId, modeConfiguration = defaults.modeConfiguration; - disposeAll(providers); - if (modeConfiguration.completionItems) { - providers.push(monaco.languages.registerCompletionItemProvider(languageId, new languageFeatures_CompletionAdapter(worker))); - } - if (modeConfiguration.hovers) { - providers.push(monaco.languages.registerHoverProvider(languageId, new HoverAdapter(worker))); - } - if (modeConfiguration.documentHighlights) { - providers.push(monaco.languages.registerDocumentHighlightProvider(languageId, new DocumentHighlightAdapter(worker))); - } - if (modeConfiguration.definitions) { - providers.push(monaco.languages.registerDefinitionProvider(languageId, new DefinitionAdapter(worker))); - } - if (modeConfiguration.references) { - providers.push(monaco.languages.registerReferenceProvider(languageId, new ReferenceAdapter(worker))); - } - if (modeConfiguration.documentSymbols) { - providers.push(monaco.languages.registerDocumentSymbolProvider(languageId, new DocumentSymbolAdapter(worker))); - } - if (modeConfiguration.rename) { - providers.push(monaco.languages.registerRenameProvider(languageId, new RenameAdapter(worker))); - } - if (modeConfiguration.colors) { - providers.push(monaco.languages.registerColorProvider(languageId, new DocumentColorAdapter(worker))); - } - if (modeConfiguration.foldingRanges) { - providers.push(monaco.languages.registerFoldingRangeProvider(languageId, new FoldingRangeAdapter(worker))); - } - if (modeConfiguration.diagnostics) { - providers.push(new DiagnosticsAdapter(languageId, worker, defaults)); - } - if (modeConfiguration.selectionRanges) { - providers.push(monaco.languages.registerSelectionRangeProvider(languageId, new SelectionRangeAdapter(worker))); - } - } - registerProviders(); - disposables.push(asDisposable(providers)); - return asDisposable(disposables); -} -function asDisposable(disposables) { - return { dispose: function () { return disposeAll(disposables); } }; -} -function disposeAll(disposables) { - while (disposables.length) { - disposables.pop().dispose(); - } -} +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + +function setupMode(defaults) { + var disposables = []; + var providers = []; + var client = new WorkerManager(defaults); + disposables.push(client); + var worker = function () { + var uris = []; + for (var _i = 0; _i < arguments.length; _i++) { + uris[_i] = arguments[_i]; + } + return client.getLanguageServiceWorker.apply(client, uris); + }; + function registerProviders() { + var languageId = defaults.languageId, modeConfiguration = defaults.modeConfiguration; + disposeAll(providers); + if (modeConfiguration.completionItems) { + providers.push(monaco.languages.registerCompletionItemProvider(languageId, new languageFeatures_CompletionAdapter(worker))); + } + if (modeConfiguration.hovers) { + providers.push(monaco.languages.registerHoverProvider(languageId, new HoverAdapter(worker))); + } + if (modeConfiguration.documentHighlights) { + providers.push(monaco.languages.registerDocumentHighlightProvider(languageId, new DocumentHighlightAdapter(worker))); + } + if (modeConfiguration.definitions) { + providers.push(monaco.languages.registerDefinitionProvider(languageId, new DefinitionAdapter(worker))); + } + if (modeConfiguration.references) { + providers.push(monaco.languages.registerReferenceProvider(languageId, new ReferenceAdapter(worker))); + } + if (modeConfiguration.documentSymbols) { + providers.push(monaco.languages.registerDocumentSymbolProvider(languageId, new DocumentSymbolAdapter(worker))); + } + if (modeConfiguration.rename) { + providers.push(monaco.languages.registerRenameProvider(languageId, new RenameAdapter(worker))); + } + if (modeConfiguration.colors) { + providers.push(monaco.languages.registerColorProvider(languageId, new DocumentColorAdapter(worker))); + } + if (modeConfiguration.foldingRanges) { + providers.push(monaco.languages.registerFoldingRangeProvider(languageId, new FoldingRangeAdapter(worker))); + } + if (modeConfiguration.diagnostics) { + providers.push(new DiagnosticsAdapter(languageId, worker, defaults)); + } + if (modeConfiguration.selectionRanges) { + providers.push(monaco.languages.registerSelectionRangeProvider(languageId, new SelectionRangeAdapter(worker))); + } + } + registerProviders(); + disposables.push(asDisposable(providers)); + return asDisposable(disposables); +} +function asDisposable(disposables) { + return { dispose: function () { return disposeAll(disposables); } }; +} +function disposeAll(disposables) { + while (disposables.length) { + disposables.pop().dispose(); + } +} /***/ }), diff --git a/22.ef8b9ab5.async.js b/22.ef8b9ab5.async.js index 8d2c3cb3e..835b3a6dd 100644 --- a/22.ef8b9ab5.async.js +++ b/22.ef8b9ab5.async.js @@ -18,1636 +18,1636 @@ __webpack_require__.d(__webpack_exports__, "setupMode1", function() { return /* __webpack_require__.d(__webpack_exports__, "setupMode", function() { return /* binding */ setupMode; }); // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/workerManager.js -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var STOP_WHEN_IDLE_FOR = 2 * 60 * 1000; // 2min -var WorkerManager = /** @class */ (function () { - function WorkerManager(defaults) { - var _this = this; - this._defaults = defaults; - this._worker = null; - this._idleCheckInterval = setInterval(function () { return _this._checkIfIdle(); }, 30 * 1000); - this._lastUsedTime = 0; - this._configChangeListener = this._defaults.onDidChange(function () { return _this._stopWorker(); }); - } - WorkerManager.prototype._stopWorker = function () { - if (this._worker) { - this._worker.dispose(); - this._worker = null; - } - this._client = null; - }; - WorkerManager.prototype.dispose = function () { - clearInterval(this._idleCheckInterval); - this._configChangeListener.dispose(); - this._stopWorker(); - }; - WorkerManager.prototype._checkIfIdle = function () { - if (!this._worker) { - return; - } - var timePassedSinceLastUsed = Date.now() - this._lastUsedTime; - if (timePassedSinceLastUsed > STOP_WHEN_IDLE_FOR) { - this._stopWorker(); - } - }; - WorkerManager.prototype._getClient = function () { - this._lastUsedTime = Date.now(); - if (!this._client) { - this._worker = monaco.editor.createWebWorker({ - // module that exports the create() method and returns a `HTMLWorker` instance - moduleId: 'vs/language/html/htmlWorker', - // passed in to the create() method - createData: { - languageSettings: this._defaults.options, - languageId: this._defaults.languageId - }, - label: this._defaults.languageId - }); - this._client = this._worker.getProxy(); - } - return this._client; - }; - WorkerManager.prototype.getLanguageServiceWorker = function () { - var _this = this; - var resources = []; - for (var _i = 0; _i < arguments.length; _i++) { - resources[_i] = arguments[_i]; - } - var _client; - return this._getClient().then(function (client) { - _client = client; - }).then(function (_) { - return _this._worker.withSyncedResources(resources); - }).then(function (_) { return _client; }); - }; - return WorkerManager; -}()); - +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var STOP_WHEN_IDLE_FOR = 2 * 60 * 1000; // 2min +var WorkerManager = /** @class */ (function () { + function WorkerManager(defaults) { + var _this = this; + this._defaults = defaults; + this._worker = null; + this._idleCheckInterval = setInterval(function () { return _this._checkIfIdle(); }, 30 * 1000); + this._lastUsedTime = 0; + this._configChangeListener = this._defaults.onDidChange(function () { return _this._stopWorker(); }); + } + WorkerManager.prototype._stopWorker = function () { + if (this._worker) { + this._worker.dispose(); + this._worker = null; + } + this._client = null; + }; + WorkerManager.prototype.dispose = function () { + clearInterval(this._idleCheckInterval); + this._configChangeListener.dispose(); + this._stopWorker(); + }; + WorkerManager.prototype._checkIfIdle = function () { + if (!this._worker) { + return; + } + var timePassedSinceLastUsed = Date.now() - this._lastUsedTime; + if (timePassedSinceLastUsed > STOP_WHEN_IDLE_FOR) { + this._stopWorker(); + } + }; + WorkerManager.prototype._getClient = function () { + this._lastUsedTime = Date.now(); + if (!this._client) { + this._worker = monaco.editor.createWebWorker({ + // module that exports the create() method and returns a `HTMLWorker` instance + moduleId: 'vs/language/html/htmlWorker', + // passed in to the create() method + createData: { + languageSettings: this._defaults.options, + languageId: this._defaults.languageId + }, + label: this._defaults.languageId + }); + this._client = this._worker.getProxy(); + } + return this._client; + }; + WorkerManager.prototype.getLanguageServiceWorker = function () { + var _this = this; + var resources = []; + for (var _i = 0; _i < arguments.length; _i++) { + resources[_i] = arguments[_i]; + } + var _client; + return this._getClient().then(function (client) { + _client = client; + }).then(function (_) { + return _this._worker.withSyncedResources(resources); + }).then(function (_) { return _client; }); + }; + return WorkerManager; +}()); + // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/fillers/vscode-nls.js -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function format(message, args) { - var result; - if (args.length === 0) { - result = message; - } - else { - result = message.replace(/\{(\d+)\}/g, function (match, rest) { - var index = rest[0]; - return typeof args[index] !== 'undefined' ? args[index] : match; - }); - } - return result; -} -function localize(key, message) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - return format(message, args); -} -function loadMessageBundle(file) { - return localize; -} -function config(opt) { - return loadMessageBundle; -} +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +function format(message, args) { + var result; + if (args.length === 0) { + result = message; + } + else { + result = message.replace(/\{(\d+)\}/g, function (match, rest) { + var index = rest[0]; + return typeof args[index] !== 'undefined' ? args[index] : match; + }); + } + return result; +} +function localize(key, message) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + return format(message, args); +} +function loadMessageBundle(file) { + return localize; +} +function config(opt) { + return loadMessageBundle; +} // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/_deps/vscode-languageserver-types/main.js -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -/** - * The Position namespace provides helper functions to work with - * [Position](#Position) literals. - */ -var Position; -(function (Position) { - /** - * Creates a new Position literal from the given line and character. - * @param line The position's line. - * @param character The position's character. - */ - function create(line, character) { - return { line: line, character: character }; - } - Position.create = create; - /** - * Checks whether the given liternal conforms to the [Position](#Position) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character); - } - Position.is = is; -})(Position || (Position = {})); -/** - * The Range namespace provides helper functions to work with - * [Range](#Range) literals. - */ -var Range; -(function (Range) { - function create(one, two, three, four) { - if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) { - return { start: Position.create(one, two), end: Position.create(three, four) }; - } - else if (Position.is(one) && Position.is(two)) { - return { start: one, end: two }; - } - else { - throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]"); - } - } - Range.create = create; - /** - * Checks whether the given literal conforms to the [Range](#Range) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); - } - Range.is = is; -})(Range || (Range = {})); -/** - * The Location namespace provides helper functions to work with - * [Location](#Location) literals. - */ -var Location; -(function (Location) { - /** - * Creates a Location literal. - * @param uri The location's uri. - * @param range The location's range. - */ - function create(uri, range) { - return { uri: uri, range: range }; - } - Location.create = create; - /** - * Checks whether the given literal conforms to the [Location](#Location) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); - } - Location.is = is; -})(Location || (Location = {})); -/** - * The LocationLink namespace provides helper functions to work with - * [LocationLink](#LocationLink) literals. - */ -var LocationLink; -(function (LocationLink) { - /** - * Creates a LocationLink literal. - * @param targetUri The definition's uri. - * @param targetRange The full range of the definition. - * @param targetSelectionRange The span of the symbol definition at the target. - * @param originSelectionRange The span of the symbol being defined in the originating source file. - */ - function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) { - return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange }; - } - LocationLink.create = create; - /** - * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) - && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) - && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); - } - LocationLink.is = is; -})(LocationLink || (LocationLink = {})); -/** - * The Color namespace provides helper functions to work with - * [Color](#Color) literals. - */ -var Color; -(function (Color) { - /** - * Creates a new Color literal. - */ - function create(red, green, blue, alpha) { - return { - red: red, - green: green, - blue: blue, - alpha: alpha, - }; - } - Color.create = create; - /** - * Checks whether the given literal conforms to the [Color](#Color) interface. - */ - function is(value) { - var candidate = value; - return Is.number(candidate.red) - && Is.number(candidate.green) - && Is.number(candidate.blue) - && Is.number(candidate.alpha); - } - Color.is = is; -})(Color || (Color = {})); -/** - * The ColorInformation namespace provides helper functions to work with - * [ColorInformation](#ColorInformation) literals. - */ -var ColorInformation; -(function (ColorInformation) { - /** - * Creates a new ColorInformation literal. - */ - function create(range, color) { - return { - range: range, - color: color, - }; - } - ColorInformation.create = create; - /** - * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. - */ - function is(value) { - var candidate = value; - return Range.is(candidate.range) && Color.is(candidate.color); - } - ColorInformation.is = is; -})(ColorInformation || (ColorInformation = {})); -/** - * The Color namespace provides helper functions to work with - * [ColorPresentation](#ColorPresentation) literals. - */ -var ColorPresentation; -(function (ColorPresentation) { - /** - * Creates a new ColorInformation literal. - */ - function create(label, textEdit, additionalTextEdits) { - return { - label: label, - textEdit: textEdit, - additionalTextEdits: additionalTextEdits, - }; - } - ColorPresentation.create = create; - /** - * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. - */ - function is(value) { - var candidate = value; - return Is.string(candidate.label) - && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) - && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is)); - } - ColorPresentation.is = is; -})(ColorPresentation || (ColorPresentation = {})); -/** - * Enum of known range kinds - */ -var FoldingRangeKind; -(function (FoldingRangeKind) { - /** - * Folding range for a comment - */ - FoldingRangeKind["Comment"] = "comment"; - /** - * Folding range for a imports or includes - */ - FoldingRangeKind["Imports"] = "imports"; - /** - * Folding range for a region (e.g. `#region`) - */ - FoldingRangeKind["Region"] = "region"; -})(FoldingRangeKind || (FoldingRangeKind = {})); -/** - * The folding range namespace provides helper functions to work with - * [FoldingRange](#FoldingRange) literals. - */ -var FoldingRange; -(function (FoldingRange) { - /** - * Creates a new FoldingRange literal. - */ - function create(startLine, endLine, startCharacter, endCharacter, kind) { - var result = { - startLine: startLine, - endLine: endLine - }; - if (Is.defined(startCharacter)) { - result.startCharacter = startCharacter; - } - if (Is.defined(endCharacter)) { - result.endCharacter = endCharacter; - } - if (Is.defined(kind)) { - result.kind = kind; - } - return result; - } - FoldingRange.create = create; - /** - * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface. - */ - function is(value) { - var candidate = value; - return Is.number(candidate.startLine) && Is.number(candidate.startLine) - && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter)) - && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter)) - && (Is.undefined(candidate.kind) || Is.string(candidate.kind)); - } - FoldingRange.is = is; -})(FoldingRange || (FoldingRange = {})); -/** - * The DiagnosticRelatedInformation namespace provides helper functions to work with - * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals. - */ -var DiagnosticRelatedInformation; -(function (DiagnosticRelatedInformation) { - /** - * Creates a new DiagnosticRelatedInformation literal. - */ - function create(location, message) { - return { - location: location, - message: message - }; - } - DiagnosticRelatedInformation.create = create; - /** - * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message); - } - DiagnosticRelatedInformation.is = is; -})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {})); -/** - * The diagnostic's severity. - */ -var DiagnosticSeverity; -(function (DiagnosticSeverity) { - /** - * Reports an error. - */ - DiagnosticSeverity.Error = 1; - /** - * Reports a warning. - */ - DiagnosticSeverity.Warning = 2; - /** - * Reports an information. - */ - DiagnosticSeverity.Information = 3; - /** - * Reports a hint. - */ - DiagnosticSeverity.Hint = 4; -})(DiagnosticSeverity || (DiagnosticSeverity = {})); -/** - * The diagnostic tags. - * - * @since 3.15.0 - */ -var DiagnosticTag; -(function (DiagnosticTag) { - /** - * Unused or unnecessary code. - * - * Clients are allowed to render diagnostics with this tag faded out instead of having - * an error squiggle. - */ - DiagnosticTag.Unnecessary = 1; - /** - * Deprecated or obsolete code. - * - * Clients are allowed to rendered diagnostics with this tag strike through. - */ - DiagnosticTag.Deprecated = 2; -})(DiagnosticTag || (DiagnosticTag = {})); -/** - * The Diagnostic namespace provides helper functions to work with - * [Diagnostic](#Diagnostic) literals. - */ -var Diagnostic; -(function (Diagnostic) { - /** - * Creates a new Diagnostic literal. - */ - function create(range, message, severity, code, source, relatedInformation) { - var result = { range: range, message: message }; - if (Is.defined(severity)) { - result.severity = severity; - } - if (Is.defined(code)) { - result.code = code; - } - if (Is.defined(source)) { - result.source = source; - } - if (Is.defined(relatedInformation)) { - result.relatedInformation = relatedInformation; - } - return result; - } - Diagnostic.create = create; - /** - * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) - && Range.is(candidate.range) - && Is.string(candidate.message) - && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) - && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) - && (Is.string(candidate.source) || Is.undefined(candidate.source)) - && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is)); - } - Diagnostic.is = is; -})(Diagnostic || (Diagnostic = {})); -/** - * The Command namespace provides helper functions to work with - * [Command](#Command) literals. - */ -var Command; -(function (Command) { - /** - * Creates a new Command literal. - */ - function create(title, command) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - var result = { title: title, command: command }; - if (Is.defined(args) && args.length > 0) { - result.arguments = args; - } - return result; - } - Command.create = create; - /** - * Checks whether the given literal conforms to the [Command](#Command) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command); - } - Command.is = is; -})(Command || (Command = {})); -/** - * The TextEdit namespace provides helper function to create replace, - * insert and delete edits more easily. - */ -var TextEdit; -(function (TextEdit) { - /** - * Creates a replace text edit. - * @param range The range of text to be replaced. - * @param newText The new text. - */ - function replace(range, newText) { - return { range: range, newText: newText }; - } - TextEdit.replace = replace; - /** - * Creates a insert text edit. - * @param position The position to insert the text at. - * @param newText The text to be inserted. - */ - function insert(position, newText) { - return { range: { start: position, end: position }, newText: newText }; - } - TextEdit.insert = insert; - /** - * Creates a delete text edit. - * @param range The range of text to be deleted. - */ - function del(range) { - return { range: range, newText: '' }; - } - TextEdit.del = del; - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) - && Is.string(candidate.newText) - && Range.is(candidate.range); - } - TextEdit.is = is; -})(TextEdit || (TextEdit = {})); -/** - * The TextDocumentEdit namespace provides helper function to create - * an edit that manipulates a text document. - */ -var TextDocumentEdit; -(function (TextDocumentEdit) { - /** - * Creates a new `TextDocumentEdit` - */ - function create(textDocument, edits) { - return { textDocument: textDocument, edits: edits }; - } - TextDocumentEdit.create = create; - function is(value) { - var candidate = value; - return Is.defined(candidate) - && VersionedTextDocumentIdentifier.is(candidate.textDocument) - && Array.isArray(candidate.edits); - } - TextDocumentEdit.is = is; -})(TextDocumentEdit || (TextDocumentEdit = {})); -var CreateFile; -(function (CreateFile) { - function create(uri, options) { - var result = { - kind: 'create', - uri: uri - }; - if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { - result.options = options; - } - return result; - } - CreateFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && - (candidate.options === void 0 || - ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); - } - CreateFile.is = is; -})(CreateFile || (CreateFile = {})); -var RenameFile; -(function (RenameFile) { - function create(oldUri, newUri, options) { - var result = { - kind: 'rename', - oldUri: oldUri, - newUri: newUri - }; - if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { - result.options = options; - } - return result; - } - RenameFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && - (candidate.options === void 0 || - ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); - } - RenameFile.is = is; -})(RenameFile || (RenameFile = {})); -var DeleteFile; -(function (DeleteFile) { - function create(uri, options) { - var result = { - kind: 'delete', - uri: uri - }; - if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) { - result.options = options; - } - return result; - } - DeleteFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && - (candidate.options === void 0 || - ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists)))); - } - DeleteFile.is = is; -})(DeleteFile || (DeleteFile = {})); -var WorkspaceEdit; -(function (WorkspaceEdit) { - function is(value) { - var candidate = value; - return candidate && - (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && - (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) { - if (Is.string(change.kind)) { - return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change); - } - else { - return TextDocumentEdit.is(change); - } - })); - } - WorkspaceEdit.is = is; -})(WorkspaceEdit || (WorkspaceEdit = {})); -var TextEditChangeImpl = /** @class */ (function () { - function TextEditChangeImpl(edits) { - this.edits = edits; - } - TextEditChangeImpl.prototype.insert = function (position, newText) { - this.edits.push(TextEdit.insert(position, newText)); - }; - TextEditChangeImpl.prototype.replace = function (range, newText) { - this.edits.push(TextEdit.replace(range, newText)); - }; - TextEditChangeImpl.prototype.delete = function (range) { - this.edits.push(TextEdit.del(range)); - }; - TextEditChangeImpl.prototype.add = function (edit) { - this.edits.push(edit); - }; - TextEditChangeImpl.prototype.all = function () { - return this.edits; - }; - TextEditChangeImpl.prototype.clear = function () { - this.edits.splice(0, this.edits.length); - }; - return TextEditChangeImpl; -}()); -/** - * A workspace change helps constructing changes to a workspace. - */ -var WorkspaceChange = /** @class */ (function () { - function WorkspaceChange(workspaceEdit) { - var _this = this; - this._textEditChanges = Object.create(null); - if (workspaceEdit) { - this._workspaceEdit = workspaceEdit; - if (workspaceEdit.documentChanges) { - workspaceEdit.documentChanges.forEach(function (change) { - if (TextDocumentEdit.is(change)) { - var textEditChange = new TextEditChangeImpl(change.edits); - _this._textEditChanges[change.textDocument.uri] = textEditChange; - } - }); - } - else if (workspaceEdit.changes) { - Object.keys(workspaceEdit.changes).forEach(function (key) { - var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]); - _this._textEditChanges[key] = textEditChange; - }); - } - } - } - Object.defineProperty(WorkspaceChange.prototype, "edit", { - /** - * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal - * use to be returned from a workspace edit operation like rename. - */ - get: function () { - return this._workspaceEdit; - }, - enumerable: true, - configurable: true - }); - WorkspaceChange.prototype.getTextEditChange = function (key) { - if (VersionedTextDocumentIdentifier.is(key)) { - if (!this._workspaceEdit) { - this._workspaceEdit = { - documentChanges: [] - }; - } - if (!this._workspaceEdit.documentChanges) { - throw new Error('Workspace edit is not configured for document changes.'); - } - var textDocument = key; - var result = this._textEditChanges[textDocument.uri]; - if (!result) { - var edits = []; - var textDocumentEdit = { - textDocument: textDocument, - edits: edits - }; - this._workspaceEdit.documentChanges.push(textDocumentEdit); - result = new TextEditChangeImpl(edits); - this._textEditChanges[textDocument.uri] = result; - } - return result; - } - else { - if (!this._workspaceEdit) { - this._workspaceEdit = { - changes: Object.create(null) - }; - } - if (!this._workspaceEdit.changes) { - throw new Error('Workspace edit is not configured for normal text edit changes.'); - } - var result = this._textEditChanges[key]; - if (!result) { - var edits = []; - this._workspaceEdit.changes[key] = edits; - result = new TextEditChangeImpl(edits); - this._textEditChanges[key] = result; - } - return result; - } - }; - WorkspaceChange.prototype.createFile = function (uri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options)); - }; - WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options)); - }; - WorkspaceChange.prototype.deleteFile = function (uri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options)); - }; - WorkspaceChange.prototype.checkDocumentChanges = function () { - if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) { - throw new Error('Workspace edit is not configured for document changes.'); - } - }; - return WorkspaceChange; -}()); - -/** - * The TextDocumentIdentifier namespace provides helper functions to work with - * [TextDocumentIdentifier](#TextDocumentIdentifier) literals. - */ -var TextDocumentIdentifier; -(function (TextDocumentIdentifier) { - /** - * Creates a new TextDocumentIdentifier literal. - * @param uri The document's uri. - */ - function create(uri) { - return { uri: uri }; - } - TextDocumentIdentifier.create = create; - /** - * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri); - } - TextDocumentIdentifier.is = is; -})(TextDocumentIdentifier || (TextDocumentIdentifier = {})); -/** - * The VersionedTextDocumentIdentifier namespace provides helper functions to work with - * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals. - */ -var VersionedTextDocumentIdentifier; -(function (VersionedTextDocumentIdentifier) { - /** - * Creates a new VersionedTextDocumentIdentifier literal. - * @param uri The document's uri. - * @param uri The document's text. - */ - function create(uri, version) { - return { uri: uri, version: version }; - } - VersionedTextDocumentIdentifier.create = create; - /** - * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version)); - } - VersionedTextDocumentIdentifier.is = is; -})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {})); -/** - * The TextDocumentItem namespace provides helper functions to work with - * [TextDocumentItem](#TextDocumentItem) literals. - */ -var TextDocumentItem; -(function (TextDocumentItem) { - /** - * Creates a new TextDocumentItem literal. - * @param uri The document's uri. - * @param languageId The document's language identifier. - * @param version The document's version number. - * @param text The document's text. - */ - function create(uri, languageId, version, text) { - return { uri: uri, languageId: languageId, version: version, text: text }; - } - TextDocumentItem.create = create; - /** - * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text); - } - TextDocumentItem.is = is; -})(TextDocumentItem || (TextDocumentItem = {})); -/** - * Describes the content type that a client supports in various - * result literals like `Hover`, `ParameterInfo` or `CompletionItem`. - * - * Please note that `MarkupKinds` must not start with a `$`. This kinds - * are reserved for internal usage. - */ -var MarkupKind; -(function (MarkupKind) { - /** - * Plain text is supported as a content format - */ - MarkupKind.PlainText = 'plaintext'; - /** - * Markdown is supported as a content format - */ - MarkupKind.Markdown = 'markdown'; -})(MarkupKind || (MarkupKind = {})); -(function (MarkupKind) { - /** - * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type. - */ - function is(value) { - var candidate = value; - return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown; - } - MarkupKind.is = is; -})(MarkupKind || (MarkupKind = {})); -var MarkupContent; -(function (MarkupContent) { - /** - * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); - } - MarkupContent.is = is; -})(MarkupContent || (MarkupContent = {})); -/** - * The kind of a completion entry. - */ -var CompletionItemKind; -(function (CompletionItemKind) { - CompletionItemKind.Text = 1; - CompletionItemKind.Method = 2; - CompletionItemKind.Function = 3; - CompletionItemKind.Constructor = 4; - CompletionItemKind.Field = 5; - CompletionItemKind.Variable = 6; - CompletionItemKind.Class = 7; - CompletionItemKind.Interface = 8; - CompletionItemKind.Module = 9; - CompletionItemKind.Property = 10; - CompletionItemKind.Unit = 11; - CompletionItemKind.Value = 12; - CompletionItemKind.Enum = 13; - CompletionItemKind.Keyword = 14; - CompletionItemKind.Snippet = 15; - CompletionItemKind.Color = 16; - CompletionItemKind.File = 17; - CompletionItemKind.Reference = 18; - CompletionItemKind.Folder = 19; - CompletionItemKind.EnumMember = 20; - CompletionItemKind.Constant = 21; - CompletionItemKind.Struct = 22; - CompletionItemKind.Event = 23; - CompletionItemKind.Operator = 24; - CompletionItemKind.TypeParameter = 25; -})(CompletionItemKind || (CompletionItemKind = {})); -/** - * Defines whether the insert text in a completion item should be interpreted as - * plain text or a snippet. - */ -var InsertTextFormat; -(function (InsertTextFormat) { - /** - * The primary text to be inserted is treated as a plain string. - */ - InsertTextFormat.PlainText = 1; - /** - * The primary text to be inserted is treated as a snippet. - * - * A snippet can define tab stops and placeholders with `$1`, `$2` - * and `${3:foo}`. `$0` defines the final tab stop, it defaults to - * the end of the snippet. Placeholders with equal identifiers are linked, - * that is typing in one will update others too. - * - * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md - */ - InsertTextFormat.Snippet = 2; -})(InsertTextFormat || (InsertTextFormat = {})); -/** - * Completion item tags are extra annotations that tweak the rendering of a completion - * item. - * - * @since 3.15.0 - */ -var CompletionItemTag; -(function (CompletionItemTag) { - /** - * Render a completion as obsolete, usually using a strike-out. - */ - CompletionItemTag.Deprecated = 1; -})(CompletionItemTag || (CompletionItemTag = {})); -/** - * The CompletionItem namespace provides functions to deal with - * completion items. - */ -var CompletionItem; -(function (CompletionItem) { - /** - * Create a completion item and seed it with a label. - * @param label The completion item's label - */ - function create(label) { - return { label: label }; - } - CompletionItem.create = create; -})(CompletionItem || (CompletionItem = {})); -/** - * The CompletionList namespace provides functions to deal with - * completion lists. - */ -var CompletionList; -(function (CompletionList) { - /** - * Creates a new completion list. - * - * @param items The completion items. - * @param isIncomplete The list is not complete. - */ - function create(items, isIncomplete) { - return { items: items ? items : [], isIncomplete: !!isIncomplete }; - } - CompletionList.create = create; -})(CompletionList || (CompletionList = {})); -var MarkedString; -(function (MarkedString) { - /** - * Creates a marked string from plain text. - * - * @param plainText The plain text. - */ - function fromPlainText(plainText) { - return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash - } - MarkedString.fromPlainText = fromPlainText; - /** - * Checks whether the given value conforms to the [MarkedString](#MarkedString) type. - */ - function is(value) { - var candidate = value; - return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value)); - } - MarkedString.is = is; -})(MarkedString || (MarkedString = {})); -var Hover; -(function (Hover) { - /** - * Checks whether the given value conforms to the [Hover](#Hover) interface. - */ - function is(value) { - var candidate = value; - return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || - MarkedString.is(candidate.contents) || - Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range)); - } - Hover.is = is; -})(Hover || (Hover = {})); -/** - * The ParameterInformation namespace provides helper functions to work with - * [ParameterInformation](#ParameterInformation) literals. - */ -var ParameterInformation; -(function (ParameterInformation) { - /** - * Creates a new parameter information literal. - * - * @param label A label string. - * @param documentation A doc string. - */ - function create(label, documentation) { - return documentation ? { label: label, documentation: documentation } : { label: label }; - } - ParameterInformation.create = create; -})(ParameterInformation || (ParameterInformation = {})); -/** - * The SignatureInformation namespace provides helper functions to work with - * [SignatureInformation](#SignatureInformation) literals. - */ -var SignatureInformation; -(function (SignatureInformation) { - function create(label, documentation) { - var parameters = []; - for (var _i = 2; _i < arguments.length; _i++) { - parameters[_i - 2] = arguments[_i]; - } - var result = { label: label }; - if (Is.defined(documentation)) { - result.documentation = documentation; - } - if (Is.defined(parameters)) { - result.parameters = parameters; - } - else { - result.parameters = []; - } - return result; - } - SignatureInformation.create = create; -})(SignatureInformation || (SignatureInformation = {})); -/** - * A document highlight kind. - */ -var DocumentHighlightKind; -(function (DocumentHighlightKind) { - /** - * A textual occurrence. - */ - DocumentHighlightKind.Text = 1; - /** - * Read-access of a symbol, like reading a variable. - */ - DocumentHighlightKind.Read = 2; - /** - * Write-access of a symbol, like writing to a variable. - */ - DocumentHighlightKind.Write = 3; -})(DocumentHighlightKind || (DocumentHighlightKind = {})); -/** - * DocumentHighlight namespace to provide helper functions to work with - * [DocumentHighlight](#DocumentHighlight) literals. - */ -var DocumentHighlight; -(function (DocumentHighlight) { - /** - * Create a DocumentHighlight object. - * @param range The range the highlight applies to. - */ - function create(range, kind) { - var result = { range: range }; - if (Is.number(kind)) { - result.kind = kind; - } - return result; - } - DocumentHighlight.create = create; -})(DocumentHighlight || (DocumentHighlight = {})); -/** - * A symbol kind. - */ -var SymbolKind; -(function (SymbolKind) { - SymbolKind.File = 1; - SymbolKind.Module = 2; - SymbolKind.Namespace = 3; - SymbolKind.Package = 4; - SymbolKind.Class = 5; - SymbolKind.Method = 6; - SymbolKind.Property = 7; - SymbolKind.Field = 8; - SymbolKind.Constructor = 9; - SymbolKind.Enum = 10; - SymbolKind.Interface = 11; - SymbolKind.Function = 12; - SymbolKind.Variable = 13; - SymbolKind.Constant = 14; - SymbolKind.String = 15; - SymbolKind.Number = 16; - SymbolKind.Boolean = 17; - SymbolKind.Array = 18; - SymbolKind.Object = 19; - SymbolKind.Key = 20; - SymbolKind.Null = 21; - SymbolKind.EnumMember = 22; - SymbolKind.Struct = 23; - SymbolKind.Event = 24; - SymbolKind.Operator = 25; - SymbolKind.TypeParameter = 26; -})(SymbolKind || (SymbolKind = {})); -/** - * Symbol tags are extra annotations that tweak the rendering of a symbol. - * @since 3.15 - */ -var SymbolTag; -(function (SymbolTag) { - /** - * Render a symbol as obsolete, usually using a strike-out. - */ - SymbolTag.Deprecated = 1; -})(SymbolTag || (SymbolTag = {})); -var SymbolInformation; -(function (SymbolInformation) { - /** - * Creates a new symbol information literal. - * - * @param name The name of the symbol. - * @param kind The kind of the symbol. - * @param range The range of the location of the symbol. - * @param uri The resource of the location of symbol, defaults to the current document. - * @param containerName The name of the symbol containing the symbol. - */ - function create(name, kind, range, uri, containerName) { - var result = { - name: name, - kind: kind, - location: { uri: uri, range: range } - }; - if (containerName) { - result.containerName = containerName; - } - return result; - } - SymbolInformation.create = create; -})(SymbolInformation || (SymbolInformation = {})); -var DocumentSymbol; -(function (DocumentSymbol) { - /** - * Creates a new symbol information literal. - * - * @param name The name of the symbol. - * @param detail The detail of the symbol. - * @param kind The kind of the symbol. - * @param range The range of the symbol. - * @param selectionRange The selectionRange of the symbol. - * @param children Children of the symbol. - */ - function create(name, detail, kind, range, selectionRange, children) { - var result = { - name: name, - detail: detail, - kind: kind, - range: range, - selectionRange: selectionRange - }; - if (children !== void 0) { - result.children = children; - } - return result; - } - DocumentSymbol.create = create; - /** - * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface. - */ - function is(value) { - var candidate = value; - return candidate && - Is.string(candidate.name) && Is.number(candidate.kind) && - Range.is(candidate.range) && Range.is(candidate.selectionRange) && - (candidate.detail === void 0 || Is.string(candidate.detail)) && - (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && - (candidate.children === void 0 || Array.isArray(candidate.children)); - } - DocumentSymbol.is = is; -})(DocumentSymbol || (DocumentSymbol = {})); -/** - * A set of predefined code action kinds - */ -var CodeActionKind; -(function (CodeActionKind) { - /** - * Empty kind. - */ - CodeActionKind.Empty = ''; - /** - * Base kind for quickfix actions: 'quickfix' - */ - CodeActionKind.QuickFix = 'quickfix'; - /** - * Base kind for refactoring actions: 'refactor' - */ - CodeActionKind.Refactor = 'refactor'; - /** - * Base kind for refactoring extraction actions: 'refactor.extract' - * - * Example extract actions: - * - * - Extract method - * - Extract function - * - Extract variable - * - Extract interface from class - * - ... - */ - CodeActionKind.RefactorExtract = 'refactor.extract'; - /** - * Base kind for refactoring inline actions: 'refactor.inline' - * - * Example inline actions: - * - * - Inline function - * - Inline variable - * - Inline constant - * - ... - */ - CodeActionKind.RefactorInline = 'refactor.inline'; - /** - * Base kind for refactoring rewrite actions: 'refactor.rewrite' - * - * Example rewrite actions: - * - * - Convert JavaScript function to class - * - Add or remove parameter - * - Encapsulate field - * - Make method static - * - Move method to base class - * - ... - */ - CodeActionKind.RefactorRewrite = 'refactor.rewrite'; - /** - * Base kind for source actions: `source` - * - * Source code actions apply to the entire file. - */ - CodeActionKind.Source = 'source'; - /** - * Base kind for an organize imports source action: `source.organizeImports` - */ - CodeActionKind.SourceOrganizeImports = 'source.organizeImports'; - /** - * Base kind for auto-fix source actions: `source.fixAll`. - * - * Fix all actions automatically fix errors that have a clear fix that do not require user input. - * They should not suppress errors or perform unsafe fixes such as generating new types or classes. - * - * @since 3.15.0 - */ - CodeActionKind.SourceFixAll = 'source.fixAll'; -})(CodeActionKind || (CodeActionKind = {})); -/** - * The CodeActionContext namespace provides helper functions to work with - * [CodeActionContext](#CodeActionContext) literals. - */ -var CodeActionContext; -(function (CodeActionContext) { - /** - * Creates a new CodeActionContext literal. - */ - function create(diagnostics, only) { - var result = { diagnostics: diagnostics }; - if (only !== void 0 && only !== null) { - result.only = only; - } - return result; - } - CodeActionContext.create = create; - /** - * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)); - } - CodeActionContext.is = is; -})(CodeActionContext || (CodeActionContext = {})); -var CodeAction; -(function (CodeAction) { - function create(title, commandOrEdit, kind) { - var result = { title: title }; - if (Command.is(commandOrEdit)) { - result.command = commandOrEdit; - } - else { - result.edit = commandOrEdit; - } - if (kind !== void 0) { - result.kind = kind; - } - return result; - } - CodeAction.create = create; - function is(value) { - var candidate = value; - return candidate && Is.string(candidate.title) && - (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && - (candidate.kind === void 0 || Is.string(candidate.kind)) && - (candidate.edit !== void 0 || candidate.command !== void 0) && - (candidate.command === void 0 || Command.is(candidate.command)) && - (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && - (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit)); - } - CodeAction.is = is; -})(CodeAction || (CodeAction = {})); -/** - * The CodeLens namespace provides helper functions to work with - * [CodeLens](#CodeLens) literals. - */ -var CodeLens; -(function (CodeLens) { - /** - * Creates a new CodeLens literal. - */ - function create(range, data) { - var result = { range: range }; - if (Is.defined(data)) { - result.data = data; - } - return result; - } - CodeLens.create = create; - /** - * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); - } - CodeLens.is = is; -})(CodeLens || (CodeLens = {})); -/** - * The FormattingOptions namespace provides helper functions to work with - * [FormattingOptions](#FormattingOptions) literals. - */ -var FormattingOptions; -(function (FormattingOptions) { - /** - * Creates a new FormattingOptions literal. - */ - function create(tabSize, insertSpaces) { - return { tabSize: tabSize, insertSpaces: insertSpaces }; - } - FormattingOptions.create = create; - /** - * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces); - } - FormattingOptions.is = is; -})(FormattingOptions || (FormattingOptions = {})); -/** - * The DocumentLink namespace provides helper functions to work with - * [DocumentLink](#DocumentLink) literals. - */ -var DocumentLink; -(function (DocumentLink) { - /** - * Creates a new DocumentLink literal. - */ - function create(range, target, data) { - return { range: range, target: target, data: data }; - } - DocumentLink.create = create; - /** - * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); - } - DocumentLink.is = is; -})(DocumentLink || (DocumentLink = {})); -/** - * The SelectionRange namespace provides helper function to work with - * SelectionRange literals. - */ -var SelectionRange; -(function (SelectionRange) { - /** - * Creates a new SelectionRange - * @param range the range. - * @param parent an optional parent. - */ - function create(range, parent) { - return { range: range, parent: parent }; - } - SelectionRange.create = create; - function is(value) { - var candidate = value; - return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent)); - } - SelectionRange.is = is; -})(SelectionRange || (SelectionRange = {})); -var EOL = ['\n', '\r\n', '\r']; -/** - * @deprecated Use the text document from the new vscode-languageserver-textdocument package. - */ -var TextDocument; -(function (TextDocument) { - /** - * Creates a new ITextDocument literal from the given uri and content. - * @param uri The document's uri. - * @param languageId The document's language Id. - * @param content The document's content. - */ - function create(uri, languageId, version, content) { - return new FullTextDocument(uri, languageId, version, content); - } - TextDocument.create = create; - /** - * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount) - && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; - } - TextDocument.is = is; - function applyEdits(document, edits) { - var text = document.getText(); - var sortedEdits = mergeSort(edits, function (a, b) { - var diff = a.range.start.line - b.range.start.line; - if (diff === 0) { - return a.range.start.character - b.range.start.character; - } - return diff; - }); - var lastModifiedOffset = text.length; - for (var i = sortedEdits.length - 1; i >= 0; i--) { - var e = sortedEdits[i]; - var startOffset = document.offsetAt(e.range.start); - var endOffset = document.offsetAt(e.range.end); - if (endOffset <= lastModifiedOffset) { - text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); - } - else { - throw new Error('Overlapping edit'); - } - lastModifiedOffset = startOffset; - } - return text; - } - TextDocument.applyEdits = applyEdits; - function mergeSort(data, compare) { - if (data.length <= 1) { - // sorted - return data; - } - var p = (data.length / 2) | 0; - var left = data.slice(0, p); - var right = data.slice(p); - mergeSort(left, compare); - mergeSort(right, compare); - var leftIdx = 0; - var rightIdx = 0; - var i = 0; - while (leftIdx < left.length && rightIdx < right.length) { - var ret = compare(left[leftIdx], right[rightIdx]); - if (ret <= 0) { - // smaller_equal -> take left to preserve order - data[i++] = left[leftIdx++]; - } - else { - // greater -> take right - data[i++] = right[rightIdx++]; - } - } - while (leftIdx < left.length) { - data[i++] = left[leftIdx++]; - } - while (rightIdx < right.length) { - data[i++] = right[rightIdx++]; - } - return data; - } -})(TextDocument || (TextDocument = {})); -var FullTextDocument = /** @class */ (function () { - function FullTextDocument(uri, languageId, version, content) { - this._uri = uri; - this._languageId = languageId; - this._version = version; - this._content = content; - this._lineOffsets = undefined; - } - Object.defineProperty(FullTextDocument.prototype, "uri", { - get: function () { - return this._uri; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "languageId", { - get: function () { - return this._languageId; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "version", { - get: function () { - return this._version; - }, - enumerable: true, - configurable: true - }); - FullTextDocument.prototype.getText = function (range) { - if (range) { - var start = this.offsetAt(range.start); - var end = this.offsetAt(range.end); - return this._content.substring(start, end); - } - return this._content; - }; - FullTextDocument.prototype.update = function (event, version) { - this._content = event.text; - this._version = version; - this._lineOffsets = undefined; - }; - FullTextDocument.prototype.getLineOffsets = function () { - if (this._lineOffsets === undefined) { - var lineOffsets = []; - var text = this._content; - var isLineStart = true; - for (var i = 0; i < text.length; i++) { - if (isLineStart) { - lineOffsets.push(i); - isLineStart = false; - } - var ch = text.charAt(i); - isLineStart = (ch === '\r' || ch === '\n'); - if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') { - i++; - } - } - if (isLineStart && text.length > 0) { - lineOffsets.push(text.length); - } - this._lineOffsets = lineOffsets; - } - return this._lineOffsets; - }; - FullTextDocument.prototype.positionAt = function (offset) { - offset = Math.max(Math.min(offset, this._content.length), 0); - var lineOffsets = this.getLineOffsets(); - var low = 0, high = lineOffsets.length; - if (high === 0) { - return Position.create(0, offset); - } - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (lineOffsets[mid] > offset) { - high = mid; - } - else { - low = mid + 1; - } - } - // low is the least x for which the line offset is larger than the current offset - // or array.length if no line offset is larger than the current offset - var line = low - 1; - return Position.create(line, offset - lineOffsets[line]); - }; - FullTextDocument.prototype.offsetAt = function (position) { - var lineOffsets = this.getLineOffsets(); - if (position.line >= lineOffsets.length) { - return this._content.length; - } - else if (position.line < 0) { - return 0; - } - var lineOffset = lineOffsets[position.line]; - var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; - return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); - }; - Object.defineProperty(FullTextDocument.prototype, "lineCount", { - get: function () { - return this.getLineOffsets().length; - }, - enumerable: true, - configurable: true - }); - return FullTextDocument; -}()); -var Is; -(function (Is) { - var toString = Object.prototype.toString; - function defined(value) { - return typeof value !== 'undefined'; - } - Is.defined = defined; - function undefined(value) { - return typeof value === 'undefined'; - } - Is.undefined = undefined; - function boolean(value) { - return value === true || value === false; - } - Is.boolean = boolean; - function string(value) { - return toString.call(value) === '[object String]'; - } - Is.string = string; - function number(value) { - return toString.call(value) === '[object Number]'; - } - Is.number = number; - function func(value) { - return toString.call(value) === '[object Function]'; - } - Is.func = func; - function objectLiteral(value) { - // Strictly speaking class instances pass this check as well. Since the LSP - // doesn't use classes we ignore this for now. If we do we need to add something - // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null` - return value !== null && typeof value === 'object'; - } - Is.objectLiteral = objectLiteral; - function typedArray(value, check) { - return Array.isArray(value) && value.every(check); - } - Is.typedArray = typedArray; -})(Is || (Is = {})); +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + +/** + * The Position namespace provides helper functions to work with + * [Position](#Position) literals. + */ +var Position; +(function (Position) { + /** + * Creates a new Position literal from the given line and character. + * @param line The position's line. + * @param character The position's character. + */ + function create(line, character) { + return { line: line, character: character }; + } + Position.create = create; + /** + * Checks whether the given liternal conforms to the [Position](#Position) interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character); + } + Position.is = is; +})(Position || (Position = {})); +/** + * The Range namespace provides helper functions to work with + * [Range](#Range) literals. + */ +var Range; +(function (Range) { + function create(one, two, three, four) { + if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) { + return { start: Position.create(one, two), end: Position.create(three, four) }; + } + else if (Position.is(one) && Position.is(two)) { + return { start: one, end: two }; + } + else { + throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]"); + } + } + Range.create = create; + /** + * Checks whether the given literal conforms to the [Range](#Range) interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); + } + Range.is = is; +})(Range || (Range = {})); +/** + * The Location namespace provides helper functions to work with + * [Location](#Location) literals. + */ +var Location; +(function (Location) { + /** + * Creates a Location literal. + * @param uri The location's uri. + * @param range The location's range. + */ + function create(uri, range) { + return { uri: uri, range: range }; + } + Location.create = create; + /** + * Checks whether the given literal conforms to the [Location](#Location) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); + } + Location.is = is; +})(Location || (Location = {})); +/** + * The LocationLink namespace provides helper functions to work with + * [LocationLink](#LocationLink) literals. + */ +var LocationLink; +(function (LocationLink) { + /** + * Creates a LocationLink literal. + * @param targetUri The definition's uri. + * @param targetRange The full range of the definition. + * @param targetSelectionRange The span of the symbol definition at the target. + * @param originSelectionRange The span of the symbol being defined in the originating source file. + */ + function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) { + return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange }; + } + LocationLink.create = create; + /** + * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) + && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) + && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); + } + LocationLink.is = is; +})(LocationLink || (LocationLink = {})); +/** + * The Color namespace provides helper functions to work with + * [Color](#Color) literals. + */ +var Color; +(function (Color) { + /** + * Creates a new Color literal. + */ + function create(red, green, blue, alpha) { + return { + red: red, + green: green, + blue: blue, + alpha: alpha, + }; + } + Color.create = create; + /** + * Checks whether the given literal conforms to the [Color](#Color) interface. + */ + function is(value) { + var candidate = value; + return Is.number(candidate.red) + && Is.number(candidate.green) + && Is.number(candidate.blue) + && Is.number(candidate.alpha); + } + Color.is = is; +})(Color || (Color = {})); +/** + * The ColorInformation namespace provides helper functions to work with + * [ColorInformation](#ColorInformation) literals. + */ +var ColorInformation; +(function (ColorInformation) { + /** + * Creates a new ColorInformation literal. + */ + function create(range, color) { + return { + range: range, + color: color, + }; + } + ColorInformation.create = create; + /** + * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. + */ + function is(value) { + var candidate = value; + return Range.is(candidate.range) && Color.is(candidate.color); + } + ColorInformation.is = is; +})(ColorInformation || (ColorInformation = {})); +/** + * The Color namespace provides helper functions to work with + * [ColorPresentation](#ColorPresentation) literals. + */ +var ColorPresentation; +(function (ColorPresentation) { + /** + * Creates a new ColorInformation literal. + */ + function create(label, textEdit, additionalTextEdits) { + return { + label: label, + textEdit: textEdit, + additionalTextEdits: additionalTextEdits, + }; + } + ColorPresentation.create = create; + /** + * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. + */ + function is(value) { + var candidate = value; + return Is.string(candidate.label) + && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) + && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is)); + } + ColorPresentation.is = is; +})(ColorPresentation || (ColorPresentation = {})); +/** + * Enum of known range kinds + */ +var FoldingRangeKind; +(function (FoldingRangeKind) { + /** + * Folding range for a comment + */ + FoldingRangeKind["Comment"] = "comment"; + /** + * Folding range for a imports or includes + */ + FoldingRangeKind["Imports"] = "imports"; + /** + * Folding range for a region (e.g. `#region`) + */ + FoldingRangeKind["Region"] = "region"; +})(FoldingRangeKind || (FoldingRangeKind = {})); +/** + * The folding range namespace provides helper functions to work with + * [FoldingRange](#FoldingRange) literals. + */ +var FoldingRange; +(function (FoldingRange) { + /** + * Creates a new FoldingRange literal. + */ + function create(startLine, endLine, startCharacter, endCharacter, kind) { + var result = { + startLine: startLine, + endLine: endLine + }; + if (Is.defined(startCharacter)) { + result.startCharacter = startCharacter; + } + if (Is.defined(endCharacter)) { + result.endCharacter = endCharacter; + } + if (Is.defined(kind)) { + result.kind = kind; + } + return result; + } + FoldingRange.create = create; + /** + * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface. + */ + function is(value) { + var candidate = value; + return Is.number(candidate.startLine) && Is.number(candidate.startLine) + && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter)) + && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter)) + && (Is.undefined(candidate.kind) || Is.string(candidate.kind)); + } + FoldingRange.is = is; +})(FoldingRange || (FoldingRange = {})); +/** + * The DiagnosticRelatedInformation namespace provides helper functions to work with + * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals. + */ +var DiagnosticRelatedInformation; +(function (DiagnosticRelatedInformation) { + /** + * Creates a new DiagnosticRelatedInformation literal. + */ + function create(location, message) { + return { + location: location, + message: message + }; + } + DiagnosticRelatedInformation.create = create; + /** + * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message); + } + DiagnosticRelatedInformation.is = is; +})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {})); +/** + * The diagnostic's severity. + */ +var DiagnosticSeverity; +(function (DiagnosticSeverity) { + /** + * Reports an error. + */ + DiagnosticSeverity.Error = 1; + /** + * Reports a warning. + */ + DiagnosticSeverity.Warning = 2; + /** + * Reports an information. + */ + DiagnosticSeverity.Information = 3; + /** + * Reports a hint. + */ + DiagnosticSeverity.Hint = 4; +})(DiagnosticSeverity || (DiagnosticSeverity = {})); +/** + * The diagnostic tags. + * + * @since 3.15.0 + */ +var DiagnosticTag; +(function (DiagnosticTag) { + /** + * Unused or unnecessary code. + * + * Clients are allowed to render diagnostics with this tag faded out instead of having + * an error squiggle. + */ + DiagnosticTag.Unnecessary = 1; + /** + * Deprecated or obsolete code. + * + * Clients are allowed to rendered diagnostics with this tag strike through. + */ + DiagnosticTag.Deprecated = 2; +})(DiagnosticTag || (DiagnosticTag = {})); +/** + * The Diagnostic namespace provides helper functions to work with + * [Diagnostic](#Diagnostic) literals. + */ +var Diagnostic; +(function (Diagnostic) { + /** + * Creates a new Diagnostic literal. + */ + function create(range, message, severity, code, source, relatedInformation) { + var result = { range: range, message: message }; + if (Is.defined(severity)) { + result.severity = severity; + } + if (Is.defined(code)) { + result.code = code; + } + if (Is.defined(source)) { + result.source = source; + } + if (Is.defined(relatedInformation)) { + result.relatedInformation = relatedInformation; + } + return result; + } + Diagnostic.create = create; + /** + * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) + && Range.is(candidate.range) + && Is.string(candidate.message) + && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) + && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) + && (Is.string(candidate.source) || Is.undefined(candidate.source)) + && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is)); + } + Diagnostic.is = is; +})(Diagnostic || (Diagnostic = {})); +/** + * The Command namespace provides helper functions to work with + * [Command](#Command) literals. + */ +var Command; +(function (Command) { + /** + * Creates a new Command literal. + */ + function create(title, command) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + var result = { title: title, command: command }; + if (Is.defined(args) && args.length > 0) { + result.arguments = args; + } + return result; + } + Command.create = create; + /** + * Checks whether the given literal conforms to the [Command](#Command) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command); + } + Command.is = is; +})(Command || (Command = {})); +/** + * The TextEdit namespace provides helper function to create replace, + * insert and delete edits more easily. + */ +var TextEdit; +(function (TextEdit) { + /** + * Creates a replace text edit. + * @param range The range of text to be replaced. + * @param newText The new text. + */ + function replace(range, newText) { + return { range: range, newText: newText }; + } + TextEdit.replace = replace; + /** + * Creates a insert text edit. + * @param position The position to insert the text at. + * @param newText The text to be inserted. + */ + function insert(position, newText) { + return { range: { start: position, end: position }, newText: newText }; + } + TextEdit.insert = insert; + /** + * Creates a delete text edit. + * @param range The range of text to be deleted. + */ + function del(range) { + return { range: range, newText: '' }; + } + TextEdit.del = del; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) + && Is.string(candidate.newText) + && Range.is(candidate.range); + } + TextEdit.is = is; +})(TextEdit || (TextEdit = {})); +/** + * The TextDocumentEdit namespace provides helper function to create + * an edit that manipulates a text document. + */ +var TextDocumentEdit; +(function (TextDocumentEdit) { + /** + * Creates a new `TextDocumentEdit` + */ + function create(textDocument, edits) { + return { textDocument: textDocument, edits: edits }; + } + TextDocumentEdit.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) + && VersionedTextDocumentIdentifier.is(candidate.textDocument) + && Array.isArray(candidate.edits); + } + TextDocumentEdit.is = is; +})(TextDocumentEdit || (TextDocumentEdit = {})); +var CreateFile; +(function (CreateFile) { + function create(uri, options) { + var result = { + kind: 'create', + uri: uri + }; + if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { + result.options = options; + } + return result; + } + CreateFile.create = create; + function is(value) { + var candidate = value; + return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && + (candidate.options === void 0 || + ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); + } + CreateFile.is = is; +})(CreateFile || (CreateFile = {})); +var RenameFile; +(function (RenameFile) { + function create(oldUri, newUri, options) { + var result = { + kind: 'rename', + oldUri: oldUri, + newUri: newUri + }; + if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { + result.options = options; + } + return result; + } + RenameFile.create = create; + function is(value) { + var candidate = value; + return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && + (candidate.options === void 0 || + ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); + } + RenameFile.is = is; +})(RenameFile || (RenameFile = {})); +var DeleteFile; +(function (DeleteFile) { + function create(uri, options) { + var result = { + kind: 'delete', + uri: uri + }; + if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) { + result.options = options; + } + return result; + } + DeleteFile.create = create; + function is(value) { + var candidate = value; + return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && + (candidate.options === void 0 || + ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists)))); + } + DeleteFile.is = is; +})(DeleteFile || (DeleteFile = {})); +var WorkspaceEdit; +(function (WorkspaceEdit) { + function is(value) { + var candidate = value; + return candidate && + (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && + (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) { + if (Is.string(change.kind)) { + return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change); + } + else { + return TextDocumentEdit.is(change); + } + })); + } + WorkspaceEdit.is = is; +})(WorkspaceEdit || (WorkspaceEdit = {})); +var TextEditChangeImpl = /** @class */ (function () { + function TextEditChangeImpl(edits) { + this.edits = edits; + } + TextEditChangeImpl.prototype.insert = function (position, newText) { + this.edits.push(TextEdit.insert(position, newText)); + }; + TextEditChangeImpl.prototype.replace = function (range, newText) { + this.edits.push(TextEdit.replace(range, newText)); + }; + TextEditChangeImpl.prototype.delete = function (range) { + this.edits.push(TextEdit.del(range)); + }; + TextEditChangeImpl.prototype.add = function (edit) { + this.edits.push(edit); + }; + TextEditChangeImpl.prototype.all = function () { + return this.edits; + }; + TextEditChangeImpl.prototype.clear = function () { + this.edits.splice(0, this.edits.length); + }; + return TextEditChangeImpl; +}()); +/** + * A workspace change helps constructing changes to a workspace. + */ +var WorkspaceChange = /** @class */ (function () { + function WorkspaceChange(workspaceEdit) { + var _this = this; + this._textEditChanges = Object.create(null); + if (workspaceEdit) { + this._workspaceEdit = workspaceEdit; + if (workspaceEdit.documentChanges) { + workspaceEdit.documentChanges.forEach(function (change) { + if (TextDocumentEdit.is(change)) { + var textEditChange = new TextEditChangeImpl(change.edits); + _this._textEditChanges[change.textDocument.uri] = textEditChange; + } + }); + } + else if (workspaceEdit.changes) { + Object.keys(workspaceEdit.changes).forEach(function (key) { + var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]); + _this._textEditChanges[key] = textEditChange; + }); + } + } + } + Object.defineProperty(WorkspaceChange.prototype, "edit", { + /** + * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal + * use to be returned from a workspace edit operation like rename. + */ + get: function () { + return this._workspaceEdit; + }, + enumerable: true, + configurable: true + }); + WorkspaceChange.prototype.getTextEditChange = function (key) { + if (VersionedTextDocumentIdentifier.is(key)) { + if (!this._workspaceEdit) { + this._workspaceEdit = { + documentChanges: [] + }; + } + if (!this._workspaceEdit.documentChanges) { + throw new Error('Workspace edit is not configured for document changes.'); + } + var textDocument = key; + var result = this._textEditChanges[textDocument.uri]; + if (!result) { + var edits = []; + var textDocumentEdit = { + textDocument: textDocument, + edits: edits + }; + this._workspaceEdit.documentChanges.push(textDocumentEdit); + result = new TextEditChangeImpl(edits); + this._textEditChanges[textDocument.uri] = result; + } + return result; + } + else { + if (!this._workspaceEdit) { + this._workspaceEdit = { + changes: Object.create(null) + }; + } + if (!this._workspaceEdit.changes) { + throw new Error('Workspace edit is not configured for normal text edit changes.'); + } + var result = this._textEditChanges[key]; + if (!result) { + var edits = []; + this._workspaceEdit.changes[key] = edits; + result = new TextEditChangeImpl(edits); + this._textEditChanges[key] = result; + } + return result; + } + }; + WorkspaceChange.prototype.createFile = function (uri, options) { + this.checkDocumentChanges(); + this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options)); + }; + WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) { + this.checkDocumentChanges(); + this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options)); + }; + WorkspaceChange.prototype.deleteFile = function (uri, options) { + this.checkDocumentChanges(); + this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options)); + }; + WorkspaceChange.prototype.checkDocumentChanges = function () { + if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) { + throw new Error('Workspace edit is not configured for document changes.'); + } + }; + return WorkspaceChange; +}()); + +/** + * The TextDocumentIdentifier namespace provides helper functions to work with + * [TextDocumentIdentifier](#TextDocumentIdentifier) literals. + */ +var TextDocumentIdentifier; +(function (TextDocumentIdentifier) { + /** + * Creates a new TextDocumentIdentifier literal. + * @param uri The document's uri. + */ + function create(uri) { + return { uri: uri }; + } + TextDocumentIdentifier.create = create; + /** + * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri); + } + TextDocumentIdentifier.is = is; +})(TextDocumentIdentifier || (TextDocumentIdentifier = {})); +/** + * The VersionedTextDocumentIdentifier namespace provides helper functions to work with + * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals. + */ +var VersionedTextDocumentIdentifier; +(function (VersionedTextDocumentIdentifier) { + /** + * Creates a new VersionedTextDocumentIdentifier literal. + * @param uri The document's uri. + * @param uri The document's text. + */ + function create(uri, version) { + return { uri: uri, version: version }; + } + VersionedTextDocumentIdentifier.create = create; + /** + * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version)); + } + VersionedTextDocumentIdentifier.is = is; +})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {})); +/** + * The TextDocumentItem namespace provides helper functions to work with + * [TextDocumentItem](#TextDocumentItem) literals. + */ +var TextDocumentItem; +(function (TextDocumentItem) { + /** + * Creates a new TextDocumentItem literal. + * @param uri The document's uri. + * @param languageId The document's language identifier. + * @param version The document's version number. + * @param text The document's text. + */ + function create(uri, languageId, version, text) { + return { uri: uri, languageId: languageId, version: version, text: text }; + } + TextDocumentItem.create = create; + /** + * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text); + } + TextDocumentItem.is = is; +})(TextDocumentItem || (TextDocumentItem = {})); +/** + * Describes the content type that a client supports in various + * result literals like `Hover`, `ParameterInfo` or `CompletionItem`. + * + * Please note that `MarkupKinds` must not start with a `$`. This kinds + * are reserved for internal usage. + */ +var MarkupKind; +(function (MarkupKind) { + /** + * Plain text is supported as a content format + */ + MarkupKind.PlainText = 'plaintext'; + /** + * Markdown is supported as a content format + */ + MarkupKind.Markdown = 'markdown'; +})(MarkupKind || (MarkupKind = {})); +(function (MarkupKind) { + /** + * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type. + */ + function is(value) { + var candidate = value; + return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown; + } + MarkupKind.is = is; +})(MarkupKind || (MarkupKind = {})); +var MarkupContent; +(function (MarkupContent) { + /** + * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); + } + MarkupContent.is = is; +})(MarkupContent || (MarkupContent = {})); +/** + * The kind of a completion entry. + */ +var CompletionItemKind; +(function (CompletionItemKind) { + CompletionItemKind.Text = 1; + CompletionItemKind.Method = 2; + CompletionItemKind.Function = 3; + CompletionItemKind.Constructor = 4; + CompletionItemKind.Field = 5; + CompletionItemKind.Variable = 6; + CompletionItemKind.Class = 7; + CompletionItemKind.Interface = 8; + CompletionItemKind.Module = 9; + CompletionItemKind.Property = 10; + CompletionItemKind.Unit = 11; + CompletionItemKind.Value = 12; + CompletionItemKind.Enum = 13; + CompletionItemKind.Keyword = 14; + CompletionItemKind.Snippet = 15; + CompletionItemKind.Color = 16; + CompletionItemKind.File = 17; + CompletionItemKind.Reference = 18; + CompletionItemKind.Folder = 19; + CompletionItemKind.EnumMember = 20; + CompletionItemKind.Constant = 21; + CompletionItemKind.Struct = 22; + CompletionItemKind.Event = 23; + CompletionItemKind.Operator = 24; + CompletionItemKind.TypeParameter = 25; +})(CompletionItemKind || (CompletionItemKind = {})); +/** + * Defines whether the insert text in a completion item should be interpreted as + * plain text or a snippet. + */ +var InsertTextFormat; +(function (InsertTextFormat) { + /** + * The primary text to be inserted is treated as a plain string. + */ + InsertTextFormat.PlainText = 1; + /** + * The primary text to be inserted is treated as a snippet. + * + * A snippet can define tab stops and placeholders with `$1`, `$2` + * and `${3:foo}`. `$0` defines the final tab stop, it defaults to + * the end of the snippet. Placeholders with equal identifiers are linked, + * that is typing in one will update others too. + * + * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md + */ + InsertTextFormat.Snippet = 2; +})(InsertTextFormat || (InsertTextFormat = {})); +/** + * Completion item tags are extra annotations that tweak the rendering of a completion + * item. + * + * @since 3.15.0 + */ +var CompletionItemTag; +(function (CompletionItemTag) { + /** + * Render a completion as obsolete, usually using a strike-out. + */ + CompletionItemTag.Deprecated = 1; +})(CompletionItemTag || (CompletionItemTag = {})); +/** + * The CompletionItem namespace provides functions to deal with + * completion items. + */ +var CompletionItem; +(function (CompletionItem) { + /** + * Create a completion item and seed it with a label. + * @param label The completion item's label + */ + function create(label) { + return { label: label }; + } + CompletionItem.create = create; +})(CompletionItem || (CompletionItem = {})); +/** + * The CompletionList namespace provides functions to deal with + * completion lists. + */ +var CompletionList; +(function (CompletionList) { + /** + * Creates a new completion list. + * + * @param items The completion items. + * @param isIncomplete The list is not complete. + */ + function create(items, isIncomplete) { + return { items: items ? items : [], isIncomplete: !!isIncomplete }; + } + CompletionList.create = create; +})(CompletionList || (CompletionList = {})); +var MarkedString; +(function (MarkedString) { + /** + * Creates a marked string from plain text. + * + * @param plainText The plain text. + */ + function fromPlainText(plainText) { + return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash + } + MarkedString.fromPlainText = fromPlainText; + /** + * Checks whether the given value conforms to the [MarkedString](#MarkedString) type. + */ + function is(value) { + var candidate = value; + return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value)); + } + MarkedString.is = is; +})(MarkedString || (MarkedString = {})); +var Hover; +(function (Hover) { + /** + * Checks whether the given value conforms to the [Hover](#Hover) interface. + */ + function is(value) { + var candidate = value; + return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || + MarkedString.is(candidate.contents) || + Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range)); + } + Hover.is = is; +})(Hover || (Hover = {})); +/** + * The ParameterInformation namespace provides helper functions to work with + * [ParameterInformation](#ParameterInformation) literals. + */ +var ParameterInformation; +(function (ParameterInformation) { + /** + * Creates a new parameter information literal. + * + * @param label A label string. + * @param documentation A doc string. + */ + function create(label, documentation) { + return documentation ? { label: label, documentation: documentation } : { label: label }; + } + ParameterInformation.create = create; +})(ParameterInformation || (ParameterInformation = {})); +/** + * The SignatureInformation namespace provides helper functions to work with + * [SignatureInformation](#SignatureInformation) literals. + */ +var SignatureInformation; +(function (SignatureInformation) { + function create(label, documentation) { + var parameters = []; + for (var _i = 2; _i < arguments.length; _i++) { + parameters[_i - 2] = arguments[_i]; + } + var result = { label: label }; + if (Is.defined(documentation)) { + result.documentation = documentation; + } + if (Is.defined(parameters)) { + result.parameters = parameters; + } + else { + result.parameters = []; + } + return result; + } + SignatureInformation.create = create; +})(SignatureInformation || (SignatureInformation = {})); +/** + * A document highlight kind. + */ +var DocumentHighlightKind; +(function (DocumentHighlightKind) { + /** + * A textual occurrence. + */ + DocumentHighlightKind.Text = 1; + /** + * Read-access of a symbol, like reading a variable. + */ + DocumentHighlightKind.Read = 2; + /** + * Write-access of a symbol, like writing to a variable. + */ + DocumentHighlightKind.Write = 3; +})(DocumentHighlightKind || (DocumentHighlightKind = {})); +/** + * DocumentHighlight namespace to provide helper functions to work with + * [DocumentHighlight](#DocumentHighlight) literals. + */ +var DocumentHighlight; +(function (DocumentHighlight) { + /** + * Create a DocumentHighlight object. + * @param range The range the highlight applies to. + */ + function create(range, kind) { + var result = { range: range }; + if (Is.number(kind)) { + result.kind = kind; + } + return result; + } + DocumentHighlight.create = create; +})(DocumentHighlight || (DocumentHighlight = {})); +/** + * A symbol kind. + */ +var SymbolKind; +(function (SymbolKind) { + SymbolKind.File = 1; + SymbolKind.Module = 2; + SymbolKind.Namespace = 3; + SymbolKind.Package = 4; + SymbolKind.Class = 5; + SymbolKind.Method = 6; + SymbolKind.Property = 7; + SymbolKind.Field = 8; + SymbolKind.Constructor = 9; + SymbolKind.Enum = 10; + SymbolKind.Interface = 11; + SymbolKind.Function = 12; + SymbolKind.Variable = 13; + SymbolKind.Constant = 14; + SymbolKind.String = 15; + SymbolKind.Number = 16; + SymbolKind.Boolean = 17; + SymbolKind.Array = 18; + SymbolKind.Object = 19; + SymbolKind.Key = 20; + SymbolKind.Null = 21; + SymbolKind.EnumMember = 22; + SymbolKind.Struct = 23; + SymbolKind.Event = 24; + SymbolKind.Operator = 25; + SymbolKind.TypeParameter = 26; +})(SymbolKind || (SymbolKind = {})); +/** + * Symbol tags are extra annotations that tweak the rendering of a symbol. + * @since 3.15 + */ +var SymbolTag; +(function (SymbolTag) { + /** + * Render a symbol as obsolete, usually using a strike-out. + */ + SymbolTag.Deprecated = 1; +})(SymbolTag || (SymbolTag = {})); +var SymbolInformation; +(function (SymbolInformation) { + /** + * Creates a new symbol information literal. + * + * @param name The name of the symbol. + * @param kind The kind of the symbol. + * @param range The range of the location of the symbol. + * @param uri The resource of the location of symbol, defaults to the current document. + * @param containerName The name of the symbol containing the symbol. + */ + function create(name, kind, range, uri, containerName) { + var result = { + name: name, + kind: kind, + location: { uri: uri, range: range } + }; + if (containerName) { + result.containerName = containerName; + } + return result; + } + SymbolInformation.create = create; +})(SymbolInformation || (SymbolInformation = {})); +var DocumentSymbol; +(function (DocumentSymbol) { + /** + * Creates a new symbol information literal. + * + * @param name The name of the symbol. + * @param detail The detail of the symbol. + * @param kind The kind of the symbol. + * @param range The range of the symbol. + * @param selectionRange The selectionRange of the symbol. + * @param children Children of the symbol. + */ + function create(name, detail, kind, range, selectionRange, children) { + var result = { + name: name, + detail: detail, + kind: kind, + range: range, + selectionRange: selectionRange + }; + if (children !== void 0) { + result.children = children; + } + return result; + } + DocumentSymbol.create = create; + /** + * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface. + */ + function is(value) { + var candidate = value; + return candidate && + Is.string(candidate.name) && Is.number(candidate.kind) && + Range.is(candidate.range) && Range.is(candidate.selectionRange) && + (candidate.detail === void 0 || Is.string(candidate.detail)) && + (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && + (candidate.children === void 0 || Array.isArray(candidate.children)); + } + DocumentSymbol.is = is; +})(DocumentSymbol || (DocumentSymbol = {})); +/** + * A set of predefined code action kinds + */ +var CodeActionKind; +(function (CodeActionKind) { + /** + * Empty kind. + */ + CodeActionKind.Empty = ''; + /** + * Base kind for quickfix actions: 'quickfix' + */ + CodeActionKind.QuickFix = 'quickfix'; + /** + * Base kind for refactoring actions: 'refactor' + */ + CodeActionKind.Refactor = 'refactor'; + /** + * Base kind for refactoring extraction actions: 'refactor.extract' + * + * Example extract actions: + * + * - Extract method + * - Extract function + * - Extract variable + * - Extract interface from class + * - ... + */ + CodeActionKind.RefactorExtract = 'refactor.extract'; + /** + * Base kind for refactoring inline actions: 'refactor.inline' + * + * Example inline actions: + * + * - Inline function + * - Inline variable + * - Inline constant + * - ... + */ + CodeActionKind.RefactorInline = 'refactor.inline'; + /** + * Base kind for refactoring rewrite actions: 'refactor.rewrite' + * + * Example rewrite actions: + * + * - Convert JavaScript function to class + * - Add or remove parameter + * - Encapsulate field + * - Make method static + * - Move method to base class + * - ... + */ + CodeActionKind.RefactorRewrite = 'refactor.rewrite'; + /** + * Base kind for source actions: `source` + * + * Source code actions apply to the entire file. + */ + CodeActionKind.Source = 'source'; + /** + * Base kind for an organize imports source action: `source.organizeImports` + */ + CodeActionKind.SourceOrganizeImports = 'source.organizeImports'; + /** + * Base kind for auto-fix source actions: `source.fixAll`. + * + * Fix all actions automatically fix errors that have a clear fix that do not require user input. + * They should not suppress errors or perform unsafe fixes such as generating new types or classes. + * + * @since 3.15.0 + */ + CodeActionKind.SourceFixAll = 'source.fixAll'; +})(CodeActionKind || (CodeActionKind = {})); +/** + * The CodeActionContext namespace provides helper functions to work with + * [CodeActionContext](#CodeActionContext) literals. + */ +var CodeActionContext; +(function (CodeActionContext) { + /** + * Creates a new CodeActionContext literal. + */ + function create(diagnostics, only) { + var result = { diagnostics: diagnostics }; + if (only !== void 0 && only !== null) { + result.only = only; + } + return result; + } + CodeActionContext.create = create; + /** + * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)); + } + CodeActionContext.is = is; +})(CodeActionContext || (CodeActionContext = {})); +var CodeAction; +(function (CodeAction) { + function create(title, commandOrEdit, kind) { + var result = { title: title }; + if (Command.is(commandOrEdit)) { + result.command = commandOrEdit; + } + else { + result.edit = commandOrEdit; + } + if (kind !== void 0) { + result.kind = kind; + } + return result; + } + CodeAction.create = create; + function is(value) { + var candidate = value; + return candidate && Is.string(candidate.title) && + (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && + (candidate.kind === void 0 || Is.string(candidate.kind)) && + (candidate.edit !== void 0 || candidate.command !== void 0) && + (candidate.command === void 0 || Command.is(candidate.command)) && + (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && + (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit)); + } + CodeAction.is = is; +})(CodeAction || (CodeAction = {})); +/** + * The CodeLens namespace provides helper functions to work with + * [CodeLens](#CodeLens) literals. + */ +var CodeLens; +(function (CodeLens) { + /** + * Creates a new CodeLens literal. + */ + function create(range, data) { + var result = { range: range }; + if (Is.defined(data)) { + result.data = data; + } + return result; + } + CodeLens.create = create; + /** + * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); + } + CodeLens.is = is; +})(CodeLens || (CodeLens = {})); +/** + * The FormattingOptions namespace provides helper functions to work with + * [FormattingOptions](#FormattingOptions) literals. + */ +var FormattingOptions; +(function (FormattingOptions) { + /** + * Creates a new FormattingOptions literal. + */ + function create(tabSize, insertSpaces) { + return { tabSize: tabSize, insertSpaces: insertSpaces }; + } + FormattingOptions.create = create; + /** + * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces); + } + FormattingOptions.is = is; +})(FormattingOptions || (FormattingOptions = {})); +/** + * The DocumentLink namespace provides helper functions to work with + * [DocumentLink](#DocumentLink) literals. + */ +var DocumentLink; +(function (DocumentLink) { + /** + * Creates a new DocumentLink literal. + */ + function create(range, target, data) { + return { range: range, target: target, data: data }; + } + DocumentLink.create = create; + /** + * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); + } + DocumentLink.is = is; +})(DocumentLink || (DocumentLink = {})); +/** + * The SelectionRange namespace provides helper function to work with + * SelectionRange literals. + */ +var SelectionRange; +(function (SelectionRange) { + /** + * Creates a new SelectionRange + * @param range the range. + * @param parent an optional parent. + */ + function create(range, parent) { + return { range: range, parent: parent }; + } + SelectionRange.create = create; + function is(value) { + var candidate = value; + return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent)); + } + SelectionRange.is = is; +})(SelectionRange || (SelectionRange = {})); +var EOL = ['\n', '\r\n', '\r']; +/** + * @deprecated Use the text document from the new vscode-languageserver-textdocument package. + */ +var TextDocument; +(function (TextDocument) { + /** + * Creates a new ITextDocument literal from the given uri and content. + * @param uri The document's uri. + * @param languageId The document's language Id. + * @param content The document's content. + */ + function create(uri, languageId, version, content) { + return new FullTextDocument(uri, languageId, version, content); + } + TextDocument.create = create; + /** + * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount) + && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; + } + TextDocument.is = is; + function applyEdits(document, edits) { + var text = document.getText(); + var sortedEdits = mergeSort(edits, function (a, b) { + var diff = a.range.start.line - b.range.start.line; + if (diff === 0) { + return a.range.start.character - b.range.start.character; + } + return diff; + }); + var lastModifiedOffset = text.length; + for (var i = sortedEdits.length - 1; i >= 0; i--) { + var e = sortedEdits[i]; + var startOffset = document.offsetAt(e.range.start); + var endOffset = document.offsetAt(e.range.end); + if (endOffset <= lastModifiedOffset) { + text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); + } + else { + throw new Error('Overlapping edit'); + } + lastModifiedOffset = startOffset; + } + return text; + } + TextDocument.applyEdits = applyEdits; + function mergeSort(data, compare) { + if (data.length <= 1) { + // sorted + return data; + } + var p = (data.length / 2) | 0; + var left = data.slice(0, p); + var right = data.slice(p); + mergeSort(left, compare); + mergeSort(right, compare); + var leftIdx = 0; + var rightIdx = 0; + var i = 0; + while (leftIdx < left.length && rightIdx < right.length) { + var ret = compare(left[leftIdx], right[rightIdx]); + if (ret <= 0) { + // smaller_equal -> take left to preserve order + data[i++] = left[leftIdx++]; + } + else { + // greater -> take right + data[i++] = right[rightIdx++]; + } + } + while (leftIdx < left.length) { + data[i++] = left[leftIdx++]; + } + while (rightIdx < right.length) { + data[i++] = right[rightIdx++]; + } + return data; + } +})(TextDocument || (TextDocument = {})); +var FullTextDocument = /** @class */ (function () { + function FullTextDocument(uri, languageId, version, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version; + this._content = content; + this._lineOffsets = undefined; + } + Object.defineProperty(FullTextDocument.prototype, "uri", { + get: function () { + return this._uri; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, "languageId", { + get: function () { + return this._languageId; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, "version", { + get: function () { + return this._version; + }, + enumerable: true, + configurable: true + }); + FullTextDocument.prototype.getText = function (range) { + if (range) { + var start = this.offsetAt(range.start); + var end = this.offsetAt(range.end); + return this._content.substring(start, end); + } + return this._content; + }; + FullTextDocument.prototype.update = function (event, version) { + this._content = event.text; + this._version = version; + this._lineOffsets = undefined; + }; + FullTextDocument.prototype.getLineOffsets = function () { + if (this._lineOffsets === undefined) { + var lineOffsets = []; + var text = this._content; + var isLineStart = true; + for (var i = 0; i < text.length; i++) { + if (isLineStart) { + lineOffsets.push(i); + isLineStart = false; + } + var ch = text.charAt(i); + isLineStart = (ch === '\r' || ch === '\n'); + if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') { + i++; + } + } + if (isLineStart && text.length > 0) { + lineOffsets.push(text.length); + } + this._lineOffsets = lineOffsets; + } + return this._lineOffsets; + }; + FullTextDocument.prototype.positionAt = function (offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + var lineOffsets = this.getLineOffsets(); + var low = 0, high = lineOffsets.length; + if (high === 0) { + return Position.create(0, offset); + } + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } + else { + low = mid + 1; + } + } + // low is the least x for which the line offset is larger than the current offset + // or array.length if no line offset is larger than the current offset + var line = low - 1; + return Position.create(line, offset - lineOffsets[line]); + }; + FullTextDocument.prototype.offsetAt = function (position) { + var lineOffsets = this.getLineOffsets(); + if (position.line >= lineOffsets.length) { + return this._content.length; + } + else if (position.line < 0) { + return 0; + } + var lineOffset = lineOffsets[position.line]; + var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; + return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); + }; + Object.defineProperty(FullTextDocument.prototype, "lineCount", { + get: function () { + return this.getLineOffsets().length; + }, + enumerable: true, + configurable: true + }); + return FullTextDocument; +}()); +var Is; +(function (Is) { + var toString = Object.prototype.toString; + function defined(value) { + return typeof value !== 'undefined'; + } + Is.defined = defined; + function undefined(value) { + return typeof value === 'undefined'; + } + Is.undefined = undefined; + function boolean(value) { + return value === true || value === false; + } + Is.boolean = boolean; + function string(value) { + return toString.call(value) === '[object String]'; + } + Is.string = string; + function number(value) { + return toString.call(value) === '[object Number]'; + } + Is.number = number; + function func(value) { + return toString.call(value) === '[object Function]'; + } + Is.func = func; + function objectLiteral(value) { + // Strictly speaking class instances pass this check as well. Since the LSP + // doesn't use classes we ignore this for now. If we do we need to add something + // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null` + return value !== null && typeof value === 'object'; + } + Is.objectLiteral = objectLiteral; + function typedArray(value, check) { + return Array.isArray(value) && value.every(check); + } + Is.typedArray = typedArray; +})(Is || (Is = {})); // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/htmlLanguageTypes.js /*--------------------------------------------------------------------------------------------- @@ -16986,271 +16986,271 @@ function getAttributeLevelRanges(document, currNode, currOffset) { } // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-languageserver-textdocument/lib/esm/main.js -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -var main_FullTextDocument = /** @class */ (function () { - function FullTextDocument(uri, languageId, version, content) { - this._uri = uri; - this._languageId = languageId; - this._version = version; - this._content = content; - this._lineOffsets = undefined; - } - Object.defineProperty(FullTextDocument.prototype, "uri", { - get: function () { - return this._uri; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "languageId", { - get: function () { - return this._languageId; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "version", { - get: function () { - return this._version; - }, - enumerable: true, - configurable: true - }); - FullTextDocument.prototype.getText = function (range) { - if (range) { - var start = this.offsetAt(range.start); - var end = this.offsetAt(range.end); - return this._content.substring(start, end); - } - return this._content; - }; - FullTextDocument.prototype.update = function (changes, version) { - for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) { - var change = changes_1[_i]; - if (FullTextDocument.isIncremental(change)) { - // makes sure start is before end - var range = getWellformedRange(change.range); - // update content - var startOffset = this.offsetAt(range.start); - var endOffset = this.offsetAt(range.end); - this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length); - // update the offsets - var startLine = Math.max(range.start.line, 0); - var endLine = Math.max(range.end.line, 0); - var lineOffsets = this._lineOffsets; - var addedLineOffsets = computeLineOffsets(change.text, false, startOffset); - if (endLine - startLine === addedLineOffsets.length) { - for (var i = 0, len = addedLineOffsets.length; i < len; i++) { - lineOffsets[i + startLine + 1] = addedLineOffsets[i]; - } - } - else { - if (addedLineOffsets.length < 10000) { - lineOffsets.splice.apply(lineOffsets, [startLine + 1, endLine - startLine].concat(addedLineOffsets)); - } - else { // avoid too many arguments for splice - this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1)); - } - } - var diff = change.text.length - (endOffset - startOffset); - if (diff !== 0) { - for (var i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) { - lineOffsets[i] = lineOffsets[i] + diff; - } - } - } - else if (FullTextDocument.isFull(change)) { - this._content = change.text; - this._lineOffsets = undefined; - } - else { - throw new Error('Unknown change event received'); - } - } - this._version = version; - }; - FullTextDocument.prototype.getLineOffsets = function () { - if (this._lineOffsets === undefined) { - this._lineOffsets = computeLineOffsets(this._content, true); - } - return this._lineOffsets; - }; - FullTextDocument.prototype.positionAt = function (offset) { - offset = Math.max(Math.min(offset, this._content.length), 0); - var lineOffsets = this.getLineOffsets(); - var low = 0, high = lineOffsets.length; - if (high === 0) { - return { line: 0, character: offset }; - } - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (lineOffsets[mid] > offset) { - high = mid; - } - else { - low = mid + 1; - } - } - // low is the least x for which the line offset is larger than the current offset - // or array.length if no line offset is larger than the current offset - var line = low - 1; - return { line: line, character: offset - lineOffsets[line] }; - }; - FullTextDocument.prototype.offsetAt = function (position) { - var lineOffsets = this.getLineOffsets(); - if (position.line >= lineOffsets.length) { - return this._content.length; - } - else if (position.line < 0) { - return 0; - } - var lineOffset = lineOffsets[position.line]; - var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; - return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); - }; - Object.defineProperty(FullTextDocument.prototype, "lineCount", { - get: function () { - return this.getLineOffsets().length; - }, - enumerable: true, - configurable: true - }); - FullTextDocument.isIncremental = function (event) { - var candidate = event; - return candidate !== undefined && candidate !== null && - typeof candidate.text === 'string' && candidate.range !== undefined && - (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number'); - }; - FullTextDocument.isFull = function (event) { - var candidate = event; - return candidate !== undefined && candidate !== null && - typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined; - }; - return FullTextDocument; -}()); -var main_TextDocument; -(function (TextDocument) { - /** - * Creates a new text document. - * - * @param uri The document's uri. - * @param languageId The document's language Id. - * @param version The document's initial version number. - * @param content The document's content. - */ - function create(uri, languageId, version, content) { - return new main_FullTextDocument(uri, languageId, version, content); - } - TextDocument.create = create; - /** - * Updates a TextDocument by modifing its content. - * - * @param document the document to update. Only documents created by TextDocument.create are valid inputs. - * @param changes the changes to apply to the document. - * @returns The updated TextDocument. Note: That's the same document instance passed in as first parameter. - * - */ - function update(document, changes, version) { - if (document instanceof main_FullTextDocument) { - document.update(changes, version); - return document; - } - else { - throw new Error('TextDocument.update: document must be created by TextDocument.create'); - } - } - TextDocument.update = update; - function applyEdits(document, edits) { - var text = document.getText(); - var sortedEdits = mergeSort(edits.map(getWellformedEdit), function (a, b) { - var diff = a.range.start.line - b.range.start.line; - if (diff === 0) { - return a.range.start.character - b.range.start.character; - } - return diff; - }); - var lastModifiedOffset = text.length; - for (var i = sortedEdits.length - 1; i >= 0; i--) { - var e = sortedEdits[i]; - var startOffset = document.offsetAt(e.range.start); - var endOffset = document.offsetAt(e.range.end); - if (endOffset <= lastModifiedOffset) { - text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); - } - else { - throw new Error('Overlapping edit'); - } - lastModifiedOffset = startOffset; - } - return text; - } - TextDocument.applyEdits = applyEdits; -})(main_TextDocument || (main_TextDocument = {})); -function mergeSort(data, compare) { - if (data.length <= 1) { - // sorted - return data; - } - var p = (data.length / 2) | 0; - var left = data.slice(0, p); - var right = data.slice(p); - mergeSort(left, compare); - mergeSort(right, compare); - var leftIdx = 0; - var rightIdx = 0; - var i = 0; - while (leftIdx < left.length && rightIdx < right.length) { - var ret = compare(left[leftIdx], right[rightIdx]); - if (ret <= 0) { - // smaller_equal -> take left to preserve order - data[i++] = left[leftIdx++]; - } - else { - // greater -> take right - data[i++] = right[rightIdx++]; - } - } - while (leftIdx < left.length) { - data[i++] = left[leftIdx++]; - } - while (rightIdx < right.length) { - data[i++] = right[rightIdx++]; - } - return data; -} -function computeLineOffsets(text, isAtLineStart, textOffset) { - if (textOffset === void 0) { textOffset = 0; } - var result = isAtLineStart ? [textOffset] : []; - for (var i = 0; i < text.length; i++) { - var ch = text.charCodeAt(i); - if (ch === 13 /* CarriageReturn */ || ch === 10 /* LineFeed */) { - if (ch === 13 /* CarriageReturn */ && i + 1 < text.length && text.charCodeAt(i + 1) === 10 /* LineFeed */) { - i++; - } - result.push(textOffset + i + 1); - } - } - return result; -} -function getWellformedRange(range) { - var start = range.start; - var end = range.end; - if (start.line > end.line || (start.line === end.line && start.character > end.character)) { - return { start: end, end: start }; - } - return range; -} -function getWellformedEdit(textEdit) { - var range = getWellformedRange(textEdit.range); - if (range !== textEdit.range) { - return { newText: textEdit.newText, range: range }; - } - return textEdit; -} +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + +var main_FullTextDocument = /** @class */ (function () { + function FullTextDocument(uri, languageId, version, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version; + this._content = content; + this._lineOffsets = undefined; + } + Object.defineProperty(FullTextDocument.prototype, "uri", { + get: function () { + return this._uri; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, "languageId", { + get: function () { + return this._languageId; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, "version", { + get: function () { + return this._version; + }, + enumerable: true, + configurable: true + }); + FullTextDocument.prototype.getText = function (range) { + if (range) { + var start = this.offsetAt(range.start); + var end = this.offsetAt(range.end); + return this._content.substring(start, end); + } + return this._content; + }; + FullTextDocument.prototype.update = function (changes, version) { + for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) { + var change = changes_1[_i]; + if (FullTextDocument.isIncremental(change)) { + // makes sure start is before end + var range = getWellformedRange(change.range); + // update content + var startOffset = this.offsetAt(range.start); + var endOffset = this.offsetAt(range.end); + this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length); + // update the offsets + var startLine = Math.max(range.start.line, 0); + var endLine = Math.max(range.end.line, 0); + var lineOffsets = this._lineOffsets; + var addedLineOffsets = computeLineOffsets(change.text, false, startOffset); + if (endLine - startLine === addedLineOffsets.length) { + for (var i = 0, len = addedLineOffsets.length; i < len; i++) { + lineOffsets[i + startLine + 1] = addedLineOffsets[i]; + } + } + else { + if (addedLineOffsets.length < 10000) { + lineOffsets.splice.apply(lineOffsets, [startLine + 1, endLine - startLine].concat(addedLineOffsets)); + } + else { // avoid too many arguments for splice + this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1)); + } + } + var diff = change.text.length - (endOffset - startOffset); + if (diff !== 0) { + for (var i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) { + lineOffsets[i] = lineOffsets[i] + diff; + } + } + } + else if (FullTextDocument.isFull(change)) { + this._content = change.text; + this._lineOffsets = undefined; + } + else { + throw new Error('Unknown change event received'); + } + } + this._version = version; + }; + FullTextDocument.prototype.getLineOffsets = function () { + if (this._lineOffsets === undefined) { + this._lineOffsets = computeLineOffsets(this._content, true); + } + return this._lineOffsets; + }; + FullTextDocument.prototype.positionAt = function (offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + var lineOffsets = this.getLineOffsets(); + var low = 0, high = lineOffsets.length; + if (high === 0) { + return { line: 0, character: offset }; + } + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } + else { + low = mid + 1; + } + } + // low is the least x for which the line offset is larger than the current offset + // or array.length if no line offset is larger than the current offset + var line = low - 1; + return { line: line, character: offset - lineOffsets[line] }; + }; + FullTextDocument.prototype.offsetAt = function (position) { + var lineOffsets = this.getLineOffsets(); + if (position.line >= lineOffsets.length) { + return this._content.length; + } + else if (position.line < 0) { + return 0; + } + var lineOffset = lineOffsets[position.line]; + var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; + return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); + }; + Object.defineProperty(FullTextDocument.prototype, "lineCount", { + get: function () { + return this.getLineOffsets().length; + }, + enumerable: true, + configurable: true + }); + FullTextDocument.isIncremental = function (event) { + var candidate = event; + return candidate !== undefined && candidate !== null && + typeof candidate.text === 'string' && candidate.range !== undefined && + (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number'); + }; + FullTextDocument.isFull = function (event) { + var candidate = event; + return candidate !== undefined && candidate !== null && + typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined; + }; + return FullTextDocument; +}()); +var main_TextDocument; +(function (TextDocument) { + /** + * Creates a new text document. + * + * @param uri The document's uri. + * @param languageId The document's language Id. + * @param version The document's initial version number. + * @param content The document's content. + */ + function create(uri, languageId, version, content) { + return new main_FullTextDocument(uri, languageId, version, content); + } + TextDocument.create = create; + /** + * Updates a TextDocument by modifing its content. + * + * @param document the document to update. Only documents created by TextDocument.create are valid inputs. + * @param changes the changes to apply to the document. + * @returns The updated TextDocument. Note: That's the same document instance passed in as first parameter. + * + */ + function update(document, changes, version) { + if (document instanceof main_FullTextDocument) { + document.update(changes, version); + return document; + } + else { + throw new Error('TextDocument.update: document must be created by TextDocument.create'); + } + } + TextDocument.update = update; + function applyEdits(document, edits) { + var text = document.getText(); + var sortedEdits = mergeSort(edits.map(getWellformedEdit), function (a, b) { + var diff = a.range.start.line - b.range.start.line; + if (diff === 0) { + return a.range.start.character - b.range.start.character; + } + return diff; + }); + var lastModifiedOffset = text.length; + for (var i = sortedEdits.length - 1; i >= 0; i--) { + var e = sortedEdits[i]; + var startOffset = document.offsetAt(e.range.start); + var endOffset = document.offsetAt(e.range.end); + if (endOffset <= lastModifiedOffset) { + text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); + } + else { + throw new Error('Overlapping edit'); + } + lastModifiedOffset = startOffset; + } + return text; + } + TextDocument.applyEdits = applyEdits; +})(main_TextDocument || (main_TextDocument = {})); +function mergeSort(data, compare) { + if (data.length <= 1) { + // sorted + return data; + } + var p = (data.length / 2) | 0; + var left = data.slice(0, p); + var right = data.slice(p); + mergeSort(left, compare); + mergeSort(right, compare); + var leftIdx = 0; + var rightIdx = 0; + var i = 0; + while (leftIdx < left.length && rightIdx < right.length) { + var ret = compare(left[leftIdx], right[rightIdx]); + if (ret <= 0) { + // smaller_equal -> take left to preserve order + data[i++] = left[leftIdx++]; + } + else { + // greater -> take right + data[i++] = right[rightIdx++]; + } + } + while (leftIdx < left.length) { + data[i++] = left[leftIdx++]; + } + while (rightIdx < right.length) { + data[i++] = right[rightIdx++]; + } + return data; +} +function computeLineOffsets(text, isAtLineStart, textOffset) { + if (textOffset === void 0) { textOffset = 0; } + var result = isAtLineStart ? [textOffset] : []; + for (var i = 0; i < text.length; i++) { + var ch = text.charCodeAt(i); + if (ch === 13 /* CarriageReturn */ || ch === 10 /* LineFeed */) { + if (ch === 13 /* CarriageReturn */ && i + 1 < text.length && text.charCodeAt(i + 1) === 10 /* LineFeed */) { + i++; + } + result.push(textOffset + i + 1); + } + } + return result; +} +function getWellformedRange(range) { + var start = range.start; + var end = range.end; + if (start.line > end.line || (start.line === end.line && start.character > end.character)) { + return { start: end, end: start }; + } + return range; +} +function getWellformedEdit(textEdit) { + var range = getWellformedRange(textEdit.range); + if (range !== textEdit.range) { + return { newText: textEdit.newText, range: range }; + } + return textEdit; +} // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/htmlLanguageService.js /*--------------------------------------------------------------------------------------------- @@ -17302,618 +17302,618 @@ function newHTMLDataProvider(id, customData) { } // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/languageFeatures.js -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -var Uri = monaco.Uri; -var languageFeatures_Range = monaco.Range; -// --- diagnostics --- --- -var DiagnosticsAdapter = /** @class */ (function () { - function DiagnosticsAdapter(_languageId, _worker, defaults) { - var _this = this; - this._languageId = _languageId; - this._worker = _worker; - this._disposables = []; - this._listener = Object.create(null); - var onModelAdd = function (model) { - var modeId = model.getModeId(); - if (modeId !== _this._languageId) { - return; - } - var handle; - _this._listener[model.uri.toString()] = model.onDidChangeContent(function () { - clearTimeout(handle); - handle = setTimeout(function () { return _this._doValidate(model.uri, modeId); }, 500); - }); - _this._doValidate(model.uri, modeId); - }; - var onModelRemoved = function (model) { - monaco.editor.setModelMarkers(model, _this._languageId, []); - var uriStr = model.uri.toString(); - var listener = _this._listener[uriStr]; - if (listener) { - listener.dispose(); - delete _this._listener[uriStr]; - } - }; - this._disposables.push(monaco.editor.onDidCreateModel(onModelAdd)); - this._disposables.push(monaco.editor.onWillDisposeModel(function (model) { - onModelRemoved(model); - })); - this._disposables.push(monaco.editor.onDidChangeModelLanguage(function (event) { - onModelRemoved(event.model); - onModelAdd(event.model); - })); - this._disposables.push(defaults.onDidChange(function (_) { - monaco.editor.getModels().forEach(function (model) { - if (model.getModeId() === _this._languageId) { - onModelRemoved(model); - onModelAdd(model); - } - }); - })); - this._disposables.push({ - dispose: function () { - for (var key in _this._listener) { - _this._listener[key].dispose(); - } - } - }); - monaco.editor.getModels().forEach(onModelAdd); - } - DiagnosticsAdapter.prototype.dispose = function () { - this._disposables.forEach(function (d) { return d && d.dispose(); }); - this._disposables = []; - }; - DiagnosticsAdapter.prototype._doValidate = function (resource, languageId) { - this._worker(resource).then(function (worker) { - return worker.doValidation(resource.toString()).then(function (diagnostics) { - var markers = diagnostics.map(function (d) { return toDiagnostics(resource, d); }); - monaco.editor.setModelMarkers(monaco.editor.getModel(resource), languageId, markers); - }); - }).then(undefined, function (err) { - console.error(err); - }); - }; - return DiagnosticsAdapter; -}()); - -function toSeverity(lsSeverity) { - switch (lsSeverity) { - case DiagnosticSeverity.Error: return monaco.MarkerSeverity.Error; - case DiagnosticSeverity.Warning: return monaco.MarkerSeverity.Warning; - case DiagnosticSeverity.Information: return monaco.MarkerSeverity.Info; - case DiagnosticSeverity.Hint: return monaco.MarkerSeverity.Hint; - default: - return monaco.MarkerSeverity.Info; - } -} -function toDiagnostics(resource, diag) { - var code = typeof diag.code === 'number' ? String(diag.code) : diag.code; - return { - severity: toSeverity(diag.severity), - startLineNumber: diag.range.start.line + 1, - startColumn: diag.range.start.character + 1, - endLineNumber: diag.range.end.line + 1, - endColumn: diag.range.end.character + 1, - message: diag.message, - code: code, - source: diag.source - }; -} -// --- completion ------ -function fromPosition(position) { - if (!position) { - return void 0; - } - return { character: position.column - 1, line: position.lineNumber - 1 }; -} -function fromRange(range) { - if (!range) { - return void 0; - } - return { start: fromPosition(range.getStartPosition()), end: fromPosition(range.getEndPosition()) }; -} -function toRange(range) { - if (!range) { - return void 0; - } - return new languageFeatures_Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1); -} -function toCompletionItemKind(kind) { - var mItemKind = monaco.languages.CompletionItemKind; - switch (kind) { - case CompletionItemKind.Text: return mItemKind.Text; - case CompletionItemKind.Method: return mItemKind.Method; - case CompletionItemKind.Function: return mItemKind.Function; - case CompletionItemKind.Constructor: return mItemKind.Constructor; - case CompletionItemKind.Field: return mItemKind.Field; - case CompletionItemKind.Variable: return mItemKind.Variable; - case CompletionItemKind.Class: return mItemKind.Class; - case CompletionItemKind.Interface: return mItemKind.Interface; - case CompletionItemKind.Module: return mItemKind.Module; - case CompletionItemKind.Property: return mItemKind.Property; - case CompletionItemKind.Unit: return mItemKind.Unit; - case CompletionItemKind.Value: return mItemKind.Value; - case CompletionItemKind.Enum: return mItemKind.Enum; - case CompletionItemKind.Keyword: return mItemKind.Keyword; - case CompletionItemKind.Snippet: return mItemKind.Snippet; - case CompletionItemKind.Color: return mItemKind.Color; - case CompletionItemKind.File: return mItemKind.File; - case CompletionItemKind.Reference: return mItemKind.Reference; - } - return mItemKind.Property; -} -function fromCompletionItemKind(kind) { - var mItemKind = monaco.languages.CompletionItemKind; - switch (kind) { - case mItemKind.Text: return CompletionItemKind.Text; - case mItemKind.Method: return CompletionItemKind.Method; - case mItemKind.Function: return CompletionItemKind.Function; - case mItemKind.Constructor: return CompletionItemKind.Constructor; - case mItemKind.Field: return CompletionItemKind.Field; - case mItemKind.Variable: return CompletionItemKind.Variable; - case mItemKind.Class: return CompletionItemKind.Class; - case mItemKind.Interface: return CompletionItemKind.Interface; - case mItemKind.Module: return CompletionItemKind.Module; - case mItemKind.Property: return CompletionItemKind.Property; - case mItemKind.Unit: return CompletionItemKind.Unit; - case mItemKind.Value: return CompletionItemKind.Value; - case mItemKind.Enum: return CompletionItemKind.Enum; - case mItemKind.Keyword: return CompletionItemKind.Keyword; - case mItemKind.Snippet: return CompletionItemKind.Snippet; - case mItemKind.Color: return CompletionItemKind.Color; - case mItemKind.File: return CompletionItemKind.File; - case mItemKind.Reference: return CompletionItemKind.Reference; - } - return CompletionItemKind.Property; -} -function toTextEdit(textEdit) { - if (!textEdit) { - return void 0; - } - return { - range: toRange(textEdit.range), - text: textEdit.newText - }; -} -var languageFeatures_CompletionAdapter = /** @class */ (function () { - function CompletionAdapter(_worker) { - this._worker = _worker; - } - Object.defineProperty(CompletionAdapter.prototype, "triggerCharacters", { - get: function () { - return ['.', ':', '<', '"', '=', '/']; - }, - enumerable: true, - configurable: true - }); - CompletionAdapter.prototype.provideCompletionItems = function (model, position, context, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { - return worker.doComplete(resource.toString(), fromPosition(position)); - }).then(function (info) { - if (!info) { - return; - } - var wordInfo = model.getWordUntilPosition(position); - var wordRange = new languageFeatures_Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn); - var items = info.items.map(function (entry) { - var item = { - label: entry.label, - insertText: entry.insertText || entry.label, - sortText: entry.sortText, - filterText: entry.filterText, - documentation: entry.documentation, - detail: entry.detail, - range: wordRange, - kind: toCompletionItemKind(entry.kind), - }; - if (entry.textEdit) { - item.range = toRange(entry.textEdit.range); - item.insertText = entry.textEdit.newText; - } - if (entry.additionalTextEdits) { - item.additionalTextEdits = entry.additionalTextEdits.map(toTextEdit); - } - if (entry.insertTextFormat === InsertTextFormat.Snippet) { - item.insertTextRules = monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet; - } - return item; - }); - return { - isIncomplete: info.isIncomplete, - suggestions: items - }; - }); - }; - return CompletionAdapter; -}()); - -// --- hover ------ -function isMarkupContent(thing) { - return thing && typeof thing === 'object' && typeof thing.kind === 'string'; -} -function toMarkdownString(entry) { - if (typeof entry === 'string') { - return { - value: entry - }; - } - if (isMarkupContent(entry)) { - if (entry.kind === 'plaintext') { - return { - value: entry.value.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&') - }; - } - return { - value: entry.value - }; - } - return { value: '```' + entry.language + '\n' + entry.value + '\n```\n' }; -} -function toMarkedStringArray(contents) { - if (!contents) { - return void 0; - } - if (Array.isArray(contents)) { - return contents.map(toMarkdownString); - } - return [toMarkdownString(contents)]; -} -var HoverAdapter = /** @class */ (function () { - function HoverAdapter(_worker) { - this._worker = _worker; - } - HoverAdapter.prototype.provideHover = function (model, position, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { - return worker.doHover(resource.toString(), fromPosition(position)); - }).then(function (info) { - if (!info) { - return; - } - return { - range: toRange(info.range), - contents: toMarkedStringArray(info.contents) - }; - }); - }; - return HoverAdapter; -}()); - -// --- document highlights ------ -function toHighlighKind(kind) { - var mKind = monaco.languages.DocumentHighlightKind; - switch (kind) { - case DocumentHighlightKind.Read: return mKind.Read; - case DocumentHighlightKind.Write: return mKind.Write; - case DocumentHighlightKind.Text: return mKind.Text; - } - return mKind.Text; -} -var DocumentHighlightAdapter = /** @class */ (function () { - function DocumentHighlightAdapter(_worker) { - this._worker = _worker; - } - DocumentHighlightAdapter.prototype.provideDocumentHighlights = function (model, position, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { return worker.findDocumentHighlights(resource.toString(), fromPosition(position)); }).then(function (items) { - if (!items) { - return; - } - return items.map(function (item) { return ({ - range: toRange(item.range), - kind: toHighlighKind(item.kind) - }); }); - }); - }; - return DocumentHighlightAdapter; -}()); - -// --- document symbols ------ -function toSymbolKind(kind) { - var mKind = monaco.languages.SymbolKind; - switch (kind) { - case SymbolKind.File: return mKind.Array; - case SymbolKind.Module: return mKind.Module; - case SymbolKind.Namespace: return mKind.Namespace; - case SymbolKind.Package: return mKind.Package; - case SymbolKind.Class: return mKind.Class; - case SymbolKind.Method: return mKind.Method; - case SymbolKind.Property: return mKind.Property; - case SymbolKind.Field: return mKind.Field; - case SymbolKind.Constructor: return mKind.Constructor; - case SymbolKind.Enum: return mKind.Enum; - case SymbolKind.Interface: return mKind.Interface; - case SymbolKind.Function: return mKind.Function; - case SymbolKind.Variable: return mKind.Variable; - case SymbolKind.Constant: return mKind.Constant; - case SymbolKind.String: return mKind.String; - case SymbolKind.Number: return mKind.Number; - case SymbolKind.Boolean: return mKind.Boolean; - case SymbolKind.Array: return mKind.Array; - } - return mKind.Function; -} -var DocumentSymbolAdapter = /** @class */ (function () { - function DocumentSymbolAdapter(_worker) { - this._worker = _worker; - } - DocumentSymbolAdapter.prototype.provideDocumentSymbols = function (model, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { return worker.findDocumentSymbols(resource.toString()); }).then(function (items) { - if (!items) { - return; - } - return items.map(function (item) { return ({ - name: item.name, - detail: '', - containerName: item.containerName, - kind: toSymbolKind(item.kind), - tags: [], - range: toRange(item.location.range), - selectionRange: toRange(item.location.range) - }); }); - }); - }; - return DocumentSymbolAdapter; -}()); - -var DocumentLinkAdapter = /** @class */ (function () { - function DocumentLinkAdapter(_worker) { - this._worker = _worker; - } - DocumentLinkAdapter.prototype.provideLinks = function (model, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { return worker.findDocumentLinks(resource.toString()); }).then(function (items) { - if (!items) { - return; - } - return { - links: items.map(function (item) { return ({ - range: toRange(item.range), - url: item.target - }); }) - }; - }); - }; - return DocumentLinkAdapter; -}()); - -function fromFormattingOptions(options) { - return { - tabSize: options.tabSize, - insertSpaces: options.insertSpaces - }; -} -var DocumentFormattingEditProvider = /** @class */ (function () { - function DocumentFormattingEditProvider(_worker) { - this._worker = _worker; - } - DocumentFormattingEditProvider.prototype.provideDocumentFormattingEdits = function (model, options, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { - return worker.format(resource.toString(), null, fromFormattingOptions(options)).then(function (edits) { - if (!edits || edits.length === 0) { - return; - } - return edits.map(toTextEdit); - }); - }); - }; - return DocumentFormattingEditProvider; -}()); - -var DocumentRangeFormattingEditProvider = /** @class */ (function () { - function DocumentRangeFormattingEditProvider(_worker) { - this._worker = _worker; - } - DocumentRangeFormattingEditProvider.prototype.provideDocumentRangeFormattingEdits = function (model, range, options, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { - return worker.format(resource.toString(), fromRange(range), fromFormattingOptions(options)).then(function (edits) { - if (!edits || edits.length === 0) { - return; - } - return edits.map(toTextEdit); - }); - }); - }; - return DocumentRangeFormattingEditProvider; -}()); - -var RenameAdapter = /** @class */ (function () { - function RenameAdapter(_worker) { - this._worker = _worker; - } - RenameAdapter.prototype.provideRenameEdits = function (model, position, newName, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { - return worker.doRename(resource.toString(), fromPosition(position), newName); - }).then(function (edit) { - return toWorkspaceEdit(edit); - }); - }; - return RenameAdapter; -}()); - -function toWorkspaceEdit(edit) { - if (!edit || !edit.changes) { - return void 0; - } - var resourceEdits = []; - for (var uri in edit.changes) { - var _uri = Uri.parse(uri); - for (var _i = 0, _a = edit.changes[uri]; _i < _a.length; _i++) { - var e = _a[_i]; - resourceEdits.push({ - resource: _uri, - edit: { - range: toRange(e.range), - text: e.newText - } - }); - } - } - return { - edits: resourceEdits - }; -} -var FoldingRangeAdapter = /** @class */ (function () { - function FoldingRangeAdapter(_worker) { - this._worker = _worker; - } - FoldingRangeAdapter.prototype.provideFoldingRanges = function (model, context, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { return worker.getFoldingRanges(resource.toString(), context); }).then(function (ranges) { - if (!ranges) { - return; - } - return ranges.map(function (range) { - var result = { - start: range.startLine + 1, - end: range.endLine + 1 - }; - if (typeof range.kind !== 'undefined') { - result.kind = toFoldingRangeKind(range.kind); - } - return result; - }); - }); - }; - return FoldingRangeAdapter; -}()); - -function toFoldingRangeKind(kind) { - switch (kind) { - case FoldingRangeKind.Comment: return monaco.languages.FoldingRangeKind.Comment; - case FoldingRangeKind.Imports: return monaco.languages.FoldingRangeKind.Imports; - case FoldingRangeKind.Region: return monaco.languages.FoldingRangeKind.Region; - } -} -var SelectionRangeAdapter = /** @class */ (function () { - function SelectionRangeAdapter(_worker) { - this._worker = _worker; - } - SelectionRangeAdapter.prototype.provideSelectionRanges = function (model, positions, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { return worker.getSelectionRanges(resource.toString(), positions.map(fromPosition)); }).then(function (selectionRanges) { - if (!selectionRanges) { - return; - } - return selectionRanges.map(function (selectionRange) { - var result = []; - while (selectionRange) { - result.push({ range: toRange(selectionRange.range) }); - selectionRange = selectionRange.parent; - } - return result; - }); - }); - }; - return SelectionRangeAdapter; -}()); - +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + +var Uri = monaco.Uri; +var languageFeatures_Range = monaco.Range; +// --- diagnostics --- --- +var DiagnosticsAdapter = /** @class */ (function () { + function DiagnosticsAdapter(_languageId, _worker, defaults) { + var _this = this; + this._languageId = _languageId; + this._worker = _worker; + this._disposables = []; + this._listener = Object.create(null); + var onModelAdd = function (model) { + var modeId = model.getModeId(); + if (modeId !== _this._languageId) { + return; + } + var handle; + _this._listener[model.uri.toString()] = model.onDidChangeContent(function () { + clearTimeout(handle); + handle = setTimeout(function () { return _this._doValidate(model.uri, modeId); }, 500); + }); + _this._doValidate(model.uri, modeId); + }; + var onModelRemoved = function (model) { + monaco.editor.setModelMarkers(model, _this._languageId, []); + var uriStr = model.uri.toString(); + var listener = _this._listener[uriStr]; + if (listener) { + listener.dispose(); + delete _this._listener[uriStr]; + } + }; + this._disposables.push(monaco.editor.onDidCreateModel(onModelAdd)); + this._disposables.push(monaco.editor.onWillDisposeModel(function (model) { + onModelRemoved(model); + })); + this._disposables.push(monaco.editor.onDidChangeModelLanguage(function (event) { + onModelRemoved(event.model); + onModelAdd(event.model); + })); + this._disposables.push(defaults.onDidChange(function (_) { + monaco.editor.getModels().forEach(function (model) { + if (model.getModeId() === _this._languageId) { + onModelRemoved(model); + onModelAdd(model); + } + }); + })); + this._disposables.push({ + dispose: function () { + for (var key in _this._listener) { + _this._listener[key].dispose(); + } + } + }); + monaco.editor.getModels().forEach(onModelAdd); + } + DiagnosticsAdapter.prototype.dispose = function () { + this._disposables.forEach(function (d) { return d && d.dispose(); }); + this._disposables = []; + }; + DiagnosticsAdapter.prototype._doValidate = function (resource, languageId) { + this._worker(resource).then(function (worker) { + return worker.doValidation(resource.toString()).then(function (diagnostics) { + var markers = diagnostics.map(function (d) { return toDiagnostics(resource, d); }); + monaco.editor.setModelMarkers(monaco.editor.getModel(resource), languageId, markers); + }); + }).then(undefined, function (err) { + console.error(err); + }); + }; + return DiagnosticsAdapter; +}()); + +function toSeverity(lsSeverity) { + switch (lsSeverity) { + case DiagnosticSeverity.Error: return monaco.MarkerSeverity.Error; + case DiagnosticSeverity.Warning: return monaco.MarkerSeverity.Warning; + case DiagnosticSeverity.Information: return monaco.MarkerSeverity.Info; + case DiagnosticSeverity.Hint: return monaco.MarkerSeverity.Hint; + default: + return monaco.MarkerSeverity.Info; + } +} +function toDiagnostics(resource, diag) { + var code = typeof diag.code === 'number' ? String(diag.code) : diag.code; + return { + severity: toSeverity(diag.severity), + startLineNumber: diag.range.start.line + 1, + startColumn: diag.range.start.character + 1, + endLineNumber: diag.range.end.line + 1, + endColumn: diag.range.end.character + 1, + message: diag.message, + code: code, + source: diag.source + }; +} +// --- completion ------ +function fromPosition(position) { + if (!position) { + return void 0; + } + return { character: position.column - 1, line: position.lineNumber - 1 }; +} +function fromRange(range) { + if (!range) { + return void 0; + } + return { start: fromPosition(range.getStartPosition()), end: fromPosition(range.getEndPosition()) }; +} +function toRange(range) { + if (!range) { + return void 0; + } + return new languageFeatures_Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1); +} +function toCompletionItemKind(kind) { + var mItemKind = monaco.languages.CompletionItemKind; + switch (kind) { + case CompletionItemKind.Text: return mItemKind.Text; + case CompletionItemKind.Method: return mItemKind.Method; + case CompletionItemKind.Function: return mItemKind.Function; + case CompletionItemKind.Constructor: return mItemKind.Constructor; + case CompletionItemKind.Field: return mItemKind.Field; + case CompletionItemKind.Variable: return mItemKind.Variable; + case CompletionItemKind.Class: return mItemKind.Class; + case CompletionItemKind.Interface: return mItemKind.Interface; + case CompletionItemKind.Module: return mItemKind.Module; + case CompletionItemKind.Property: return mItemKind.Property; + case CompletionItemKind.Unit: return mItemKind.Unit; + case CompletionItemKind.Value: return mItemKind.Value; + case CompletionItemKind.Enum: return mItemKind.Enum; + case CompletionItemKind.Keyword: return mItemKind.Keyword; + case CompletionItemKind.Snippet: return mItemKind.Snippet; + case CompletionItemKind.Color: return mItemKind.Color; + case CompletionItemKind.File: return mItemKind.File; + case CompletionItemKind.Reference: return mItemKind.Reference; + } + return mItemKind.Property; +} +function fromCompletionItemKind(kind) { + var mItemKind = monaco.languages.CompletionItemKind; + switch (kind) { + case mItemKind.Text: return CompletionItemKind.Text; + case mItemKind.Method: return CompletionItemKind.Method; + case mItemKind.Function: return CompletionItemKind.Function; + case mItemKind.Constructor: return CompletionItemKind.Constructor; + case mItemKind.Field: return CompletionItemKind.Field; + case mItemKind.Variable: return CompletionItemKind.Variable; + case mItemKind.Class: return CompletionItemKind.Class; + case mItemKind.Interface: return CompletionItemKind.Interface; + case mItemKind.Module: return CompletionItemKind.Module; + case mItemKind.Property: return CompletionItemKind.Property; + case mItemKind.Unit: return CompletionItemKind.Unit; + case mItemKind.Value: return CompletionItemKind.Value; + case mItemKind.Enum: return CompletionItemKind.Enum; + case mItemKind.Keyword: return CompletionItemKind.Keyword; + case mItemKind.Snippet: return CompletionItemKind.Snippet; + case mItemKind.Color: return CompletionItemKind.Color; + case mItemKind.File: return CompletionItemKind.File; + case mItemKind.Reference: return CompletionItemKind.Reference; + } + return CompletionItemKind.Property; +} +function toTextEdit(textEdit) { + if (!textEdit) { + return void 0; + } + return { + range: toRange(textEdit.range), + text: textEdit.newText + }; +} +var languageFeatures_CompletionAdapter = /** @class */ (function () { + function CompletionAdapter(_worker) { + this._worker = _worker; + } + Object.defineProperty(CompletionAdapter.prototype, "triggerCharacters", { + get: function () { + return ['.', ':', '<', '"', '=', '/']; + }, + enumerable: true, + configurable: true + }); + CompletionAdapter.prototype.provideCompletionItems = function (model, position, context, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { + return worker.doComplete(resource.toString(), fromPosition(position)); + }).then(function (info) { + if (!info) { + return; + } + var wordInfo = model.getWordUntilPosition(position); + var wordRange = new languageFeatures_Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn); + var items = info.items.map(function (entry) { + var item = { + label: entry.label, + insertText: entry.insertText || entry.label, + sortText: entry.sortText, + filterText: entry.filterText, + documentation: entry.documentation, + detail: entry.detail, + range: wordRange, + kind: toCompletionItemKind(entry.kind), + }; + if (entry.textEdit) { + item.range = toRange(entry.textEdit.range); + item.insertText = entry.textEdit.newText; + } + if (entry.additionalTextEdits) { + item.additionalTextEdits = entry.additionalTextEdits.map(toTextEdit); + } + if (entry.insertTextFormat === InsertTextFormat.Snippet) { + item.insertTextRules = monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet; + } + return item; + }); + return { + isIncomplete: info.isIncomplete, + suggestions: items + }; + }); + }; + return CompletionAdapter; +}()); + +// --- hover ------ +function isMarkupContent(thing) { + return thing && typeof thing === 'object' && typeof thing.kind === 'string'; +} +function toMarkdownString(entry) { + if (typeof entry === 'string') { + return { + value: entry + }; + } + if (isMarkupContent(entry)) { + if (entry.kind === 'plaintext') { + return { + value: entry.value.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&') + }; + } + return { + value: entry.value + }; + } + return { value: '```' + entry.language + '\n' + entry.value + '\n```\n' }; +} +function toMarkedStringArray(contents) { + if (!contents) { + return void 0; + } + if (Array.isArray(contents)) { + return contents.map(toMarkdownString); + } + return [toMarkdownString(contents)]; +} +var HoverAdapter = /** @class */ (function () { + function HoverAdapter(_worker) { + this._worker = _worker; + } + HoverAdapter.prototype.provideHover = function (model, position, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { + return worker.doHover(resource.toString(), fromPosition(position)); + }).then(function (info) { + if (!info) { + return; + } + return { + range: toRange(info.range), + contents: toMarkedStringArray(info.contents) + }; + }); + }; + return HoverAdapter; +}()); + +// --- document highlights ------ +function toHighlighKind(kind) { + var mKind = monaco.languages.DocumentHighlightKind; + switch (kind) { + case DocumentHighlightKind.Read: return mKind.Read; + case DocumentHighlightKind.Write: return mKind.Write; + case DocumentHighlightKind.Text: return mKind.Text; + } + return mKind.Text; +} +var DocumentHighlightAdapter = /** @class */ (function () { + function DocumentHighlightAdapter(_worker) { + this._worker = _worker; + } + DocumentHighlightAdapter.prototype.provideDocumentHighlights = function (model, position, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { return worker.findDocumentHighlights(resource.toString(), fromPosition(position)); }).then(function (items) { + if (!items) { + return; + } + return items.map(function (item) { return ({ + range: toRange(item.range), + kind: toHighlighKind(item.kind) + }); }); + }); + }; + return DocumentHighlightAdapter; +}()); + +// --- document symbols ------ +function toSymbolKind(kind) { + var mKind = monaco.languages.SymbolKind; + switch (kind) { + case SymbolKind.File: return mKind.Array; + case SymbolKind.Module: return mKind.Module; + case SymbolKind.Namespace: return mKind.Namespace; + case SymbolKind.Package: return mKind.Package; + case SymbolKind.Class: return mKind.Class; + case SymbolKind.Method: return mKind.Method; + case SymbolKind.Property: return mKind.Property; + case SymbolKind.Field: return mKind.Field; + case SymbolKind.Constructor: return mKind.Constructor; + case SymbolKind.Enum: return mKind.Enum; + case SymbolKind.Interface: return mKind.Interface; + case SymbolKind.Function: return mKind.Function; + case SymbolKind.Variable: return mKind.Variable; + case SymbolKind.Constant: return mKind.Constant; + case SymbolKind.String: return mKind.String; + case SymbolKind.Number: return mKind.Number; + case SymbolKind.Boolean: return mKind.Boolean; + case SymbolKind.Array: return mKind.Array; + } + return mKind.Function; +} +var DocumentSymbolAdapter = /** @class */ (function () { + function DocumentSymbolAdapter(_worker) { + this._worker = _worker; + } + DocumentSymbolAdapter.prototype.provideDocumentSymbols = function (model, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { return worker.findDocumentSymbols(resource.toString()); }).then(function (items) { + if (!items) { + return; + } + return items.map(function (item) { return ({ + name: item.name, + detail: '', + containerName: item.containerName, + kind: toSymbolKind(item.kind), + tags: [], + range: toRange(item.location.range), + selectionRange: toRange(item.location.range) + }); }); + }); + }; + return DocumentSymbolAdapter; +}()); + +var DocumentLinkAdapter = /** @class */ (function () { + function DocumentLinkAdapter(_worker) { + this._worker = _worker; + } + DocumentLinkAdapter.prototype.provideLinks = function (model, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { return worker.findDocumentLinks(resource.toString()); }).then(function (items) { + if (!items) { + return; + } + return { + links: items.map(function (item) { return ({ + range: toRange(item.range), + url: item.target + }); }) + }; + }); + }; + return DocumentLinkAdapter; +}()); + +function fromFormattingOptions(options) { + return { + tabSize: options.tabSize, + insertSpaces: options.insertSpaces + }; +} +var DocumentFormattingEditProvider = /** @class */ (function () { + function DocumentFormattingEditProvider(_worker) { + this._worker = _worker; + } + DocumentFormattingEditProvider.prototype.provideDocumentFormattingEdits = function (model, options, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { + return worker.format(resource.toString(), null, fromFormattingOptions(options)).then(function (edits) { + if (!edits || edits.length === 0) { + return; + } + return edits.map(toTextEdit); + }); + }); + }; + return DocumentFormattingEditProvider; +}()); + +var DocumentRangeFormattingEditProvider = /** @class */ (function () { + function DocumentRangeFormattingEditProvider(_worker) { + this._worker = _worker; + } + DocumentRangeFormattingEditProvider.prototype.provideDocumentRangeFormattingEdits = function (model, range, options, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { + return worker.format(resource.toString(), fromRange(range), fromFormattingOptions(options)).then(function (edits) { + if (!edits || edits.length === 0) { + return; + } + return edits.map(toTextEdit); + }); + }); + }; + return DocumentRangeFormattingEditProvider; +}()); + +var RenameAdapter = /** @class */ (function () { + function RenameAdapter(_worker) { + this._worker = _worker; + } + RenameAdapter.prototype.provideRenameEdits = function (model, position, newName, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { + return worker.doRename(resource.toString(), fromPosition(position), newName); + }).then(function (edit) { + return toWorkspaceEdit(edit); + }); + }; + return RenameAdapter; +}()); + +function toWorkspaceEdit(edit) { + if (!edit || !edit.changes) { + return void 0; + } + var resourceEdits = []; + for (var uri in edit.changes) { + var _uri = Uri.parse(uri); + for (var _i = 0, _a = edit.changes[uri]; _i < _a.length; _i++) { + var e = _a[_i]; + resourceEdits.push({ + resource: _uri, + edit: { + range: toRange(e.range), + text: e.newText + } + }); + } + } + return { + edits: resourceEdits + }; +} +var FoldingRangeAdapter = /** @class */ (function () { + function FoldingRangeAdapter(_worker) { + this._worker = _worker; + } + FoldingRangeAdapter.prototype.provideFoldingRanges = function (model, context, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { return worker.getFoldingRanges(resource.toString(), context); }).then(function (ranges) { + if (!ranges) { + return; + } + return ranges.map(function (range) { + var result = { + start: range.startLine + 1, + end: range.endLine + 1 + }; + if (typeof range.kind !== 'undefined') { + result.kind = toFoldingRangeKind(range.kind); + } + return result; + }); + }); + }; + return FoldingRangeAdapter; +}()); + +function toFoldingRangeKind(kind) { + switch (kind) { + case FoldingRangeKind.Comment: return monaco.languages.FoldingRangeKind.Comment; + case FoldingRangeKind.Imports: return monaco.languages.FoldingRangeKind.Imports; + case FoldingRangeKind.Region: return monaco.languages.FoldingRangeKind.Region; + } +} +var SelectionRangeAdapter = /** @class */ (function () { + function SelectionRangeAdapter(_worker) { + this._worker = _worker; + } + SelectionRangeAdapter.prototype.provideSelectionRanges = function (model, positions, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { return worker.getSelectionRanges(resource.toString(), positions.map(fromPosition)); }).then(function (selectionRanges) { + if (!selectionRanges) { + return; + } + return selectionRanges.map(function (selectionRange) { + var result = []; + while (selectionRange) { + result.push({ range: toRange(selectionRange.range) }); + selectionRange = selectionRange.parent; + } + return result; + }); + }); + }; + return SelectionRangeAdapter; +}()); + // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/htmlMode.js -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -function setupMode1(defaults) { - var client = new WorkerManager(defaults); - var worker = function () { - var uris = []; - for (var _i = 0; _i < arguments.length; _i++) { - uris[_i] = arguments[_i]; - } - return client.getLanguageServiceWorker.apply(client, uris); - }; - var languageId = defaults.languageId; - // all modes - monaco.languages.registerCompletionItemProvider(languageId, new languageFeatures_CompletionAdapter(worker)); - monaco.languages.registerHoverProvider(languageId, new HoverAdapter(worker)); - monaco.languages.registerDocumentHighlightProvider(languageId, new DocumentHighlightAdapter(worker)); - monaco.languages.registerLinkProvider(languageId, new DocumentLinkAdapter(worker)); - monaco.languages.registerFoldingRangeProvider(languageId, new FoldingRangeAdapter(worker)); - monaco.languages.registerDocumentSymbolProvider(languageId, new DocumentSymbolAdapter(worker)); - monaco.languages.registerSelectionRangeProvider(languageId, new SelectionRangeAdapter(worker)); - monaco.languages.registerRenameProvider(languageId, new RenameAdapter(worker)); - // only html - if (languageId === 'html') { - monaco.languages.registerDocumentFormattingEditProvider(languageId, new DocumentFormattingEditProvider(worker)); - monaco.languages.registerDocumentRangeFormattingEditProvider(languageId, new DocumentRangeFormattingEditProvider(worker)); - new DiagnosticsAdapter(languageId, worker, defaults); - } -} -function setupMode(defaults) { - var disposables = []; - var providers = []; - var client = new WorkerManager(defaults); - disposables.push(client); - var worker = function () { - var uris = []; - for (var _i = 0; _i < arguments.length; _i++) { - uris[_i] = arguments[_i]; - } - return client.getLanguageServiceWorker.apply(client, uris); - }; - function registerProviders() { - var languageId = defaults.languageId, modeConfiguration = defaults.modeConfiguration; - disposeAll(providers); - if (modeConfiguration.completionItems) { - providers.push(monaco.languages.registerCompletionItemProvider(languageId, new languageFeatures_CompletionAdapter(worker))); - } - if (modeConfiguration.hovers) { - providers.push(monaco.languages.registerHoverProvider(languageId, new HoverAdapter(worker))); - } - if (modeConfiguration.documentHighlights) { - providers.push(monaco.languages.registerDocumentHighlightProvider(languageId, new DocumentHighlightAdapter(worker))); - } - if (modeConfiguration.links) { - providers.push(monaco.languages.registerLinkProvider(languageId, new DocumentLinkAdapter(worker))); - } - if (modeConfiguration.documentSymbols) { - providers.push(monaco.languages.registerDocumentSymbolProvider(languageId, new DocumentSymbolAdapter(worker))); - } - if (modeConfiguration.rename) { - providers.push(monaco.languages.registerRenameProvider(languageId, new RenameAdapter(worker))); - } - if (modeConfiguration.foldingRanges) { - providers.push(monaco.languages.registerFoldingRangeProvider(languageId, new FoldingRangeAdapter(worker))); - } - if (modeConfiguration.selectionRanges) { - providers.push(monaco.languages.registerSelectionRangeProvider(languageId, new SelectionRangeAdapter(worker))); - } - if (modeConfiguration.documentFormattingEdits) { - providers.push(monaco.languages.registerDocumentFormattingEditProvider(languageId, new DocumentFormattingEditProvider(worker))); - } - if (modeConfiguration.documentRangeFormattingEdits) { - providers.push(monaco.languages.registerDocumentRangeFormattingEditProvider(languageId, new DocumentRangeFormattingEditProvider(worker))); - } - if (modeConfiguration.diagnostics) { - providers.push(new DiagnosticsAdapter(languageId, worker, defaults)); - } - } - registerProviders(); - disposables.push(asDisposable(providers)); - return asDisposable(disposables); -} -function asDisposable(disposables) { - return { dispose: function () { return disposeAll(disposables); } }; -} -function disposeAll(disposables) { - while (disposables.length) { - disposables.pop().dispose(); - } -} +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + +function setupMode1(defaults) { + var client = new WorkerManager(defaults); + var worker = function () { + var uris = []; + for (var _i = 0; _i < arguments.length; _i++) { + uris[_i] = arguments[_i]; + } + return client.getLanguageServiceWorker.apply(client, uris); + }; + var languageId = defaults.languageId; + // all modes + monaco.languages.registerCompletionItemProvider(languageId, new languageFeatures_CompletionAdapter(worker)); + monaco.languages.registerHoverProvider(languageId, new HoverAdapter(worker)); + monaco.languages.registerDocumentHighlightProvider(languageId, new DocumentHighlightAdapter(worker)); + monaco.languages.registerLinkProvider(languageId, new DocumentLinkAdapter(worker)); + monaco.languages.registerFoldingRangeProvider(languageId, new FoldingRangeAdapter(worker)); + monaco.languages.registerDocumentSymbolProvider(languageId, new DocumentSymbolAdapter(worker)); + monaco.languages.registerSelectionRangeProvider(languageId, new SelectionRangeAdapter(worker)); + monaco.languages.registerRenameProvider(languageId, new RenameAdapter(worker)); + // only html + if (languageId === 'html') { + monaco.languages.registerDocumentFormattingEditProvider(languageId, new DocumentFormattingEditProvider(worker)); + monaco.languages.registerDocumentRangeFormattingEditProvider(languageId, new DocumentRangeFormattingEditProvider(worker)); + new DiagnosticsAdapter(languageId, worker, defaults); + } +} +function setupMode(defaults) { + var disposables = []; + var providers = []; + var client = new WorkerManager(defaults); + disposables.push(client); + var worker = function () { + var uris = []; + for (var _i = 0; _i < arguments.length; _i++) { + uris[_i] = arguments[_i]; + } + return client.getLanguageServiceWorker.apply(client, uris); + }; + function registerProviders() { + var languageId = defaults.languageId, modeConfiguration = defaults.modeConfiguration; + disposeAll(providers); + if (modeConfiguration.completionItems) { + providers.push(monaco.languages.registerCompletionItemProvider(languageId, new languageFeatures_CompletionAdapter(worker))); + } + if (modeConfiguration.hovers) { + providers.push(monaco.languages.registerHoverProvider(languageId, new HoverAdapter(worker))); + } + if (modeConfiguration.documentHighlights) { + providers.push(monaco.languages.registerDocumentHighlightProvider(languageId, new DocumentHighlightAdapter(worker))); + } + if (modeConfiguration.links) { + providers.push(monaco.languages.registerLinkProvider(languageId, new DocumentLinkAdapter(worker))); + } + if (modeConfiguration.documentSymbols) { + providers.push(monaco.languages.registerDocumentSymbolProvider(languageId, new DocumentSymbolAdapter(worker))); + } + if (modeConfiguration.rename) { + providers.push(monaco.languages.registerRenameProvider(languageId, new RenameAdapter(worker))); + } + if (modeConfiguration.foldingRanges) { + providers.push(monaco.languages.registerFoldingRangeProvider(languageId, new FoldingRangeAdapter(worker))); + } + if (modeConfiguration.selectionRanges) { + providers.push(monaco.languages.registerSelectionRangeProvider(languageId, new SelectionRangeAdapter(worker))); + } + if (modeConfiguration.documentFormattingEdits) { + providers.push(monaco.languages.registerDocumentFormattingEditProvider(languageId, new DocumentFormattingEditProvider(worker))); + } + if (modeConfiguration.documentRangeFormattingEdits) { + providers.push(monaco.languages.registerDocumentRangeFormattingEditProvider(languageId, new DocumentRangeFormattingEditProvider(worker))); + } + if (modeConfiguration.diagnostics) { + providers.push(new DiagnosticsAdapter(languageId, worker, defaults)); + } + } + registerProviders(); + disposables.push(asDisposable(providers)); + return asDisposable(disposables); +} +function asDisposable(disposables) { + return { dispose: function () { return disposeAll(disposables); } }; +} +function disposeAll(disposables) { + while (disposables.length) { + disposables.pop().dispose(); + } +} /***/ }), diff --git a/23.2f1b1a41.async.js b/23.2f1b1a41.async.js index c460abb35..19f24a001 100644 --- a/23.2f1b1a41.async.js +++ b/23.2f1b1a41.async.js @@ -17,76 +17,76 @@ __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "setupMode", function() { return /* binding */ setupMode; }); // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/workerManager.js -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var STOP_WHEN_IDLE_FOR = 2 * 60 * 1000; // 2min -var WorkerManager = /** @class */ (function () { - function WorkerManager(defaults) { - var _this = this; - this._defaults = defaults; - this._worker = null; - this._idleCheckInterval = setInterval(function () { return _this._checkIfIdle(); }, 30 * 1000); - this._lastUsedTime = 0; - this._configChangeListener = this._defaults.onDidChange(function () { return _this._stopWorker(); }); - } - WorkerManager.prototype._stopWorker = function () { - if (this._worker) { - this._worker.dispose(); - this._worker = null; - } - this._client = null; - }; - WorkerManager.prototype.dispose = function () { - clearInterval(this._idleCheckInterval); - this._configChangeListener.dispose(); - this._stopWorker(); - }; - WorkerManager.prototype._checkIfIdle = function () { - if (!this._worker) { - return; - } - var timePassedSinceLastUsed = Date.now() - this._lastUsedTime; - if (timePassedSinceLastUsed > STOP_WHEN_IDLE_FOR) { - this._stopWorker(); - } - }; - WorkerManager.prototype._getClient = function () { - this._lastUsedTime = Date.now(); - if (!this._client) { - this._worker = monaco.editor.createWebWorker({ - // module that exports the create() method and returns a `JSONWorker` instance - moduleId: 'vs/language/json/jsonWorker', - label: this._defaults.languageId, - // passed in to the create() method - createData: { - languageSettings: this._defaults.diagnosticsOptions, - languageId: this._defaults.languageId, - enableSchemaRequest: this._defaults.diagnosticsOptions.enableSchemaRequest - } - }); - this._client = this._worker.getProxy(); - } - return this._client; - }; - WorkerManager.prototype.getLanguageServiceWorker = function () { - var _this = this; - var resources = []; - for (var _i = 0; _i < arguments.length; _i++) { - resources[_i] = arguments[_i]; - } - var _client; - return this._getClient().then(function (client) { - _client = client; - }).then(function (_) { - return _this._worker.withSyncedResources(resources); - }).then(function (_) { return _client; }); - }; - return WorkerManager; -}()); - +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var STOP_WHEN_IDLE_FOR = 2 * 60 * 1000; // 2min +var WorkerManager = /** @class */ (function () { + function WorkerManager(defaults) { + var _this = this; + this._defaults = defaults; + this._worker = null; + this._idleCheckInterval = setInterval(function () { return _this._checkIfIdle(); }, 30 * 1000); + this._lastUsedTime = 0; + this._configChangeListener = this._defaults.onDidChange(function () { return _this._stopWorker(); }); + } + WorkerManager.prototype._stopWorker = function () { + if (this._worker) { + this._worker.dispose(); + this._worker = null; + } + this._client = null; + }; + WorkerManager.prototype.dispose = function () { + clearInterval(this._idleCheckInterval); + this._configChangeListener.dispose(); + this._stopWorker(); + }; + WorkerManager.prototype._checkIfIdle = function () { + if (!this._worker) { + return; + } + var timePassedSinceLastUsed = Date.now() - this._lastUsedTime; + if (timePassedSinceLastUsed > STOP_WHEN_IDLE_FOR) { + this._stopWorker(); + } + }; + WorkerManager.prototype._getClient = function () { + this._lastUsedTime = Date.now(); + if (!this._client) { + this._worker = monaco.editor.createWebWorker({ + // module that exports the create() method and returns a `JSONWorker` instance + moduleId: 'vs/language/json/jsonWorker', + label: this._defaults.languageId, + // passed in to the create() method + createData: { + languageSettings: this._defaults.diagnosticsOptions, + languageId: this._defaults.languageId, + enableSchemaRequest: this._defaults.diagnosticsOptions.enableSchemaRequest + } + }); + this._client = this._worker.getProxy(); + } + return this._client; + }; + WorkerManager.prototype.getLanguageServiceWorker = function () { + var _this = this; + var resources = []; + for (var _i = 0; _i < arguments.length; _i++) { + resources[_i] = arguments[_i]; + } + var _client; + return this._getClient().then(function (client) { + _client = client; + }).then(function (_) { + return _this._worker.withSyncedResources(resources); + }).then(function (_) { return _client; }); + }; + return WorkerManager; +}()); + // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/scanner.js /*--------------------------------------------------------------------------------------------- @@ -1632,1800 +1632,1800 @@ function isString(val) { } // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-types/main.js -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -/** - * The Position namespace provides helper functions to work with - * [Position](#Position) literals. - */ -var Position; -(function (Position) { - /** - * Creates a new Position literal from the given line and character. - * @param line The position's line. - * @param character The position's character. - */ - function create(line, character) { - return { line: line, character: character }; - } - Position.create = create; - /** - * Checks whether the given liternal conforms to the [Position](#Position) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character); - } - Position.is = is; -})(Position || (Position = {})); -/** - * The Range namespace provides helper functions to work with - * [Range](#Range) literals. - */ -var Range; -(function (Range) { - function create(one, two, three, four) { - if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) { - return { start: Position.create(one, two), end: Position.create(three, four) }; - } - else if (Position.is(one) && Position.is(two)) { - return { start: one, end: two }; - } - else { - throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]"); - } - } - Range.create = create; - /** - * Checks whether the given literal conforms to the [Range](#Range) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); - } - Range.is = is; -})(Range || (Range = {})); -/** - * The Location namespace provides helper functions to work with - * [Location](#Location) literals. - */ -var Location; -(function (Location) { - /** - * Creates a Location literal. - * @param uri The location's uri. - * @param range The location's range. - */ - function create(uri, range) { - return { uri: uri, range: range }; - } - Location.create = create; - /** - * Checks whether the given literal conforms to the [Location](#Location) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); - } - Location.is = is; -})(Location || (Location = {})); -/** - * The LocationLink namespace provides helper functions to work with - * [LocationLink](#LocationLink) literals. - */ -var LocationLink; -(function (LocationLink) { - /** - * Creates a LocationLink literal. - * @param targetUri The definition's uri. - * @param targetRange The full range of the definition. - * @param targetSelectionRange The span of the symbol definition at the target. - * @param originSelectionRange The span of the symbol being defined in the originating source file. - */ - function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) { - return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange }; - } - LocationLink.create = create; - /** - * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) - && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) - && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); - } - LocationLink.is = is; -})(LocationLink || (LocationLink = {})); -/** - * The Color namespace provides helper functions to work with - * [Color](#Color) literals. - */ -var Color; -(function (Color) { - /** - * Creates a new Color literal. - */ - function create(red, green, blue, alpha) { - return { - red: red, - green: green, - blue: blue, - alpha: alpha, - }; - } - Color.create = create; - /** - * Checks whether the given literal conforms to the [Color](#Color) interface. - */ - function is(value) { - var candidate = value; - return Is.number(candidate.red) - && Is.number(candidate.green) - && Is.number(candidate.blue) - && Is.number(candidate.alpha); - } - Color.is = is; -})(Color || (Color = {})); -/** - * The ColorInformation namespace provides helper functions to work with - * [ColorInformation](#ColorInformation) literals. - */ -var ColorInformation; -(function (ColorInformation) { - /** - * Creates a new ColorInformation literal. - */ - function create(range, color) { - return { - range: range, - color: color, - }; - } - ColorInformation.create = create; - /** - * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. - */ - function is(value) { - var candidate = value; - return Range.is(candidate.range) && Color.is(candidate.color); - } - ColorInformation.is = is; -})(ColorInformation || (ColorInformation = {})); -/** - * The Color namespace provides helper functions to work with - * [ColorPresentation](#ColorPresentation) literals. - */ -var ColorPresentation; -(function (ColorPresentation) { - /** - * Creates a new ColorInformation literal. - */ - function create(label, textEdit, additionalTextEdits) { - return { - label: label, - textEdit: textEdit, - additionalTextEdits: additionalTextEdits, - }; - } - ColorPresentation.create = create; - /** - * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. - */ - function is(value) { - var candidate = value; - return Is.string(candidate.label) - && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) - && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is)); - } - ColorPresentation.is = is; -})(ColorPresentation || (ColorPresentation = {})); -/** - * Enum of known range kinds - */ -var FoldingRangeKind; -(function (FoldingRangeKind) { - /** - * Folding range for a comment - */ - FoldingRangeKind["Comment"] = "comment"; - /** - * Folding range for a imports or includes - */ - FoldingRangeKind["Imports"] = "imports"; - /** - * Folding range for a region (e.g. `#region`) - */ - FoldingRangeKind["Region"] = "region"; -})(FoldingRangeKind || (FoldingRangeKind = {})); -/** - * The folding range namespace provides helper functions to work with - * [FoldingRange](#FoldingRange) literals. - */ -var FoldingRange; -(function (FoldingRange) { - /** - * Creates a new FoldingRange literal. - */ - function create(startLine, endLine, startCharacter, endCharacter, kind) { - var result = { - startLine: startLine, - endLine: endLine - }; - if (Is.defined(startCharacter)) { - result.startCharacter = startCharacter; - } - if (Is.defined(endCharacter)) { - result.endCharacter = endCharacter; - } - if (Is.defined(kind)) { - result.kind = kind; - } - return result; - } - FoldingRange.create = create; - /** - * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface. - */ - function is(value) { - var candidate = value; - return Is.number(candidate.startLine) && Is.number(candidate.startLine) - && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter)) - && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter)) - && (Is.undefined(candidate.kind) || Is.string(candidate.kind)); - } - FoldingRange.is = is; -})(FoldingRange || (FoldingRange = {})); -/** - * The DiagnosticRelatedInformation namespace provides helper functions to work with - * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals. - */ -var DiagnosticRelatedInformation; -(function (DiagnosticRelatedInformation) { - /** - * Creates a new DiagnosticRelatedInformation literal. - */ - function create(location, message) { - return { - location: location, - message: message - }; - } - DiagnosticRelatedInformation.create = create; - /** - * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message); - } - DiagnosticRelatedInformation.is = is; -})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {})); -/** - * The diagnostic's severity. - */ -var DiagnosticSeverity; -(function (DiagnosticSeverity) { - /** - * Reports an error. - */ - DiagnosticSeverity.Error = 1; - /** - * Reports a warning. - */ - DiagnosticSeverity.Warning = 2; - /** - * Reports an information. - */ - DiagnosticSeverity.Information = 3; - /** - * Reports a hint. - */ - DiagnosticSeverity.Hint = 4; -})(DiagnosticSeverity || (DiagnosticSeverity = {})); -/** - * The diagnostic tags. - * - * @since 3.15.0 - */ -var DiagnosticTag; -(function (DiagnosticTag) { - /** - * Unused or unnecessary code. - * - * Clients are allowed to render diagnostics with this tag faded out instead of having - * an error squiggle. - */ - DiagnosticTag.Unnecessary = 1; - /** - * Deprecated or obsolete code. - * - * Clients are allowed to rendered diagnostics with this tag strike through. - */ - DiagnosticTag.Deprecated = 2; -})(DiagnosticTag || (DiagnosticTag = {})); -/** - * The Diagnostic namespace provides helper functions to work with - * [Diagnostic](#Diagnostic) literals. - */ -var Diagnostic; -(function (Diagnostic) { - /** - * Creates a new Diagnostic literal. - */ - function create(range, message, severity, code, source, relatedInformation) { - var result = { range: range, message: message }; - if (Is.defined(severity)) { - result.severity = severity; - } - if (Is.defined(code)) { - result.code = code; - } - if (Is.defined(source)) { - result.source = source; - } - if (Is.defined(relatedInformation)) { - result.relatedInformation = relatedInformation; - } - return result; - } - Diagnostic.create = create; - /** - * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) - && Range.is(candidate.range) - && Is.string(candidate.message) - && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) - && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) - && (Is.string(candidate.source) || Is.undefined(candidate.source)) - && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is)); - } - Diagnostic.is = is; -})(Diagnostic || (Diagnostic = {})); -/** - * The Command namespace provides helper functions to work with - * [Command](#Command) literals. - */ -var Command; -(function (Command) { - /** - * Creates a new Command literal. - */ - function create(title, command) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - var result = { title: title, command: command }; - if (Is.defined(args) && args.length > 0) { - result.arguments = args; - } - return result; - } - Command.create = create; - /** - * Checks whether the given literal conforms to the [Command](#Command) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command); - } - Command.is = is; -})(Command || (Command = {})); -/** - * The TextEdit namespace provides helper function to create replace, - * insert and delete edits more easily. - */ -var TextEdit; -(function (TextEdit) { - /** - * Creates a replace text edit. - * @param range The range of text to be replaced. - * @param newText The new text. - */ - function replace(range, newText) { - return { range: range, newText: newText }; - } - TextEdit.replace = replace; - /** - * Creates a insert text edit. - * @param position The position to insert the text at. - * @param newText The text to be inserted. - */ - function insert(position, newText) { - return { range: { start: position, end: position }, newText: newText }; - } - TextEdit.insert = insert; - /** - * Creates a delete text edit. - * @param range The range of text to be deleted. - */ - function del(range) { - return { range: range, newText: '' }; - } - TextEdit.del = del; - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) - && Is.string(candidate.newText) - && Range.is(candidate.range); - } - TextEdit.is = is; -})(TextEdit || (TextEdit = {})); -/** - * The TextDocumentEdit namespace provides helper function to create - * an edit that manipulates a text document. - */ -var TextDocumentEdit; -(function (TextDocumentEdit) { - /** - * Creates a new `TextDocumentEdit` - */ - function create(textDocument, edits) { - return { textDocument: textDocument, edits: edits }; - } - TextDocumentEdit.create = create; - function is(value) { - var candidate = value; - return Is.defined(candidate) - && VersionedTextDocumentIdentifier.is(candidate.textDocument) - && Array.isArray(candidate.edits); - } - TextDocumentEdit.is = is; -})(TextDocumentEdit || (TextDocumentEdit = {})); -var CreateFile; -(function (CreateFile) { - function create(uri, options) { - var result = { - kind: 'create', - uri: uri - }; - if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { - result.options = options; - } - return result; - } - CreateFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && - (candidate.options === void 0 || - ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); - } - CreateFile.is = is; -})(CreateFile || (CreateFile = {})); -var RenameFile; -(function (RenameFile) { - function create(oldUri, newUri, options) { - var result = { - kind: 'rename', - oldUri: oldUri, - newUri: newUri - }; - if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { - result.options = options; - } - return result; - } - RenameFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && - (candidate.options === void 0 || - ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); - } - RenameFile.is = is; -})(RenameFile || (RenameFile = {})); -var DeleteFile; -(function (DeleteFile) { - function create(uri, options) { - var result = { - kind: 'delete', - uri: uri - }; - if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) { - result.options = options; - } - return result; - } - DeleteFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && - (candidate.options === void 0 || - ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists)))); - } - DeleteFile.is = is; -})(DeleteFile || (DeleteFile = {})); -var WorkspaceEdit; -(function (WorkspaceEdit) { - function is(value) { - var candidate = value; - return candidate && - (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && - (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) { - if (Is.string(change.kind)) { - return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change); - } - else { - return TextDocumentEdit.is(change); - } - })); - } - WorkspaceEdit.is = is; -})(WorkspaceEdit || (WorkspaceEdit = {})); -var TextEditChangeImpl = /** @class */ (function () { - function TextEditChangeImpl(edits) { - this.edits = edits; - } - TextEditChangeImpl.prototype.insert = function (position, newText) { - this.edits.push(TextEdit.insert(position, newText)); - }; - TextEditChangeImpl.prototype.replace = function (range, newText) { - this.edits.push(TextEdit.replace(range, newText)); - }; - TextEditChangeImpl.prototype.delete = function (range) { - this.edits.push(TextEdit.del(range)); - }; - TextEditChangeImpl.prototype.add = function (edit) { - this.edits.push(edit); - }; - TextEditChangeImpl.prototype.all = function () { - return this.edits; - }; - TextEditChangeImpl.prototype.clear = function () { - this.edits.splice(0, this.edits.length); - }; - return TextEditChangeImpl; -}()); -/** - * A workspace change helps constructing changes to a workspace. - */ -var WorkspaceChange = /** @class */ (function () { - function WorkspaceChange(workspaceEdit) { - var _this = this; - this._textEditChanges = Object.create(null); - if (workspaceEdit) { - this._workspaceEdit = workspaceEdit; - if (workspaceEdit.documentChanges) { - workspaceEdit.documentChanges.forEach(function (change) { - if (TextDocumentEdit.is(change)) { - var textEditChange = new TextEditChangeImpl(change.edits); - _this._textEditChanges[change.textDocument.uri] = textEditChange; - } - }); - } - else if (workspaceEdit.changes) { - Object.keys(workspaceEdit.changes).forEach(function (key) { - var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]); - _this._textEditChanges[key] = textEditChange; - }); - } - } - } - Object.defineProperty(WorkspaceChange.prototype, "edit", { - /** - * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal - * use to be returned from a workspace edit operation like rename. - */ - get: function () { - return this._workspaceEdit; - }, - enumerable: true, - configurable: true - }); - WorkspaceChange.prototype.getTextEditChange = function (key) { - if (VersionedTextDocumentIdentifier.is(key)) { - if (!this._workspaceEdit) { - this._workspaceEdit = { - documentChanges: [] - }; - } - if (!this._workspaceEdit.documentChanges) { - throw new Error('Workspace edit is not configured for document changes.'); - } - var textDocument = key; - var result = this._textEditChanges[textDocument.uri]; - if (!result) { - var edits = []; - var textDocumentEdit = { - textDocument: textDocument, - edits: edits - }; - this._workspaceEdit.documentChanges.push(textDocumentEdit); - result = new TextEditChangeImpl(edits); - this._textEditChanges[textDocument.uri] = result; - } - return result; - } - else { - if (!this._workspaceEdit) { - this._workspaceEdit = { - changes: Object.create(null) - }; - } - if (!this._workspaceEdit.changes) { - throw new Error('Workspace edit is not configured for normal text edit changes.'); - } - var result = this._textEditChanges[key]; - if (!result) { - var edits = []; - this._workspaceEdit.changes[key] = edits; - result = new TextEditChangeImpl(edits); - this._textEditChanges[key] = result; - } - return result; - } - }; - WorkspaceChange.prototype.createFile = function (uri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options)); - }; - WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options)); - }; - WorkspaceChange.prototype.deleteFile = function (uri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options)); - }; - WorkspaceChange.prototype.checkDocumentChanges = function () { - if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) { - throw new Error('Workspace edit is not configured for document changes.'); - } - }; - return WorkspaceChange; -}()); - -/** - * The TextDocumentIdentifier namespace provides helper functions to work with - * [TextDocumentIdentifier](#TextDocumentIdentifier) literals. - */ -var TextDocumentIdentifier; -(function (TextDocumentIdentifier) { - /** - * Creates a new TextDocumentIdentifier literal. - * @param uri The document's uri. - */ - function create(uri) { - return { uri: uri }; - } - TextDocumentIdentifier.create = create; - /** - * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri); - } - TextDocumentIdentifier.is = is; -})(TextDocumentIdentifier || (TextDocumentIdentifier = {})); -/** - * The VersionedTextDocumentIdentifier namespace provides helper functions to work with - * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals. - */ -var VersionedTextDocumentIdentifier; -(function (VersionedTextDocumentIdentifier) { - /** - * Creates a new VersionedTextDocumentIdentifier literal. - * @param uri The document's uri. - * @param uri The document's text. - */ - function create(uri, version) { - return { uri: uri, version: version }; - } - VersionedTextDocumentIdentifier.create = create; - /** - * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version)); - } - VersionedTextDocumentIdentifier.is = is; -})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {})); -/** - * The TextDocumentItem namespace provides helper functions to work with - * [TextDocumentItem](#TextDocumentItem) literals. - */ -var TextDocumentItem; -(function (TextDocumentItem) { - /** - * Creates a new TextDocumentItem literal. - * @param uri The document's uri. - * @param languageId The document's language identifier. - * @param version The document's version number. - * @param text The document's text. - */ - function create(uri, languageId, version, text) { - return { uri: uri, languageId: languageId, version: version, text: text }; - } - TextDocumentItem.create = create; - /** - * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text); - } - TextDocumentItem.is = is; -})(TextDocumentItem || (TextDocumentItem = {})); -/** - * Describes the content type that a client supports in various - * result literals like `Hover`, `ParameterInfo` or `CompletionItem`. - * - * Please note that `MarkupKinds` must not start with a `$`. This kinds - * are reserved for internal usage. - */ -var MarkupKind; -(function (MarkupKind) { - /** - * Plain text is supported as a content format - */ - MarkupKind.PlainText = 'plaintext'; - /** - * Markdown is supported as a content format - */ - MarkupKind.Markdown = 'markdown'; -})(MarkupKind || (MarkupKind = {})); -(function (MarkupKind) { - /** - * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type. - */ - function is(value) { - var candidate = value; - return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown; - } - MarkupKind.is = is; -})(MarkupKind || (MarkupKind = {})); -var MarkupContent; -(function (MarkupContent) { - /** - * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); - } - MarkupContent.is = is; -})(MarkupContent || (MarkupContent = {})); -/** - * The kind of a completion entry. - */ -var CompletionItemKind; -(function (CompletionItemKind) { - CompletionItemKind.Text = 1; - CompletionItemKind.Method = 2; - CompletionItemKind.Function = 3; - CompletionItemKind.Constructor = 4; - CompletionItemKind.Field = 5; - CompletionItemKind.Variable = 6; - CompletionItemKind.Class = 7; - CompletionItemKind.Interface = 8; - CompletionItemKind.Module = 9; - CompletionItemKind.Property = 10; - CompletionItemKind.Unit = 11; - CompletionItemKind.Value = 12; - CompletionItemKind.Enum = 13; - CompletionItemKind.Keyword = 14; - CompletionItemKind.Snippet = 15; - CompletionItemKind.Color = 16; - CompletionItemKind.File = 17; - CompletionItemKind.Reference = 18; - CompletionItemKind.Folder = 19; - CompletionItemKind.EnumMember = 20; - CompletionItemKind.Constant = 21; - CompletionItemKind.Struct = 22; - CompletionItemKind.Event = 23; - CompletionItemKind.Operator = 24; - CompletionItemKind.TypeParameter = 25; -})(CompletionItemKind || (CompletionItemKind = {})); -/** - * Defines whether the insert text in a completion item should be interpreted as - * plain text or a snippet. - */ -var InsertTextFormat; -(function (InsertTextFormat) { - /** - * The primary text to be inserted is treated as a plain string. - */ - InsertTextFormat.PlainText = 1; - /** - * The primary text to be inserted is treated as a snippet. - * - * A snippet can define tab stops and placeholders with `$1`, `$2` - * and `${3:foo}`. `$0` defines the final tab stop, it defaults to - * the end of the snippet. Placeholders with equal identifiers are linked, - * that is typing in one will update others too. - * - * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md - */ - InsertTextFormat.Snippet = 2; -})(InsertTextFormat || (InsertTextFormat = {})); -/** - * Completion item tags are extra annotations that tweak the rendering of a completion - * item. - * - * @since 3.15.0 - */ -var CompletionItemTag; -(function (CompletionItemTag) { - /** - * Render a completion as obsolete, usually using a strike-out. - */ - CompletionItemTag.Deprecated = 1; -})(CompletionItemTag || (CompletionItemTag = {})); -/** - * The CompletionItem namespace provides functions to deal with - * completion items. - */ -var CompletionItem; -(function (CompletionItem) { - /** - * Create a completion item and seed it with a label. - * @param label The completion item's label - */ - function create(label) { - return { label: label }; - } - CompletionItem.create = create; -})(CompletionItem || (CompletionItem = {})); -/** - * The CompletionList namespace provides functions to deal with - * completion lists. - */ -var CompletionList; -(function (CompletionList) { - /** - * Creates a new completion list. - * - * @param items The completion items. - * @param isIncomplete The list is not complete. - */ - function create(items, isIncomplete) { - return { items: items ? items : [], isIncomplete: !!isIncomplete }; - } - CompletionList.create = create; -})(CompletionList || (CompletionList = {})); -var MarkedString; -(function (MarkedString) { - /** - * Creates a marked string from plain text. - * - * @param plainText The plain text. - */ - function fromPlainText(plainText) { - return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash - } - MarkedString.fromPlainText = fromPlainText; - /** - * Checks whether the given value conforms to the [MarkedString](#MarkedString) type. - */ - function is(value) { - var candidate = value; - return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value)); - } - MarkedString.is = is; -})(MarkedString || (MarkedString = {})); -var Hover; -(function (Hover) { - /** - * Checks whether the given value conforms to the [Hover](#Hover) interface. - */ - function is(value) { - var candidate = value; - return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || - MarkedString.is(candidate.contents) || - Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range)); - } - Hover.is = is; -})(Hover || (Hover = {})); -/** - * The ParameterInformation namespace provides helper functions to work with - * [ParameterInformation](#ParameterInformation) literals. - */ -var ParameterInformation; -(function (ParameterInformation) { - /** - * Creates a new parameter information literal. - * - * @param label A label string. - * @param documentation A doc string. - */ - function create(label, documentation) { - return documentation ? { label: label, documentation: documentation } : { label: label }; - } - ParameterInformation.create = create; -})(ParameterInformation || (ParameterInformation = {})); -/** - * The SignatureInformation namespace provides helper functions to work with - * [SignatureInformation](#SignatureInformation) literals. - */ -var SignatureInformation; -(function (SignatureInformation) { - function create(label, documentation) { - var parameters = []; - for (var _i = 2; _i < arguments.length; _i++) { - parameters[_i - 2] = arguments[_i]; - } - var result = { label: label }; - if (Is.defined(documentation)) { - result.documentation = documentation; - } - if (Is.defined(parameters)) { - result.parameters = parameters; - } - else { - result.parameters = []; - } - return result; - } - SignatureInformation.create = create; -})(SignatureInformation || (SignatureInformation = {})); -/** - * A document highlight kind. - */ -var DocumentHighlightKind; -(function (DocumentHighlightKind) { - /** - * A textual occurrence. - */ - DocumentHighlightKind.Text = 1; - /** - * Read-access of a symbol, like reading a variable. - */ - DocumentHighlightKind.Read = 2; - /** - * Write-access of a symbol, like writing to a variable. - */ - DocumentHighlightKind.Write = 3; -})(DocumentHighlightKind || (DocumentHighlightKind = {})); -/** - * DocumentHighlight namespace to provide helper functions to work with - * [DocumentHighlight](#DocumentHighlight) literals. - */ -var DocumentHighlight; -(function (DocumentHighlight) { - /** - * Create a DocumentHighlight object. - * @param range The range the highlight applies to. - */ - function create(range, kind) { - var result = { range: range }; - if (Is.number(kind)) { - result.kind = kind; - } - return result; - } - DocumentHighlight.create = create; -})(DocumentHighlight || (DocumentHighlight = {})); -/** - * A symbol kind. - */ -var SymbolKind; -(function (SymbolKind) { - SymbolKind.File = 1; - SymbolKind.Module = 2; - SymbolKind.Namespace = 3; - SymbolKind.Package = 4; - SymbolKind.Class = 5; - SymbolKind.Method = 6; - SymbolKind.Property = 7; - SymbolKind.Field = 8; - SymbolKind.Constructor = 9; - SymbolKind.Enum = 10; - SymbolKind.Interface = 11; - SymbolKind.Function = 12; - SymbolKind.Variable = 13; - SymbolKind.Constant = 14; - SymbolKind.String = 15; - SymbolKind.Number = 16; - SymbolKind.Boolean = 17; - SymbolKind.Array = 18; - SymbolKind.Object = 19; - SymbolKind.Key = 20; - SymbolKind.Null = 21; - SymbolKind.EnumMember = 22; - SymbolKind.Struct = 23; - SymbolKind.Event = 24; - SymbolKind.Operator = 25; - SymbolKind.TypeParameter = 26; -})(SymbolKind || (SymbolKind = {})); -/** - * Symbol tags are extra annotations that tweak the rendering of a symbol. - * @since 3.15 - */ -var SymbolTag; -(function (SymbolTag) { - /** - * Render a symbol as obsolete, usually using a strike-out. - */ - SymbolTag.Deprecated = 1; -})(SymbolTag || (SymbolTag = {})); -var SymbolInformation; -(function (SymbolInformation) { - /** - * Creates a new symbol information literal. - * - * @param name The name of the symbol. - * @param kind The kind of the symbol. - * @param range The range of the location of the symbol. - * @param uri The resource of the location of symbol, defaults to the current document. - * @param containerName The name of the symbol containing the symbol. - */ - function create(name, kind, range, uri, containerName) { - var result = { - name: name, - kind: kind, - location: { uri: uri, range: range } - }; - if (containerName) { - result.containerName = containerName; - } - return result; - } - SymbolInformation.create = create; -})(SymbolInformation || (SymbolInformation = {})); -var DocumentSymbol; -(function (DocumentSymbol) { - /** - * Creates a new symbol information literal. - * - * @param name The name of the symbol. - * @param detail The detail of the symbol. - * @param kind The kind of the symbol. - * @param range The range of the symbol. - * @param selectionRange The selectionRange of the symbol. - * @param children Children of the symbol. - */ - function create(name, detail, kind, range, selectionRange, children) { - var result = { - name: name, - detail: detail, - kind: kind, - range: range, - selectionRange: selectionRange - }; - if (children !== void 0) { - result.children = children; - } - return result; - } - DocumentSymbol.create = create; - /** - * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface. - */ - function is(value) { - var candidate = value; - return candidate && - Is.string(candidate.name) && Is.number(candidate.kind) && - Range.is(candidate.range) && Range.is(candidate.selectionRange) && - (candidate.detail === void 0 || Is.string(candidate.detail)) && - (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && - (candidate.children === void 0 || Array.isArray(candidate.children)); - } - DocumentSymbol.is = is; -})(DocumentSymbol || (DocumentSymbol = {})); -/** - * A set of predefined code action kinds - */ -var CodeActionKind; -(function (CodeActionKind) { - /** - * Empty kind. - */ - CodeActionKind.Empty = ''; - /** - * Base kind for quickfix actions: 'quickfix' - */ - CodeActionKind.QuickFix = 'quickfix'; - /** - * Base kind for refactoring actions: 'refactor' - */ - CodeActionKind.Refactor = 'refactor'; - /** - * Base kind for refactoring extraction actions: 'refactor.extract' - * - * Example extract actions: - * - * - Extract method - * - Extract function - * - Extract variable - * - Extract interface from class - * - ... - */ - CodeActionKind.RefactorExtract = 'refactor.extract'; - /** - * Base kind for refactoring inline actions: 'refactor.inline' - * - * Example inline actions: - * - * - Inline function - * - Inline variable - * - Inline constant - * - ... - */ - CodeActionKind.RefactorInline = 'refactor.inline'; - /** - * Base kind for refactoring rewrite actions: 'refactor.rewrite' - * - * Example rewrite actions: - * - * - Convert JavaScript function to class - * - Add or remove parameter - * - Encapsulate field - * - Make method static - * - Move method to base class - * - ... - */ - CodeActionKind.RefactorRewrite = 'refactor.rewrite'; - /** - * Base kind for source actions: `source` - * - * Source code actions apply to the entire file. - */ - CodeActionKind.Source = 'source'; - /** - * Base kind for an organize imports source action: `source.organizeImports` - */ - CodeActionKind.SourceOrganizeImports = 'source.organizeImports'; - /** - * Base kind for auto-fix source actions: `source.fixAll`. - * - * Fix all actions automatically fix errors that have a clear fix that do not require user input. - * They should not suppress errors or perform unsafe fixes such as generating new types or classes. - * - * @since 3.15.0 - */ - CodeActionKind.SourceFixAll = 'source.fixAll'; -})(CodeActionKind || (CodeActionKind = {})); -/** - * The CodeActionContext namespace provides helper functions to work with - * [CodeActionContext](#CodeActionContext) literals. - */ -var CodeActionContext; -(function (CodeActionContext) { - /** - * Creates a new CodeActionContext literal. - */ - function create(diagnostics, only) { - var result = { diagnostics: diagnostics }; - if (only !== void 0 && only !== null) { - result.only = only; - } - return result; - } - CodeActionContext.create = create; - /** - * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)); - } - CodeActionContext.is = is; -})(CodeActionContext || (CodeActionContext = {})); -var CodeAction; -(function (CodeAction) { - function create(title, commandOrEdit, kind) { - var result = { title: title }; - if (Command.is(commandOrEdit)) { - result.command = commandOrEdit; - } - else { - result.edit = commandOrEdit; - } - if (kind !== void 0) { - result.kind = kind; - } - return result; - } - CodeAction.create = create; - function is(value) { - var candidate = value; - return candidate && Is.string(candidate.title) && - (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && - (candidate.kind === void 0 || Is.string(candidate.kind)) && - (candidate.edit !== void 0 || candidate.command !== void 0) && - (candidate.command === void 0 || Command.is(candidate.command)) && - (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && - (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit)); - } - CodeAction.is = is; -})(CodeAction || (CodeAction = {})); -/** - * The CodeLens namespace provides helper functions to work with - * [CodeLens](#CodeLens) literals. - */ -var CodeLens; -(function (CodeLens) { - /** - * Creates a new CodeLens literal. - */ - function create(range, data) { - var result = { range: range }; - if (Is.defined(data)) { - result.data = data; - } - return result; - } - CodeLens.create = create; - /** - * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); - } - CodeLens.is = is; -})(CodeLens || (CodeLens = {})); -/** - * The FormattingOptions namespace provides helper functions to work with - * [FormattingOptions](#FormattingOptions) literals. - */ -var FormattingOptions; -(function (FormattingOptions) { - /** - * Creates a new FormattingOptions literal. - */ - function create(tabSize, insertSpaces) { - return { tabSize: tabSize, insertSpaces: insertSpaces }; - } - FormattingOptions.create = create; - /** - * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces); - } - FormattingOptions.is = is; -})(FormattingOptions || (FormattingOptions = {})); -/** - * The DocumentLink namespace provides helper functions to work with - * [DocumentLink](#DocumentLink) literals. - */ -var DocumentLink; -(function (DocumentLink) { - /** - * Creates a new DocumentLink literal. - */ - function create(range, target, data) { - return { range: range, target: target, data: data }; - } - DocumentLink.create = create; - /** - * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); - } - DocumentLink.is = is; -})(DocumentLink || (DocumentLink = {})); -/** - * The SelectionRange namespace provides helper function to work with - * SelectionRange literals. - */ -var SelectionRange; -(function (SelectionRange) { - /** - * Creates a new SelectionRange - * @param range the range. - * @param parent an optional parent. - */ - function create(range, parent) { - return { range: range, parent: parent }; - } - SelectionRange.create = create; - function is(value) { - var candidate = value; - return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent)); - } - SelectionRange.is = is; -})(SelectionRange || (SelectionRange = {})); -var EOL = ['\n', '\r\n', '\r']; -/** - * @deprecated Use the text document from the new vscode-languageserver-textdocument package. - */ -var TextDocument; -(function (TextDocument) { - /** - * Creates a new ITextDocument literal from the given uri and content. - * @param uri The document's uri. - * @param languageId The document's language Id. - * @param content The document's content. - */ - function create(uri, languageId, version, content) { - return new FullTextDocument(uri, languageId, version, content); - } - TextDocument.create = create; - /** - * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount) - && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; - } - TextDocument.is = is; - function applyEdits(document, edits) { - var text = document.getText(); - var sortedEdits = mergeSort(edits, function (a, b) { - var diff = a.range.start.line - b.range.start.line; - if (diff === 0) { - return a.range.start.character - b.range.start.character; - } - return diff; - }); - var lastModifiedOffset = text.length; - for (var i = sortedEdits.length - 1; i >= 0; i--) { - var e = sortedEdits[i]; - var startOffset = document.offsetAt(e.range.start); - var endOffset = document.offsetAt(e.range.end); - if (endOffset <= lastModifiedOffset) { - text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); - } - else { - throw new Error('Overlapping edit'); - } - lastModifiedOffset = startOffset; - } - return text; - } - TextDocument.applyEdits = applyEdits; - function mergeSort(data, compare) { - if (data.length <= 1) { - // sorted - return data; - } - var p = (data.length / 2) | 0; - var left = data.slice(0, p); - var right = data.slice(p); - mergeSort(left, compare); - mergeSort(right, compare); - var leftIdx = 0; - var rightIdx = 0; - var i = 0; - while (leftIdx < left.length && rightIdx < right.length) { - var ret = compare(left[leftIdx], right[rightIdx]); - if (ret <= 0) { - // smaller_equal -> take left to preserve order - data[i++] = left[leftIdx++]; - } - else { - // greater -> take right - data[i++] = right[rightIdx++]; - } - } - while (leftIdx < left.length) { - data[i++] = left[leftIdx++]; - } - while (rightIdx < right.length) { - data[i++] = right[rightIdx++]; - } - return data; - } -})(TextDocument || (TextDocument = {})); -var FullTextDocument = /** @class */ (function () { - function FullTextDocument(uri, languageId, version, content) { - this._uri = uri; - this._languageId = languageId; - this._version = version; - this._content = content; - this._lineOffsets = undefined; - } - Object.defineProperty(FullTextDocument.prototype, "uri", { - get: function () { - return this._uri; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "languageId", { - get: function () { - return this._languageId; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "version", { - get: function () { - return this._version; - }, - enumerable: true, - configurable: true - }); - FullTextDocument.prototype.getText = function (range) { - if (range) { - var start = this.offsetAt(range.start); - var end = this.offsetAt(range.end); - return this._content.substring(start, end); - } - return this._content; - }; - FullTextDocument.prototype.update = function (event, version) { - this._content = event.text; - this._version = version; - this._lineOffsets = undefined; - }; - FullTextDocument.prototype.getLineOffsets = function () { - if (this._lineOffsets === undefined) { - var lineOffsets = []; - var text = this._content; - var isLineStart = true; - for (var i = 0; i < text.length; i++) { - if (isLineStart) { - lineOffsets.push(i); - isLineStart = false; - } - var ch = text.charAt(i); - isLineStart = (ch === '\r' || ch === '\n'); - if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') { - i++; - } - } - if (isLineStart && text.length > 0) { - lineOffsets.push(text.length); - } - this._lineOffsets = lineOffsets; - } - return this._lineOffsets; - }; - FullTextDocument.prototype.positionAt = function (offset) { - offset = Math.max(Math.min(offset, this._content.length), 0); - var lineOffsets = this.getLineOffsets(); - var low = 0, high = lineOffsets.length; - if (high === 0) { - return Position.create(0, offset); - } - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (lineOffsets[mid] > offset) { - high = mid; - } - else { - low = mid + 1; - } - } - // low is the least x for which the line offset is larger than the current offset - // or array.length if no line offset is larger than the current offset - var line = low - 1; - return Position.create(line, offset - lineOffsets[line]); - }; - FullTextDocument.prototype.offsetAt = function (position) { - var lineOffsets = this.getLineOffsets(); - if (position.line >= lineOffsets.length) { - return this._content.length; - } - else if (position.line < 0) { - return 0; - } - var lineOffset = lineOffsets[position.line]; - var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; - return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); - }; - Object.defineProperty(FullTextDocument.prototype, "lineCount", { - get: function () { - return this.getLineOffsets().length; - }, - enumerable: true, - configurable: true - }); - return FullTextDocument; -}()); -var Is; -(function (Is) { - var toString = Object.prototype.toString; - function defined(value) { - return typeof value !== 'undefined'; - } - Is.defined = defined; - function undefined(value) { - return typeof value === 'undefined'; - } - Is.undefined = undefined; - function boolean(value) { - return value === true || value === false; - } - Is.boolean = boolean; - function string(value) { - return toString.call(value) === '[object String]'; - } - Is.string = string; - function number(value) { - return toString.call(value) === '[object Number]'; - } - Is.number = number; - function func(value) { - return toString.call(value) === '[object Function]'; - } - Is.func = func; - function objectLiteral(value) { - // Strictly speaking class instances pass this check as well. Since the LSP - // doesn't use classes we ignore this for now. If we do we need to add something - // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null` - return value !== null && typeof value === 'object'; - } - Is.objectLiteral = objectLiteral; - function typedArray(value, check) { - return Array.isArray(value) && value.every(check); - } - Is.typedArray = typedArray; -})(Is || (Is = {})); +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + +/** + * The Position namespace provides helper functions to work with + * [Position](#Position) literals. + */ +var Position; +(function (Position) { + /** + * Creates a new Position literal from the given line and character. + * @param line The position's line. + * @param character The position's character. + */ + function create(line, character) { + return { line: line, character: character }; + } + Position.create = create; + /** + * Checks whether the given liternal conforms to the [Position](#Position) interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character); + } + Position.is = is; +})(Position || (Position = {})); +/** + * The Range namespace provides helper functions to work with + * [Range](#Range) literals. + */ +var Range; +(function (Range) { + function create(one, two, three, four) { + if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) { + return { start: Position.create(one, two), end: Position.create(three, four) }; + } + else if (Position.is(one) && Position.is(two)) { + return { start: one, end: two }; + } + else { + throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]"); + } + } + Range.create = create; + /** + * Checks whether the given literal conforms to the [Range](#Range) interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); + } + Range.is = is; +})(Range || (Range = {})); +/** + * The Location namespace provides helper functions to work with + * [Location](#Location) literals. + */ +var Location; +(function (Location) { + /** + * Creates a Location literal. + * @param uri The location's uri. + * @param range The location's range. + */ + function create(uri, range) { + return { uri: uri, range: range }; + } + Location.create = create; + /** + * Checks whether the given literal conforms to the [Location](#Location) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); + } + Location.is = is; +})(Location || (Location = {})); +/** + * The LocationLink namespace provides helper functions to work with + * [LocationLink](#LocationLink) literals. + */ +var LocationLink; +(function (LocationLink) { + /** + * Creates a LocationLink literal. + * @param targetUri The definition's uri. + * @param targetRange The full range of the definition. + * @param targetSelectionRange The span of the symbol definition at the target. + * @param originSelectionRange The span of the symbol being defined in the originating source file. + */ + function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) { + return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange }; + } + LocationLink.create = create; + /** + * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) + && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) + && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); + } + LocationLink.is = is; +})(LocationLink || (LocationLink = {})); +/** + * The Color namespace provides helper functions to work with + * [Color](#Color) literals. + */ +var Color; +(function (Color) { + /** + * Creates a new Color literal. + */ + function create(red, green, blue, alpha) { + return { + red: red, + green: green, + blue: blue, + alpha: alpha, + }; + } + Color.create = create; + /** + * Checks whether the given literal conforms to the [Color](#Color) interface. + */ + function is(value) { + var candidate = value; + return Is.number(candidate.red) + && Is.number(candidate.green) + && Is.number(candidate.blue) + && Is.number(candidate.alpha); + } + Color.is = is; +})(Color || (Color = {})); +/** + * The ColorInformation namespace provides helper functions to work with + * [ColorInformation](#ColorInformation) literals. + */ +var ColorInformation; +(function (ColorInformation) { + /** + * Creates a new ColorInformation literal. + */ + function create(range, color) { + return { + range: range, + color: color, + }; + } + ColorInformation.create = create; + /** + * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. + */ + function is(value) { + var candidate = value; + return Range.is(candidate.range) && Color.is(candidate.color); + } + ColorInformation.is = is; +})(ColorInformation || (ColorInformation = {})); +/** + * The Color namespace provides helper functions to work with + * [ColorPresentation](#ColorPresentation) literals. + */ +var ColorPresentation; +(function (ColorPresentation) { + /** + * Creates a new ColorInformation literal. + */ + function create(label, textEdit, additionalTextEdits) { + return { + label: label, + textEdit: textEdit, + additionalTextEdits: additionalTextEdits, + }; + } + ColorPresentation.create = create; + /** + * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. + */ + function is(value) { + var candidate = value; + return Is.string(candidate.label) + && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) + && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is)); + } + ColorPresentation.is = is; +})(ColorPresentation || (ColorPresentation = {})); +/** + * Enum of known range kinds + */ +var FoldingRangeKind; +(function (FoldingRangeKind) { + /** + * Folding range for a comment + */ + FoldingRangeKind["Comment"] = "comment"; + /** + * Folding range for a imports or includes + */ + FoldingRangeKind["Imports"] = "imports"; + /** + * Folding range for a region (e.g. `#region`) + */ + FoldingRangeKind["Region"] = "region"; +})(FoldingRangeKind || (FoldingRangeKind = {})); +/** + * The folding range namespace provides helper functions to work with + * [FoldingRange](#FoldingRange) literals. + */ +var FoldingRange; +(function (FoldingRange) { + /** + * Creates a new FoldingRange literal. + */ + function create(startLine, endLine, startCharacter, endCharacter, kind) { + var result = { + startLine: startLine, + endLine: endLine + }; + if (Is.defined(startCharacter)) { + result.startCharacter = startCharacter; + } + if (Is.defined(endCharacter)) { + result.endCharacter = endCharacter; + } + if (Is.defined(kind)) { + result.kind = kind; + } + return result; + } + FoldingRange.create = create; + /** + * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface. + */ + function is(value) { + var candidate = value; + return Is.number(candidate.startLine) && Is.number(candidate.startLine) + && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter)) + && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter)) + && (Is.undefined(candidate.kind) || Is.string(candidate.kind)); + } + FoldingRange.is = is; +})(FoldingRange || (FoldingRange = {})); +/** + * The DiagnosticRelatedInformation namespace provides helper functions to work with + * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals. + */ +var DiagnosticRelatedInformation; +(function (DiagnosticRelatedInformation) { + /** + * Creates a new DiagnosticRelatedInformation literal. + */ + function create(location, message) { + return { + location: location, + message: message + }; + } + DiagnosticRelatedInformation.create = create; + /** + * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message); + } + DiagnosticRelatedInformation.is = is; +})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {})); +/** + * The diagnostic's severity. + */ +var DiagnosticSeverity; +(function (DiagnosticSeverity) { + /** + * Reports an error. + */ + DiagnosticSeverity.Error = 1; + /** + * Reports a warning. + */ + DiagnosticSeverity.Warning = 2; + /** + * Reports an information. + */ + DiagnosticSeverity.Information = 3; + /** + * Reports a hint. + */ + DiagnosticSeverity.Hint = 4; +})(DiagnosticSeverity || (DiagnosticSeverity = {})); +/** + * The diagnostic tags. + * + * @since 3.15.0 + */ +var DiagnosticTag; +(function (DiagnosticTag) { + /** + * Unused or unnecessary code. + * + * Clients are allowed to render diagnostics with this tag faded out instead of having + * an error squiggle. + */ + DiagnosticTag.Unnecessary = 1; + /** + * Deprecated or obsolete code. + * + * Clients are allowed to rendered diagnostics with this tag strike through. + */ + DiagnosticTag.Deprecated = 2; +})(DiagnosticTag || (DiagnosticTag = {})); +/** + * The Diagnostic namespace provides helper functions to work with + * [Diagnostic](#Diagnostic) literals. + */ +var Diagnostic; +(function (Diagnostic) { + /** + * Creates a new Diagnostic literal. + */ + function create(range, message, severity, code, source, relatedInformation) { + var result = { range: range, message: message }; + if (Is.defined(severity)) { + result.severity = severity; + } + if (Is.defined(code)) { + result.code = code; + } + if (Is.defined(source)) { + result.source = source; + } + if (Is.defined(relatedInformation)) { + result.relatedInformation = relatedInformation; + } + return result; + } + Diagnostic.create = create; + /** + * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) + && Range.is(candidate.range) + && Is.string(candidate.message) + && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) + && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) + && (Is.string(candidate.source) || Is.undefined(candidate.source)) + && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is)); + } + Diagnostic.is = is; +})(Diagnostic || (Diagnostic = {})); +/** + * The Command namespace provides helper functions to work with + * [Command](#Command) literals. + */ +var Command; +(function (Command) { + /** + * Creates a new Command literal. + */ + function create(title, command) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + var result = { title: title, command: command }; + if (Is.defined(args) && args.length > 0) { + result.arguments = args; + } + return result; + } + Command.create = create; + /** + * Checks whether the given literal conforms to the [Command](#Command) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command); + } + Command.is = is; +})(Command || (Command = {})); +/** + * The TextEdit namespace provides helper function to create replace, + * insert and delete edits more easily. + */ +var TextEdit; +(function (TextEdit) { + /** + * Creates a replace text edit. + * @param range The range of text to be replaced. + * @param newText The new text. + */ + function replace(range, newText) { + return { range: range, newText: newText }; + } + TextEdit.replace = replace; + /** + * Creates a insert text edit. + * @param position The position to insert the text at. + * @param newText The text to be inserted. + */ + function insert(position, newText) { + return { range: { start: position, end: position }, newText: newText }; + } + TextEdit.insert = insert; + /** + * Creates a delete text edit. + * @param range The range of text to be deleted. + */ + function del(range) { + return { range: range, newText: '' }; + } + TextEdit.del = del; + function is(value) { + var candidate = value; + return Is.objectLiteral(candidate) + && Is.string(candidate.newText) + && Range.is(candidate.range); + } + TextEdit.is = is; +})(TextEdit || (TextEdit = {})); +/** + * The TextDocumentEdit namespace provides helper function to create + * an edit that manipulates a text document. + */ +var TextDocumentEdit; +(function (TextDocumentEdit) { + /** + * Creates a new `TextDocumentEdit` + */ + function create(textDocument, edits) { + return { textDocument: textDocument, edits: edits }; + } + TextDocumentEdit.create = create; + function is(value) { + var candidate = value; + return Is.defined(candidate) + && VersionedTextDocumentIdentifier.is(candidate.textDocument) + && Array.isArray(candidate.edits); + } + TextDocumentEdit.is = is; +})(TextDocumentEdit || (TextDocumentEdit = {})); +var CreateFile; +(function (CreateFile) { + function create(uri, options) { + var result = { + kind: 'create', + uri: uri + }; + if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { + result.options = options; + } + return result; + } + CreateFile.create = create; + function is(value) { + var candidate = value; + return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && + (candidate.options === void 0 || + ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); + } + CreateFile.is = is; +})(CreateFile || (CreateFile = {})); +var RenameFile; +(function (RenameFile) { + function create(oldUri, newUri, options) { + var result = { + kind: 'rename', + oldUri: oldUri, + newUri: newUri + }; + if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { + result.options = options; + } + return result; + } + RenameFile.create = create; + function is(value) { + var candidate = value; + return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && + (candidate.options === void 0 || + ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); + } + RenameFile.is = is; +})(RenameFile || (RenameFile = {})); +var DeleteFile; +(function (DeleteFile) { + function create(uri, options) { + var result = { + kind: 'delete', + uri: uri + }; + if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) { + result.options = options; + } + return result; + } + DeleteFile.create = create; + function is(value) { + var candidate = value; + return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && + (candidate.options === void 0 || + ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists)))); + } + DeleteFile.is = is; +})(DeleteFile || (DeleteFile = {})); +var WorkspaceEdit; +(function (WorkspaceEdit) { + function is(value) { + var candidate = value; + return candidate && + (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && + (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) { + if (Is.string(change.kind)) { + return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change); + } + else { + return TextDocumentEdit.is(change); + } + })); + } + WorkspaceEdit.is = is; +})(WorkspaceEdit || (WorkspaceEdit = {})); +var TextEditChangeImpl = /** @class */ (function () { + function TextEditChangeImpl(edits) { + this.edits = edits; + } + TextEditChangeImpl.prototype.insert = function (position, newText) { + this.edits.push(TextEdit.insert(position, newText)); + }; + TextEditChangeImpl.prototype.replace = function (range, newText) { + this.edits.push(TextEdit.replace(range, newText)); + }; + TextEditChangeImpl.prototype.delete = function (range) { + this.edits.push(TextEdit.del(range)); + }; + TextEditChangeImpl.prototype.add = function (edit) { + this.edits.push(edit); + }; + TextEditChangeImpl.prototype.all = function () { + return this.edits; + }; + TextEditChangeImpl.prototype.clear = function () { + this.edits.splice(0, this.edits.length); + }; + return TextEditChangeImpl; +}()); +/** + * A workspace change helps constructing changes to a workspace. + */ +var WorkspaceChange = /** @class */ (function () { + function WorkspaceChange(workspaceEdit) { + var _this = this; + this._textEditChanges = Object.create(null); + if (workspaceEdit) { + this._workspaceEdit = workspaceEdit; + if (workspaceEdit.documentChanges) { + workspaceEdit.documentChanges.forEach(function (change) { + if (TextDocumentEdit.is(change)) { + var textEditChange = new TextEditChangeImpl(change.edits); + _this._textEditChanges[change.textDocument.uri] = textEditChange; + } + }); + } + else if (workspaceEdit.changes) { + Object.keys(workspaceEdit.changes).forEach(function (key) { + var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]); + _this._textEditChanges[key] = textEditChange; + }); + } + } + } + Object.defineProperty(WorkspaceChange.prototype, "edit", { + /** + * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal + * use to be returned from a workspace edit operation like rename. + */ + get: function () { + return this._workspaceEdit; + }, + enumerable: true, + configurable: true + }); + WorkspaceChange.prototype.getTextEditChange = function (key) { + if (VersionedTextDocumentIdentifier.is(key)) { + if (!this._workspaceEdit) { + this._workspaceEdit = { + documentChanges: [] + }; + } + if (!this._workspaceEdit.documentChanges) { + throw new Error('Workspace edit is not configured for document changes.'); + } + var textDocument = key; + var result = this._textEditChanges[textDocument.uri]; + if (!result) { + var edits = []; + var textDocumentEdit = { + textDocument: textDocument, + edits: edits + }; + this._workspaceEdit.documentChanges.push(textDocumentEdit); + result = new TextEditChangeImpl(edits); + this._textEditChanges[textDocument.uri] = result; + } + return result; + } + else { + if (!this._workspaceEdit) { + this._workspaceEdit = { + changes: Object.create(null) + }; + } + if (!this._workspaceEdit.changes) { + throw new Error('Workspace edit is not configured for normal text edit changes.'); + } + var result = this._textEditChanges[key]; + if (!result) { + var edits = []; + this._workspaceEdit.changes[key] = edits; + result = new TextEditChangeImpl(edits); + this._textEditChanges[key] = result; + } + return result; + } + }; + WorkspaceChange.prototype.createFile = function (uri, options) { + this.checkDocumentChanges(); + this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options)); + }; + WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) { + this.checkDocumentChanges(); + this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options)); + }; + WorkspaceChange.prototype.deleteFile = function (uri, options) { + this.checkDocumentChanges(); + this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options)); + }; + WorkspaceChange.prototype.checkDocumentChanges = function () { + if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) { + throw new Error('Workspace edit is not configured for document changes.'); + } + }; + return WorkspaceChange; +}()); + +/** + * The TextDocumentIdentifier namespace provides helper functions to work with + * [TextDocumentIdentifier](#TextDocumentIdentifier) literals. + */ +var TextDocumentIdentifier; +(function (TextDocumentIdentifier) { + /** + * Creates a new TextDocumentIdentifier literal. + * @param uri The document's uri. + */ + function create(uri) { + return { uri: uri }; + } + TextDocumentIdentifier.create = create; + /** + * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri); + } + TextDocumentIdentifier.is = is; +})(TextDocumentIdentifier || (TextDocumentIdentifier = {})); +/** + * The VersionedTextDocumentIdentifier namespace provides helper functions to work with + * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals. + */ +var VersionedTextDocumentIdentifier; +(function (VersionedTextDocumentIdentifier) { + /** + * Creates a new VersionedTextDocumentIdentifier literal. + * @param uri The document's uri. + * @param uri The document's text. + */ + function create(uri, version) { + return { uri: uri, version: version }; + } + VersionedTextDocumentIdentifier.create = create; + /** + * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version)); + } + VersionedTextDocumentIdentifier.is = is; +})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {})); +/** + * The TextDocumentItem namespace provides helper functions to work with + * [TextDocumentItem](#TextDocumentItem) literals. + */ +var TextDocumentItem; +(function (TextDocumentItem) { + /** + * Creates a new TextDocumentItem literal. + * @param uri The document's uri. + * @param languageId The document's language identifier. + * @param version The document's version number. + * @param text The document's text. + */ + function create(uri, languageId, version, text) { + return { uri: uri, languageId: languageId, version: version, text: text }; + } + TextDocumentItem.create = create; + /** + * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text); + } + TextDocumentItem.is = is; +})(TextDocumentItem || (TextDocumentItem = {})); +/** + * Describes the content type that a client supports in various + * result literals like `Hover`, `ParameterInfo` or `CompletionItem`. + * + * Please note that `MarkupKinds` must not start with a `$`. This kinds + * are reserved for internal usage. + */ +var MarkupKind; +(function (MarkupKind) { + /** + * Plain text is supported as a content format + */ + MarkupKind.PlainText = 'plaintext'; + /** + * Markdown is supported as a content format + */ + MarkupKind.Markdown = 'markdown'; +})(MarkupKind || (MarkupKind = {})); +(function (MarkupKind) { + /** + * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type. + */ + function is(value) { + var candidate = value; + return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown; + } + MarkupKind.is = is; +})(MarkupKind || (MarkupKind = {})); +var MarkupContent; +(function (MarkupContent) { + /** + * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface. + */ + function is(value) { + var candidate = value; + return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); + } + MarkupContent.is = is; +})(MarkupContent || (MarkupContent = {})); +/** + * The kind of a completion entry. + */ +var CompletionItemKind; +(function (CompletionItemKind) { + CompletionItemKind.Text = 1; + CompletionItemKind.Method = 2; + CompletionItemKind.Function = 3; + CompletionItemKind.Constructor = 4; + CompletionItemKind.Field = 5; + CompletionItemKind.Variable = 6; + CompletionItemKind.Class = 7; + CompletionItemKind.Interface = 8; + CompletionItemKind.Module = 9; + CompletionItemKind.Property = 10; + CompletionItemKind.Unit = 11; + CompletionItemKind.Value = 12; + CompletionItemKind.Enum = 13; + CompletionItemKind.Keyword = 14; + CompletionItemKind.Snippet = 15; + CompletionItemKind.Color = 16; + CompletionItemKind.File = 17; + CompletionItemKind.Reference = 18; + CompletionItemKind.Folder = 19; + CompletionItemKind.EnumMember = 20; + CompletionItemKind.Constant = 21; + CompletionItemKind.Struct = 22; + CompletionItemKind.Event = 23; + CompletionItemKind.Operator = 24; + CompletionItemKind.TypeParameter = 25; +})(CompletionItemKind || (CompletionItemKind = {})); +/** + * Defines whether the insert text in a completion item should be interpreted as + * plain text or a snippet. + */ +var InsertTextFormat; +(function (InsertTextFormat) { + /** + * The primary text to be inserted is treated as a plain string. + */ + InsertTextFormat.PlainText = 1; + /** + * The primary text to be inserted is treated as a snippet. + * + * A snippet can define tab stops and placeholders with `$1`, `$2` + * and `${3:foo}`. `$0` defines the final tab stop, it defaults to + * the end of the snippet. Placeholders with equal identifiers are linked, + * that is typing in one will update others too. + * + * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md + */ + InsertTextFormat.Snippet = 2; +})(InsertTextFormat || (InsertTextFormat = {})); +/** + * Completion item tags are extra annotations that tweak the rendering of a completion + * item. + * + * @since 3.15.0 + */ +var CompletionItemTag; +(function (CompletionItemTag) { + /** + * Render a completion as obsolete, usually using a strike-out. + */ + CompletionItemTag.Deprecated = 1; +})(CompletionItemTag || (CompletionItemTag = {})); +/** + * The CompletionItem namespace provides functions to deal with + * completion items. + */ +var CompletionItem; +(function (CompletionItem) { + /** + * Create a completion item and seed it with a label. + * @param label The completion item's label + */ + function create(label) { + return { label: label }; + } + CompletionItem.create = create; +})(CompletionItem || (CompletionItem = {})); +/** + * The CompletionList namespace provides functions to deal with + * completion lists. + */ +var CompletionList; +(function (CompletionList) { + /** + * Creates a new completion list. + * + * @param items The completion items. + * @param isIncomplete The list is not complete. + */ + function create(items, isIncomplete) { + return { items: items ? items : [], isIncomplete: !!isIncomplete }; + } + CompletionList.create = create; +})(CompletionList || (CompletionList = {})); +var MarkedString; +(function (MarkedString) { + /** + * Creates a marked string from plain text. + * + * @param plainText The plain text. + */ + function fromPlainText(plainText) { + return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash + } + MarkedString.fromPlainText = fromPlainText; + /** + * Checks whether the given value conforms to the [MarkedString](#MarkedString) type. + */ + function is(value) { + var candidate = value; + return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value)); + } + MarkedString.is = is; +})(MarkedString || (MarkedString = {})); +var Hover; +(function (Hover) { + /** + * Checks whether the given value conforms to the [Hover](#Hover) interface. + */ + function is(value) { + var candidate = value; + return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || + MarkedString.is(candidate.contents) || + Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range)); + } + Hover.is = is; +})(Hover || (Hover = {})); +/** + * The ParameterInformation namespace provides helper functions to work with + * [ParameterInformation](#ParameterInformation) literals. + */ +var ParameterInformation; +(function (ParameterInformation) { + /** + * Creates a new parameter information literal. + * + * @param label A label string. + * @param documentation A doc string. + */ + function create(label, documentation) { + return documentation ? { label: label, documentation: documentation } : { label: label }; + } + ParameterInformation.create = create; +})(ParameterInformation || (ParameterInformation = {})); +/** + * The SignatureInformation namespace provides helper functions to work with + * [SignatureInformation](#SignatureInformation) literals. + */ +var SignatureInformation; +(function (SignatureInformation) { + function create(label, documentation) { + var parameters = []; + for (var _i = 2; _i < arguments.length; _i++) { + parameters[_i - 2] = arguments[_i]; + } + var result = { label: label }; + if (Is.defined(documentation)) { + result.documentation = documentation; + } + if (Is.defined(parameters)) { + result.parameters = parameters; + } + else { + result.parameters = []; + } + return result; + } + SignatureInformation.create = create; +})(SignatureInformation || (SignatureInformation = {})); +/** + * A document highlight kind. + */ +var DocumentHighlightKind; +(function (DocumentHighlightKind) { + /** + * A textual occurrence. + */ + DocumentHighlightKind.Text = 1; + /** + * Read-access of a symbol, like reading a variable. + */ + DocumentHighlightKind.Read = 2; + /** + * Write-access of a symbol, like writing to a variable. + */ + DocumentHighlightKind.Write = 3; +})(DocumentHighlightKind || (DocumentHighlightKind = {})); +/** + * DocumentHighlight namespace to provide helper functions to work with + * [DocumentHighlight](#DocumentHighlight) literals. + */ +var DocumentHighlight; +(function (DocumentHighlight) { + /** + * Create a DocumentHighlight object. + * @param range The range the highlight applies to. + */ + function create(range, kind) { + var result = { range: range }; + if (Is.number(kind)) { + result.kind = kind; + } + return result; + } + DocumentHighlight.create = create; +})(DocumentHighlight || (DocumentHighlight = {})); +/** + * A symbol kind. + */ +var SymbolKind; +(function (SymbolKind) { + SymbolKind.File = 1; + SymbolKind.Module = 2; + SymbolKind.Namespace = 3; + SymbolKind.Package = 4; + SymbolKind.Class = 5; + SymbolKind.Method = 6; + SymbolKind.Property = 7; + SymbolKind.Field = 8; + SymbolKind.Constructor = 9; + SymbolKind.Enum = 10; + SymbolKind.Interface = 11; + SymbolKind.Function = 12; + SymbolKind.Variable = 13; + SymbolKind.Constant = 14; + SymbolKind.String = 15; + SymbolKind.Number = 16; + SymbolKind.Boolean = 17; + SymbolKind.Array = 18; + SymbolKind.Object = 19; + SymbolKind.Key = 20; + SymbolKind.Null = 21; + SymbolKind.EnumMember = 22; + SymbolKind.Struct = 23; + SymbolKind.Event = 24; + SymbolKind.Operator = 25; + SymbolKind.TypeParameter = 26; +})(SymbolKind || (SymbolKind = {})); +/** + * Symbol tags are extra annotations that tweak the rendering of a symbol. + * @since 3.15 + */ +var SymbolTag; +(function (SymbolTag) { + /** + * Render a symbol as obsolete, usually using a strike-out. + */ + SymbolTag.Deprecated = 1; +})(SymbolTag || (SymbolTag = {})); +var SymbolInformation; +(function (SymbolInformation) { + /** + * Creates a new symbol information literal. + * + * @param name The name of the symbol. + * @param kind The kind of the symbol. + * @param range The range of the location of the symbol. + * @param uri The resource of the location of symbol, defaults to the current document. + * @param containerName The name of the symbol containing the symbol. + */ + function create(name, kind, range, uri, containerName) { + var result = { + name: name, + kind: kind, + location: { uri: uri, range: range } + }; + if (containerName) { + result.containerName = containerName; + } + return result; + } + SymbolInformation.create = create; +})(SymbolInformation || (SymbolInformation = {})); +var DocumentSymbol; +(function (DocumentSymbol) { + /** + * Creates a new symbol information literal. + * + * @param name The name of the symbol. + * @param detail The detail of the symbol. + * @param kind The kind of the symbol. + * @param range The range of the symbol. + * @param selectionRange The selectionRange of the symbol. + * @param children Children of the symbol. + */ + function create(name, detail, kind, range, selectionRange, children) { + var result = { + name: name, + detail: detail, + kind: kind, + range: range, + selectionRange: selectionRange + }; + if (children !== void 0) { + result.children = children; + } + return result; + } + DocumentSymbol.create = create; + /** + * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface. + */ + function is(value) { + var candidate = value; + return candidate && + Is.string(candidate.name) && Is.number(candidate.kind) && + Range.is(candidate.range) && Range.is(candidate.selectionRange) && + (candidate.detail === void 0 || Is.string(candidate.detail)) && + (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && + (candidate.children === void 0 || Array.isArray(candidate.children)); + } + DocumentSymbol.is = is; +})(DocumentSymbol || (DocumentSymbol = {})); +/** + * A set of predefined code action kinds + */ +var CodeActionKind; +(function (CodeActionKind) { + /** + * Empty kind. + */ + CodeActionKind.Empty = ''; + /** + * Base kind for quickfix actions: 'quickfix' + */ + CodeActionKind.QuickFix = 'quickfix'; + /** + * Base kind for refactoring actions: 'refactor' + */ + CodeActionKind.Refactor = 'refactor'; + /** + * Base kind for refactoring extraction actions: 'refactor.extract' + * + * Example extract actions: + * + * - Extract method + * - Extract function + * - Extract variable + * - Extract interface from class + * - ... + */ + CodeActionKind.RefactorExtract = 'refactor.extract'; + /** + * Base kind for refactoring inline actions: 'refactor.inline' + * + * Example inline actions: + * + * - Inline function + * - Inline variable + * - Inline constant + * - ... + */ + CodeActionKind.RefactorInline = 'refactor.inline'; + /** + * Base kind for refactoring rewrite actions: 'refactor.rewrite' + * + * Example rewrite actions: + * + * - Convert JavaScript function to class + * - Add or remove parameter + * - Encapsulate field + * - Make method static + * - Move method to base class + * - ... + */ + CodeActionKind.RefactorRewrite = 'refactor.rewrite'; + /** + * Base kind for source actions: `source` + * + * Source code actions apply to the entire file. + */ + CodeActionKind.Source = 'source'; + /** + * Base kind for an organize imports source action: `source.organizeImports` + */ + CodeActionKind.SourceOrganizeImports = 'source.organizeImports'; + /** + * Base kind for auto-fix source actions: `source.fixAll`. + * + * Fix all actions automatically fix errors that have a clear fix that do not require user input. + * They should not suppress errors or perform unsafe fixes such as generating new types or classes. + * + * @since 3.15.0 + */ + CodeActionKind.SourceFixAll = 'source.fixAll'; +})(CodeActionKind || (CodeActionKind = {})); +/** + * The CodeActionContext namespace provides helper functions to work with + * [CodeActionContext](#CodeActionContext) literals. + */ +var CodeActionContext; +(function (CodeActionContext) { + /** + * Creates a new CodeActionContext literal. + */ + function create(diagnostics, only) { + var result = { diagnostics: diagnostics }; + if (only !== void 0 && only !== null) { + result.only = only; + } + return result; + } + CodeActionContext.create = create; + /** + * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)); + } + CodeActionContext.is = is; +})(CodeActionContext || (CodeActionContext = {})); +var CodeAction; +(function (CodeAction) { + function create(title, commandOrEdit, kind) { + var result = { title: title }; + if (Command.is(commandOrEdit)) { + result.command = commandOrEdit; + } + else { + result.edit = commandOrEdit; + } + if (kind !== void 0) { + result.kind = kind; + } + return result; + } + CodeAction.create = create; + function is(value) { + var candidate = value; + return candidate && Is.string(candidate.title) && + (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && + (candidate.kind === void 0 || Is.string(candidate.kind)) && + (candidate.edit !== void 0 || candidate.command !== void 0) && + (candidate.command === void 0 || Command.is(candidate.command)) && + (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && + (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit)); + } + CodeAction.is = is; +})(CodeAction || (CodeAction = {})); +/** + * The CodeLens namespace provides helper functions to work with + * [CodeLens](#CodeLens) literals. + */ +var CodeLens; +(function (CodeLens) { + /** + * Creates a new CodeLens literal. + */ + function create(range, data) { + var result = { range: range }; + if (Is.defined(data)) { + result.data = data; + } + return result; + } + CodeLens.create = create; + /** + * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); + } + CodeLens.is = is; +})(CodeLens || (CodeLens = {})); +/** + * The FormattingOptions namespace provides helper functions to work with + * [FormattingOptions](#FormattingOptions) literals. + */ +var FormattingOptions; +(function (FormattingOptions) { + /** + * Creates a new FormattingOptions literal. + */ + function create(tabSize, insertSpaces) { + return { tabSize: tabSize, insertSpaces: insertSpaces }; + } + FormattingOptions.create = create; + /** + * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces); + } + FormattingOptions.is = is; +})(FormattingOptions || (FormattingOptions = {})); +/** + * The DocumentLink namespace provides helper functions to work with + * [DocumentLink](#DocumentLink) literals. + */ +var DocumentLink; +(function (DocumentLink) { + /** + * Creates a new DocumentLink literal. + */ + function create(range, target, data) { + return { range: range, target: target, data: data }; + } + DocumentLink.create = create; + /** + * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); + } + DocumentLink.is = is; +})(DocumentLink || (DocumentLink = {})); +/** + * The SelectionRange namespace provides helper function to work with + * SelectionRange literals. + */ +var SelectionRange; +(function (SelectionRange) { + /** + * Creates a new SelectionRange + * @param range the range. + * @param parent an optional parent. + */ + function create(range, parent) { + return { range: range, parent: parent }; + } + SelectionRange.create = create; + function is(value) { + var candidate = value; + return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent)); + } + SelectionRange.is = is; +})(SelectionRange || (SelectionRange = {})); +var EOL = ['\n', '\r\n', '\r']; +/** + * @deprecated Use the text document from the new vscode-languageserver-textdocument package. + */ +var TextDocument; +(function (TextDocument) { + /** + * Creates a new ITextDocument literal from the given uri and content. + * @param uri The document's uri. + * @param languageId The document's language Id. + * @param content The document's content. + */ + function create(uri, languageId, version, content) { + return new FullTextDocument(uri, languageId, version, content); + } + TextDocument.create = create; + /** + * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface. + */ + function is(value) { + var candidate = value; + return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount) + && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; + } + TextDocument.is = is; + function applyEdits(document, edits) { + var text = document.getText(); + var sortedEdits = mergeSort(edits, function (a, b) { + var diff = a.range.start.line - b.range.start.line; + if (diff === 0) { + return a.range.start.character - b.range.start.character; + } + return diff; + }); + var lastModifiedOffset = text.length; + for (var i = sortedEdits.length - 1; i >= 0; i--) { + var e = sortedEdits[i]; + var startOffset = document.offsetAt(e.range.start); + var endOffset = document.offsetAt(e.range.end); + if (endOffset <= lastModifiedOffset) { + text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); + } + else { + throw new Error('Overlapping edit'); + } + lastModifiedOffset = startOffset; + } + return text; + } + TextDocument.applyEdits = applyEdits; + function mergeSort(data, compare) { + if (data.length <= 1) { + // sorted + return data; + } + var p = (data.length / 2) | 0; + var left = data.slice(0, p); + var right = data.slice(p); + mergeSort(left, compare); + mergeSort(right, compare); + var leftIdx = 0; + var rightIdx = 0; + var i = 0; + while (leftIdx < left.length && rightIdx < right.length) { + var ret = compare(left[leftIdx], right[rightIdx]); + if (ret <= 0) { + // smaller_equal -> take left to preserve order + data[i++] = left[leftIdx++]; + } + else { + // greater -> take right + data[i++] = right[rightIdx++]; + } + } + while (leftIdx < left.length) { + data[i++] = left[leftIdx++]; + } + while (rightIdx < right.length) { + data[i++] = right[rightIdx++]; + } + return data; + } +})(TextDocument || (TextDocument = {})); +var FullTextDocument = /** @class */ (function () { + function FullTextDocument(uri, languageId, version, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version; + this._content = content; + this._lineOffsets = undefined; + } + Object.defineProperty(FullTextDocument.prototype, "uri", { + get: function () { + return this._uri; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, "languageId", { + get: function () { + return this._languageId; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, "version", { + get: function () { + return this._version; + }, + enumerable: true, + configurable: true + }); + FullTextDocument.prototype.getText = function (range) { + if (range) { + var start = this.offsetAt(range.start); + var end = this.offsetAt(range.end); + return this._content.substring(start, end); + } + return this._content; + }; + FullTextDocument.prototype.update = function (event, version) { + this._content = event.text; + this._version = version; + this._lineOffsets = undefined; + }; + FullTextDocument.prototype.getLineOffsets = function () { + if (this._lineOffsets === undefined) { + var lineOffsets = []; + var text = this._content; + var isLineStart = true; + for (var i = 0; i < text.length; i++) { + if (isLineStart) { + lineOffsets.push(i); + isLineStart = false; + } + var ch = text.charAt(i); + isLineStart = (ch === '\r' || ch === '\n'); + if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') { + i++; + } + } + if (isLineStart && text.length > 0) { + lineOffsets.push(text.length); + } + this._lineOffsets = lineOffsets; + } + return this._lineOffsets; + }; + FullTextDocument.prototype.positionAt = function (offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + var lineOffsets = this.getLineOffsets(); + var low = 0, high = lineOffsets.length; + if (high === 0) { + return Position.create(0, offset); + } + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } + else { + low = mid + 1; + } + } + // low is the least x for which the line offset is larger than the current offset + // or array.length if no line offset is larger than the current offset + var line = low - 1; + return Position.create(line, offset - lineOffsets[line]); + }; + FullTextDocument.prototype.offsetAt = function (position) { + var lineOffsets = this.getLineOffsets(); + if (position.line >= lineOffsets.length) { + return this._content.length; + } + else if (position.line < 0) { + return 0; + } + var lineOffset = lineOffsets[position.line]; + var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; + return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); + }; + Object.defineProperty(FullTextDocument.prototype, "lineCount", { + get: function () { + return this.getLineOffsets().length; + }, + enumerable: true, + configurable: true + }); + return FullTextDocument; +}()); +var Is; +(function (Is) { + var toString = Object.prototype.toString; + function defined(value) { + return typeof value !== 'undefined'; + } + Is.defined = defined; + function undefined(value) { + return typeof value === 'undefined'; + } + Is.undefined = undefined; + function boolean(value) { + return value === true || value === false; + } + Is.boolean = boolean; + function string(value) { + return toString.call(value) === '[object String]'; + } + Is.string = string; + function number(value) { + return toString.call(value) === '[object Number]'; + } + Is.number = number; + function func(value) { + return toString.call(value) === '[object Function]'; + } + Is.func = func; + function objectLiteral(value) { + // Strictly speaking class instances pass this check as well. Since the LSP + // doesn't use classes we ignore this for now. If we do we need to add something + // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null` + return value !== null && typeof value === 'object'; + } + Is.objectLiteral = objectLiteral; + function typedArray(value, check) { + return Array.isArray(value) && value.every(check); + } + Is.typedArray = typedArray; +})(Is || (Is = {})); // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-textdocument/lib/esm/main.js -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -var main_FullTextDocument = /** @class */ (function () { - function FullTextDocument(uri, languageId, version, content) { - this._uri = uri; - this._languageId = languageId; - this._version = version; - this._content = content; - this._lineOffsets = undefined; - } - Object.defineProperty(FullTextDocument.prototype, "uri", { - get: function () { - return this._uri; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "languageId", { - get: function () { - return this._languageId; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "version", { - get: function () { - return this._version; - }, - enumerable: true, - configurable: true - }); - FullTextDocument.prototype.getText = function (range) { - if (range) { - var start = this.offsetAt(range.start); - var end = this.offsetAt(range.end); - return this._content.substring(start, end); - } - return this._content; - }; - FullTextDocument.prototype.update = function (changes, version) { - for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) { - var change = changes_1[_i]; - if (FullTextDocument.isIncremental(change)) { - // makes sure start is before end - var range = getWellformedRange(change.range); - // update content - var startOffset = this.offsetAt(range.start); - var endOffset = this.offsetAt(range.end); - this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length); - // update the offsets - var startLine = Math.max(range.start.line, 0); - var endLine = Math.max(range.end.line, 0); - var lineOffsets = this._lineOffsets; - var addedLineOffsets = computeLineOffsets(change.text, false, startOffset); - if (endLine - startLine === addedLineOffsets.length) { - for (var i = 0, len = addedLineOffsets.length; i < len; i++) { - lineOffsets[i + startLine + 1] = addedLineOffsets[i]; - } - } - else { - if (addedLineOffsets.length < 10000) { - lineOffsets.splice.apply(lineOffsets, [startLine + 1, endLine - startLine].concat(addedLineOffsets)); - } - else { // avoid too many arguments for splice - this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1)); - } - } - var diff = change.text.length - (endOffset - startOffset); - if (diff !== 0) { - for (var i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) { - lineOffsets[i] = lineOffsets[i] + diff; - } - } - } - else if (FullTextDocument.isFull(change)) { - this._content = change.text; - this._lineOffsets = undefined; - } - else { - throw new Error('Unknown change event received'); - } - } - this._version = version; - }; - FullTextDocument.prototype.getLineOffsets = function () { - if (this._lineOffsets === undefined) { - this._lineOffsets = computeLineOffsets(this._content, true); - } - return this._lineOffsets; - }; - FullTextDocument.prototype.positionAt = function (offset) { - offset = Math.max(Math.min(offset, this._content.length), 0); - var lineOffsets = this.getLineOffsets(); - var low = 0, high = lineOffsets.length; - if (high === 0) { - return { line: 0, character: offset }; - } - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (lineOffsets[mid] > offset) { - high = mid; - } - else { - low = mid + 1; - } - } - // low is the least x for which the line offset is larger than the current offset - // or array.length if no line offset is larger than the current offset - var line = low - 1; - return { line: line, character: offset - lineOffsets[line] }; - }; - FullTextDocument.prototype.offsetAt = function (position) { - var lineOffsets = this.getLineOffsets(); - if (position.line >= lineOffsets.length) { - return this._content.length; - } - else if (position.line < 0) { - return 0; - } - var lineOffset = lineOffsets[position.line]; - var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; - return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); - }; - Object.defineProperty(FullTextDocument.prototype, "lineCount", { - get: function () { - return this.getLineOffsets().length; - }, - enumerable: true, - configurable: true - }); - FullTextDocument.isIncremental = function (event) { - var candidate = event; - return candidate !== undefined && candidate !== null && - typeof candidate.text === 'string' && candidate.range !== undefined && - (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number'); - }; - FullTextDocument.isFull = function (event) { - var candidate = event; - return candidate !== undefined && candidate !== null && - typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined; - }; - return FullTextDocument; -}()); -var main_TextDocument; -(function (TextDocument) { - /** - * Creates a new text document. - * - * @param uri The document's uri. - * @param languageId The document's language Id. - * @param version The document's initial version number. - * @param content The document's content. - */ - function create(uri, languageId, version, content) { - return new main_FullTextDocument(uri, languageId, version, content); - } - TextDocument.create = create; - /** - * Updates a TextDocument by modifing its content. - * - * @param document the document to update. Only documents created by TextDocument.create are valid inputs. - * @param changes the changes to apply to the document. - * @returns The updated TextDocument. Note: That's the same document instance passed in as first parameter. - * - */ - function update(document, changes, version) { - if (document instanceof main_FullTextDocument) { - document.update(changes, version); - return document; - } - else { - throw new Error('TextDocument.update: document must be created by TextDocument.create'); - } - } - TextDocument.update = update; - function applyEdits(document, edits) { - var text = document.getText(); - var sortedEdits = mergeSort(edits.map(getWellformedEdit), function (a, b) { - var diff = a.range.start.line - b.range.start.line; - if (diff === 0) { - return a.range.start.character - b.range.start.character; - } - return diff; - }); - var lastModifiedOffset = text.length; - for (var i = sortedEdits.length - 1; i >= 0; i--) { - var e = sortedEdits[i]; - var startOffset = document.offsetAt(e.range.start); - var endOffset = document.offsetAt(e.range.end); - if (endOffset <= lastModifiedOffset) { - text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); - } - else { - throw new Error('Overlapping edit'); - } - lastModifiedOffset = startOffset; - } - return text; - } - TextDocument.applyEdits = applyEdits; -})(main_TextDocument || (main_TextDocument = {})); -function mergeSort(data, compare) { - if (data.length <= 1) { - // sorted - return data; - } - var p = (data.length / 2) | 0; - var left = data.slice(0, p); - var right = data.slice(p); - mergeSort(left, compare); - mergeSort(right, compare); - var leftIdx = 0; - var rightIdx = 0; - var i = 0; - while (leftIdx < left.length && rightIdx < right.length) { - var ret = compare(left[leftIdx], right[rightIdx]); - if (ret <= 0) { - // smaller_equal -> take left to preserve order - data[i++] = left[leftIdx++]; - } - else { - // greater -> take right - data[i++] = right[rightIdx++]; - } - } - while (leftIdx < left.length) { - data[i++] = left[leftIdx++]; - } - while (rightIdx < right.length) { - data[i++] = right[rightIdx++]; - } - return data; -} -function computeLineOffsets(text, isAtLineStart, textOffset) { - if (textOffset === void 0) { textOffset = 0; } - var result = isAtLineStart ? [textOffset] : []; - for (var i = 0; i < text.length; i++) { - var ch = text.charCodeAt(i); - if (ch === 13 /* CarriageReturn */ || ch === 10 /* LineFeed */) { - if (ch === 13 /* CarriageReturn */ && i + 1 < text.length && text.charCodeAt(i + 1) === 10 /* LineFeed */) { - i++; - } - result.push(textOffset + i + 1); - } - } - return result; -} -function getWellformedRange(range) { - var start = range.start; - var end = range.end; - if (start.line > end.line || (start.line === end.line && start.character > end.character)) { - return { start: end, end: start }; - } - return range; -} -function getWellformedEdit(textEdit) { - var range = getWellformedRange(textEdit.range); - if (range !== textEdit.range) { - return { newText: textEdit.newText, range: range }; - } - return textEdit; -} +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + +var main_FullTextDocument = /** @class */ (function () { + function FullTextDocument(uri, languageId, version, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version; + this._content = content; + this._lineOffsets = undefined; + } + Object.defineProperty(FullTextDocument.prototype, "uri", { + get: function () { + return this._uri; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, "languageId", { + get: function () { + return this._languageId; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FullTextDocument.prototype, "version", { + get: function () { + return this._version; + }, + enumerable: true, + configurable: true + }); + FullTextDocument.prototype.getText = function (range) { + if (range) { + var start = this.offsetAt(range.start); + var end = this.offsetAt(range.end); + return this._content.substring(start, end); + } + return this._content; + }; + FullTextDocument.prototype.update = function (changes, version) { + for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) { + var change = changes_1[_i]; + if (FullTextDocument.isIncremental(change)) { + // makes sure start is before end + var range = getWellformedRange(change.range); + // update content + var startOffset = this.offsetAt(range.start); + var endOffset = this.offsetAt(range.end); + this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length); + // update the offsets + var startLine = Math.max(range.start.line, 0); + var endLine = Math.max(range.end.line, 0); + var lineOffsets = this._lineOffsets; + var addedLineOffsets = computeLineOffsets(change.text, false, startOffset); + if (endLine - startLine === addedLineOffsets.length) { + for (var i = 0, len = addedLineOffsets.length; i < len; i++) { + lineOffsets[i + startLine + 1] = addedLineOffsets[i]; + } + } + else { + if (addedLineOffsets.length < 10000) { + lineOffsets.splice.apply(lineOffsets, [startLine + 1, endLine - startLine].concat(addedLineOffsets)); + } + else { // avoid too many arguments for splice + this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1)); + } + } + var diff = change.text.length - (endOffset - startOffset); + if (diff !== 0) { + for (var i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) { + lineOffsets[i] = lineOffsets[i] + diff; + } + } + } + else if (FullTextDocument.isFull(change)) { + this._content = change.text; + this._lineOffsets = undefined; + } + else { + throw new Error('Unknown change event received'); + } + } + this._version = version; + }; + FullTextDocument.prototype.getLineOffsets = function () { + if (this._lineOffsets === undefined) { + this._lineOffsets = computeLineOffsets(this._content, true); + } + return this._lineOffsets; + }; + FullTextDocument.prototype.positionAt = function (offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + var lineOffsets = this.getLineOffsets(); + var low = 0, high = lineOffsets.length; + if (high === 0) { + return { line: 0, character: offset }; + } + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } + else { + low = mid + 1; + } + } + // low is the least x for which the line offset is larger than the current offset + // or array.length if no line offset is larger than the current offset + var line = low - 1; + return { line: line, character: offset - lineOffsets[line] }; + }; + FullTextDocument.prototype.offsetAt = function (position) { + var lineOffsets = this.getLineOffsets(); + if (position.line >= lineOffsets.length) { + return this._content.length; + } + else if (position.line < 0) { + return 0; + } + var lineOffset = lineOffsets[position.line]; + var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; + return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); + }; + Object.defineProperty(FullTextDocument.prototype, "lineCount", { + get: function () { + return this.getLineOffsets().length; + }, + enumerable: true, + configurable: true + }); + FullTextDocument.isIncremental = function (event) { + var candidate = event; + return candidate !== undefined && candidate !== null && + typeof candidate.text === 'string' && candidate.range !== undefined && + (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number'); + }; + FullTextDocument.isFull = function (event) { + var candidate = event; + return candidate !== undefined && candidate !== null && + typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined; + }; + return FullTextDocument; +}()); +var main_TextDocument; +(function (TextDocument) { + /** + * Creates a new text document. + * + * @param uri The document's uri. + * @param languageId The document's language Id. + * @param version The document's initial version number. + * @param content The document's content. + */ + function create(uri, languageId, version, content) { + return new main_FullTextDocument(uri, languageId, version, content); + } + TextDocument.create = create; + /** + * Updates a TextDocument by modifing its content. + * + * @param document the document to update. Only documents created by TextDocument.create are valid inputs. + * @param changes the changes to apply to the document. + * @returns The updated TextDocument. Note: That's the same document instance passed in as first parameter. + * + */ + function update(document, changes, version) { + if (document instanceof main_FullTextDocument) { + document.update(changes, version); + return document; + } + else { + throw new Error('TextDocument.update: document must be created by TextDocument.create'); + } + } + TextDocument.update = update; + function applyEdits(document, edits) { + var text = document.getText(); + var sortedEdits = mergeSort(edits.map(getWellformedEdit), function (a, b) { + var diff = a.range.start.line - b.range.start.line; + if (diff === 0) { + return a.range.start.character - b.range.start.character; + } + return diff; + }); + var lastModifiedOffset = text.length; + for (var i = sortedEdits.length - 1; i >= 0; i--) { + var e = sortedEdits[i]; + var startOffset = document.offsetAt(e.range.start); + var endOffset = document.offsetAt(e.range.end); + if (endOffset <= lastModifiedOffset) { + text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); + } + else { + throw new Error('Overlapping edit'); + } + lastModifiedOffset = startOffset; + } + return text; + } + TextDocument.applyEdits = applyEdits; +})(main_TextDocument || (main_TextDocument = {})); +function mergeSort(data, compare) { + if (data.length <= 1) { + // sorted + return data; + } + var p = (data.length / 2) | 0; + var left = data.slice(0, p); + var right = data.slice(p); + mergeSort(left, compare); + mergeSort(right, compare); + var leftIdx = 0; + var rightIdx = 0; + var i = 0; + while (leftIdx < left.length && rightIdx < right.length) { + var ret = compare(left[leftIdx], right[rightIdx]); + if (ret <= 0) { + // smaller_equal -> take left to preserve order + data[i++] = left[leftIdx++]; + } + else { + // greater -> take right + data[i++] = right[rightIdx++]; + } + } + while (leftIdx < left.length) { + data[i++] = left[leftIdx++]; + } + while (rightIdx < right.length) { + data[i++] = right[rightIdx++]; + } + return data; +} +function computeLineOffsets(text, isAtLineStart, textOffset) { + if (textOffset === void 0) { textOffset = 0; } + var result = isAtLineStart ? [textOffset] : []; + for (var i = 0; i < text.length; i++) { + var ch = text.charCodeAt(i); + if (ch === 13 /* CarriageReturn */ || ch === 10 /* LineFeed */) { + if (ch === 13 /* CarriageReturn */ && i + 1 < text.length && text.charCodeAt(i + 1) === 10 /* LineFeed */) { + i++; + } + result.push(textOffset + i + 1); + } + } + return result; +} +function getWellformedRange(range) { + var start = range.start; + var end = range.end; + if (start.line > end.line || (start.line === end.line && start.character > end.character)) { + return { start: end, end: start }; + } + return range; +} +function getWellformedEdit(textEdit) { + var range = getWellformedRange(textEdit.range); + if (range !== textEdit.range) { + return { newText: textEdit.newText, range: range }; + } + return textEdit; +} // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js @@ -3470,36 +3470,36 @@ var jsonLanguageTypes_ClientCapabilities; })(jsonLanguageTypes_ClientCapabilities || (jsonLanguageTypes_ClientCapabilities = {})); // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/fillers/vscode-nls.js -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function vscode_nls_format(message, args) { - var result; - if (args.length === 0) { - result = message; - } - else { - result = message.replace(/\{(\d+)\}/g, function (match, rest) { - var index = rest[0]; - return typeof args[index] !== 'undefined' ? args[index] : match; - }); - } - return result; -} -function localize(key, message) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - return vscode_nls_format(message, args); -} -function loadMessageBundle(file) { - return localize; -} -function vscode_nls_config(opt) { - return loadMessageBundle; -} +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +function vscode_nls_format(message, args) { + var result; + if (args.length === 0) { + result = message; + } + else { + result = message.replace(/\{(\d+)\}/g, function (match, rest) { + var index = rest[0]; + return typeof args[index] !== 'undefined' ? args[index] : match; + }); + } + return result; +} +function localize(key, message) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + return vscode_nls_format(message, args); +} +function loadMessageBundle(file) { + return localize; +} +function vscode_nls_config(opt) { + return loadMessageBundle; +} // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js /*--------------------------------------------------------------------------------------------- @@ -7530,735 +7530,735 @@ function getLanguageService(params) { } // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/languageFeatures.js -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -var Uri = monaco.Uri; -var languageFeatures_Range = monaco.Range; -// --- diagnostics --- --- -var DiagnosticsAdapter = /** @class */ (function () { - function DiagnosticsAdapter(_languageId, _worker, defaults) { - var _this = this; - this._languageId = _languageId; - this._worker = _worker; - this._disposables = []; - this._listener = Object.create(null); - var onModelAdd = function (model) { - var modeId = model.getModeId(); - if (modeId !== _this._languageId) { - return; - } - var handle; - _this._listener[model.uri.toString()] = model.onDidChangeContent(function () { - clearTimeout(handle); - handle = setTimeout(function () { return _this._doValidate(model.uri, modeId); }, 500); - }); - _this._doValidate(model.uri, modeId); - }; - var onModelRemoved = function (model) { - monaco.editor.setModelMarkers(model, _this._languageId, []); - var uriStr = model.uri.toString(); - var listener = _this._listener[uriStr]; - if (listener) { - listener.dispose(); - delete _this._listener[uriStr]; - } - }; - this._disposables.push(monaco.editor.onDidCreateModel(onModelAdd)); - this._disposables.push(monaco.editor.onWillDisposeModel(function (model) { - onModelRemoved(model); - _this._resetSchema(model.uri); - })); - this._disposables.push(monaco.editor.onDidChangeModelLanguage(function (event) { - onModelRemoved(event.model); - onModelAdd(event.model); - _this._resetSchema(event.model.uri); - })); - this._disposables.push(defaults.onDidChange(function (_) { - monaco.editor.getModels().forEach(function (model) { - if (model.getModeId() === _this._languageId) { - onModelRemoved(model); - onModelAdd(model); - } - }); - })); - this._disposables.push({ - dispose: function () { - monaco.editor.getModels().forEach(onModelRemoved); - for (var key in _this._listener) { - _this._listener[key].dispose(); - } - } - }); - monaco.editor.getModels().forEach(onModelAdd); - } - DiagnosticsAdapter.prototype.dispose = function () { - this._disposables.forEach(function (d) { return d && d.dispose(); }); - this._disposables = []; - }; - DiagnosticsAdapter.prototype._resetSchema = function (resource) { - this._worker().then(function (worker) { - worker.resetSchema(resource.toString()); - }); - }; - DiagnosticsAdapter.prototype._doValidate = function (resource, languageId) { - this._worker(resource).then(function (worker) { - return worker.doValidation(resource.toString()).then(function (diagnostics) { - var markers = diagnostics.map(function (d) { return toDiagnostics(resource, d); }); - var model = monaco.editor.getModel(resource); - if (model && model.getModeId() === languageId) { - monaco.editor.setModelMarkers(model, languageId, markers); - } - }); - }).then(undefined, function (err) { - console.error(err); - }); - }; - return DiagnosticsAdapter; -}()); - -function toSeverity(lsSeverity) { - switch (lsSeverity) { - case DiagnosticSeverity.Error: return monaco.MarkerSeverity.Error; - case DiagnosticSeverity.Warning: return monaco.MarkerSeverity.Warning; - case DiagnosticSeverity.Information: return monaco.MarkerSeverity.Info; - case DiagnosticSeverity.Hint: return monaco.MarkerSeverity.Hint; - default: - return monaco.MarkerSeverity.Info; - } -} -function toDiagnostics(resource, diag) { - var code = typeof diag.code === 'number' ? String(diag.code) : diag.code; - return { - severity: toSeverity(diag.severity), - startLineNumber: diag.range.start.line + 1, - startColumn: diag.range.start.character + 1, - endLineNumber: diag.range.end.line + 1, - endColumn: diag.range.end.character + 1, - message: diag.message, - code: code, - source: diag.source - }; -} -// --- completion ------ -function fromPosition(position) { - if (!position) { - return void 0; - } - return { character: position.column - 1, line: position.lineNumber - 1 }; -} -function fromRange(range) { - if (!range) { - return void 0; - } - return { start: { line: range.startLineNumber - 1, character: range.startColumn - 1 }, end: { line: range.endLineNumber - 1, character: range.endColumn - 1 } }; -} -function toRange(range) { - if (!range) { - return void 0; - } - return new languageFeatures_Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1); -} -function toCompletionItemKind(kind) { - var mItemKind = monaco.languages.CompletionItemKind; - switch (kind) { - case CompletionItemKind.Text: return mItemKind.Text; - case CompletionItemKind.Method: return mItemKind.Method; - case CompletionItemKind.Function: return mItemKind.Function; - case CompletionItemKind.Constructor: return mItemKind.Constructor; - case CompletionItemKind.Field: return mItemKind.Field; - case CompletionItemKind.Variable: return mItemKind.Variable; - case CompletionItemKind.Class: return mItemKind.Class; - case CompletionItemKind.Interface: return mItemKind.Interface; - case CompletionItemKind.Module: return mItemKind.Module; - case CompletionItemKind.Property: return mItemKind.Property; - case CompletionItemKind.Unit: return mItemKind.Unit; - case CompletionItemKind.Value: return mItemKind.Value; - case CompletionItemKind.Enum: return mItemKind.Enum; - case CompletionItemKind.Keyword: return mItemKind.Keyword; - case CompletionItemKind.Snippet: return mItemKind.Snippet; - case CompletionItemKind.Color: return mItemKind.Color; - case CompletionItemKind.File: return mItemKind.File; - case CompletionItemKind.Reference: return mItemKind.Reference; - } - return mItemKind.Property; -} -function fromCompletionItemKind(kind) { - var mItemKind = monaco.languages.CompletionItemKind; - switch (kind) { - case mItemKind.Text: return CompletionItemKind.Text; - case mItemKind.Method: return CompletionItemKind.Method; - case mItemKind.Function: return CompletionItemKind.Function; - case mItemKind.Constructor: return CompletionItemKind.Constructor; - case mItemKind.Field: return CompletionItemKind.Field; - case mItemKind.Variable: return CompletionItemKind.Variable; - case mItemKind.Class: return CompletionItemKind.Class; - case mItemKind.Interface: return CompletionItemKind.Interface; - case mItemKind.Module: return CompletionItemKind.Module; - case mItemKind.Property: return CompletionItemKind.Property; - case mItemKind.Unit: return CompletionItemKind.Unit; - case mItemKind.Value: return CompletionItemKind.Value; - case mItemKind.Enum: return CompletionItemKind.Enum; - case mItemKind.Keyword: return CompletionItemKind.Keyword; - case mItemKind.Snippet: return CompletionItemKind.Snippet; - case mItemKind.Color: return CompletionItemKind.Color; - case mItemKind.File: return CompletionItemKind.File; - case mItemKind.Reference: return CompletionItemKind.Reference; - } - return CompletionItemKind.Property; -} -function toTextEdit(textEdit) { - if (!textEdit) { - return void 0; - } - return { - range: toRange(textEdit.range), - text: textEdit.newText - }; -} -var languageFeatures_CompletionAdapter = /** @class */ (function () { - function CompletionAdapter(_worker) { - this._worker = _worker; - } - Object.defineProperty(CompletionAdapter.prototype, "triggerCharacters", { - get: function () { - return [' ', ':']; - }, - enumerable: true, - configurable: true - }); - CompletionAdapter.prototype.provideCompletionItems = function (model, position, context, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { - return worker.doComplete(resource.toString(), fromPosition(position)); - }).then(function (info) { - if (!info) { - return; - } - var wordInfo = model.getWordUntilPosition(position); - var wordRange = new languageFeatures_Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn); - var items = info.items.map(function (entry) { - var item = { - label: entry.label, - insertText: entry.insertText || entry.label, - sortText: entry.sortText, - filterText: entry.filterText, - documentation: entry.documentation, - detail: entry.detail, - range: wordRange, - kind: toCompletionItemKind(entry.kind), - }; - if (entry.textEdit) { - item.range = toRange(entry.textEdit.range); - item.insertText = entry.textEdit.newText; - } - if (entry.additionalTextEdits) { - item.additionalTextEdits = entry.additionalTextEdits.map(toTextEdit); - } - if (entry.insertTextFormat === InsertTextFormat.Snippet) { - item.insertTextRules = monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet; - } - return item; - }); - return { - isIncomplete: info.isIncomplete, - suggestions: items - }; - }); - }; - return CompletionAdapter; -}()); - -function isMarkupContent(thing) { - return thing && typeof thing === 'object' && typeof thing.kind === 'string'; -} -function toMarkdownString(entry) { - if (typeof entry === 'string') { - return { - value: entry - }; - } - if (isMarkupContent(entry)) { - if (entry.kind === 'plaintext') { - return { - value: entry.value.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&') - }; - } - return { - value: entry.value - }; - } - return { value: '```' + entry.language + '\n' + entry.value + '\n```\n' }; -} -function toMarkedStringArray(contents) { - if (!contents) { - return void 0; - } - if (Array.isArray(contents)) { - return contents.map(toMarkdownString); - } - return [toMarkdownString(contents)]; -} -// --- hover ------ -var HoverAdapter = /** @class */ (function () { - function HoverAdapter(_worker) { - this._worker = _worker; - } - HoverAdapter.prototype.provideHover = function (model, position, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { - return worker.doHover(resource.toString(), fromPosition(position)); - }).then(function (info) { - if (!info) { - return; - } - return { - range: toRange(info.range), - contents: toMarkedStringArray(info.contents) - }; - }); - }; - return HoverAdapter; -}()); - -// --- definition ------ -function toLocation(location) { - return { - uri: Uri.parse(location.uri), - range: toRange(location.range) - }; -} -// --- document symbols ------ -function toSymbolKind(kind) { - var mKind = monaco.languages.SymbolKind; - switch (kind) { - case SymbolKind.File: return mKind.Array; - case SymbolKind.Module: return mKind.Module; - case SymbolKind.Namespace: return mKind.Namespace; - case SymbolKind.Package: return mKind.Package; - case SymbolKind.Class: return mKind.Class; - case SymbolKind.Method: return mKind.Method; - case SymbolKind.Property: return mKind.Property; - case SymbolKind.Field: return mKind.Field; - case SymbolKind.Constructor: return mKind.Constructor; - case SymbolKind.Enum: return mKind.Enum; - case SymbolKind.Interface: return mKind.Interface; - case SymbolKind.Function: return mKind.Function; - case SymbolKind.Variable: return mKind.Variable; - case SymbolKind.Constant: return mKind.Constant; - case SymbolKind.String: return mKind.String; - case SymbolKind.Number: return mKind.Number; - case SymbolKind.Boolean: return mKind.Boolean; - case SymbolKind.Array: return mKind.Array; - } - return mKind.Function; -} -var DocumentSymbolAdapter = /** @class */ (function () { - function DocumentSymbolAdapter(_worker) { - this._worker = _worker; - } - DocumentSymbolAdapter.prototype.provideDocumentSymbols = function (model, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { return worker.findDocumentSymbols(resource.toString()); }).then(function (items) { - if (!items) { - return; - } - return items.map(function (item) { return ({ - name: item.name, - detail: '', - containerName: item.containerName, - kind: toSymbolKind(item.kind), - range: toRange(item.location.range), - selectionRange: toRange(item.location.range), - tags: [] - }); }); - }); - }; - return DocumentSymbolAdapter; -}()); - -function fromFormattingOptions(options) { - return { - tabSize: options.tabSize, - insertSpaces: options.insertSpaces - }; -} -var DocumentFormattingEditProvider = /** @class */ (function () { - function DocumentFormattingEditProvider(_worker) { - this._worker = _worker; - } - DocumentFormattingEditProvider.prototype.provideDocumentFormattingEdits = function (model, options, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { - return worker.format(resource.toString(), null, fromFormattingOptions(options)).then(function (edits) { - if (!edits || edits.length === 0) { - return; - } - return edits.map(toTextEdit); - }); - }); - }; - return DocumentFormattingEditProvider; -}()); - -var DocumentRangeFormattingEditProvider = /** @class */ (function () { - function DocumentRangeFormattingEditProvider(_worker) { - this._worker = _worker; - } - DocumentRangeFormattingEditProvider.prototype.provideDocumentRangeFormattingEdits = function (model, range, options, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { - return worker.format(resource.toString(), fromRange(range), fromFormattingOptions(options)).then(function (edits) { - if (!edits || edits.length === 0) { - return; - } - return edits.map(toTextEdit); - }); - }); - }; - return DocumentRangeFormattingEditProvider; -}()); - -var DocumentColorAdapter = /** @class */ (function () { - function DocumentColorAdapter(_worker) { - this._worker = _worker; - } - DocumentColorAdapter.prototype.provideDocumentColors = function (model, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { return worker.findDocumentColors(resource.toString()); }).then(function (infos) { - if (!infos) { - return; - } - return infos.map(function (item) { return ({ - color: item.color, - range: toRange(item.range) - }); }); - }); - }; - DocumentColorAdapter.prototype.provideColorPresentations = function (model, info, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { return worker.getColorPresentations(resource.toString(), info.color, fromRange(info.range)); }).then(function (presentations) { - if (!presentations) { - return; - } - return presentations.map(function (presentation) { - var item = { - label: presentation.label, - }; - if (presentation.textEdit) { - item.textEdit = toTextEdit(presentation.textEdit); - } - if (presentation.additionalTextEdits) { - item.additionalTextEdits = presentation.additionalTextEdits.map(toTextEdit); - } - return item; - }); - }); - }; - return DocumentColorAdapter; -}()); - -var FoldingRangeAdapter = /** @class */ (function () { - function FoldingRangeAdapter(_worker) { - this._worker = _worker; - } - FoldingRangeAdapter.prototype.provideFoldingRanges = function (model, context, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { return worker.getFoldingRanges(resource.toString(), context); }).then(function (ranges) { - if (!ranges) { - return; - } - return ranges.map(function (range) { - var result = { - start: range.startLine + 1, - end: range.endLine + 1 - }; - if (typeof range.kind !== 'undefined') { - result.kind = toFoldingRangeKind(range.kind); - } - return result; - }); - }); - }; - return FoldingRangeAdapter; -}()); - -function toFoldingRangeKind(kind) { - switch (kind) { - case FoldingRangeKind.Comment: return monaco.languages.FoldingRangeKind.Comment; - case FoldingRangeKind.Imports: return monaco.languages.FoldingRangeKind.Imports; - case FoldingRangeKind.Region: return monaco.languages.FoldingRangeKind.Region; - } - return void 0; -} -var SelectionRangeAdapter = /** @class */ (function () { - function SelectionRangeAdapter(_worker) { - this._worker = _worker; - } - SelectionRangeAdapter.prototype.provideSelectionRanges = function (model, positions, token) { - var resource = model.uri; - return this._worker(resource).then(function (worker) { return worker.getSelectionRanges(resource.toString(), positions.map(fromPosition)); }).then(function (selectionRanges) { - if (!selectionRanges) { - return; - } - return selectionRanges.map(function (selectionRange) { - var result = []; - while (selectionRange) { - result.push({ range: toRange(selectionRange.range) }); - selectionRange = selectionRange.parent; - } - return result; - }); - }); - }; - return SelectionRangeAdapter; -}()); - +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + +var Uri = monaco.Uri; +var languageFeatures_Range = monaco.Range; +// --- diagnostics --- --- +var DiagnosticsAdapter = /** @class */ (function () { + function DiagnosticsAdapter(_languageId, _worker, defaults) { + var _this = this; + this._languageId = _languageId; + this._worker = _worker; + this._disposables = []; + this._listener = Object.create(null); + var onModelAdd = function (model) { + var modeId = model.getModeId(); + if (modeId !== _this._languageId) { + return; + } + var handle; + _this._listener[model.uri.toString()] = model.onDidChangeContent(function () { + clearTimeout(handle); + handle = setTimeout(function () { return _this._doValidate(model.uri, modeId); }, 500); + }); + _this._doValidate(model.uri, modeId); + }; + var onModelRemoved = function (model) { + monaco.editor.setModelMarkers(model, _this._languageId, []); + var uriStr = model.uri.toString(); + var listener = _this._listener[uriStr]; + if (listener) { + listener.dispose(); + delete _this._listener[uriStr]; + } + }; + this._disposables.push(monaco.editor.onDidCreateModel(onModelAdd)); + this._disposables.push(monaco.editor.onWillDisposeModel(function (model) { + onModelRemoved(model); + _this._resetSchema(model.uri); + })); + this._disposables.push(monaco.editor.onDidChangeModelLanguage(function (event) { + onModelRemoved(event.model); + onModelAdd(event.model); + _this._resetSchema(event.model.uri); + })); + this._disposables.push(defaults.onDidChange(function (_) { + monaco.editor.getModels().forEach(function (model) { + if (model.getModeId() === _this._languageId) { + onModelRemoved(model); + onModelAdd(model); + } + }); + })); + this._disposables.push({ + dispose: function () { + monaco.editor.getModels().forEach(onModelRemoved); + for (var key in _this._listener) { + _this._listener[key].dispose(); + } + } + }); + monaco.editor.getModels().forEach(onModelAdd); + } + DiagnosticsAdapter.prototype.dispose = function () { + this._disposables.forEach(function (d) { return d && d.dispose(); }); + this._disposables = []; + }; + DiagnosticsAdapter.prototype._resetSchema = function (resource) { + this._worker().then(function (worker) { + worker.resetSchema(resource.toString()); + }); + }; + DiagnosticsAdapter.prototype._doValidate = function (resource, languageId) { + this._worker(resource).then(function (worker) { + return worker.doValidation(resource.toString()).then(function (diagnostics) { + var markers = diagnostics.map(function (d) { return toDiagnostics(resource, d); }); + var model = monaco.editor.getModel(resource); + if (model && model.getModeId() === languageId) { + monaco.editor.setModelMarkers(model, languageId, markers); + } + }); + }).then(undefined, function (err) { + console.error(err); + }); + }; + return DiagnosticsAdapter; +}()); + +function toSeverity(lsSeverity) { + switch (lsSeverity) { + case DiagnosticSeverity.Error: return monaco.MarkerSeverity.Error; + case DiagnosticSeverity.Warning: return monaco.MarkerSeverity.Warning; + case DiagnosticSeverity.Information: return monaco.MarkerSeverity.Info; + case DiagnosticSeverity.Hint: return monaco.MarkerSeverity.Hint; + default: + return monaco.MarkerSeverity.Info; + } +} +function toDiagnostics(resource, diag) { + var code = typeof diag.code === 'number' ? String(diag.code) : diag.code; + return { + severity: toSeverity(diag.severity), + startLineNumber: diag.range.start.line + 1, + startColumn: diag.range.start.character + 1, + endLineNumber: diag.range.end.line + 1, + endColumn: diag.range.end.character + 1, + message: diag.message, + code: code, + source: diag.source + }; +} +// --- completion ------ +function fromPosition(position) { + if (!position) { + return void 0; + } + return { character: position.column - 1, line: position.lineNumber - 1 }; +} +function fromRange(range) { + if (!range) { + return void 0; + } + return { start: { line: range.startLineNumber - 1, character: range.startColumn - 1 }, end: { line: range.endLineNumber - 1, character: range.endColumn - 1 } }; +} +function toRange(range) { + if (!range) { + return void 0; + } + return new languageFeatures_Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1); +} +function toCompletionItemKind(kind) { + var mItemKind = monaco.languages.CompletionItemKind; + switch (kind) { + case CompletionItemKind.Text: return mItemKind.Text; + case CompletionItemKind.Method: return mItemKind.Method; + case CompletionItemKind.Function: return mItemKind.Function; + case CompletionItemKind.Constructor: return mItemKind.Constructor; + case CompletionItemKind.Field: return mItemKind.Field; + case CompletionItemKind.Variable: return mItemKind.Variable; + case CompletionItemKind.Class: return mItemKind.Class; + case CompletionItemKind.Interface: return mItemKind.Interface; + case CompletionItemKind.Module: return mItemKind.Module; + case CompletionItemKind.Property: return mItemKind.Property; + case CompletionItemKind.Unit: return mItemKind.Unit; + case CompletionItemKind.Value: return mItemKind.Value; + case CompletionItemKind.Enum: return mItemKind.Enum; + case CompletionItemKind.Keyword: return mItemKind.Keyword; + case CompletionItemKind.Snippet: return mItemKind.Snippet; + case CompletionItemKind.Color: return mItemKind.Color; + case CompletionItemKind.File: return mItemKind.File; + case CompletionItemKind.Reference: return mItemKind.Reference; + } + return mItemKind.Property; +} +function fromCompletionItemKind(kind) { + var mItemKind = monaco.languages.CompletionItemKind; + switch (kind) { + case mItemKind.Text: return CompletionItemKind.Text; + case mItemKind.Method: return CompletionItemKind.Method; + case mItemKind.Function: return CompletionItemKind.Function; + case mItemKind.Constructor: return CompletionItemKind.Constructor; + case mItemKind.Field: return CompletionItemKind.Field; + case mItemKind.Variable: return CompletionItemKind.Variable; + case mItemKind.Class: return CompletionItemKind.Class; + case mItemKind.Interface: return CompletionItemKind.Interface; + case mItemKind.Module: return CompletionItemKind.Module; + case mItemKind.Property: return CompletionItemKind.Property; + case mItemKind.Unit: return CompletionItemKind.Unit; + case mItemKind.Value: return CompletionItemKind.Value; + case mItemKind.Enum: return CompletionItemKind.Enum; + case mItemKind.Keyword: return CompletionItemKind.Keyword; + case mItemKind.Snippet: return CompletionItemKind.Snippet; + case mItemKind.Color: return CompletionItemKind.Color; + case mItemKind.File: return CompletionItemKind.File; + case mItemKind.Reference: return CompletionItemKind.Reference; + } + return CompletionItemKind.Property; +} +function toTextEdit(textEdit) { + if (!textEdit) { + return void 0; + } + return { + range: toRange(textEdit.range), + text: textEdit.newText + }; +} +var languageFeatures_CompletionAdapter = /** @class */ (function () { + function CompletionAdapter(_worker) { + this._worker = _worker; + } + Object.defineProperty(CompletionAdapter.prototype, "triggerCharacters", { + get: function () { + return [' ', ':']; + }, + enumerable: true, + configurable: true + }); + CompletionAdapter.prototype.provideCompletionItems = function (model, position, context, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { + return worker.doComplete(resource.toString(), fromPosition(position)); + }).then(function (info) { + if (!info) { + return; + } + var wordInfo = model.getWordUntilPosition(position); + var wordRange = new languageFeatures_Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn); + var items = info.items.map(function (entry) { + var item = { + label: entry.label, + insertText: entry.insertText || entry.label, + sortText: entry.sortText, + filterText: entry.filterText, + documentation: entry.documentation, + detail: entry.detail, + range: wordRange, + kind: toCompletionItemKind(entry.kind), + }; + if (entry.textEdit) { + item.range = toRange(entry.textEdit.range); + item.insertText = entry.textEdit.newText; + } + if (entry.additionalTextEdits) { + item.additionalTextEdits = entry.additionalTextEdits.map(toTextEdit); + } + if (entry.insertTextFormat === InsertTextFormat.Snippet) { + item.insertTextRules = monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet; + } + return item; + }); + return { + isIncomplete: info.isIncomplete, + suggestions: items + }; + }); + }; + return CompletionAdapter; +}()); + +function isMarkupContent(thing) { + return thing && typeof thing === 'object' && typeof thing.kind === 'string'; +} +function toMarkdownString(entry) { + if (typeof entry === 'string') { + return { + value: entry + }; + } + if (isMarkupContent(entry)) { + if (entry.kind === 'plaintext') { + return { + value: entry.value.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&') + }; + } + return { + value: entry.value + }; + } + return { value: '```' + entry.language + '\n' + entry.value + '\n```\n' }; +} +function toMarkedStringArray(contents) { + if (!contents) { + return void 0; + } + if (Array.isArray(contents)) { + return contents.map(toMarkdownString); + } + return [toMarkdownString(contents)]; +} +// --- hover ------ +var HoverAdapter = /** @class */ (function () { + function HoverAdapter(_worker) { + this._worker = _worker; + } + HoverAdapter.prototype.provideHover = function (model, position, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { + return worker.doHover(resource.toString(), fromPosition(position)); + }).then(function (info) { + if (!info) { + return; + } + return { + range: toRange(info.range), + contents: toMarkedStringArray(info.contents) + }; + }); + }; + return HoverAdapter; +}()); + +// --- definition ------ +function toLocation(location) { + return { + uri: Uri.parse(location.uri), + range: toRange(location.range) + }; +} +// --- document symbols ------ +function toSymbolKind(kind) { + var mKind = monaco.languages.SymbolKind; + switch (kind) { + case SymbolKind.File: return mKind.Array; + case SymbolKind.Module: return mKind.Module; + case SymbolKind.Namespace: return mKind.Namespace; + case SymbolKind.Package: return mKind.Package; + case SymbolKind.Class: return mKind.Class; + case SymbolKind.Method: return mKind.Method; + case SymbolKind.Property: return mKind.Property; + case SymbolKind.Field: return mKind.Field; + case SymbolKind.Constructor: return mKind.Constructor; + case SymbolKind.Enum: return mKind.Enum; + case SymbolKind.Interface: return mKind.Interface; + case SymbolKind.Function: return mKind.Function; + case SymbolKind.Variable: return mKind.Variable; + case SymbolKind.Constant: return mKind.Constant; + case SymbolKind.String: return mKind.String; + case SymbolKind.Number: return mKind.Number; + case SymbolKind.Boolean: return mKind.Boolean; + case SymbolKind.Array: return mKind.Array; + } + return mKind.Function; +} +var DocumentSymbolAdapter = /** @class */ (function () { + function DocumentSymbolAdapter(_worker) { + this._worker = _worker; + } + DocumentSymbolAdapter.prototype.provideDocumentSymbols = function (model, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { return worker.findDocumentSymbols(resource.toString()); }).then(function (items) { + if (!items) { + return; + } + return items.map(function (item) { return ({ + name: item.name, + detail: '', + containerName: item.containerName, + kind: toSymbolKind(item.kind), + range: toRange(item.location.range), + selectionRange: toRange(item.location.range), + tags: [] + }); }); + }); + }; + return DocumentSymbolAdapter; +}()); + +function fromFormattingOptions(options) { + return { + tabSize: options.tabSize, + insertSpaces: options.insertSpaces + }; +} +var DocumentFormattingEditProvider = /** @class */ (function () { + function DocumentFormattingEditProvider(_worker) { + this._worker = _worker; + } + DocumentFormattingEditProvider.prototype.provideDocumentFormattingEdits = function (model, options, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { + return worker.format(resource.toString(), null, fromFormattingOptions(options)).then(function (edits) { + if (!edits || edits.length === 0) { + return; + } + return edits.map(toTextEdit); + }); + }); + }; + return DocumentFormattingEditProvider; +}()); + +var DocumentRangeFormattingEditProvider = /** @class */ (function () { + function DocumentRangeFormattingEditProvider(_worker) { + this._worker = _worker; + } + DocumentRangeFormattingEditProvider.prototype.provideDocumentRangeFormattingEdits = function (model, range, options, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { + return worker.format(resource.toString(), fromRange(range), fromFormattingOptions(options)).then(function (edits) { + if (!edits || edits.length === 0) { + return; + } + return edits.map(toTextEdit); + }); + }); + }; + return DocumentRangeFormattingEditProvider; +}()); + +var DocumentColorAdapter = /** @class */ (function () { + function DocumentColorAdapter(_worker) { + this._worker = _worker; + } + DocumentColorAdapter.prototype.provideDocumentColors = function (model, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { return worker.findDocumentColors(resource.toString()); }).then(function (infos) { + if (!infos) { + return; + } + return infos.map(function (item) { return ({ + color: item.color, + range: toRange(item.range) + }); }); + }); + }; + DocumentColorAdapter.prototype.provideColorPresentations = function (model, info, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { return worker.getColorPresentations(resource.toString(), info.color, fromRange(info.range)); }).then(function (presentations) { + if (!presentations) { + return; + } + return presentations.map(function (presentation) { + var item = { + label: presentation.label, + }; + if (presentation.textEdit) { + item.textEdit = toTextEdit(presentation.textEdit); + } + if (presentation.additionalTextEdits) { + item.additionalTextEdits = presentation.additionalTextEdits.map(toTextEdit); + } + return item; + }); + }); + }; + return DocumentColorAdapter; +}()); + +var FoldingRangeAdapter = /** @class */ (function () { + function FoldingRangeAdapter(_worker) { + this._worker = _worker; + } + FoldingRangeAdapter.prototype.provideFoldingRanges = function (model, context, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { return worker.getFoldingRanges(resource.toString(), context); }).then(function (ranges) { + if (!ranges) { + return; + } + return ranges.map(function (range) { + var result = { + start: range.startLine + 1, + end: range.endLine + 1 + }; + if (typeof range.kind !== 'undefined') { + result.kind = toFoldingRangeKind(range.kind); + } + return result; + }); + }); + }; + return FoldingRangeAdapter; +}()); + +function toFoldingRangeKind(kind) { + switch (kind) { + case FoldingRangeKind.Comment: return monaco.languages.FoldingRangeKind.Comment; + case FoldingRangeKind.Imports: return monaco.languages.FoldingRangeKind.Imports; + case FoldingRangeKind.Region: return monaco.languages.FoldingRangeKind.Region; + } + return void 0; +} +var SelectionRangeAdapter = /** @class */ (function () { + function SelectionRangeAdapter(_worker) { + this._worker = _worker; + } + SelectionRangeAdapter.prototype.provideSelectionRanges = function (model, positions, token) { + var resource = model.uri; + return this._worker(resource).then(function (worker) { return worker.getSelectionRanges(resource.toString(), positions.map(fromPosition)); }).then(function (selectionRanges) { + if (!selectionRanges) { + return; + } + return selectionRanges.map(function (selectionRange) { + var result = []; + while (selectionRange) { + result.push({ range: toRange(selectionRange.range) }); + selectionRange = selectionRange.parent; + } + return result; + }); + }); + }; + return SelectionRangeAdapter; +}()); + // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/tokenization.js -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -function createTokenizationSupport(supportComments) { - return { - getInitialState: function () { return new JSONState(null, null, false); }, - tokenize: function (line, state, offsetDelta, stopAtOffset) { return tokenize(supportComments, line, state, offsetDelta, stopAtOffset); } - }; -} -var TOKEN_DELIM_OBJECT = 'delimiter.bracket.json'; -var TOKEN_DELIM_ARRAY = 'delimiter.array.json'; -var TOKEN_DELIM_COLON = 'delimiter.colon.json'; -var TOKEN_DELIM_COMMA = 'delimiter.comma.json'; -var TOKEN_VALUE_BOOLEAN = 'keyword.json'; -var TOKEN_VALUE_NULL = 'keyword.json'; -var TOKEN_VALUE_STRING = 'string.value.json'; -var TOKEN_VALUE_NUMBER = 'number.json'; -var TOKEN_PROPERTY_NAME = 'string.key.json'; -var TOKEN_COMMENT_BLOCK = 'comment.block.json'; -var TOKEN_COMMENT_LINE = 'comment.line.json'; -var JSONState = /** @class */ (function () { - function JSONState(state, scanError, lastWasColon) { - this._state = state; - this.scanError = scanError; - this.lastWasColon = lastWasColon; - } - JSONState.prototype.clone = function () { - return new JSONState(this._state, this.scanError, this.lastWasColon); - }; - JSONState.prototype.equals = function (other) { - if (other === this) { - return true; - } - if (!other || !(other instanceof JSONState)) { - return false; - } - return this.scanError === other.scanError && - this.lastWasColon === other.lastWasColon; - }; - JSONState.prototype.getStateData = function () { - return this._state; - }; - JSONState.prototype.setStateData = function (state) { - this._state = state; - }; - return JSONState; -}()); -function tokenize(comments, line, state, offsetDelta, stopAtOffset) { - if (offsetDelta === void 0) { offsetDelta = 0; } - // handle multiline strings and block comments - var numberOfInsertedCharacters = 0, adjustOffset = false; - switch (state.scanError) { - case 2 /* UnexpectedEndOfString */: - line = '"' + line; - numberOfInsertedCharacters = 1; - break; - case 1 /* UnexpectedEndOfComment */: - line = '/*' + line; - numberOfInsertedCharacters = 2; - break; - } - var scanner = main_createScanner(line), kind, ret, lastWasColon = state.lastWasColon; - ret = { - tokens: [], - endState: state.clone() - }; - while (true) { - var offset = offsetDelta + scanner.getPosition(), type = ''; - kind = scanner.scan(); - if (kind === 17 /* EOF */) { - break; - } - // Check that the scanner has advanced - if (offset === offsetDelta + scanner.getPosition()) { - throw new Error('Scanner did not advance, next 3 characters are: ' + line.substr(scanner.getPosition(), 3)); - } - // In case we inserted /* or " character, we need to - // adjust the offset of all tokens (except the first) - if (adjustOffset) { - offset -= numberOfInsertedCharacters; - } - adjustOffset = numberOfInsertedCharacters > 0; - // brackets and type - switch (kind) { - case 1 /* OpenBraceToken */: - type = TOKEN_DELIM_OBJECT; - lastWasColon = false; - break; - case 2 /* CloseBraceToken */: - type = TOKEN_DELIM_OBJECT; - lastWasColon = false; - break; - case 3 /* OpenBracketToken */: - type = TOKEN_DELIM_ARRAY; - lastWasColon = false; - break; - case 4 /* CloseBracketToken */: - type = TOKEN_DELIM_ARRAY; - lastWasColon = false; - break; - case 6 /* ColonToken */: - type = TOKEN_DELIM_COLON; - lastWasColon = true; - break; - case 5 /* CommaToken */: - type = TOKEN_DELIM_COMMA; - lastWasColon = false; - break; - case 8 /* TrueKeyword */: - case 9 /* FalseKeyword */: - type = TOKEN_VALUE_BOOLEAN; - lastWasColon = false; - break; - case 7 /* NullKeyword */: - type = TOKEN_VALUE_NULL; - lastWasColon = false; - break; - case 10 /* StringLiteral */: - type = lastWasColon ? TOKEN_VALUE_STRING : TOKEN_PROPERTY_NAME; - lastWasColon = false; - break; - case 11 /* NumericLiteral */: - type = TOKEN_VALUE_NUMBER; - lastWasColon = false; - break; - } - // comments, iff enabled - if (comments) { - switch (kind) { - case 12 /* LineCommentTrivia */: - type = TOKEN_COMMENT_LINE; - break; - case 13 /* BlockCommentTrivia */: - type = TOKEN_COMMENT_BLOCK; - break; - } - } - ret.endState = new JSONState(state.getStateData(), scanner.getTokenError(), lastWasColon); - ret.tokens.push({ - startIndex: offset, - scopes: type - }); - } - return ret; -} +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + +function createTokenizationSupport(supportComments) { + return { + getInitialState: function () { return new JSONState(null, null, false); }, + tokenize: function (line, state, offsetDelta, stopAtOffset) { return tokenize(supportComments, line, state, offsetDelta, stopAtOffset); } + }; +} +var TOKEN_DELIM_OBJECT = 'delimiter.bracket.json'; +var TOKEN_DELIM_ARRAY = 'delimiter.array.json'; +var TOKEN_DELIM_COLON = 'delimiter.colon.json'; +var TOKEN_DELIM_COMMA = 'delimiter.comma.json'; +var TOKEN_VALUE_BOOLEAN = 'keyword.json'; +var TOKEN_VALUE_NULL = 'keyword.json'; +var TOKEN_VALUE_STRING = 'string.value.json'; +var TOKEN_VALUE_NUMBER = 'number.json'; +var TOKEN_PROPERTY_NAME = 'string.key.json'; +var TOKEN_COMMENT_BLOCK = 'comment.block.json'; +var TOKEN_COMMENT_LINE = 'comment.line.json'; +var JSONState = /** @class */ (function () { + function JSONState(state, scanError, lastWasColon) { + this._state = state; + this.scanError = scanError; + this.lastWasColon = lastWasColon; + } + JSONState.prototype.clone = function () { + return new JSONState(this._state, this.scanError, this.lastWasColon); + }; + JSONState.prototype.equals = function (other) { + if (other === this) { + return true; + } + if (!other || !(other instanceof JSONState)) { + return false; + } + return this.scanError === other.scanError && + this.lastWasColon === other.lastWasColon; + }; + JSONState.prototype.getStateData = function () { + return this._state; + }; + JSONState.prototype.setStateData = function (state) { + this._state = state; + }; + return JSONState; +}()); +function tokenize(comments, line, state, offsetDelta, stopAtOffset) { + if (offsetDelta === void 0) { offsetDelta = 0; } + // handle multiline strings and block comments + var numberOfInsertedCharacters = 0, adjustOffset = false; + switch (state.scanError) { + case 2 /* UnexpectedEndOfString */: + line = '"' + line; + numberOfInsertedCharacters = 1; + break; + case 1 /* UnexpectedEndOfComment */: + line = '/*' + line; + numberOfInsertedCharacters = 2; + break; + } + var scanner = main_createScanner(line), kind, ret, lastWasColon = state.lastWasColon; + ret = { + tokens: [], + endState: state.clone() + }; + while (true) { + var offset = offsetDelta + scanner.getPosition(), type = ''; + kind = scanner.scan(); + if (kind === 17 /* EOF */) { + break; + } + // Check that the scanner has advanced + if (offset === offsetDelta + scanner.getPosition()) { + throw new Error('Scanner did not advance, next 3 characters are: ' + line.substr(scanner.getPosition(), 3)); + } + // In case we inserted /* or " character, we need to + // adjust the offset of all tokens (except the first) + if (adjustOffset) { + offset -= numberOfInsertedCharacters; + } + adjustOffset = numberOfInsertedCharacters > 0; + // brackets and type + switch (kind) { + case 1 /* OpenBraceToken */: + type = TOKEN_DELIM_OBJECT; + lastWasColon = false; + break; + case 2 /* CloseBraceToken */: + type = TOKEN_DELIM_OBJECT; + lastWasColon = false; + break; + case 3 /* OpenBracketToken */: + type = TOKEN_DELIM_ARRAY; + lastWasColon = false; + break; + case 4 /* CloseBracketToken */: + type = TOKEN_DELIM_ARRAY; + lastWasColon = false; + break; + case 6 /* ColonToken */: + type = TOKEN_DELIM_COLON; + lastWasColon = true; + break; + case 5 /* CommaToken */: + type = TOKEN_DELIM_COMMA; + lastWasColon = false; + break; + case 8 /* TrueKeyword */: + case 9 /* FalseKeyword */: + type = TOKEN_VALUE_BOOLEAN; + lastWasColon = false; + break; + case 7 /* NullKeyword */: + type = TOKEN_VALUE_NULL; + lastWasColon = false; + break; + case 10 /* StringLiteral */: + type = lastWasColon ? TOKEN_VALUE_STRING : TOKEN_PROPERTY_NAME; + lastWasColon = false; + break; + case 11 /* NumericLiteral */: + type = TOKEN_VALUE_NUMBER; + lastWasColon = false; + break; + } + // comments, iff enabled + if (comments) { + switch (kind) { + case 12 /* LineCommentTrivia */: + type = TOKEN_COMMENT_LINE; + break; + case 13 /* BlockCommentTrivia */: + type = TOKEN_COMMENT_BLOCK; + break; + } + } + ret.endState = new JSONState(state.getStateData(), scanner.getTokenError(), lastWasColon); + ret.tokens.push({ + startIndex: offset, + scopes: type + }); + } + return ret; +} // CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/jsonMode.js -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -function setupMode(defaults) { - var disposables = []; - var providers = []; - var client = new WorkerManager(defaults); - disposables.push(client); - var worker = function () { - var uris = []; - for (var _i = 0; _i < arguments.length; _i++) { - uris[_i] = arguments[_i]; - } - return client.getLanguageServiceWorker.apply(client, uris); - }; - function registerProviders() { - var languageId = defaults.languageId, modeConfiguration = defaults.modeConfiguration; - disposeAll(providers); - if (modeConfiguration.documentFormattingEdits) { - providers.push(monaco.languages.registerDocumentFormattingEditProvider(languageId, new DocumentFormattingEditProvider(worker))); - } - if (modeConfiguration.documentRangeFormattingEdits) { - providers.push(monaco.languages.registerDocumentRangeFormattingEditProvider(languageId, new DocumentRangeFormattingEditProvider(worker))); - } - if (modeConfiguration.completionItems) { - providers.push(monaco.languages.registerCompletionItemProvider(languageId, new languageFeatures_CompletionAdapter(worker))); - } - if (modeConfiguration.hovers) { - providers.push(monaco.languages.registerHoverProvider(languageId, new HoverAdapter(worker))); - } - if (modeConfiguration.documentSymbols) { - providers.push(monaco.languages.registerDocumentSymbolProvider(languageId, new DocumentSymbolAdapter(worker))); - } - if (modeConfiguration.tokens) { - providers.push(monaco.languages.setTokensProvider(languageId, createTokenizationSupport(true))); - } - if (modeConfiguration.colors) { - providers.push(monaco.languages.registerColorProvider(languageId, new DocumentColorAdapter(worker))); - } - if (modeConfiguration.foldingRanges) { - providers.push(monaco.languages.registerFoldingRangeProvider(languageId, new FoldingRangeAdapter(worker))); - } - if (modeConfiguration.diagnostics) { - providers.push(new DiagnosticsAdapter(languageId, worker, defaults)); - } - if (modeConfiguration.selectionRanges) { - providers.push(monaco.languages.registerSelectionRangeProvider(languageId, new SelectionRangeAdapter(worker))); - } - } - registerProviders(); - disposables.push(monaco.languages.setLanguageConfiguration(defaults.languageId, richEditConfiguration)); - var modeConfiguration = defaults.modeConfiguration; - defaults.onDidChange(function (newDefaults) { - if (newDefaults.modeConfiguration !== modeConfiguration) { - modeConfiguration = newDefaults.modeConfiguration; - registerProviders(); - } - }); - disposables.push(asDisposable(providers)); - return asDisposable(disposables); -} -function asDisposable(disposables) { - return { dispose: function () { return disposeAll(disposables); } }; -} -function disposeAll(disposables) { - while (disposables.length) { - disposables.pop().dispose(); - } -} -var richEditConfiguration = { - wordPattern: /(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g, - comments: { - lineComment: '//', - blockComment: ['/*', '*/'] - }, - brackets: [ - ['{', '}'], - ['[', ']'] - ], - autoClosingPairs: [ - { open: '{', close: '}', notIn: ['string'] }, - { open: '[', close: ']', notIn: ['string'] }, - { open: '"', close: '"', notIn: ['string'] } - ] -}; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + + +function setupMode(defaults) { + var disposables = []; + var providers = []; + var client = new WorkerManager(defaults); + disposables.push(client); + var worker = function () { + var uris = []; + for (var _i = 0; _i < arguments.length; _i++) { + uris[_i] = arguments[_i]; + } + return client.getLanguageServiceWorker.apply(client, uris); + }; + function registerProviders() { + var languageId = defaults.languageId, modeConfiguration = defaults.modeConfiguration; + disposeAll(providers); + if (modeConfiguration.documentFormattingEdits) { + providers.push(monaco.languages.registerDocumentFormattingEditProvider(languageId, new DocumentFormattingEditProvider(worker))); + } + if (modeConfiguration.documentRangeFormattingEdits) { + providers.push(monaco.languages.registerDocumentRangeFormattingEditProvider(languageId, new DocumentRangeFormattingEditProvider(worker))); + } + if (modeConfiguration.completionItems) { + providers.push(monaco.languages.registerCompletionItemProvider(languageId, new languageFeatures_CompletionAdapter(worker))); + } + if (modeConfiguration.hovers) { + providers.push(monaco.languages.registerHoverProvider(languageId, new HoverAdapter(worker))); + } + if (modeConfiguration.documentSymbols) { + providers.push(monaco.languages.registerDocumentSymbolProvider(languageId, new DocumentSymbolAdapter(worker))); + } + if (modeConfiguration.tokens) { + providers.push(monaco.languages.setTokensProvider(languageId, createTokenizationSupport(true))); + } + if (modeConfiguration.colors) { + providers.push(monaco.languages.registerColorProvider(languageId, new DocumentColorAdapter(worker))); + } + if (modeConfiguration.foldingRanges) { + providers.push(monaco.languages.registerFoldingRangeProvider(languageId, new FoldingRangeAdapter(worker))); + } + if (modeConfiguration.diagnostics) { + providers.push(new DiagnosticsAdapter(languageId, worker, defaults)); + } + if (modeConfiguration.selectionRanges) { + providers.push(monaco.languages.registerSelectionRangeProvider(languageId, new SelectionRangeAdapter(worker))); + } + } + registerProviders(); + disposables.push(monaco.languages.setLanguageConfiguration(defaults.languageId, richEditConfiguration)); + var modeConfiguration = defaults.modeConfiguration; + defaults.onDidChange(function (newDefaults) { + if (newDefaults.modeConfiguration !== modeConfiguration) { + modeConfiguration = newDefaults.modeConfiguration; + registerProviders(); + } + }); + disposables.push(asDisposable(providers)); + return asDisposable(disposables); +} +function asDisposable(disposables) { + return { dispose: function () { return disposeAll(disposables); } }; +} +function disposeAll(disposables) { + while (disposables.length) { + disposables.pop().dispose(); + } +} +var richEditConfiguration = { + wordPattern: /(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g, + comments: { + lineComment: '//', + blockComment: ['/*', '*/'] + }, + brackets: [ + ['{', '}'], + ['[', ']'] + ], + autoClosingPairs: [ + { open: '{', close: '}', notIn: ['string'] }, + { open: '[', close: ']', notIn: ['string'] }, + { open: '"', close: '"', notIn: ['string'] } + ] +}; /***/ }), diff --git a/25.a0d109f5.async.js b/25.a0d109f5.async.js index e8407b41d..cab3b7cb2 100644 --- a/25.a0d109f5.async.js +++ b/25.a0d109f5.async.js @@ -13,100 +13,100 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var conf = { - comments: { - lineComment: '*', - }, - brackets: [ - ['[', ']'], - ['(', ')'] - ], -}; -var abapKeywords = [ - 'abstract', 'add', 'add-corresponding', 'adjacent', 'alias', 'aliases', 'all', 'append', 'appending', 'ascending', 'as', 'assert', 'assign', 'assigned', 'assigning', 'association', 'authority-check', - 'back', 'begin', 'binary', 'block', 'bound', 'break-point', 'by', 'byte', - 'class', 'call', 'cast', 'changing', 'check', 'class-data', 'class-method', 'class-methods', 'clear', 'close', 'cnt', 'collect', 'commit', 'cond', 'character', - 'corresponding', 'communication', 'component', 'compute', 'concatenate', 'condense', 'constants', 'conv', 'count', - 'controls', 'convert', 'create', 'currency', - 'data', 'descending', 'default', 'define', 'deferred', 'delete', 'describe', 'detail', 'display', 'divide', 'divide-corresponding', 'display-mode', 'duplicates', - 'deleting', - 'editor-call', 'end', 'endexec', 'endfunction', 'ending', 'endmodule', 'end-of-definition', 'end-of-page', 'end-of-selection', 'end-test-injection', 'end-test-seam', 'exit-command', 'endclass', 'endmethod', 'endform', 'endinterface', - 'endprovide', 'endselect', 'endtry', 'endwhile', 'enum', 'event', 'events', 'exec', 'exit', 'export', - 'exporting', 'extract', 'exception', 'exceptions', - 'field-symbols', 'field-groups', 'field', 'first', 'fetch', 'fields', 'format', 'frame', 'free', 'from', 'function', 'find', 'for', 'found', 'function-pool', - 'generate', 'get', - 'handle', 'hide', 'hashed', - 'include', 'import', 'importing', 'index', 'infotypes', 'initial', 'initialization', - 'id', 'is', 'in', 'interface', 'interfaces', 'init', 'input', 'insert', 'instance', 'into', - 'key', - 'left-justified', 'leave', 'like', 'line', 'line-count', 'line-size', 'load', 'local', 'log-point', 'length', 'left', 'leading', 'lower', - 'matchcode', 'method', 'mesh', 'message', 'message-id', 'methods', 'modify', 'module', 'move', 'move-corresponding', 'multiply', 'multiply-corresponding', 'match', - 'new', 'new-line', 'new-page', 'new-section', 'next', 'no', 'no-gap', 'no-gaps', 'no-sign', 'no-zero', 'non-unique', 'number', - 'occurrence', 'object', 'obligatory', 'of', 'output', 'overlay', 'optional', 'others', 'occurrences', 'occurs', 'offset', 'options', - 'pack', 'parameters', 'perform', 'places', 'position', 'print-control', 'private', 'program', 'protected', 'provide', 'public', 'put', - 'radiobutton', 'raising', 'ranges', 'receive', 'receiving', 'redefinition', 'reduce', 'reference', 'refresh', 'regex', 'reject', 'results', 'requested', - 'ref', 'replace', 'report', 'reserve', 'restore', 'result', 'return', 'returning', 'right-justified', 'rollback', 'read', 'read-only', 'rp-provide-from-last', 'run', - 'scan', 'screen', 'scroll', 'search', 'select', 'select-options', 'selection-screen', 'stamp', 'source', 'subkey', - 'separated', 'set', 'shift', 'single', 'skip', 'sort', 'sorted', 'split', 'standard', 'stamp', 'starting', 'start-of-selection', 'sum', 'subtract-corresponding', 'statics', 'step', 'stop', 'structure', 'submatches', 'submit', 'subtract', 'summary', 'supplied', 'suppress', 'section', 'syntax-check', 'syntax-trace', 'system-call', 'switch', - 'tables', 'table', 'task', 'testing', 'test-seam', 'test-injection', 'then', 'time', 'times', 'title', 'titlebar', 'to', 'top-of-page', 'trailing', 'transfer', 'transformation', 'translate', 'transporting', 'types', 'type', 'type-pool', 'type-pools', - 'unassign', 'unique', 'uline', 'unpack', 'update', 'upper', 'using', - 'value', - 'when', 'while', 'window', 'write', 'where', 'with', 'work', - 'at', 'case', 'catch', 'continue', 'do', 'elseif', 'else', 'endat', 'endcase', 'enddo', 'endif', 'endloop', 'endon', 'if', 'loop', 'on', 'raise', 'try', - 'abs', 'sign', 'ceil', 'floor', 'trunc', 'frac', 'acos', 'asin', 'atan', 'cos', 'sin', 'tan', 'cosh', 'sinh', 'tanh', 'exp', 'log', 'log10', 'sqrt', 'strlen', 'xstrlen', 'charlen', 'lines', 'numofchar', 'dbmaxlen', 'round', 'rescale', 'nmax', 'nmin', 'cmax', 'cmin', 'boolc', 'boolx', 'xsdbool', 'contains', 'contains_any_of', 'contains_any_not_of', 'matches', 'line_exists', 'ipow', 'char_off', 'count', 'count_any_of', 'count_any_not_of', 'distance', 'condense', 'concat_lines_of', 'escape', 'find', 'find_end', 'find_any_of', 'find_any_not_of', 'insert', 'match', 'repeat', 'replace', 'reverse', 'segment', 'shift_left', 'shift_right', 'substring', 'substring_after', 'substring_from', 'substring_before', 'substring_to', 'to_upper', 'to_lower', 'to_mixed', 'from_mixed', 'translate', 'bit-set', 'line_index', - 'definition', 'implementation', 'public', 'inheriting', 'final' -]; -var language = { - defaultToken: 'invalid', - ignoreCase: true, - tokenPostfix: '.abap', - keywords: abapKeywords, - typeKeywords: [ - 'abap_bool', 'string', 'xstring', 'any', 'clike', 'csequence', 'numeric', - 'xsequence', 'c', 'n', 'i', 'p', 'f', 'd', 't', 'x' - ], - operators: [ - '+', '-', '/', '*', - '=', '<', '>', '<=', '>=', '<>', '><', '=<', '=>', - 'EQ', 'NE', 'GE', 'LE', - 'CS', 'CN', 'CA', 'CO', 'CP', 'NS', 'NA', 'NP', - ], - symbols: /[=>', '<=', '>=', '<>', '><', '=<', '=>', + 'EQ', 'NE', 'GE', 'LE', + 'CS', 'CN', 'CA', 'CO', 'CP', 'NS', 'NA', 'NP', + ], + symbols: /[=>\/\?\s]+)/g, - comments: { - lineComment: '//', - blockComment: ['/*', '*/'], - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'], - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: '\'', close: '\'' }, - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: '\'', close: '\'' }, - { open: '<', close: '>' }, - ], - folding: { - markers: { - start: new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:))") - } - } -}; -var keywords = [ - 'abstract', - 'activate', - 'and', - 'any', - 'array', - 'as', - 'asc', - 'assert', - 'autonomous', - 'begin', - 'bigdecimal', - 'blob', - 'boolean', - 'break', - 'bulk', - 'by', - 'case', - 'cast', - 'catch', - 'char', - 'class', - 'collect', - 'commit', - 'const', - 'continue', - 'convertcurrency', - 'decimal', - 'default', - 'delete', - 'desc', - 'do', - 'double', - 'else', - 'end', - 'enum', - 'exception', - 'exit', - 'export', - 'extends', - 'false', - 'final', - 'finally', - 'float', - 'for', - 'from', - 'future', - 'get', - 'global', - 'goto', - 'group', - 'having', - 'hint', - 'if', - 'implements', - 'import', - 'in', - 'inner', - 'insert', - 'instanceof', - 'int', - 'interface', - 'into', - 'join', - 'last_90_days', - 'last_month', - 'last_n_days', - 'last_week', - 'like', - 'limit', - 'list', - 'long', - 'loop', - 'map', - 'merge', - 'native', - 'new', - 'next_90_days', - 'next_month', - 'next_n_days', - 'next_week', - 'not', - 'null', - 'nulls', - 'number', - 'object', - 'of', - 'on', - 'or', - 'outer', - 'override', - 'package', - 'parallel', - 'pragma', - 'private', - 'protected', - 'public', - 'retrieve', - 'return', - 'returning', - 'rollback', - 'savepoint', - 'search', - 'select', - 'set', - 'short', - 'sort', - 'stat', - 'static', - 'strictfp', - 'super', - 'switch', - 'synchronized', - 'system', - 'testmethod', - 'then', - 'this', - 'this_month', - 'this_week', - 'throw', - 'throws', - 'today', - 'tolabel', - 'tomorrow', - 'transaction', - 'transient', - 'trigger', - 'true', - 'try', - 'type', - 'undelete', - 'update', - 'upsert', - 'using', - 'virtual', - 'void', - 'volatile', - 'webservice', - 'when', - 'where', - 'while', - 'yesterday' -]; -// create case variations of the keywords - apex is case insensitive, but we can't make the highlighter case insensitive -// because we use a heuristic to assume that identifiers starting with an upper case letter are types. -var uppercaseFirstLetter = function (lowercase) { return lowercase.charAt(0).toUpperCase() + lowercase.substr(1); }; -var keywordsWithCaseVariations = []; -keywords.forEach(function (lowercase) { - keywordsWithCaseVariations.push(lowercase); - keywordsWithCaseVariations.push(lowercase.toUpperCase()); - keywordsWithCaseVariations.push(uppercaseFirstLetter(lowercase)); -}); -var language = { - defaultToken: '', - tokenPostfix: '.apex', - keywords: keywordsWithCaseVariations, - operators: [ - '=', '>', '<', '!', '~', '?', ':', - '==', '<=', '>=', '!=', '&&', '||', '++', '--', - '+', '-', '*', '/', '&', '|', '^', '%', '<<', - '>>', '>>>', '+=', '-=', '*=', '/=', '&=', '|=', - '^=', '%=', '<<=', '>>=', '>>>=' - ], - // we include these common regular expressions - symbols: /[=>](?!@symbols)/, '@brackets'], - [/@symbols/, { - cases: { - '@operators': 'delimiter', - '@default': '' - } - }], - // @ annotations. - [/@\s*[a-zA-Z_\$][\w\$]*/, 'annotation'], - // numbers - [/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, 'number.float'], - [/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, 'number.float'], - [/(@digits)[fFdD]/, 'number.float'], - [/(@digits)[lL]?/, 'number'], - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - // strings - [/"([^"\\]|\\.)*$/, 'string.invalid'], - [/'([^'\\]|\\.)*$/, 'string.invalid'], - [/"/, 'string', '@string."'], - [/'/, 'string', '@string.\''], - // characters - [/'[^\\']'/, 'string'], - [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], - [/'/, 'string.invalid'] - ], - whitespace: [ - [/[ \t\r\n]+/, ''], - [/\/\*\*(?!\/)/, 'comment.doc', '@apexdoc'], - [/\/\*/, 'comment', '@comment'], - [/\/\/.*$/, 'comment'], - ], - comment: [ - [/[^\/*]+/, 'comment'], - // [/\/\*/, 'comment', '@push' ], // nested comment not allowed :-( - // [/\/\*/, 'comment.invalid' ], // this breaks block comments in the shape of /* //*/ - [/\*\//, 'comment', '@pop'], - [/[\/*]/, 'comment'] - ], - //Identical copy of comment above, except for the addition of .doc - apexdoc: [ - [/[^\/*]+/, 'comment.doc'], - [/\*\//, 'comment.doc', '@pop'], - [/[\/*]/, 'comment.doc'] - ], - string: [ - [/[^\\"']+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/["']/, { cases: { '$#==$S2': { token: 'string', next: '@pop' }, - '@default': 'string' } }] - ], - }, -}; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var conf = { + // the default separators except `@$` + wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, + comments: { + lineComment: '//', + blockComment: ['/*', '*/'], + }, + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'], + ], + autoClosingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"', close: '"' }, + { open: '\'', close: '\'' }, + ], + surroundingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"', close: '"' }, + { open: '\'', close: '\'' }, + { open: '<', close: '>' }, + ], + folding: { + markers: { + start: new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:))") + } + } +}; +var keywords = [ + 'abstract', + 'activate', + 'and', + 'any', + 'array', + 'as', + 'asc', + 'assert', + 'autonomous', + 'begin', + 'bigdecimal', + 'blob', + 'boolean', + 'break', + 'bulk', + 'by', + 'case', + 'cast', + 'catch', + 'char', + 'class', + 'collect', + 'commit', + 'const', + 'continue', + 'convertcurrency', + 'decimal', + 'default', + 'delete', + 'desc', + 'do', + 'double', + 'else', + 'end', + 'enum', + 'exception', + 'exit', + 'export', + 'extends', + 'false', + 'final', + 'finally', + 'float', + 'for', + 'from', + 'future', + 'get', + 'global', + 'goto', + 'group', + 'having', + 'hint', + 'if', + 'implements', + 'import', + 'in', + 'inner', + 'insert', + 'instanceof', + 'int', + 'interface', + 'into', + 'join', + 'last_90_days', + 'last_month', + 'last_n_days', + 'last_week', + 'like', + 'limit', + 'list', + 'long', + 'loop', + 'map', + 'merge', + 'native', + 'new', + 'next_90_days', + 'next_month', + 'next_n_days', + 'next_week', + 'not', + 'null', + 'nulls', + 'number', + 'object', + 'of', + 'on', + 'or', + 'outer', + 'override', + 'package', + 'parallel', + 'pragma', + 'private', + 'protected', + 'public', + 'retrieve', + 'return', + 'returning', + 'rollback', + 'savepoint', + 'search', + 'select', + 'set', + 'short', + 'sort', + 'stat', + 'static', + 'strictfp', + 'super', + 'switch', + 'synchronized', + 'system', + 'testmethod', + 'then', + 'this', + 'this_month', + 'this_week', + 'throw', + 'throws', + 'today', + 'tolabel', + 'tomorrow', + 'transaction', + 'transient', + 'trigger', + 'true', + 'try', + 'type', + 'undelete', + 'update', + 'upsert', + 'using', + 'virtual', + 'void', + 'volatile', + 'webservice', + 'when', + 'where', + 'while', + 'yesterday' +]; +// create case variations of the keywords - apex is case insensitive, but we can't make the highlighter case insensitive +// because we use a heuristic to assume that identifiers starting with an upper case letter are types. +var uppercaseFirstLetter = function (lowercase) { return lowercase.charAt(0).toUpperCase() + lowercase.substr(1); }; +var keywordsWithCaseVariations = []; +keywords.forEach(function (lowercase) { + keywordsWithCaseVariations.push(lowercase); + keywordsWithCaseVariations.push(lowercase.toUpperCase()); + keywordsWithCaseVariations.push(uppercaseFirstLetter(lowercase)); +}); +var language = { + defaultToken: '', + tokenPostfix: '.apex', + keywords: keywordsWithCaseVariations, + operators: [ + '=', '>', '<', '!', '~', '?', ':', + '==', '<=', '>=', '!=', '&&', '||', '++', '--', + '+', '-', '*', '/', '&', '|', '^', '%', '<<', + '>>', '>>>', '+=', '-=', '*=', '/=', '&=', '|=', + '^=', '%=', '<<=', '>>=', '>>>=' + ], + // we include these common regular expressions + symbols: /[=>](?!@symbols)/, '@brackets'], + [/@symbols/, { + cases: { + '@operators': 'delimiter', + '@default': '' + } + }], + // @ annotations. + [/@\s*[a-zA-Z_\$][\w\$]*/, 'annotation'], + // numbers + [/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/, 'number.float'], + [/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/, 'number.float'], + [/(@digits)[fFdD]/, 'number.float'], + [/(@digits)[lL]?/, 'number'], + // delimiter: after number because of .\d floats + [/[;,.]/, 'delimiter'], + // strings + [/"([^"\\]|\\.)*$/, 'string.invalid'], + [/'([^'\\]|\\.)*$/, 'string.invalid'], + [/"/, 'string', '@string."'], + [/'/, 'string', '@string.\''], + // characters + [/'[^\\']'/, 'string'], + [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], + [/'/, 'string.invalid'] + ], + whitespace: [ + [/[ \t\r\n]+/, ''], + [/\/\*\*(?!\/)/, 'comment.doc', '@apexdoc'], + [/\/\*/, 'comment', '@comment'], + [/\/\/.*$/, 'comment'], + ], + comment: [ + [/[^\/*]+/, 'comment'], + // [/\/\*/, 'comment', '@push' ], // nested comment not allowed :-( + // [/\/\*/, 'comment.invalid' ], // this breaks block comments in the shape of /* //*/ + [/\*\//, 'comment', '@pop'], + [/[\/*]/, 'comment'] + ], + //Identical copy of comment above, except for the addition of .doc + apexdoc: [ + [/[^\/*]+/, 'comment.doc'], + [/\*\//, 'comment.doc', '@pop'], + [/[\/*]/, 'comment.doc'] + ], + string: [ + [/[^\\"']+/, 'string'], + [/@escapes/, 'string.escape'], + [/\\./, 'string.escape.invalid'], + [/["']/, { cases: { '$#==$S2': { token: 'string', next: '@pop' }, + '@default': 'string' } }] + ], + }, +}; /***/ }) diff --git a/27.166a58e7.async.js b/27.166a58e7.async.js index beedb2782..59bf1308e 100644 --- a/27.166a58e7.async.js +++ b/27.166a58e7.async.js @@ -13,61 +13,61 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var conf = { - comments: { - lineComment: '#', - } -}; -var language = { - defaultToken: 'keyword', - ignoreCase: true, - tokenPostfix: '.azcli', - str: /[^#\s]/, - tokenizer: { - root: [ - { include: '@comment' }, - [/\s-+@str*\s*/, { - cases: { - '@eos': { token: 'key.identifier', next: '@popall' }, - '@default': { token: 'key.identifier', next: '@type' } - } - }], - [/^-+@str*\s*/, { - cases: { - '@eos': { token: 'key.identifier', next: '@popall' }, - '@default': { token: 'key.identifier', next: '@type' } - } - }] - ], - type: [ - { include: '@comment' }, - [/-+@str*\s*/, { - cases: { - '@eos': { token: 'key.identifier', next: '@popall' }, - '@default': 'key.identifier' - } - }], - [/@str+\s*/, { - cases: { - '@eos': { token: 'string', next: '@popall' }, - '@default': 'string' - } - }] - ], - comment: [ - [/#.*$/, { - cases: { - '@eos': { token: 'comment', next: '@popall' } - } - }] - ] - } -}; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var conf = { + comments: { + lineComment: '#', + } +}; +var language = { + defaultToken: 'keyword', + ignoreCase: true, + tokenPostfix: '.azcli', + str: /[^#\s]/, + tokenizer: { + root: [ + { include: '@comment' }, + [/\s-+@str*\s*/, { + cases: { + '@eos': { token: 'key.identifier', next: '@popall' }, + '@default': { token: 'key.identifier', next: '@type' } + } + }], + [/^-+@str*\s*/, { + cases: { + '@eos': { token: 'key.identifier', next: '@popall' }, + '@default': { token: 'key.identifier', next: '@type' } + } + }] + ], + type: [ + { include: '@comment' }, + [/-+@str*\s*/, { + cases: { + '@eos': { token: 'key.identifier', next: '@popall' }, + '@default': 'key.identifier' + } + }], + [/@str+\s*/, { + cases: { + '@eos': { token: 'string', next: '@popall' }, + '@default': 'string' + } + }] + ], + comment: [ + [/#.*$/, { + cases: { + '@eos': { token: 'comment', next: '@popall' } + } + }] + ] + } +}; /***/ }) diff --git a/28.14f5abf9.async.js b/28.14f5abf9.async.js index 2d3c6098b..9aabcf302 100644 --- a/28.14f5abf9.async.js +++ b/28.14f5abf9.async.js @@ -13,102 +13,102 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var conf = { - comments: { - lineComment: 'REM' - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - ], - surroundingPairs: [ - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - ], - folding: { - markers: { - start: new RegExp("^\\s*(::\\s*|REM\\s+)#region"), - end: new RegExp("^\\s*(::\\s*|REM\\s+)#endregion") - } - } -}; -var language = { - defaultToken: '', - ignoreCase: true, - tokenPostfix: '.bat', - brackets: [ - { token: 'delimiter.bracket', open: '{', close: '}' }, - { token: 'delimiter.parenthesis', open: '(', close: ')' }, - { token: 'delimiter.square', open: '[', close: ']' } - ], - keywords: /call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/, - // we include these common regular expressions - symbols: /[=>'], - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '<', close: '>' }, - { open: '\'', close: '\'' }, - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '<', close: '>' }, - { open: '\'', close: '\'' }, - ] -}; -var language = { - defaultToken: '', - tokenPostfix: '.cameligo', - ignoreCase: true, - brackets: [ - { open: '{', close: '}', token: 'delimiter.curly' }, - { open: '[', close: ']', token: 'delimiter.square' }, - { open: '(', close: ')', token: 'delimiter.parenthesis' }, - { open: '<', close: '>', token: 'delimiter.angle' } - ], - keywords: [ - 'abs', 'begin', 'Bytes', 'Crypto', 'Current', 'else', 'end', 'failwith', - 'false', 'fun', 'if', 'in', 'let', 'let%entry', 'let%init', 'List', 'list', - 'Map', 'map', 'match', 'match%nat', 'mod', 'not', 'operation', 'Operation', 'of', - 'Set', 'set', 'sender', 'source', 'String', 'then', 'true', 'type', 'with', - ], - typeKeywords: [ - 'int', 'unit', 'string', 'tz', - ], - operators: [ - '=', '>', '<', '<=', '>=', '<>', ':', ':=', 'and', 'mod', 'or', - '+', '-', '*', '/', '@', '&', '^', '%', '->', '<-' - ], - // we include these common regular expressions - symbols: /[=><:@\^&|+\-*\/\^%]+/, - // The main tokenizer for our languages - tokenizer: { - root: [ - // identifiers and keywords - [/[a-zA-Z_][\w]*/, { - cases: { - '@keywords': { token: 'keyword.$0' }, - '@default': 'identifier' - } - }], - // whitespace - { include: '@whitespace' }, - // delimiters and operators - [/[{}()\[\]]/, '@brackets'], - [/[<>](?!@symbols)/, '@brackets'], - [/@symbols/, { - cases: { - '@operators': 'delimiter', - '@default': '' - } - }], - // numbers - [/\d*\.\d+([eE][\-+]?\d+)?/, 'number.float'], - [/\$[0-9a-fA-F]{1,16}/, 'number.hex'], - [/\d+/, 'number'], - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - // strings - [/'([^'\\]|\\.)*$/, 'string.invalid'], - [/'/, 'string', '@string'], - // characters - [/'[^\\']'/, 'string'], - [/'/, 'string.invalid'], - [/\#\d+/, 'string'] - ], - /* */ - comment: [ - [/[^\(\*]+/, 'comment'], - //[/\(\*/, 'comment', '@push' ], // nested comment not allowed :-( - [/\*\)/, 'comment', '@pop'], - [/\(\*/, 'comment'] - ], - string: [ - [/[^\\']+/, 'string'], - [/\\./, 'string.escape.invalid'], - [/'/, { token: 'string.quote', bracket: '@close', next: '@pop' }] - ], - whitespace: [ - [/[ \t\r\n]+/, 'white'], - [/\(\*/, 'comment', '@comment'], - [/\/\/.*$/, 'comment'], - ], - }, -}; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var conf = { + comments: { + lineComment: '//', + blockComment: ['(*', '*)'], + }, + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'], + ['<', '>'], + ], + autoClosingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '<', close: '>' }, + { open: '\'', close: '\'' }, + ], + surroundingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '<', close: '>' }, + { open: '\'', close: '\'' }, + ] +}; +var language = { + defaultToken: '', + tokenPostfix: '.cameligo', + ignoreCase: true, + brackets: [ + { open: '{', close: '}', token: 'delimiter.curly' }, + { open: '[', close: ']', token: 'delimiter.square' }, + { open: '(', close: ')', token: 'delimiter.parenthesis' }, + { open: '<', close: '>', token: 'delimiter.angle' } + ], + keywords: [ + 'abs', 'begin', 'Bytes', 'Crypto', 'Current', 'else', 'end', 'failwith', + 'false', 'fun', 'if', 'in', 'let', 'let%entry', 'let%init', 'List', 'list', + 'Map', 'map', 'match', 'match%nat', 'mod', 'not', 'operation', 'Operation', 'of', + 'Set', 'set', 'sender', 'source', 'String', 'then', 'true', 'type', 'with', + ], + typeKeywords: [ + 'int', 'unit', 'string', 'tz', + ], + operators: [ + '=', '>', '<', '<=', '>=', '<>', ':', ':=', 'and', 'mod', 'or', + '+', '-', '*', '/', '@', '&', '^', '%', '->', '<-' + ], + // we include these common regular expressions + symbols: /[=><:@\^&|+\-*\/\^%]+/, + // The main tokenizer for our languages + tokenizer: { + root: [ + // identifiers and keywords + [/[a-zA-Z_][\w]*/, { + cases: { + '@keywords': { token: 'keyword.$0' }, + '@default': 'identifier' + } + }], + // whitespace + { include: '@whitespace' }, + // delimiters and operators + [/[{}()\[\]]/, '@brackets'], + [/[<>](?!@symbols)/, '@brackets'], + [/@symbols/, { + cases: { + '@operators': 'delimiter', + '@default': '' + } + }], + // numbers + [/\d*\.\d+([eE][\-+]?\d+)?/, 'number.float'], + [/\$[0-9a-fA-F]{1,16}/, 'number.hex'], + [/\d+/, 'number'], + // delimiter: after number because of .\d floats + [/[;,.]/, 'delimiter'], + // strings + [/'([^'\\]|\\.)*$/, 'string.invalid'], + [/'/, 'string', '@string'], + // characters + [/'[^\\']'/, 'string'], + [/'/, 'string.invalid'], + [/\#\d+/, 'string'] + ], + /* */ + comment: [ + [/[^\(\*]+/, 'comment'], + //[/\(\*/, 'comment', '@push' ], // nested comment not allowed :-( + [/\*\)/, 'comment', '@pop'], + [/\(\*/, 'comment'] + ], + string: [ + [/[^\\']+/, 'string'], + [/\\./, 'string.escape.invalid'], + [/'/, { token: 'string.quote', bracket: '@close', next: '@pop' }] + ], + whitespace: [ + [/[ \t\r\n]+/, 'white'], + [/\(\*/, 'comment', '@comment'], + [/\/\/.*$/, 'comment'], + ], + }, +}; /***/ }) diff --git a/30.0ee59578.async.js b/30.0ee59578.async.js index 1acf15f64..e11cbaad7 100644 --- a/30.0ee59578.async.js +++ b/30.0ee59578.async.js @@ -13,768 +13,768 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var conf = { - comments: { - lineComment: ';;', - }, - brackets: [ - ['[', ']'], - ['(', ')'], - ['{', '}'] - ], - autoClosingPairs: [ - { open: '[', close: ']' }, - { open: '"', close: '"' }, - { open: '(', close: ')' }, - { open: '{', close: '}' }, - ], - surroundingPairs: [ - { open: '[', close: ']' }, - { open: '"', close: '"' }, - { open: '(', close: ')' }, - { open: '{', close: '}' }, - ], -}; -var language = { - defaultToken: '', - ignoreCase: true, - tokenPostfix: '.clj', - brackets: [ - { open: '[', close: ']', token: 'delimiter.square' }, - { open: '(', close: ')', token: 'delimiter.parenthesis' }, - { open: '{', close: '}', token: 'delimiter.curly' }, - ], - constants: ['true', 'false', 'nil'], - // delimiters: /[\\\[\]\s"#'(),;@^`{}~]|$/, - numbers: /^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/, - characters: /^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/, - escapes: /^\\(?:["'\\bfnrt]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/, - // simple-namespace := /^[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*/ - // simple-symbol := /^(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)/ - // qualified-symbol := ((<.>)*)? - qualifiedSymbols: /^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/, - specialForms: [ - '.', - 'catch', - 'def', - 'do', - 'if', - 'monitor-enter', - 'monitor-exit', - 'new', - 'quote', - 'recur', - 'set!', - 'throw', - 'try', - 'var', - ], - coreSymbols: [ - '*', - '*\'', - '*1', - '*2', - '*3', - '*agent*', - '*allow-unresolved-vars*', - '*assert*', - '*clojure-version*', - '*command-line-args*', - '*compile-files*', - '*compile-path*', - '*compiler-options*', - '*data-readers*', - '*default-data-reader-fn*', - '*e', - '*err*', - '*file*', - '*flush-on-newline*', - '*fn-loader*', - '*in*', - '*math-context*', - '*ns*', - '*out*', - '*print-dup*', - '*print-length*', - '*print-level*', - '*print-meta*', - '*print-namespace-maps*', - '*print-readably*', - '*read-eval*', - '*reader-resolver*', - '*source-path*', - '*suppress-read*', - '*unchecked-math*', - '*use-context-classloader*', - '*verbose-defrecords*', - '*warn-on-reflection*', - '+', - '+\'', - '-', - '-\'', - '->', - '->>', - '->ArrayChunk', - '->Eduction', - '->Vec', - '->VecNode', - '->VecSeq', - '-cache-protocol-fn', - '-reset-methods', - '..', - '/', - '<', - '<=', - '=', - '==', - '>', - '>=', - 'EMPTY-NODE', - 'Inst', - 'StackTraceElement->vec', - 'Throwable->map', - 'accessor', - 'aclone', - 'add-classpath', - 'add-watch', - 'agent', - 'agent-error', - 'agent-errors', - 'aget', - 'alength', - 'alias', - 'all-ns', - 'alter', - 'alter-meta!', - 'alter-var-root', - 'amap', - 'ancestors', - 'and', - 'any?', - 'apply', - 'areduce', - 'array-map', - 'as->', - 'aset', - 'aset-boolean', - 'aset-byte', - 'aset-char', - 'aset-double', - 'aset-float', - 'aset-int', - 'aset-long', - 'aset-short', - 'assert', - 'assoc', - 'assoc!', - 'assoc-in', - 'associative?', - 'atom', - 'await', - 'await-for', - 'await1', - 'bases', - 'bean', - 'bigdec', - 'bigint', - 'biginteger', - 'binding', - 'bit-and', - 'bit-and-not', - 'bit-clear', - 'bit-flip', - 'bit-not', - 'bit-or', - 'bit-set', - 'bit-shift-left', - 'bit-shift-right', - 'bit-test', - 'bit-xor', - 'boolean', - 'boolean-array', - 'boolean?', - 'booleans', - 'bound-fn', - 'bound-fn*', - 'bound?', - 'bounded-count', - 'butlast', - 'byte', - 'byte-array', - 'bytes', - 'bytes?', - 'case', - 'cast', - 'cat', - 'char', - 'char-array', - 'char-escape-string', - 'char-name-string', - 'char?', - 'chars', - 'chunk', - 'chunk-append', - 'chunk-buffer', - 'chunk-cons', - 'chunk-first', - 'chunk-next', - 'chunk-rest', - 'chunked-seq?', - 'class', - 'class?', - 'clear-agent-errors', - 'clojure-version', - 'coll?', - 'comment', - 'commute', - 'comp', - 'comparator', - 'compare', - 'compare-and-set!', - 'compile', - 'complement', - 'completing', - 'concat', - 'cond', - 'cond->', - 'cond->>', - 'condp', - 'conj', - 'conj!', - 'cons', - 'constantly', - 'construct-proxy', - 'contains?', - 'count', - 'counted?', - 'create-ns', - 'create-struct', - 'cycle', - 'dec', - 'dec\'', - 'decimal?', - 'declare', - 'dedupe', - 'default-data-readers', - 'definline', - 'definterface', - 'defmacro', - 'defmethod', - 'defmulti', - 'defn', - 'defn-', - 'defonce', - 'defprotocol', - 'defrecord', - 'defstruct', - 'deftype', - 'delay', - 'delay?', - 'deliver', - 'denominator', - 'deref', - 'derive', - 'descendants', - 'destructure', - 'disj', - 'disj!', - 'dissoc', - 'dissoc!', - 'distinct', - 'distinct?', - 'doall', - 'dorun', - 'doseq', - 'dosync', - 'dotimes', - 'doto', - 'double', - 'double-array', - 'double?', - 'doubles', - 'drop', - 'drop-last', - 'drop-while', - 'eduction', - 'empty', - 'empty?', - 'ensure', - 'ensure-reduced', - 'enumeration-seq', - 'error-handler', - 'error-mode', - 'eval', - 'even?', - 'every-pred', - 'every?', - 'ex-data', - 'ex-info', - 'extend', - 'extend-protocol', - 'extend-type', - 'extenders', - 'extends?', - 'false?', - 'ffirst', - 'file-seq', - 'filter', - 'filterv', - 'find', - 'find-keyword', - 'find-ns', - 'find-protocol-impl', - 'find-protocol-method', - 'find-var', - 'first', - 'flatten', - 'float', - 'float-array', - 'float?', - 'floats', - 'flush', - 'fn', - 'fn?', - 'fnext', - 'fnil', - 'for', - 'force', - 'format', - 'frequencies', - 'future', - 'future-call', - 'future-cancel', - 'future-cancelled?', - 'future-done?', - 'future?', - 'gen-class', - 'gen-interface', - 'gensym', - 'get', - 'get-in', - 'get-method', - 'get-proxy-class', - 'get-thread-bindings', - 'get-validator', - 'group-by', - 'halt-when', - 'hash', - 'hash-combine', - 'hash-map', - 'hash-ordered-coll', - 'hash-set', - 'hash-unordered-coll', - 'ident?', - 'identical?', - 'identity', - 'if-let', - 'if-not', - 'if-some', - 'ifn?', - 'import', - 'in-ns', - 'inc', - 'inc\'', - 'indexed?', - 'init-proxy', - 'inst-ms', - 'inst-ms*', - 'inst?', - 'instance?', - 'int', - 'int-array', - 'int?', - 'integer?', - 'interleave', - 'intern', - 'interpose', - 'into', - 'into-array', - 'ints', - 'io!', - 'isa?', - 'iterate', - 'iterator-seq', - 'juxt', - 'keep', - 'keep-indexed', - 'key', - 'keys', - 'keyword', - 'keyword?', - 'last', - 'lazy-cat', - 'lazy-seq', - 'let', - 'letfn', - 'line-seq', - 'list', - 'list*', - 'list?', - 'load', - 'load-file', - 'load-reader', - 'load-string', - 'loaded-libs', - 'locking', - 'long', - 'long-array', - 'longs', - 'loop', - 'macroexpand', - 'macroexpand-1', - 'make-array', - 'make-hierarchy', - 'map', - 'map-entry?', - 'map-indexed', - 'map?', - 'mapcat', - 'mapv', - 'max', - 'max-key', - 'memfn', - 'memoize', - 'merge', - 'merge-with', - 'meta', - 'method-sig', - 'methods', - 'min', - 'min-key', - 'mix-collection-hash', - 'mod', - 'munge', - 'name', - 'namespace', - 'namespace-munge', - 'nat-int?', - 'neg-int?', - 'neg?', - 'newline', - 'next', - 'nfirst', - 'nil?', - 'nnext', - 'not', - 'not-any?', - 'not-empty', - 'not-every?', - 'not=', - 'ns', - 'ns-aliases', - 'ns-imports', - 'ns-interns', - 'ns-map', - 'ns-name', - 'ns-publics', - 'ns-refers', - 'ns-resolve', - 'ns-unalias', - 'ns-unmap', - 'nth', - 'nthnext', - 'nthrest', - 'num', - 'number?', - 'numerator', - 'object-array', - 'odd?', - 'or', - 'parents', - 'partial', - 'partition', - 'partition-all', - 'partition-by', - 'pcalls', - 'peek', - 'persistent!', - 'pmap', - 'pop', - 'pop!', - 'pop-thread-bindings', - 'pos-int?', - 'pos?', - 'pr', - 'pr-str', - 'prefer-method', - 'prefers', - 'primitives-classnames', - 'print', - 'print-ctor', - 'print-dup', - 'print-method', - 'print-simple', - 'print-str', - 'printf', - 'println', - 'println-str', - 'prn', - 'prn-str', - 'promise', - 'proxy', - 'proxy-call-with-super', - 'proxy-mappings', - 'proxy-name', - 'proxy-super', - 'push-thread-bindings', - 'pvalues', - 'qualified-ident?', - 'qualified-keyword?', - 'qualified-symbol?', - 'quot', - 'rand', - 'rand-int', - 'rand-nth', - 'random-sample', - 'range', - 'ratio?', - 'rational?', - 'rationalize', - 're-find', - 're-groups', - 're-matcher', - 're-matches', - 're-pattern', - 're-seq', - 'read', - 'read-line', - 'read-string', - 'reader-conditional', - 'reader-conditional?', - 'realized?', - 'record?', - 'reduce', - 'reduce-kv', - 'reduced', - 'reduced?', - 'reductions', - 'ref', - 'ref-history-count', - 'ref-max-history', - 'ref-min-history', - 'ref-set', - 'refer', - 'refer-clojure', - 'reify', - 'release-pending-sends', - 'rem', - 'remove', - 'remove-all-methods', - 'remove-method', - 'remove-ns', - 'remove-watch', - 'repeat', - 'repeatedly', - 'replace', - 'replicate', - 'require', - 'reset!', - 'reset-meta!', - 'reset-vals!', - 'resolve', - 'rest', - 'restart-agent', - 'resultset-seq', - 'reverse', - 'reversible?', - 'rseq', - 'rsubseq', - 'run!', - 'satisfies?', - 'second', - 'select-keys', - 'send', - 'send-off', - 'send-via', - 'seq', - 'seq?', - 'seqable?', - 'seque', - 'sequence', - 'sequential?', - 'set', - 'set-agent-send-executor!', - 'set-agent-send-off-executor!', - 'set-error-handler!', - 'set-error-mode!', - 'set-validator!', - 'set?', - 'short', - 'short-array', - 'shorts', - 'shuffle', - 'shutdown-agents', - 'simple-ident?', - 'simple-keyword?', - 'simple-symbol?', - 'slurp', - 'some', - 'some->', - 'some->>', - 'some-fn', - 'some?', - 'sort', - 'sort-by', - 'sorted-map', - 'sorted-map-by', - 'sorted-set', - 'sorted-set-by', - 'sorted?', - 'special-symbol?', - 'spit', - 'split-at', - 'split-with', - 'str', - 'string?', - 'struct', - 'struct-map', - 'subs', - 'subseq', - 'subvec', - 'supers', - 'swap!', - 'swap-vals!', - 'symbol', - 'symbol?', - 'sync', - 'tagged-literal', - 'tagged-literal?', - 'take', - 'take-last', - 'take-nth', - 'take-while', - 'test', - 'the-ns', - 'thread-bound?', - 'time', - 'to-array', - 'to-array-2d', - 'trampoline', - 'transduce', - 'transient', - 'tree-seq', - 'true?', - 'type', - 'unchecked-add', - 'unchecked-add-int', - 'unchecked-byte', - 'unchecked-char', - 'unchecked-dec', - 'unchecked-dec-int', - 'unchecked-divide-int', - 'unchecked-double', - 'unchecked-float', - 'unchecked-inc', - 'unchecked-inc-int', - 'unchecked-int', - 'unchecked-long', - 'unchecked-multiply', - 'unchecked-multiply-int', - 'unchecked-negate', - 'unchecked-negate-int', - 'unchecked-remainder-int', - 'unchecked-short', - 'unchecked-subtract', - 'unchecked-subtract-int', - 'underive', - 'unquote', - 'unquote-splicing', - 'unreduced', - 'unsigned-bit-shift-right', - 'update', - 'update-in', - 'update-proxy', - 'uri?', - 'use', - 'uuid?', - 'val', - 'vals', - 'var-get', - 'var-set', - 'var?', - 'vary-meta', - 'vec', - 'vector', - 'vector-of', - 'vector?', - 'volatile!', - 'volatile?', - 'vreset!', - 'vswap!', - 'when', - 'when-first', - 'when-let', - 'when-not', - 'when-some', - 'while', - 'with-bindings', - 'with-bindings*', - 'with-in-str', - 'with-loading-context', - 'with-local-vars', - 'with-meta', - 'with-open', - 'with-out-str', - 'with-precision', - 'with-redefs', - 'with-redefs-fn', - 'xml-seq', - 'zero?', - 'zipmap', - ], - tokenizer: { - root: [ - // whitespaces and comments - { include: '@whitespace' }, - // numbers - [/@numbers/, 'number'], - // characters - [/@characters/, 'string'], - // strings - { include: '@string' }, - // brackets - [/[()\[\]{}]/, '@brackets'], - // regular expressions - [/\/#"(?:\.|(?:")|[^"\n])*"\/g/, 'regexp'], - // reader macro characters - [/[#'@^`~]/, 'meta'], - // symbols - [/@qualifiedSymbols/, { - cases: { - '^:.+$': 'constant', - '@specialForms': 'keyword', - '@coreSymbols': 'keyword', - '@constants': 'constant', - '@default': 'identifier', - }, - }, - ], - ], - whitespace: [ - [/[\s,]+/, 'white'], - [/;.*$/, 'comment'], - [/\(comment\b/, 'comment', '@comment'], - ], - comment: [ - [/\(/, 'comment', '@push'], - [/\)/, 'comment', '@pop'], - [/[^()]/, 'comment'], - ], - string: [ - [/"/, 'string', '@multiLineString'], - ], - multiLineString: [ - [/"/, 'string', '@popall'], - [/@escapes/, 'string.escape'], - [/./, 'string'] - ], - }, -}; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var conf = { + comments: { + lineComment: ';;', + }, + brackets: [ + ['[', ']'], + ['(', ')'], + ['{', '}'] + ], + autoClosingPairs: [ + { open: '[', close: ']' }, + { open: '"', close: '"' }, + { open: '(', close: ')' }, + { open: '{', close: '}' }, + ], + surroundingPairs: [ + { open: '[', close: ']' }, + { open: '"', close: '"' }, + { open: '(', close: ')' }, + { open: '{', close: '}' }, + ], +}; +var language = { + defaultToken: '', + ignoreCase: true, + tokenPostfix: '.clj', + brackets: [ + { open: '[', close: ']', token: 'delimiter.square' }, + { open: '(', close: ')', token: 'delimiter.parenthesis' }, + { open: '{', close: '}', token: 'delimiter.curly' }, + ], + constants: ['true', 'false', 'nil'], + // delimiters: /[\\\[\]\s"#'(),;@^`{}~]|$/, + numbers: /^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/, + characters: /^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/, + escapes: /^\\(?:["'\\bfnrt]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/, + // simple-namespace := /^[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*/ + // simple-symbol := /^(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)/ + // qualified-symbol := ((<.>)*)? + qualifiedSymbols: /^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/, + specialForms: [ + '.', + 'catch', + 'def', + 'do', + 'if', + 'monitor-enter', + 'monitor-exit', + 'new', + 'quote', + 'recur', + 'set!', + 'throw', + 'try', + 'var', + ], + coreSymbols: [ + '*', + '*\'', + '*1', + '*2', + '*3', + '*agent*', + '*allow-unresolved-vars*', + '*assert*', + '*clojure-version*', + '*command-line-args*', + '*compile-files*', + '*compile-path*', + '*compiler-options*', + '*data-readers*', + '*default-data-reader-fn*', + '*e', + '*err*', + '*file*', + '*flush-on-newline*', + '*fn-loader*', + '*in*', + '*math-context*', + '*ns*', + '*out*', + '*print-dup*', + '*print-length*', + '*print-level*', + '*print-meta*', + '*print-namespace-maps*', + '*print-readably*', + '*read-eval*', + '*reader-resolver*', + '*source-path*', + '*suppress-read*', + '*unchecked-math*', + '*use-context-classloader*', + '*verbose-defrecords*', + '*warn-on-reflection*', + '+', + '+\'', + '-', + '-\'', + '->', + '->>', + '->ArrayChunk', + '->Eduction', + '->Vec', + '->VecNode', + '->VecSeq', + '-cache-protocol-fn', + '-reset-methods', + '..', + '/', + '<', + '<=', + '=', + '==', + '>', + '>=', + 'EMPTY-NODE', + 'Inst', + 'StackTraceElement->vec', + 'Throwable->map', + 'accessor', + 'aclone', + 'add-classpath', + 'add-watch', + 'agent', + 'agent-error', + 'agent-errors', + 'aget', + 'alength', + 'alias', + 'all-ns', + 'alter', + 'alter-meta!', + 'alter-var-root', + 'amap', + 'ancestors', + 'and', + 'any?', + 'apply', + 'areduce', + 'array-map', + 'as->', + 'aset', + 'aset-boolean', + 'aset-byte', + 'aset-char', + 'aset-double', + 'aset-float', + 'aset-int', + 'aset-long', + 'aset-short', + 'assert', + 'assoc', + 'assoc!', + 'assoc-in', + 'associative?', + 'atom', + 'await', + 'await-for', + 'await1', + 'bases', + 'bean', + 'bigdec', + 'bigint', + 'biginteger', + 'binding', + 'bit-and', + 'bit-and-not', + 'bit-clear', + 'bit-flip', + 'bit-not', + 'bit-or', + 'bit-set', + 'bit-shift-left', + 'bit-shift-right', + 'bit-test', + 'bit-xor', + 'boolean', + 'boolean-array', + 'boolean?', + 'booleans', + 'bound-fn', + 'bound-fn*', + 'bound?', + 'bounded-count', + 'butlast', + 'byte', + 'byte-array', + 'bytes', + 'bytes?', + 'case', + 'cast', + 'cat', + 'char', + 'char-array', + 'char-escape-string', + 'char-name-string', + 'char?', + 'chars', + 'chunk', + 'chunk-append', + 'chunk-buffer', + 'chunk-cons', + 'chunk-first', + 'chunk-next', + 'chunk-rest', + 'chunked-seq?', + 'class', + 'class?', + 'clear-agent-errors', + 'clojure-version', + 'coll?', + 'comment', + 'commute', + 'comp', + 'comparator', + 'compare', + 'compare-and-set!', + 'compile', + 'complement', + 'completing', + 'concat', + 'cond', + 'cond->', + 'cond->>', + 'condp', + 'conj', + 'conj!', + 'cons', + 'constantly', + 'construct-proxy', + 'contains?', + 'count', + 'counted?', + 'create-ns', + 'create-struct', + 'cycle', + 'dec', + 'dec\'', + 'decimal?', + 'declare', + 'dedupe', + 'default-data-readers', + 'definline', + 'definterface', + 'defmacro', + 'defmethod', + 'defmulti', + 'defn', + 'defn-', + 'defonce', + 'defprotocol', + 'defrecord', + 'defstruct', + 'deftype', + 'delay', + 'delay?', + 'deliver', + 'denominator', + 'deref', + 'derive', + 'descendants', + 'destructure', + 'disj', + 'disj!', + 'dissoc', + 'dissoc!', + 'distinct', + 'distinct?', + 'doall', + 'dorun', + 'doseq', + 'dosync', + 'dotimes', + 'doto', + 'double', + 'double-array', + 'double?', + 'doubles', + 'drop', + 'drop-last', + 'drop-while', + 'eduction', + 'empty', + 'empty?', + 'ensure', + 'ensure-reduced', + 'enumeration-seq', + 'error-handler', + 'error-mode', + 'eval', + 'even?', + 'every-pred', + 'every?', + 'ex-data', + 'ex-info', + 'extend', + 'extend-protocol', + 'extend-type', + 'extenders', + 'extends?', + 'false?', + 'ffirst', + 'file-seq', + 'filter', + 'filterv', + 'find', + 'find-keyword', + 'find-ns', + 'find-protocol-impl', + 'find-protocol-method', + 'find-var', + 'first', + 'flatten', + 'float', + 'float-array', + 'float?', + 'floats', + 'flush', + 'fn', + 'fn?', + 'fnext', + 'fnil', + 'for', + 'force', + 'format', + 'frequencies', + 'future', + 'future-call', + 'future-cancel', + 'future-cancelled?', + 'future-done?', + 'future?', + 'gen-class', + 'gen-interface', + 'gensym', + 'get', + 'get-in', + 'get-method', + 'get-proxy-class', + 'get-thread-bindings', + 'get-validator', + 'group-by', + 'halt-when', + 'hash', + 'hash-combine', + 'hash-map', + 'hash-ordered-coll', + 'hash-set', + 'hash-unordered-coll', + 'ident?', + 'identical?', + 'identity', + 'if-let', + 'if-not', + 'if-some', + 'ifn?', + 'import', + 'in-ns', + 'inc', + 'inc\'', + 'indexed?', + 'init-proxy', + 'inst-ms', + 'inst-ms*', + 'inst?', + 'instance?', + 'int', + 'int-array', + 'int?', + 'integer?', + 'interleave', + 'intern', + 'interpose', + 'into', + 'into-array', + 'ints', + 'io!', + 'isa?', + 'iterate', + 'iterator-seq', + 'juxt', + 'keep', + 'keep-indexed', + 'key', + 'keys', + 'keyword', + 'keyword?', + 'last', + 'lazy-cat', + 'lazy-seq', + 'let', + 'letfn', + 'line-seq', + 'list', + 'list*', + 'list?', + 'load', + 'load-file', + 'load-reader', + 'load-string', + 'loaded-libs', + 'locking', + 'long', + 'long-array', + 'longs', + 'loop', + 'macroexpand', + 'macroexpand-1', + 'make-array', + 'make-hierarchy', + 'map', + 'map-entry?', + 'map-indexed', + 'map?', + 'mapcat', + 'mapv', + 'max', + 'max-key', + 'memfn', + 'memoize', + 'merge', + 'merge-with', + 'meta', + 'method-sig', + 'methods', + 'min', + 'min-key', + 'mix-collection-hash', + 'mod', + 'munge', + 'name', + 'namespace', + 'namespace-munge', + 'nat-int?', + 'neg-int?', + 'neg?', + 'newline', + 'next', + 'nfirst', + 'nil?', + 'nnext', + 'not', + 'not-any?', + 'not-empty', + 'not-every?', + 'not=', + 'ns', + 'ns-aliases', + 'ns-imports', + 'ns-interns', + 'ns-map', + 'ns-name', + 'ns-publics', + 'ns-refers', + 'ns-resolve', + 'ns-unalias', + 'ns-unmap', + 'nth', + 'nthnext', + 'nthrest', + 'num', + 'number?', + 'numerator', + 'object-array', + 'odd?', + 'or', + 'parents', + 'partial', + 'partition', + 'partition-all', + 'partition-by', + 'pcalls', + 'peek', + 'persistent!', + 'pmap', + 'pop', + 'pop!', + 'pop-thread-bindings', + 'pos-int?', + 'pos?', + 'pr', + 'pr-str', + 'prefer-method', + 'prefers', + 'primitives-classnames', + 'print', + 'print-ctor', + 'print-dup', + 'print-method', + 'print-simple', + 'print-str', + 'printf', + 'println', + 'println-str', + 'prn', + 'prn-str', + 'promise', + 'proxy', + 'proxy-call-with-super', + 'proxy-mappings', + 'proxy-name', + 'proxy-super', + 'push-thread-bindings', + 'pvalues', + 'qualified-ident?', + 'qualified-keyword?', + 'qualified-symbol?', + 'quot', + 'rand', + 'rand-int', + 'rand-nth', + 'random-sample', + 'range', + 'ratio?', + 'rational?', + 'rationalize', + 're-find', + 're-groups', + 're-matcher', + 're-matches', + 're-pattern', + 're-seq', + 'read', + 'read-line', + 'read-string', + 'reader-conditional', + 'reader-conditional?', + 'realized?', + 'record?', + 'reduce', + 'reduce-kv', + 'reduced', + 'reduced?', + 'reductions', + 'ref', + 'ref-history-count', + 'ref-max-history', + 'ref-min-history', + 'ref-set', + 'refer', + 'refer-clojure', + 'reify', + 'release-pending-sends', + 'rem', + 'remove', + 'remove-all-methods', + 'remove-method', + 'remove-ns', + 'remove-watch', + 'repeat', + 'repeatedly', + 'replace', + 'replicate', + 'require', + 'reset!', + 'reset-meta!', + 'reset-vals!', + 'resolve', + 'rest', + 'restart-agent', + 'resultset-seq', + 'reverse', + 'reversible?', + 'rseq', + 'rsubseq', + 'run!', + 'satisfies?', + 'second', + 'select-keys', + 'send', + 'send-off', + 'send-via', + 'seq', + 'seq?', + 'seqable?', + 'seque', + 'sequence', + 'sequential?', + 'set', + 'set-agent-send-executor!', + 'set-agent-send-off-executor!', + 'set-error-handler!', + 'set-error-mode!', + 'set-validator!', + 'set?', + 'short', + 'short-array', + 'shorts', + 'shuffle', + 'shutdown-agents', + 'simple-ident?', + 'simple-keyword?', + 'simple-symbol?', + 'slurp', + 'some', + 'some->', + 'some->>', + 'some-fn', + 'some?', + 'sort', + 'sort-by', + 'sorted-map', + 'sorted-map-by', + 'sorted-set', + 'sorted-set-by', + 'sorted?', + 'special-symbol?', + 'spit', + 'split-at', + 'split-with', + 'str', + 'string?', + 'struct', + 'struct-map', + 'subs', + 'subseq', + 'subvec', + 'supers', + 'swap!', + 'swap-vals!', + 'symbol', + 'symbol?', + 'sync', + 'tagged-literal', + 'tagged-literal?', + 'take', + 'take-last', + 'take-nth', + 'take-while', + 'test', + 'the-ns', + 'thread-bound?', + 'time', + 'to-array', + 'to-array-2d', + 'trampoline', + 'transduce', + 'transient', + 'tree-seq', + 'true?', + 'type', + 'unchecked-add', + 'unchecked-add-int', + 'unchecked-byte', + 'unchecked-char', + 'unchecked-dec', + 'unchecked-dec-int', + 'unchecked-divide-int', + 'unchecked-double', + 'unchecked-float', + 'unchecked-inc', + 'unchecked-inc-int', + 'unchecked-int', + 'unchecked-long', + 'unchecked-multiply', + 'unchecked-multiply-int', + 'unchecked-negate', + 'unchecked-negate-int', + 'unchecked-remainder-int', + 'unchecked-short', + 'unchecked-subtract', + 'unchecked-subtract-int', + 'underive', + 'unquote', + 'unquote-splicing', + 'unreduced', + 'unsigned-bit-shift-right', + 'update', + 'update-in', + 'update-proxy', + 'uri?', + 'use', + 'uuid?', + 'val', + 'vals', + 'var-get', + 'var-set', + 'var?', + 'vary-meta', + 'vec', + 'vector', + 'vector-of', + 'vector?', + 'volatile!', + 'volatile?', + 'vreset!', + 'vswap!', + 'when', + 'when-first', + 'when-let', + 'when-not', + 'when-some', + 'while', + 'with-bindings', + 'with-bindings*', + 'with-in-str', + 'with-loading-context', + 'with-local-vars', + 'with-meta', + 'with-open', + 'with-out-str', + 'with-precision', + 'with-redefs', + 'with-redefs-fn', + 'xml-seq', + 'zero?', + 'zipmap', + ], + tokenizer: { + root: [ + // whitespaces and comments + { include: '@whitespace' }, + // numbers + [/@numbers/, 'number'], + // characters + [/@characters/, 'string'], + // strings + { include: '@string' }, + // brackets + [/[()\[\]{}]/, '@brackets'], + // regular expressions + [/\/#"(?:\.|(?:")|[^"\n])*"\/g/, 'regexp'], + // reader macro characters + [/[#'@^`~]/, 'meta'], + // symbols + [/@qualifiedSymbols/, { + cases: { + '^:.+$': 'constant', + '@specialForms': 'keyword', + '@coreSymbols': 'keyword', + '@constants': 'constant', + '@default': 'identifier', + }, + }, + ], + ], + whitespace: [ + [/[\s,]+/, 'white'], + [/;.*$/, 'comment'], + [/\(comment\b/, 'comment', '@comment'], + ], + comment: [ + [/\(/, 'comment', '@push'], + [/\)/, 'comment', '@pop'], + [/[^()]/, 'comment'], + ], + string: [ + [/"/, 'string', '@multiLineString'], + ], + multiLineString: [ + [/"/, 'string', '@popall'], + [/@escapes/, 'string.escape'], + [/./, 'string'] + ], + }, +}; /***/ }) diff --git a/31.d5887f1d.async.js b/31.d5887f1d.async.js index c6af01fd8..c43a8d5ac 100644 --- a/31.d5887f1d.async.js +++ b/31.d5887f1d.async.js @@ -13,176 +13,176 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var conf = { - wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, - comments: { - blockComment: ['###', '###'], - lineComment: '#' - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: '\'', close: '\'' }, - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: '\'', close: '\'' }, - ], - folding: { - markers: { - start: new RegExp("^\\s*#region\\b"), - end: new RegExp("^\\s*#endregion\\b") - } - } -}; -var language = { - defaultToken: '', - ignoreCase: true, - tokenPostfix: '.coffee', - brackets: [ - { open: '{', close: '}', token: 'delimiter.curly' }, - { open: '[', close: ']', token: 'delimiter.square' }, - { open: '(', close: ')', token: 'delimiter.parenthesis' } - ], - regEx: /\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/, - keywords: [ - 'and', 'or', 'is', 'isnt', 'not', 'on', 'yes', '@', 'no', 'off', - 'true', 'false', 'null', 'this', - 'new', 'delete', 'typeof', 'in', 'instanceof', - 'return', 'throw', 'break', 'continue', 'debugger', - 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', - 'class', 'extends', 'super', - 'undefined', 'then', 'unless', 'until', 'loop', 'of', 'by', 'when' - ], - // we include these common regular expressions - symbols: /[=>\/\?\s]+)/g, + comments: { + blockComment: ['###', '###'], + lineComment: '#' + }, + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'] + ], + autoClosingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"', close: '"' }, + { open: '\'', close: '\'' }, + ], + surroundingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"', close: '"' }, + { open: '\'', close: '\'' }, + ], + folding: { + markers: { + start: new RegExp("^\\s*#region\\b"), + end: new RegExp("^\\s*#endregion\\b") + } + } +}; +var language = { + defaultToken: '', + ignoreCase: true, + tokenPostfix: '.coffee', + brackets: [ + { open: '{', close: '}', token: 'delimiter.curly' }, + { open: '[', close: ']', token: 'delimiter.square' }, + { open: '(', close: ')', token: 'delimiter.parenthesis' } + ], + regEx: /\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/, + keywords: [ + 'and', 'or', 'is', 'isnt', 'not', 'on', 'yes', '@', 'no', 'off', + 'true', 'false', 'null', 'this', + 'new', 'delete', 'typeof', 'in', 'instanceof', + 'return', 'throw', 'break', 'continue', 'debugger', + 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', + 'class', 'extends', 'super', + 'undefined', 'then', 'unless', 'until', 'loop', 'of', 'by', 'when' + ], + // we include these common regular expressions + symbols: /[=>\/\?\s]+)/g, - comments: { - lineComment: '//', - blockComment: ['/*', '*/'], - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'], - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '\'', close: '\'', notIn: ['string', 'comment'] }, - { open: '"', close: '"', notIn: ['string', 'comment'] }, - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '<', close: '>' }, - { open: '\'', close: '\'' }, - { open: '"', close: '"' }, - ], - folding: { - markers: { - start: new RegExp("^\\s*#region\\b"), - end: new RegExp("^\\s*#endregion\\b") - } - } -}; -var language = { - defaultToken: '', - tokenPostfix: '.cs', - brackets: [ - { open: '{', close: '}', token: 'delimiter.curly' }, - { open: '[', close: ']', token: 'delimiter.square' }, - { open: '(', close: ')', token: 'delimiter.parenthesis' }, - { open: '<', close: '>', token: 'delimiter.angle' } - ], - keywords: [ - 'extern', 'alias', 'using', 'bool', 'decimal', 'sbyte', 'byte', 'short', - 'ushort', 'int', 'uint', 'long', 'ulong', 'char', 'float', 'double', - 'object', 'dynamic', 'string', 'assembly', 'is', 'as', 'ref', - 'out', 'this', 'base', 'new', 'typeof', 'void', 'checked', 'unchecked', - 'default', 'delegate', 'var', 'const', 'if', 'else', 'switch', 'case', - 'while', 'do', 'for', 'foreach', 'in', 'break', 'continue', 'goto', - 'return', 'throw', 'try', 'catch', 'finally', 'lock', 'yield', 'from', - 'let', 'where', 'join', 'on', 'equals', 'into', 'orderby', 'ascending', - 'descending', 'select', 'group', 'by', 'namespace', 'partial', 'class', - 'field', 'event', 'method', 'param', 'property', 'public', 'protected', - 'internal', 'private', 'abstract', 'sealed', 'static', 'struct', 'readonly', - 'volatile', 'virtual', 'override', 'params', 'get', 'set', 'add', 'remove', - 'operator', 'true', 'false', 'implicit', 'explicit', 'interface', 'enum', - 'null', 'async', 'await', 'fixed', 'sizeof', 'stackalloc', 'unsafe', 'nameof', - 'when' - ], - namespaceFollows: [ - 'namespace', 'using', - ], - parenFollows: [ - 'if', 'for', 'while', 'switch', 'foreach', 'using', 'catch', 'when' - ], - operators: [ - '=', '??', '||', '&&', '|', '^', '&', '==', '!=', '<=', '>=', '<<', - '+', '-', '*', '/', '%', '!', '~', '++', '--', '+=', - '-=', '*=', '/=', '%=', '&=', '|=', '^=', '<<=', '>>=', '>>', '=>' - ], - symbols: /[=>](?!@symbols)/, '@brackets'], - [/@symbols/, { - cases: { - '@operators': 'delimiter', - '@default': '' - } - }], - // numbers - [/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?[fFdD]?/, 'number.float'], - [/0[xX][0-9a-fA-F_]+/, 'number.hex'], - [/0[bB][01_]+/, 'number.hex'], - [/[0-9_]+/, 'number'], - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - // strings - [/"([^"\\]|\\.)*$/, 'string.invalid'], - [/"/, { token: 'string.quote', next: '@string' }], - [/\$\@"/, { token: 'string.quote', next: '@litinterpstring' }], - [/\@"/, { token: 'string.quote', next: '@litstring' }], - [/\$"/, { token: 'string.quote', next: '@interpolatedstring' }], - // characters - [/'[^\\']'/, 'string'], - [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], - [/'/, 'string.invalid'] - ], - qualified: [ - [/[a-zA-Z_][\w]*/, { - cases: { - '@keywords': { token: 'keyword.$0' }, - '@default': 'identifier' - } - }], - [/\./, 'delimiter'], - ['', '', '@pop'], - ], - namespace: [ - { include: '@whitespace' }, - [/[A-Z]\w*/, 'namespace'], - [/[\.=]/, 'delimiter'], - ['', '', '@pop'], - ], - comment: [ - [/[^\/*]+/, 'comment'], - // [/\/\*/, 'comment', '@push' ], // no nested comments :-( - ['\\*/', 'comment', '@pop'], - [/[\/*]/, 'comment'] - ], - string: [ - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, { token: 'string.quote', next: '@pop' }] - ], - litstring: [ - [/[^"]+/, 'string'], - [/""/, 'string.escape'], - [/"/, { token: 'string.quote', next: '@pop' }] - ], - litinterpstring: [ - [/[^"{]+/, 'string'], - [/""/, 'string.escape'], - [/{{/, 'string.escape'], - [/}}/, 'string.escape'], - [/{/, { token: 'string.quote', next: 'root.litinterpstring' }], - [/"/, { token: 'string.quote', next: '@pop' }] - ], - interpolatedstring: [ - [/[^\\"{]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/{{/, 'string.escape'], - [/}}/, 'string.escape'], - [/{/, { token: 'string.quote', next: 'root.interpolatedstring' }], - [/"/, { token: 'string.quote', next: '@pop' }] - ], - whitespace: [ - [/^[ \t\v\f]*#((r)|(load))(?=\s)/, 'directive.csx'], - [/^[ \t\v\f]*#\w.*$/, 'namespace.cpp'], - [/[ \t\v\f\r\n]+/, ''], - [/\/\*/, 'comment', '@comment'], - [/\/\/.*$/, 'comment'], - ], - }, -}; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var conf = { + wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, + comments: { + lineComment: '//', + blockComment: ['/*', '*/'], + }, + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'], + ], + autoClosingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '\'', close: '\'', notIn: ['string', 'comment'] }, + { open: '"', close: '"', notIn: ['string', 'comment'] }, + ], + surroundingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '<', close: '>' }, + { open: '\'', close: '\'' }, + { open: '"', close: '"' }, + ], + folding: { + markers: { + start: new RegExp("^\\s*#region\\b"), + end: new RegExp("^\\s*#endregion\\b") + } + } +}; +var language = { + defaultToken: '', + tokenPostfix: '.cs', + brackets: [ + { open: '{', close: '}', token: 'delimiter.curly' }, + { open: '[', close: ']', token: 'delimiter.square' }, + { open: '(', close: ')', token: 'delimiter.parenthesis' }, + { open: '<', close: '>', token: 'delimiter.angle' } + ], + keywords: [ + 'extern', 'alias', 'using', 'bool', 'decimal', 'sbyte', 'byte', 'short', + 'ushort', 'int', 'uint', 'long', 'ulong', 'char', 'float', 'double', + 'object', 'dynamic', 'string', 'assembly', 'is', 'as', 'ref', + 'out', 'this', 'base', 'new', 'typeof', 'void', 'checked', 'unchecked', + 'default', 'delegate', 'var', 'const', 'if', 'else', 'switch', 'case', + 'while', 'do', 'for', 'foreach', 'in', 'break', 'continue', 'goto', + 'return', 'throw', 'try', 'catch', 'finally', 'lock', 'yield', 'from', + 'let', 'where', 'join', 'on', 'equals', 'into', 'orderby', 'ascending', + 'descending', 'select', 'group', 'by', 'namespace', 'partial', 'class', + 'field', 'event', 'method', 'param', 'property', 'public', 'protected', + 'internal', 'private', 'abstract', 'sealed', 'static', 'struct', 'readonly', + 'volatile', 'virtual', 'override', 'params', 'get', 'set', 'add', 'remove', + 'operator', 'true', 'false', 'implicit', 'explicit', 'interface', 'enum', + 'null', 'async', 'await', 'fixed', 'sizeof', 'stackalloc', 'unsafe', 'nameof', + 'when' + ], + namespaceFollows: [ + 'namespace', 'using', + ], + parenFollows: [ + 'if', 'for', 'while', 'switch', 'foreach', 'using', 'catch', 'when' + ], + operators: [ + '=', '??', '||', '&&', '|', '^', '&', '==', '!=', '<=', '>=', '<<', + '+', '-', '*', '/', '%', '!', '~', '++', '--', '+=', + '-=', '*=', '/=', '%=', '&=', '|=', '^=', '<<=', '>>=', '>>', '=>' + ], + symbols: /[=>](?!@symbols)/, '@brackets'], + [/@symbols/, { + cases: { + '@operators': 'delimiter', + '@default': '' + } + }], + // numbers + [/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?[fFdD]?/, 'number.float'], + [/0[xX][0-9a-fA-F_]+/, 'number.hex'], + [/0[bB][01_]+/, 'number.hex'], + [/[0-9_]+/, 'number'], + // delimiter: after number because of .\d floats + [/[;,.]/, 'delimiter'], + // strings + [/"([^"\\]|\\.)*$/, 'string.invalid'], + [/"/, { token: 'string.quote', next: '@string' }], + [/\$\@"/, { token: 'string.quote', next: '@litinterpstring' }], + [/\@"/, { token: 'string.quote', next: '@litstring' }], + [/\$"/, { token: 'string.quote', next: '@interpolatedstring' }], + // characters + [/'[^\\']'/, 'string'], + [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], + [/'/, 'string.invalid'] + ], + qualified: [ + [/[a-zA-Z_][\w]*/, { + cases: { + '@keywords': { token: 'keyword.$0' }, + '@default': 'identifier' + } + }], + [/\./, 'delimiter'], + ['', '', '@pop'], + ], + namespace: [ + { include: '@whitespace' }, + [/[A-Z]\w*/, 'namespace'], + [/[\.=]/, 'delimiter'], + ['', '', '@pop'], + ], + comment: [ + [/[^\/*]+/, 'comment'], + // [/\/\*/, 'comment', '@push' ], // no nested comments :-( + ['\\*/', 'comment', '@pop'], + [/[\/*]/, 'comment'] + ], + string: [ + [/[^\\"]+/, 'string'], + [/@escapes/, 'string.escape'], + [/\\./, 'string.escape.invalid'], + [/"/, { token: 'string.quote', next: '@pop' }] + ], + litstring: [ + [/[^"]+/, 'string'], + [/""/, 'string.escape'], + [/"/, { token: 'string.quote', next: '@pop' }] + ], + litinterpstring: [ + [/[^"{]+/, 'string'], + [/""/, 'string.escape'], + [/{{/, 'string.escape'], + [/}}/, 'string.escape'], + [/{/, { token: 'string.quote', next: 'root.litinterpstring' }], + [/"/, { token: 'string.quote', next: '@pop' }] + ], + interpolatedstring: [ + [/[^\\"{]+/, 'string'], + [/@escapes/, 'string.escape'], + [/\\./, 'string.escape.invalid'], + [/{{/, 'string.escape'], + [/}}/, 'string.escape'], + [/{/, { token: 'string.quote', next: 'root.interpolatedstring' }], + [/"/, { token: 'string.quote', next: '@pop' }] + ], + whitespace: [ + [/^[ \t\v\f]*#((r)|(load))(?=\s)/, 'directive.csx'], + [/^[ \t\v\f]*#\w.*$/, 'namespace.cpp'], + [/[ \t\v\f\r\n]+/, ''], + [/\/\*/, 'comment', '@comment'], + [/\/\/.*$/, 'comment'], + ], + }, +}; /***/ }) diff --git a/33.21ecd820.async.js b/33.21ecd820.async.js index 46982d61f..9620e7f1f 100644 --- a/33.21ecd820.async.js +++ b/33.21ecd820.async.js @@ -13,61 +13,61 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var conf = { - brackets: [], - autoClosingPairs: [], - surroundingPairs: [] -}; -var language = { - // Set defaultToken to invalid to see what you do not tokenize yet - // defaultToken: 'invalid', - keywords: [], - typeKeywords: [], - tokenPostfix: '.csp', - operators: [], - symbols: /[=>', token: 'delimiter.angle' } - ], - tokenizer: { - root: [ - { include: '@selector' }, - ], - selector: [ - { include: '@comments' }, - { include: '@import' }, - { include: '@strings' }, - ['[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)', { token: 'keyword', next: '@keyframedeclaration' }], - ['[@](page|content|font-face|-moz-document)', { token: 'keyword' }], - ['[@](charset|namespace)', { token: 'keyword', next: '@declarationbody' }], - ['(url-prefix)(\\()', ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }]], - ['(url)(\\()', ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }]], - { include: '@selectorname' }, - ['[\\*]', 'tag'], - ['[>\\+,]', 'delimiter'], - ['\\[', { token: 'delimiter.bracket', next: '@selectorattribute' }], - ['{', { token: 'delimiter.bracket', next: '@selectorbody' }] - ], - selectorbody: [ - { include: '@comments' }, - ['[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))', 'attribute.name', '@rulevalue'], - ['}', { token: 'delimiter.bracket', next: '@pop' }] - ], - selectorname: [ - ['(\\.|#(?=[^{])|%|(@identifier)|:)+', 'tag'], - ], - selectorattribute: [ - { include: '@term' }, - [']', { token: 'delimiter.bracket', next: '@pop' }], - ], - term: [ - { include: '@comments' }, - ['(url-prefix)(\\()', ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }]], - ['(url)(\\()', ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }]], - { include: '@functioninvocation' }, - { include: '@numbers' }, - { include: '@name' }, - ['([<>=\\+\\-\\*\\/\\^\\|\\~,])', 'delimiter'], - [',', 'delimiter'] - ], - rulevalue: [ - { include: '@comments' }, - { include: '@strings' }, - { include: '@term' }, - ['!important', 'keyword'], - [';', 'delimiter', '@pop'], - ['(?=})', { token: '', next: '@pop' }] // missing semicolon - ], - warndebug: [ - ['[@](warn|debug)', { token: 'keyword', next: '@declarationbody' }] - ], - import: [ - ['[@](import)', { token: 'keyword', next: '@declarationbody' }] - ], - urldeclaration: [ - { include: '@strings' }, - ['[^)\r\n]+', 'string'], - ['\\)', { token: 'delimiter.parenthesis', next: '@pop' }] - ], - parenthizedterm: [ - { include: '@term' }, - ['\\)', { token: 'delimiter.parenthesis', next: '@pop' }] - ], - declarationbody: [ - { include: '@term' }, - [';', 'delimiter', '@pop'], - ['(?=})', { token: '', next: '@pop' }] // missing semicolon - ], - comments: [ - ['\\/\\*', 'comment', '@comment'], - ['\\/\\/+.*', 'comment'] - ], - comment: [ - ['\\*\\/', 'comment', '@pop'], - [/[^*/]+/, 'comment'], - [/./, 'comment'], - ], - name: [ - ['@identifier', 'attribute.value'] - ], - numbers: [ - ['-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?', { token: 'attribute.value.number', next: '@units' }], - ['#[0-9a-fA-F_]+(?!\\w)', 'attribute.value.hex'] - ], - units: [ - ['(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?', 'attribute.value.unit', '@pop'] - ], - keyframedeclaration: [ - ['@identifier', 'attribute.value'], - ['{', { token: 'delimiter.bracket', switchTo: '@keyframebody' }], - ], - keyframebody: [ - { include: '@term' }, - ['{', { token: 'delimiter.bracket', next: '@selectorbody' }], - ['}', { token: 'delimiter.bracket', next: '@pop' }], - ], - functioninvocation: [ - ['@identifier\\(', { token: 'attribute.value', next: '@functionarguments' }], - ], - functionarguments: [ - ['\\$@identifier@ws:', 'attribute.name'], - ['[,]', 'delimiter'], - { include: '@term' }, - ['\\)', { token: 'attribute.value', next: '@pop' }], - ], - strings: [ - ['~?"', { token: 'string', next: '@stringenddoublequote' }], - ['~?\'', { token: 'string', next: '@stringendquote' }] - ], - stringenddoublequote: [ - ['\\\\.', 'string'], - ['"', { token: 'string', next: '@pop' }], - [/[^\\"]+/, 'string'], - ['.', 'string'] - ], - stringendquote: [ - ['\\\\.', 'string'], - ['\'', { token: 'string', next: '@pop' }], - [/[^\\']+/, 'string'], - ['.', 'string'] - ] - } -}; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var conf = { + wordPattern: /(#?-?\d*\.\d\w*%?)|((::|[@#.!:])?[\w-?]+%?)|::|[@#.!:]/g, + comments: { + blockComment: ['/*', '*/'] + }, + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'] + ], + autoClosingPairs: [ + { open: '{', close: '}', notIn: ['string', 'comment'] }, + { open: '[', close: ']', notIn: ['string', 'comment'] }, + { open: '(', close: ')', notIn: ['string', 'comment'] }, + { open: '"', close: '"', notIn: ['string', 'comment'] }, + { open: '\'', close: '\'', notIn: ['string', 'comment'] } + ], + surroundingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"', close: '"' }, + { open: '\'', close: '\'' } + ], + folding: { + markers: { + start: new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"), + end: new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/") + } + } +}; +var language = { + defaultToken: '', + tokenPostfix: '.css', + ws: '[ \t\n\r\f]*', + identifier: '-?-?([a-zA-Z]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))([\\w\\-]|(\\\\(([0-9a-fA-F]{1,6}\\s?)|[^[0-9a-fA-F])))*', + brackets: [ + { open: '{', close: '}', token: 'delimiter.bracket' }, + { open: '[', close: ']', token: 'delimiter.bracket' }, + { open: '(', close: ')', token: 'delimiter.parenthesis' }, + { open: '<', close: '>', token: 'delimiter.angle' } + ], + tokenizer: { + root: [ + { include: '@selector' }, + ], + selector: [ + { include: '@comments' }, + { include: '@import' }, + { include: '@strings' }, + ['[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)', { token: 'keyword', next: '@keyframedeclaration' }], + ['[@](page|content|font-face|-moz-document)', { token: 'keyword' }], + ['[@](charset|namespace)', { token: 'keyword', next: '@declarationbody' }], + ['(url-prefix)(\\()', ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }]], + ['(url)(\\()', ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }]], + { include: '@selectorname' }, + ['[\\*]', 'tag'], + ['[>\\+,]', 'delimiter'], + ['\\[', { token: 'delimiter.bracket', next: '@selectorattribute' }], + ['{', { token: 'delimiter.bracket', next: '@selectorbody' }] + ], + selectorbody: [ + { include: '@comments' }, + ['[*_]?@identifier@ws:(?=(\\s|\\d|[^{;}]*[;}]))', 'attribute.name', '@rulevalue'], + ['}', { token: 'delimiter.bracket', next: '@pop' }] + ], + selectorname: [ + ['(\\.|#(?=[^{])|%|(@identifier)|:)+', 'tag'], + ], + selectorattribute: [ + { include: '@term' }, + [']', { token: 'delimiter.bracket', next: '@pop' }], + ], + term: [ + { include: '@comments' }, + ['(url-prefix)(\\()', ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }]], + ['(url)(\\()', ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }]], + { include: '@functioninvocation' }, + { include: '@numbers' }, + { include: '@name' }, + ['([<>=\\+\\-\\*\\/\\^\\|\\~,])', 'delimiter'], + [',', 'delimiter'] + ], + rulevalue: [ + { include: '@comments' }, + { include: '@strings' }, + { include: '@term' }, + ['!important', 'keyword'], + [';', 'delimiter', '@pop'], + ['(?=})', { token: '', next: '@pop' }] // missing semicolon + ], + warndebug: [ + ['[@](warn|debug)', { token: 'keyword', next: '@declarationbody' }] + ], + import: [ + ['[@](import)', { token: 'keyword', next: '@declarationbody' }] + ], + urldeclaration: [ + { include: '@strings' }, + ['[^)\r\n]+', 'string'], + ['\\)', { token: 'delimiter.parenthesis', next: '@pop' }] + ], + parenthizedterm: [ + { include: '@term' }, + ['\\)', { token: 'delimiter.parenthesis', next: '@pop' }] + ], + declarationbody: [ + { include: '@term' }, + [';', 'delimiter', '@pop'], + ['(?=})', { token: '', next: '@pop' }] // missing semicolon + ], + comments: [ + ['\\/\\*', 'comment', '@comment'], + ['\\/\\/+.*', 'comment'] + ], + comment: [ + ['\\*\\/', 'comment', '@pop'], + [/[^*/]+/, 'comment'], + [/./, 'comment'], + ], + name: [ + ['@identifier', 'attribute.value'] + ], + numbers: [ + ['-?(\\d*\\.)?\\d+([eE][\\-+]?\\d+)?', { token: 'attribute.value.number', next: '@units' }], + ['#[0-9a-fA-F_]+(?!\\w)', 'attribute.value.hex'] + ], + units: [ + ['(em|ex|ch|rem|vmin|vmax|vw|vh|vm|cm|mm|in|px|pt|pc|deg|grad|rad|turn|s|ms|Hz|kHz|%)?', 'attribute.value.unit', '@pop'] + ], + keyframedeclaration: [ + ['@identifier', 'attribute.value'], + ['{', { token: 'delimiter.bracket', switchTo: '@keyframebody' }], + ], + keyframebody: [ + { include: '@term' }, + ['{', { token: 'delimiter.bracket', next: '@selectorbody' }], + ['}', { token: 'delimiter.bracket', next: '@pop' }], + ], + functioninvocation: [ + ['@identifier\\(', { token: 'attribute.value', next: '@functionarguments' }], + ], + functionarguments: [ + ['\\$@identifier@ws:', 'attribute.name'], + ['[,]', 'delimiter'], + { include: '@term' }, + ['\\)', { token: 'attribute.value', next: '@pop' }], + ], + strings: [ + ['~?"', { token: 'string', next: '@stringenddoublequote' }], + ['~?\'', { token: 'string', next: '@stringendquote' }] + ], + stringenddoublequote: [ + ['\\\\.', 'string'], + ['"', { token: 'string', next: '@pop' }], + [/[^\\"]+/, 'string'], + ['.', 'string'] + ], + stringendquote: [ + ['\\\\.', 'string'], + ['\'', { token: 'string', next: '@pop' }], + [/[^\\']+/, 'string'], + ['.', 'string'] + ] + } +}; /***/ }) diff --git a/35.26c1d613.async.js b/35.26c1d613.async.js index f0561997b..f5cb36cba 100644 --- a/35.26c1d613.async.js +++ b/35.26c1d613.async.js @@ -13,115 +13,115 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var conf = { - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: '\'', close: '\'' }, - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: '\'', close: '\'' }, - ] -}; -var language = { - defaultToken: '', - tokenPostfix: '.dockerfile', - variable: /\${?[\w]+}?/, - tokenizer: { - root: [ - { include: '@whitespace' }, - { include: '@comment' }, - [/(ONBUILD)(\s+)/, ['keyword', '']], - [/(ENV)(\s+)([\w]+)/, ['keyword', '', { token: 'variable', next: '@arguments' }]], - [/(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|ARG|VOLUME|LABEL|USER|WORKDIR|COPY|CMD|STOPSIGNAL|SHELL|HEALTHCHECK|ENTRYPOINT)/, { token: 'keyword', next: '@arguments' }] - ], - arguments: [ - { include: '@whitespace' }, - { include: '@strings' }, - [/(@variable)/, { - cases: { - '@eos': { token: 'variable', next: '@popall' }, - '@default': 'variable' - } - }], - [/\\/, { - cases: { - '@eos': '', - '@default': '' - } - }], - [/./, { - cases: { - '@eos': { token: '', next: '@popall' }, - '@default': '' - } - }], - ], - // Deal with white space, including comments - whitespace: [ - [/\s+/, { - cases: { - '@eos': { token: '', next: '@popall' }, - '@default': '' - } - }], - ], - comment: [ - [/(^#.*$)/, 'comment', '@popall'] - ], - // Recognize strings, including those broken across lines with \ (but not without) - strings: [ - [/'$/, 'string', '@popall'], - [/'/, 'string', '@stringBody'], - [/"$/, 'string', '@popall'], - [/"/, 'string', '@dblStringBody'] - ], - stringBody: [ - [/[^\\\$']/, { - cases: { - '@eos': { token: 'string', next: '@popall' }, - '@default': 'string' - } - }], - [/\\./, 'string.escape'], - [/'$/, 'string', '@popall'], - [/'/, 'string', '@pop'], - [/(@variable)/, 'variable'], - [/\\$/, 'string'], - [/$/, 'string', '@popall'] - ], - dblStringBody: [ - [/[^\\\$"]/, { - cases: { - '@eos': { token: 'string', next: '@popall' }, - '@default': 'string' - } - }], - [/\\./, 'string.escape'], - [/"$/, 'string', '@popall'], - [/"/, 'string', '@pop'], - [/(@variable)/, 'variable'], - [/\\$/, 'string'], - [/$/, 'string', '@popall'] - ] - } -}; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var conf = { + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'] + ], + autoClosingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"', close: '"' }, + { open: '\'', close: '\'' }, + ], + surroundingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"', close: '"' }, + { open: '\'', close: '\'' }, + ] +}; +var language = { + defaultToken: '', + tokenPostfix: '.dockerfile', + variable: /\${?[\w]+}?/, + tokenizer: { + root: [ + { include: '@whitespace' }, + { include: '@comment' }, + [/(ONBUILD)(\s+)/, ['keyword', '']], + [/(ENV)(\s+)([\w]+)/, ['keyword', '', { token: 'variable', next: '@arguments' }]], + [/(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|ARG|VOLUME|LABEL|USER|WORKDIR|COPY|CMD|STOPSIGNAL|SHELL|HEALTHCHECK|ENTRYPOINT)/, { token: 'keyword', next: '@arguments' }] + ], + arguments: [ + { include: '@whitespace' }, + { include: '@strings' }, + [/(@variable)/, { + cases: { + '@eos': { token: 'variable', next: '@popall' }, + '@default': 'variable' + } + }], + [/\\/, { + cases: { + '@eos': '', + '@default': '' + } + }], + [/./, { + cases: { + '@eos': { token: '', next: '@popall' }, + '@default': '' + } + }], + ], + // Deal with white space, including comments + whitespace: [ + [/\s+/, { + cases: { + '@eos': { token: '', next: '@popall' }, + '@default': '' + } + }], + ], + comment: [ + [/(^#.*$)/, 'comment', '@popall'] + ], + // Recognize strings, including those broken across lines with \ (but not without) + strings: [ + [/'$/, 'string', '@popall'], + [/'/, 'string', '@stringBody'], + [/"$/, 'string', '@popall'], + [/"/, 'string', '@dblStringBody'] + ], + stringBody: [ + [/[^\\\$']/, { + cases: { + '@eos': { token: 'string', next: '@popall' }, + '@default': 'string' + } + }], + [/\\./, 'string.escape'], + [/'$/, 'string', '@popall'], + [/'/, 'string', '@pop'], + [/(@variable)/, 'variable'], + [/\\$/, 'string'], + [/$/, 'string', '@popall'] + ], + dblStringBody: [ + [/[^\\\$"]/, { + cases: { + '@eos': { token: 'string', next: '@popall' }, + '@default': 'string' + } + }], + [/\\./, 'string.escape'], + [/"$/, 'string', '@popall'], + [/"/, 'string', '@pop'], + [/(@variable)/, 'variable'], + [/\\$/, 'string'], + [/$/, 'string', '@popall'] + ] + } +}; /***/ }) diff --git a/36.da74844c.async.js b/36.da74844c.async.js index df24d3a38..562cd43a7 100644 --- a/36.da74844c.async.js +++ b/36.da74844c.async.js @@ -13,144 +13,144 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var conf = { - comments: { - lineComment: '//', - blockComment: ['(*', '*)'], - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' } - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: '\'', close: '\'' } - ], - folding: { - markers: { - start: new RegExp("^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)"), - end: new RegExp("^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)") - } - } -}; -var language = { - defaultToken: '', - tokenPostfix: '.fs', - keywords: [ - 'abstract', 'and', 'atomic', 'as', - 'assert', 'asr', 'base', 'begin', - 'break', 'checked', 'component', - 'const', 'constraint', 'constructor', - 'continue', 'class', 'default', - 'delegate', 'do', 'done', 'downcast', - 'downto', 'elif', 'else', 'end', - 'exception', 'eager', 'event', 'external', - 'extern', 'false', 'finally', 'for', - 'fun', 'function', 'fixed', 'functor', - 'global', 'if', 'in', 'include', 'inherit', - 'inline', 'interface', 'internal', 'land', - 'lor', 'lsl', 'lsr', 'lxor', 'lazy', 'let', - 'match', 'member', 'mod', 'module', 'mutable', - 'namespace', 'method', 'mixin', 'new', 'not', - 'null', 'of', 'open', 'or', 'object', - 'override', 'private', 'parallel', 'process', - 'protected', 'pure', 'public', 'rec', 'return', - 'static', 'sealed', 'struct', 'sig', 'then', - 'to', 'true', 'tailcall', 'trait', - 'try', 'type', 'upcast', 'use', - 'val', 'void', 'virtual', 'volatile', - 'when', 'while', 'with', 'yield' - ], - // we include these common regular expressions - symbols: /[=>]. - [/\[<.*>\]/, 'annotation'], - // Preprocessor directive - [/^#(if|else|endif)/, 'keyword'], - // delimiters and operators - [/[{}()\[\]]/, '@brackets'], - [/[<>](?!@symbols)/, '@brackets'], - [/@symbols/, 'delimiter'], - // numbers - [/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, 'number.float'], - [/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/, 'number.float'], - [/0x[0-9a-fA-F]+LF/, 'number.float'], - [/0x[0-9a-fA-F]+(@integersuffix)/, 'number.hex'], - [/0b[0-1]+(@integersuffix)/, 'number.bin'], - [/\d+(@integersuffix)/, 'number'], - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - // strings - [/"([^"\\]|\\.)*$/, 'string.invalid'], - [/"""/, 'string', '@string."""'], - [/"/, 'string', '@string."'], - // literal string - [/\@"/, { token: 'string.quote', next: '@litstring' }], - // characters - [/'[^\\']'B?/, 'string'], - [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], - [/'/, 'string.invalid'] - ], - whitespace: [ - [/[ \t\r\n]+/, ''], - [/\(\*(?!\))/, 'comment', '@comment'], - [/\/\/.*$/, 'comment'], - ], - comment: [ - [/[^*(]+/, 'comment'], - [/\*\)/, 'comment', '@pop'], - [/\*/, 'comment'], - [/\(\*\)/, 'comment'], - [/\(/, 'comment'] - ], - string: [ - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/("""|"B?)/, { - cases: { - '$#==$S2': { token: 'string', next: '@pop' }, - '@default': 'string' - } - }] - ], - litstring: [ - [/[^"]+/, 'string'], - [/""/, 'string.escape'], - [/"/, { token: 'string.quote', next: '@pop' }] - ], - }, -}; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var conf = { + comments: { + lineComment: '//', + blockComment: ['(*', '*)'], + }, + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'] + ], + autoClosingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"', close: '"' } + ], + surroundingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"', close: '"' }, + { open: '\'', close: '\'' } + ], + folding: { + markers: { + start: new RegExp("^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)"), + end: new RegExp("^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)") + } + } +}; +var language = { + defaultToken: '', + tokenPostfix: '.fs', + keywords: [ + 'abstract', 'and', 'atomic', 'as', + 'assert', 'asr', 'base', 'begin', + 'break', 'checked', 'component', + 'const', 'constraint', 'constructor', + 'continue', 'class', 'default', + 'delegate', 'do', 'done', 'downcast', + 'downto', 'elif', 'else', 'end', + 'exception', 'eager', 'event', 'external', + 'extern', 'false', 'finally', 'for', + 'fun', 'function', 'fixed', 'functor', + 'global', 'if', 'in', 'include', 'inherit', + 'inline', 'interface', 'internal', 'land', + 'lor', 'lsl', 'lsr', 'lxor', 'lazy', 'let', + 'match', 'member', 'mod', 'module', 'mutable', + 'namespace', 'method', 'mixin', 'new', 'not', + 'null', 'of', 'open', 'or', 'object', + 'override', 'private', 'parallel', 'process', + 'protected', 'pure', 'public', 'rec', 'return', + 'static', 'sealed', 'struct', 'sig', 'then', + 'to', 'true', 'tailcall', 'trait', + 'try', 'type', 'upcast', 'use', + 'val', 'void', 'virtual', 'volatile', + 'when', 'while', 'with', 'yield' + ], + // we include these common regular expressions + symbols: /[=>]. + [/\[<.*>\]/, 'annotation'], + // Preprocessor directive + [/^#(if|else|endif)/, 'keyword'], + // delimiters and operators + [/[{}()\[\]]/, '@brackets'], + [/[<>](?!@symbols)/, '@brackets'], + [/@symbols/, 'delimiter'], + // numbers + [/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, 'number.float'], + [/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/, 'number.float'], + [/0x[0-9a-fA-F]+LF/, 'number.float'], + [/0x[0-9a-fA-F]+(@integersuffix)/, 'number.hex'], + [/0b[0-1]+(@integersuffix)/, 'number.bin'], + [/\d+(@integersuffix)/, 'number'], + // delimiter: after number because of .\d floats + [/[;,.]/, 'delimiter'], + // strings + [/"([^"\\]|\\.)*$/, 'string.invalid'], + [/"""/, 'string', '@string."""'], + [/"/, 'string', '@string."'], + // literal string + [/\@"/, { token: 'string.quote', next: '@litstring' }], + // characters + [/'[^\\']'B?/, 'string'], + [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], + [/'/, 'string.invalid'] + ], + whitespace: [ + [/[ \t\r\n]+/, ''], + [/\(\*(?!\))/, 'comment', '@comment'], + [/\/\/.*$/, 'comment'], + ], + comment: [ + [/[^*(]+/, 'comment'], + [/\*\)/, 'comment', '@pop'], + [/\*/, 'comment'], + [/\(\*\)/, 'comment'], + [/\(/, 'comment'] + ], + string: [ + [/[^\\"]+/, 'string'], + [/@escapes/, 'string.escape'], + [/\\./, 'string.escape.invalid'], + [/("""|"B?)/, { + cases: { + '$#==$S2': { token: 'string', next: '@pop' }, + '@default': 'string' + } + }] + ], + litstring: [ + [/[^"]+/, 'string'], + [/""/, 'string.escape'], + [/"/, { token: 'string.quote', next: '@pop' }] + ], + }, +}; /***/ }) diff --git a/37.116cf847.async.js b/37.116cf847.async.js index 373679504..31a1d04d2 100644 --- a/37.116cf847.async.js +++ b/37.116cf847.async.js @@ -13,176 +13,176 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var conf = { - comments: { - lineComment: '//', - blockComment: ['/*', '*/'], - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '`', close: '`', notIn: ['string'] }, - { open: '"', close: '"', notIn: ['string'] }, - { open: '\'', close: '\'', notIn: ['string', 'comment'] }, - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '`', close: '`' }, - { open: '"', close: '"' }, - { open: '\'', close: '\'' }, - ] -}; -var language = { - defaultToken: '', - tokenPostfix: '.go', - keywords: [ - 'break', - 'case', - 'chan', - 'const', - 'continue', - 'default', - 'defer', - 'else', - 'fallthrough', - 'for', - 'func', - 'go', - 'goto', - 'if', - 'import', - 'interface', - 'map', - 'package', - 'range', - 'return', - 'select', - 'struct', - 'switch', - 'type', - 'var', - 'bool', - 'true', - 'false', - 'uint8', - 'uint16', - 'uint32', - 'uint64', - 'int8', - 'int16', - 'int32', - 'int64', - 'float32', - 'float64', - 'complex64', - 'complex128', - 'byte', - 'rune', - 'uint', - 'int', - 'uintptr', - 'string', - 'nil', - ], - operators: [ - '+', '-', '*', '/', '%', '&', '|', '^', '<<', '>>', '&^', - '+=', '-=', '*=', '/=', '%=', '&=', '|=', '^=', '<<=', '>>=', '&^=', - '&&', '||', '<-', '++', '--', '==', '<', '>', '=', '!', '!=', '<=', '>=', ':=', '...', - '(', ')', '', ']', '{', '}', ',', ';', '.', ':' - ], - // we include these common regular expressions - symbols: /[=>](?!@symbols)/, '@brackets'], - [/@symbols/, { - cases: { - '@operators': 'delimiter', - '@default': '' - } - }], - // numbers - [/\d*\d+[eE]([\-+]?\d+)?/, 'number.float'], - [/\d*\.\d+([eE][\-+]?\d+)?/, 'number.float'], - [/0[xX][0-9a-fA-F']*[0-9a-fA-F]/, 'number.hex'], - [/0[0-7']*[0-7]/, 'number.octal'], - [/0[bB][0-1']*[0-1]/, 'number.binary'], - [/\d[\d']*/, 'number'], - [/\d/, 'number'], - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - // strings - [/"([^"\\]|\\.)*$/, 'string.invalid'], - [/"/, 'string', '@string'], - [/`/, "string", "@rawstring"], - // characters - [/'[^\\']'/, 'string'], - [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], - [/'/, 'string.invalid'] - ], - whitespace: [ - [/[ \t\r\n]+/, ''], - [/\/\*\*(?!\/)/, 'comment.doc', '@doccomment'], - [/\/\*/, 'comment', '@comment'], - [/\/\/.*$/, 'comment'], - ], - comment: [ - [/[^\/*]+/, 'comment'], - // [/\/\*/, 'comment', '@push' ], // nested comment not allowed :-( - // [/\/\*/, 'comment.invalid' ], // this breaks block comments in the shape of /* //*/ - [/\*\//, 'comment', '@pop'], - [/[\/*]/, 'comment'] - ], - //Identical copy of comment above, except for the addition of .doc - doccomment: [ - [/[^\/*]+/, 'comment.doc'], - // [/\/\*/, 'comment.doc', '@push' ], // nested comment not allowed :-( - [/\/\*/, 'comment.doc.invalid'], - [/\*\//, 'comment.doc', '@pop'], - [/[\/*]/, 'comment.doc'] - ], - string: [ - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, 'string', '@pop'] - ], - rawstring: [ - [/[^\`]/, "string"], - [/`/, "string", "@pop"] - ], - }, -}; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var conf = { + comments: { + lineComment: '//', + blockComment: ['/*', '*/'], + }, + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'] + ], + autoClosingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '`', close: '`', notIn: ['string'] }, + { open: '"', close: '"', notIn: ['string'] }, + { open: '\'', close: '\'', notIn: ['string', 'comment'] }, + ], + surroundingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '`', close: '`' }, + { open: '"', close: '"' }, + { open: '\'', close: '\'' }, + ] +}; +var language = { + defaultToken: '', + tokenPostfix: '.go', + keywords: [ + 'break', + 'case', + 'chan', + 'const', + 'continue', + 'default', + 'defer', + 'else', + 'fallthrough', + 'for', + 'func', + 'go', + 'goto', + 'if', + 'import', + 'interface', + 'map', + 'package', + 'range', + 'return', + 'select', + 'struct', + 'switch', + 'type', + 'var', + 'bool', + 'true', + 'false', + 'uint8', + 'uint16', + 'uint32', + 'uint64', + 'int8', + 'int16', + 'int32', + 'int64', + 'float32', + 'float64', + 'complex64', + 'complex128', + 'byte', + 'rune', + 'uint', + 'int', + 'uintptr', + 'string', + 'nil', + ], + operators: [ + '+', '-', '*', '/', '%', '&', '|', '^', '<<', '>>', '&^', + '+=', '-=', '*=', '/=', '%=', '&=', '|=', '^=', '<<=', '>>=', '&^=', + '&&', '||', '<-', '++', '--', '==', '<', '>', '=', '!', '!=', '<=', '>=', ':=', '...', + '(', ')', '', ']', '{', '}', ',', ';', '.', ':' + ], + // we include these common regular expressions + symbols: /[=>](?!@symbols)/, '@brackets'], + [/@symbols/, { + cases: { + '@operators': 'delimiter', + '@default': '' + } + }], + // numbers + [/\d*\d+[eE]([\-+]?\d+)?/, 'number.float'], + [/\d*\.\d+([eE][\-+]?\d+)?/, 'number.float'], + [/0[xX][0-9a-fA-F']*[0-9a-fA-F]/, 'number.hex'], + [/0[0-7']*[0-7]/, 'number.octal'], + [/0[bB][0-1']*[0-1]/, 'number.binary'], + [/\d[\d']*/, 'number'], + [/\d/, 'number'], + // delimiter: after number because of .\d floats + [/[;,.]/, 'delimiter'], + // strings + [/"([^"\\]|\\.)*$/, 'string.invalid'], + [/"/, 'string', '@string'], + [/`/, "string", "@rawstring"], + // characters + [/'[^\\']'/, 'string'], + [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], + [/'/, 'string.invalid'] + ], + whitespace: [ + [/[ \t\r\n]+/, ''], + [/\/\*\*(?!\/)/, 'comment.doc', '@doccomment'], + [/\/\*/, 'comment', '@comment'], + [/\/\/.*$/, 'comment'], + ], + comment: [ + [/[^\/*]+/, 'comment'], + // [/\/\*/, 'comment', '@push' ], // nested comment not allowed :-( + // [/\/\*/, 'comment.invalid' ], // this breaks block comments in the shape of /* //*/ + [/\*\//, 'comment', '@pop'], + [/[\/*]/, 'comment'] + ], + //Identical copy of comment above, except for the addition of .doc + doccomment: [ + [/[^\/*]+/, 'comment.doc'], + // [/\/\*/, 'comment.doc', '@push' ], // nested comment not allowed :-( + [/\/\*/, 'comment.doc.invalid'], + [/\*\//, 'comment.doc', '@pop'], + [/[\/*]/, 'comment.doc'] + ], + string: [ + [/[^\\"]+/, 'string'], + [/@escapes/, 'string.escape'], + [/\\./, 'string.escape.invalid'], + [/"/, 'string', '@pop'] + ], + rawstring: [ + [/[^\`]/, "string"], + [/`/, "string", "@pop"] + ], + }, +}; /***/ }) diff --git a/38.b1f00a5a.async.js b/38.b1f00a5a.async.js index 3c649c114..2e6368e99 100644 --- a/38.b1f00a5a.async.js +++ b/38.b1f00a5a.async.js @@ -13,135 +13,135 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var conf = { - comments: { - lineComment: '#' - }, - brackets: [ - ['{', '}'], - ['[', ']'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"""', close: '"""', notIn: ['string', 'comment'] }, - { open: '"', close: '"', notIn: ['string', 'comment'] }, - ], - surroundingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"""', close: '"""' }, - { open: '"', close: '"' }, - ], - folding: { - offSide: true - } -}; -var language = { - // Set defaultToken to invalid to see what you do not tokenize yet - defaultToken: 'invalid', - tokenPostfix: '.gql', - keywords: [ - 'null', 'true', 'false', - 'query', 'mutation', 'subscription', - 'extend', 'schema', 'directive', - 'scalar', 'type', 'interface', 'union', 'enum', 'input', 'implements', - 'fragment', 'on', - ], - typeKeywords: ['Int', 'Float', 'String', 'Boolean', 'ID'], - directiveLocations: [ - 'SCHEMA', 'SCALAR', 'OBJECT', 'FIELD_DEFINITION', 'ARGUMENT_DEFINITION', - 'INTERFACE', 'UNION', 'ENUM', 'ENUM_VALUE', 'INPUT_OBJECT', 'INPUT_FIELD_DEFINITION', - 'QUERY', 'MUTATION', 'SUBSCRIPTION', 'FIELD', 'FRAGMENT_DEFINITION', - 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT', 'VARIABLE_DEFINITION', - ], - operators: ['=', '!', '?', ':', '&', '|'], - // we include these common regular expressions - symbols: /[=!?:&|]+/, - // https://facebook.github.io/graphql/draft/#sec-String-Value - escapes: /\\(?:["\\\/bfnrt]|u[0-9A-Fa-f]{4})/, - // The main tokenizer for our languages - tokenizer: { - root: [ - // fields and argument names - [ - /[a-z_][\w$]*/, - { - cases: { - '@keywords': 'keyword', - '@default': 'key.identifier', - }, - }, - ], - // identify typed input variables - [ - /[$][\w$]*/, - { - cases: { - '@keywords': 'keyword', - '@default': 'argument.identifier', - }, - }, - ], - // to show class names nicely - [ - /[A-Z][\w\$]*/, - { - cases: { - '@typeKeywords': 'keyword', - '@default': 'type.identifier', - }, - }, - ], - // whitespace - { include: '@whitespace' }, - // delimiters and operators - [/[{}()\[\]]/, '@brackets'], - [ - /@symbols/, - { cases: { '@operators': 'operator', '@default': '' } }, - ], - // @ annotations. - // As an example, we emit a debugging log message on these tokens. - // Note: message are supressed during the first load -- change some lines to see them. - [ - /@\s*[a-zA-Z_\$][\w\$]*/, - { token: 'annotation', log: 'annotation token: $0' }, - ], - // numbers - [/\d*\.\d+([eE][\-+]?\d+)?/, 'number.float'], - [/0[xX][0-9a-fA-F]+/, 'number.hex'], - [/\d+/, 'number'], - // delimiter: after number because of .\d floats - [/[;,.]/, 'delimiter'], - [/"""/, - { token: 'string', next: '@mlstring', nextEmbedded: 'markdown' } - ], - // strings - [/"([^"\\]|\\.)*$/, 'string.invalid'], - [/"/, { token: 'string.quote', bracket: '@open', next: '@string' }], - ], - mlstring: [ - [/[^"]+/, 'string'], - ['"""', { token: 'string', next: '@pop', nextEmbedded: '@pop' }] - ], - string: [ - [/[^\\"]+/, 'string'], - [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, { token: 'string.quote', bracket: '@close', next: '@pop' }], - ], - whitespace: [[/[ \t\r\n]+/, ''], [/#.*$/, 'comment']], - }, -}; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var conf = { + comments: { + lineComment: '#' + }, + brackets: [ + ['{', '}'], + ['[', ']'], + ['(', ')'] + ], + autoClosingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"""', close: '"""', notIn: ['string', 'comment'] }, + { open: '"', close: '"', notIn: ['string', 'comment'] }, + ], + surroundingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"""', close: '"""' }, + { open: '"', close: '"' }, + ], + folding: { + offSide: true + } +}; +var language = { + // Set defaultToken to invalid to see what you do not tokenize yet + defaultToken: 'invalid', + tokenPostfix: '.gql', + keywords: [ + 'null', 'true', 'false', + 'query', 'mutation', 'subscription', + 'extend', 'schema', 'directive', + 'scalar', 'type', 'interface', 'union', 'enum', 'input', 'implements', + 'fragment', 'on', + ], + typeKeywords: ['Int', 'Float', 'String', 'Boolean', 'ID'], + directiveLocations: [ + 'SCHEMA', 'SCALAR', 'OBJECT', 'FIELD_DEFINITION', 'ARGUMENT_DEFINITION', + 'INTERFACE', 'UNION', 'ENUM', 'ENUM_VALUE', 'INPUT_OBJECT', 'INPUT_FIELD_DEFINITION', + 'QUERY', 'MUTATION', 'SUBSCRIPTION', 'FIELD', 'FRAGMENT_DEFINITION', + 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT', 'VARIABLE_DEFINITION', + ], + operators: ['=', '!', '?', ':', '&', '|'], + // we include these common regular expressions + symbols: /[=!?:&|]+/, + // https://facebook.github.io/graphql/draft/#sec-String-Value + escapes: /\\(?:["\\\/bfnrt]|u[0-9A-Fa-f]{4})/, + // The main tokenizer for our languages + tokenizer: { + root: [ + // fields and argument names + [ + /[a-z_][\w$]*/, + { + cases: { + '@keywords': 'keyword', + '@default': 'key.identifier', + }, + }, + ], + // identify typed input variables + [ + /[$][\w$]*/, + { + cases: { + '@keywords': 'keyword', + '@default': 'argument.identifier', + }, + }, + ], + // to show class names nicely + [ + /[A-Z][\w\$]*/, + { + cases: { + '@typeKeywords': 'keyword', + '@default': 'type.identifier', + }, + }, + ], + // whitespace + { include: '@whitespace' }, + // delimiters and operators + [/[{}()\[\]]/, '@brackets'], + [ + /@symbols/, + { cases: { '@operators': 'operator', '@default': '' } }, + ], + // @ annotations. + // As an example, we emit a debugging log message on these tokens. + // Note: message are supressed during the first load -- change some lines to see them. + [ + /@\s*[a-zA-Z_\$][\w\$]*/, + { token: 'annotation', log: 'annotation token: $0' }, + ], + // numbers + [/\d*\.\d+([eE][\-+]?\d+)?/, 'number.float'], + [/0[xX][0-9a-fA-F]+/, 'number.hex'], + [/\d+/, 'number'], + // delimiter: after number because of .\d floats + [/[;,.]/, 'delimiter'], + [/"""/, + { token: 'string', next: '@mlstring', nextEmbedded: 'markdown' } + ], + // strings + [/"([^"\\]|\\.)*$/, 'string.invalid'], + [/"/, { token: 'string.quote', bracket: '@open', next: '@string' }], + ], + mlstring: [ + [/[^"]+/, 'string'], + ['"""', { token: 'string', next: '@pop', nextEmbedded: '@pop' }] + ], + string: [ + [/[^\\"]+/, 'string'], + [/@escapes/, 'string.escape'], + [/\\./, 'string.escape.invalid'], + [/"/, { token: 'string.quote', bracket: '@close', next: '@pop' }], + ], + whitespace: [[/[ \t\r\n]+/, ''], [/#.*$/, 'comment']], + }, +}; /***/ }) diff --git a/39.b873d6bc.async.js b/39.b873d6bc.async.js index ba2a53b46..5a4625014 100644 --- a/39.b873d6bc.async.js +++ b/39.b873d6bc.async.js @@ -13,200 +13,200 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conf", function() { return conf; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "language", function() { return language; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -// Allow for running under nodejs/requirejs in tests -var _monaco = (typeof monaco === 'undefined' ? self.monaco : monaco); -var EMPTY_ELEMENTS = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr']; -var conf = { - wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g, - comments: { - blockComment: ['{{!--', '--}}'] - }, - brackets: [ - [''], - ['<', '>'], - ['{{', '}}'], - ['{', '}'], - ['(', ')'] - ], - autoClosingPairs: [ - { open: '{', close: '}' }, - { open: '[', close: ']' }, - { open: '(', close: ')' }, - { open: '"', close: '"' }, - { open: '\'', close: '\'' } - ], - surroundingPairs: [ - { open: '<', close: '>' }, - { open: '"', close: '"' }, - { open: '\'', close: '\'' } - ], - onEnterRules: [ - { - beforeText: new RegExp("<(?!(?:" + EMPTY_ELEMENTS.join('|') + "))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$", 'i'), - afterText: /^<\/(\w[\w\d]*)\s*>$/i, - action: { indentAction: _monaco.languages.IndentAction.IndentOutdent } - }, - { - beforeText: new RegExp("<(?!(?:" + EMPTY_ELEMENTS.join('|') + "))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$", 'i'), - action: { indentAction: _monaco.languages.IndentAction.Indent } - } - ], -}; -var language = { - defaultToken: '', - tokenPostfix: '', - // ignoreCase: true, - // The main tokenizer for our languages - tokenizer: { - root: [ - [/\{\{/, { token: '@rematch', switchTo: '@handlebarsInSimpleState.root' }], - [/)/, ['delimiter.html', 'tag.html', 'delimiter.html']], - [/(<)(script)/, ['delimiter.html', { token: 'tag.html', next: '@script' }]], - [/(<)(style)/, ['delimiter.html', { token: 'tag.html', next: '@style' }]], - [/(<)([:\w]+)/, ['delimiter.html', { token: 'tag.html', next: '@otherTag' }]], - [/(<\/)(\w+)/, ['delimiter.html', { token: 'tag.html', next: '@otherTag' }]], - [/]+/, 'metatag.content.html'], - [/>/, 'metatag.html', '@pop'], - ], - comment: [ - [/\{\{/, { token: '@rematch', switchTo: '@handlebarsInSimpleState.comment' }], - [/-->/, 'comment.html', '@pop'], - [/[^-]+/, 'comment.content.html'], - [/./, 'comment.content.html'] - ], - otherTag: [ - [/\{\{/, { token: '@rematch', switchTo: '@handlebarsInSimpleState.otherTag' }], - [/\/?>/, 'delimiter.html', '@pop'], - [/"([^"]*)"/, 'attribute.value'], - [/'([^']*)'/, 'attribute.value'], - [/[\w\-]+/, 'attribute.name'], - [/=/, 'delimiter'], - [/[ \t\r\n]+/], - ], - // -- BEGIN