From a11f71758a08bfd96fa05bf4346d36a9afa86c61 Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Sat, 11 Jan 2020 23:54:32 +0530 Subject: [PATCH] update-json-typegen (#168) * update-json-typegen * fixes * fixes * fixes * fixes * fixes * fixes * fixes --- components/Form.tsx | 34 +- components/Navigator.tsx | 6 +- package.json | 24 +- pages/json-to-rust-serde.tsx | 74 +- patches/json_typegen_wasm+0.3.3.patch | 16 - patches/json_typegen_wasm+0.4.0.patch | 17 + public/static/monaco/css.worker.js | 27385 +++++++++--------- public/static/monaco/editor.worker.js | 9270 +++---- public/static/monaco/html.worker.js | 29322 ++++++++++---------- public/static/monaco/json.worker.js | 19412 ++++++------- public/static/monaco/typescript.worker.js | 9803 +++---- tsconfig.json | 2 +- typings/npm/evergreen-ui.d.ts | 2 + yarn.lock | 526 +- 14 files changed, 45578 insertions(+), 50315 deletions(-) delete mode 100644 patches/json_typegen_wasm+0.3.3.patch create mode 100644 patches/json_typegen_wasm+0.4.0.patch diff --git a/components/Form.tsx b/components/Form.tsx index 00d5ff4..1c732d0 100644 --- a/components/Form.tsx +++ b/components/Form.tsx @@ -1,10 +1,11 @@ import React from "react"; import { Formik, FormikProps } from "formik"; -import { Dialog, Heading, Pane, Switch, TextInput } from "evergreen-ui"; +import { Dialog, Heading, Pane, Switch, TextInput, Select } from "evergreen-ui"; export enum InputType { SWITCH = 1, - TEXT_INPUT + TEXT_INPUT, + SELECT } interface FormProps { @@ -17,6 +18,7 @@ interface FormProps { label: string; isDisabled?: (values: T) => boolean; props?: any; + options?: { label: string; value: string | number }[]; }[]; open: boolean; toggle: () => void; @@ -50,10 +52,32 @@ const Form = ({ > <> {formsFields.map( - ({ type, key, label, isDisabled, props: _props }, i) => { - let FormField; + ( + { type, key, label, isDisabled, props: _props, options }, + i + ) => { + let FormField, select; if (type === InputType.TEXT_INPUT) FormField = TextInput; else if (type === InputType.SWITCH) FormField = Switch; + else if (type === InputType.SELECT) + select = ( + + ); const _isDisabled = isDisabled ? isDisabled(props.values) @@ -86,6 +110,8 @@ const Form = ({ disabled={_isDisabled} /> )} + + {select} ); } diff --git a/components/Navigator.tsx b/components/Navigator.tsx index 03f86b8..5b510c3 100644 --- a/components/Navigator.tsx +++ b/components/Navigator.tsx @@ -86,9 +86,9 @@ export default function() {
Created by{" "} - - @ritz078 - + + @ritz078 + diff --git a/package.json b/package.json index 4245b28..e72e233 100644 --- a/package.json +++ b/package.json @@ -43,10 +43,10 @@ "babel-plugin-json-to-proptypes": "^0.1.0", "babel-plugin-object-styles-to-template": "^0.2.2", "babel-standalone": "^6.26.0", - "clipboard-copy": "^3.0.0", + "clipboard-copy": "^3.1.0", "evergreen-ui": "^4.18.1", "flow-to-ts": "gist:3f49c8bd7a2b71429dcae28f2c2d1d97", - "flowgen": "^1.9.2", + "flowgen": "^1.10.0", "formik": "^1.5.8", "generate-schema": "^2.6.0", "gofmt.js": "^0.0.2", @@ -60,31 +60,31 @@ "json-schema-to-typescript": "^6.1.3", "json-to-go": "gist:0d0b8324131c80eeb7e1df20001be32f", "json-ts": "^1.6.4", - "json_typegen_wasm": "^0.3.3", + "json_typegen_wasm": "^0.4.0", "jsonld": "^1.6.2", "load-script": "^1.0.0", "lodash": "^4.17.15", "markdown": "^0.5.0", - "monaco-editor": "^0.17.1", - "next": "^9.1.1", + "monaco-editor": "0.17.1", + "next": "9.1.1", "nprogress": "^0.2.0", - "postcss": "^7.0.17", - "postcss-js": "^2.0.2", + "postcss": "^7.0.26", + "postcss-js": "^2.0.3", "qrcode.react": "^0.9.3", - "react": "^16.11.0", - "react-dom": "^16.11.0", + "react": "^16.12.0", + "react-dom": "^16.12.0", "react-dropzone": "^10.2.1", - "react-ga": "^2.6.0", + "react-ga": "^2.7.0", "rust-keywords": "^1.1.0", "sha1": "^1.1.1", "snack-sdk": "^2.3.1", "stringify-object": "^3.3.0", "svg-to-dataurl": "^1.0.0", - "svgo": "^1.3.0", + "svgo": "^1.3.2", "text-encoding-utf-8": "^1.0.2", "transform-json-types": "^0.7.0", "xml-js": "^1.6.11", - "yaml": "^1.6.0" + "yaml": "^1.7.2" }, "devDependencies": { "@next/bundle-analyzer": "^9.0.2", diff --git a/pages/json-to-rust-serde.tsx b/pages/json-to-rust-serde.tsx index df148cd..1324597 100644 --- a/pages/json-to-rust-serde.tsx +++ b/pages/json-to-rust-serde.tsx @@ -1,18 +1,70 @@ import ConversionPanel, { Transformer } from "@components/ConversionPanel"; import * as React from "react"; import { useCallback } from "react"; +import Form, { InputType } from "@components/Form"; +import { useSettings } from "@hooks/useSettings"; +import { EditorPanelProps } from "@components/EditorPanel"; +import { Settings } from "@constants/svgoConfig"; + +const formFields = [ + { + type: InputType.SELECT, + key: "property_name_format", + label: "Property Name Format", + options: [ + "PascalCase", + "camelCase", + "snake_case", + "SCREAMING_SNAKE_CASE", + "kebab-case", + "SCREAMING-KEBAB-CASE", + "UPPERCASE" + ].map(value => ({ + label: value, + value + })) + } +]; + +const defaultSettings = { + property_name_format: "camelCase" +}; export default function() { - const transformer = useCallback(async ({ value }) => { - const { run } = await import("json_typegen_wasm"); - return run( - "Root", - value, - JSON.stringify({ - output_mode: "rust" - }) - ); - }, []); + const name = "json-to-rust-serde"; + + const [settings, setSettings] = useSettings(name, defaultSettings); + + const transformer = useCallback( + async ({ value }) => { + const { run } = await import("json_typegen_wasm"); + return run( + "Root", + value, + JSON.stringify({ + output_mode: "rust", + property_name_format: settings.property_name_format + }) + ); + }, + [settings] + ); + + const getSettingsElement = useCallback( + ({ open, toggle }) => { + return ( + + title="JSON to Rust Serde" + onSubmit={setSettings} + open={open} + toggle={toggle} + formsFields={formFields} + initialValues={settings} + /> + ); + }, + [] + ); return ( ); } diff --git a/patches/json_typegen_wasm+0.3.3.patch b/patches/json_typegen_wasm+0.3.3.patch deleted file mode 100644 index 8f3ef43..0000000 --- a/patches/json_typegen_wasm+0.3.3.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/node_modules/json_typegen_wasm/json_typegen_wasm.js b/node_modules/json_typegen_wasm/json_typegen_wasm.js -index 8baafc9..3c9dc39 100644 ---- a/node_modules/json_typegen_wasm/json_typegen_wasm.js -+++ b/node_modules/json_typegen_wasm/json_typegen_wasm.js -@@ -1,5 +1,11 @@ - import * as wasm from './json_typegen_wasm_bg'; - -+if (IN_BROWSER && !window.TextEncoder) { -+ const encoding = require("text-encoding-utf-8"); -+ window.TextEncoder = encoding.TextEncoder; -+ window.TextDecoder = encoding.TextDecoder; -+} -+ - let cachedTextEncoder = new TextEncoder('utf-8'); - - let cachegetUint8Memory = null; diff --git a/patches/json_typegen_wasm+0.4.0.patch b/patches/json_typegen_wasm+0.4.0.patch new file mode 100644 index 0000000..8f93c51 --- /dev/null +++ b/patches/json_typegen_wasm+0.4.0.patch @@ -0,0 +1,17 @@ +diff --git a/node_modules/json_typegen_wasm/index.js b/node_modules/json_typegen_wasm/index.js +index 2201033..e7f5ab6 100644 +--- a/node_modules/json_typegen_wasm/index.js ++++ b/node_modules/json_typegen_wasm/index.js +@@ -4,6 +4,12 @@ let WASM_VECTOR_LEN = 0; + + let cachedTextEncoder = new TextEncoder('utf-8'); + ++if (IN_BROWSER && !window.TextEncoder) { ++ const encoding = require("text-encoding-utf-8"); ++ window.TextEncoder = encoding.TextEncoder; ++ window.TextDecoder = encoding.TextDecoder; ++} ++ + const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' + ? function (arg, view) { + return cachedTextEncoder.encodeInto(arg, view); diff --git a/public/static/monaco/css.worker.js b/public/static/monaco/css.worker.js index 429bdb2..73e1f0c 100644 --- a/public/static/monaco/css.worker.js +++ b/public/static/monaco/css.worker.js @@ -87,40 +87,721 @@ /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./node_modules/monaco-editor/esm/vs/language/css/css.worker.js"); +/******/ return __webpack_require__(__webpack_require__.s = "Kt2+"); /******/ }) /************************************************************************/ /******/ ({ -/***/ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/arrays.js ***! - \*****************************************************************/ -/*! exports provided: tail, tail2, equals, binarySearch, findFirstInSorted, mergeSort, groupBy, coalesce, isFalsyOrEmpty, isNonEmptyArray, distinct, distinctES6, firstIndex, first, flatten, range, arrayInsert, pushToStart, pushToEnd, asArray */ +/***/ "Kt2+": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return tail; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tail2", function() { return tail2; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "binarySearch", function() { return binarySearch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findFirstInSorted", function() { return findFirstInSorted; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeSort", function() { return mergeSort; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return groupBy; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "coalesce", function() { return coalesce; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFalsyOrEmpty", function() { return isFalsyOrEmpty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNonEmptyArray", function() { return isNonEmptyArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return distinct; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctES6", function() { return distinctES6; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstIndex", function() { return firstIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return first; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return flatten; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayInsert", function() { return arrayInsert; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushToStart", function() { return pushToStart; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushToEnd", function() { return pushToEnd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asArray", function() { return asArray; }); + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/errors.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Avoid circular dependency on EventEmitter by implementing a subset of the interface. +var ErrorHandler = /** @class */ (function () { + function ErrorHandler() { + this.listeners = []; + this.unexpectedErrorHandler = function (e) { + setTimeout(function () { + if (e.stack) { + throw new Error(e.message + '\n\n' + e.stack); + } + throw e; + }, 0); + }; + } + ErrorHandler.prototype.emit = function (e) { + this.listeners.forEach(function (listener) { + listener(e); + }); + }; + ErrorHandler.prototype.onUnexpectedError = function (e) { + this.unexpectedErrorHandler(e); + this.emit(e); + }; + // For external errors, we don't want the listeners to be called + ErrorHandler.prototype.onUnexpectedExternalError = function (e) { + this.unexpectedErrorHandler(e); + }; + return ErrorHandler; +}()); + +var errorHandler = new ErrorHandler(); +function onUnexpectedError(e) { + // ignore errors from cancelled promises + if (!isPromiseCanceledError(e)) { + errorHandler.onUnexpectedError(e); + } + return undefined; +} +function onUnexpectedExternalError(e) { + // ignore errors from cancelled promises + if (!isPromiseCanceledError(e)) { + errorHandler.onUnexpectedExternalError(e); + } + return undefined; +} +function transformErrorForSerialization(error) { + if (error instanceof Error) { + var name_1 = error.name, message = error.message; + var stack = error.stacktrace || error.stack; + return { + $isError: true, + name: name_1, + message: message, + stack: stack + }; + } + // return as is + return error; +} +var canceledName = 'Canceled'; +/** + * Checks if the given error is a promise in canceled state + */ +function isPromiseCanceledError(error) { + return error instanceof Error && error.name === canceledName && error.message === canceledName; +} +/** + * Returns an error that signals cancellation. + */ +function canceled() { + var error = new Error(canceledName); + error.name = error.message; + return error; +} +function illegalArgument(name) { + if (name) { + return new Error("Illegal argument: " + name); + } + else { + return new Error('Illegal argument'); + } +} +function illegalState(name) { + if (name) { + return new Error("Illegal state: " + name); + } + else { + return new Error('Illegal state'); + } +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js +function isDisposable(thing) { + return typeof thing.dispose === 'function' + && thing.dispose.length === 0; +} +function lifecycle_dispose(first) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + if (Array.isArray(first)) { + first.forEach(function (d) { return d && d.dispose(); }); + return []; + } + else if (rest.length === 0) { + if (first) { + first.dispose(); + return first; + } + return undefined; + } + else { + lifecycle_dispose(first); + lifecycle_dispose(rest); + return []; + } +} +function combinedDisposable(disposables) { + return { dispose: function () { return lifecycle_dispose(disposables); } }; +} +function toDisposable(fn) { + return { dispose: function () { fn(); } }; +} +var Disposable = /** @class */ (function () { + function Disposable() { + this._toDispose = []; + this._lifecycle_disposable_isDisposed = false; + } + Disposable.prototype.dispose = function () { + this._lifecycle_disposable_isDisposed = true; + this._toDispose = lifecycle_dispose(this._toDispose); + }; + Disposable.prototype._register = function (t) { + if (this._lifecycle_disposable_isDisposed) { + console.warn('Registering disposable on object that has already been disposed.'); + t.dispose(); + } + else { + this._toDispose.push(t); + } + return t; + }; + Disposable.None = Object.freeze({ dispose: function () { } }); + return Disposable; +}()); + +var ImmortalReference = /** @class */ (function () { + function ImmortalReference(object) { + this.object = object; + } + ImmortalReference.prototype.dispose = function () { }; + return ImmortalReference; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/platform.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var LANGUAGE_DEFAULT = 'en'; +var _isWindows = false; +var _isMacintosh = false; +var _isLinux = false; +var _isNative = false; +var _isWeb = false; +var _locale = undefined; +var _language = LANGUAGE_DEFAULT; +var _translationsConfigFile = undefined; +var isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer'); +// OS detection +if (typeof navigator === 'object' && !isElectronRenderer) { + var userAgent = navigator.userAgent; + _isWindows = userAgent.indexOf('Windows') >= 0; + _isMacintosh = userAgent.indexOf('Macintosh') >= 0; + _isLinux = userAgent.indexOf('Linux') >= 0; + _isWeb = true; + _locale = navigator.language; + _language = _locale; +} +else if (typeof process === 'object') { + _isWindows = (process.platform === 'win32'); + _isMacintosh = (process.platform === 'darwin'); + _isLinux = (process.platform === 'linux'); + _locale = LANGUAGE_DEFAULT; + _language = LANGUAGE_DEFAULT; + var rawNlsConfig = process.env['VSCODE_NLS_CONFIG']; + if (rawNlsConfig) { + try { + var nlsConfig = JSON.parse(rawNlsConfig); + var resolved = nlsConfig.availableLanguages['*']; + _locale = nlsConfig.locale; + // VSCode's default language is 'en' + _language = resolved ? resolved : LANGUAGE_DEFAULT; + _translationsConfigFile = nlsConfig._translationsConfigFile; + } + catch (e) { + } + } + _isNative = true; +} +var _platform = 0 /* Web */; +if (_isNative) { + if (_isMacintosh) { + _platform = 1 /* Mac */; + } + else if (_isWindows) { + _platform = 3 /* Windows */; + } + else if (_isLinux) { + _platform = 2 /* Linux */; + } +} +var isWindows = _isWindows; +var isMacintosh = _isMacintosh; +var isLinux = _isLinux; +var isNative = _isNative; +var isWeb = _isWeb; +var _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {}); +var globals = _globals; +var _setImmediate = null; +function setImmediate(callback) { + if (_setImmediate === null) { + if (globals.setImmediate) { + _setImmediate = globals.setImmediate.bind(globals); + } + else if (typeof process !== 'undefined' && typeof process.nextTick === 'function') { + _setImmediate = process.nextTick.bind(process); + } + else { + _setImmediate = globals.setTimeout.bind(globals); + } + } + return _setImmediate(callback); +} +var OS = (_isMacintosh ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */)); + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/types.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var _typeof = { + number: 'number', + string: 'string', + undefined: 'undefined', + object: 'object', + function: 'function' +}; +/** + * @returns whether the provided parameter is a JavaScript Array or not. + */ +function isArray(array) { + if (Array.isArray) { + return Array.isArray(array); + } + if (array && typeof (array.length) === _typeof.number && array.constructor === Array) { + return true; + } + return false; +} +/** + * @returns whether the provided parameter is a JavaScript String or not. + */ +function isString(str) { + if (typeof (str) === _typeof.string || str instanceof String) { + return true; + } + return false; +} +/** + * + * @returns whether the provided parameter is of type `object` but **not** + * `null`, an `array`, a `regexp`, nor a `date`. + */ +function isObject(obj) { + // The method can't do a type cast since there are type (like strings) which + // are subclasses of any put not positvely matched by the function. Hence type + // narrowing results in wrong results. + return typeof obj === _typeof.object + && obj !== null + && !Array.isArray(obj) + && !(obj instanceof RegExp) + && !(obj instanceof Date); +} +/** + * In **contrast** to just checking `typeof` this will return `false` for `NaN`. + * @returns whether the provided parameter is a JavaScript Number or not. + */ +function isNumber(obj) { + if ((typeof (obj) === _typeof.number || obj instanceof Number) && !isNaN(obj)) { + return true; + } + return false; +} +/** + * @returns whether the provided parameter is a JavaScript Boolean or not. + */ +function isBoolean(obj) { + return obj === true || obj === false; +} +/** + * @returns whether the provided parameter is undefined. + */ +function isUndefined(obj) { + return typeof (obj) === _typeof.undefined; +} +/** + * @returns whether the provided parameter is undefined or null. + */ +function isUndefinedOrNull(obj) { + return isUndefined(obj) || obj === null; +} +var types_hasOwnProperty = Object.prototype.hasOwnProperty; +/** + * @returns whether the provided parameter is an empty JavaScript Object or not. + */ +function isEmptyObject(obj) { + if (!isObject(obj)) { + return false; + } + for (var key in obj) { + if (types_hasOwnProperty.call(obj, key)) { + return false; + } + } + return true; +} +/** + * @returns whether the provided parameter is a JavaScript Function or not. + */ +function isFunction(obj) { + return typeof obj === _typeof.function; +} +function validateConstraints(args, constraints) { + var len = Math.min(args.length, constraints.length); + for (var i = 0; i < len; i++) { + validateConstraint(args[i], constraints[i]); + } +} +function validateConstraint(arg, constraint) { + if (isString(constraint)) { + if (typeof arg !== constraint) { + throw new Error("argument does not match constraint: typeof " + constraint); + } + } + else if (isFunction(constraint)) { + try { + if (arg instanceof constraint) { + return; + } + } + catch (_a) { + // ignore + } + if (!isUndefinedOrNull(arg) && arg.constructor === constraint) { + return; + } + if (constraint.length === 1 && constraint.call(undefined, arg) === true) { + return; + } + throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true"); + } +} +function getAllPropertyNames(obj) { + var res = []; + var proto = Object.getPrototypeOf(obj); + while (Object.prototype !== proto) { + res = res.concat(Object.getOwnPropertyNames(proto)); + proto = Object.getPrototypeOf(proto); + } + return res; +} +/** + * Converts null to undefined, passes all other values through. + */ +function withNullAsUndefined(x) { + return x === null ? undefined : x; +} +/** + * Converts undefined to null, passes all other values through. + */ +function withUndefinedAsNull(x) { + return typeof x === 'undefined' ? null : x; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var __extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + +var INITIALIZE = '$initialize'; +var webWorkerWarningLogged = false; +function logOnceWebWorkerWarning(err) { + if (!isWeb) { + // running tests + return; + } + if (!webWorkerWarningLogged) { + webWorkerWarningLogged = true; + console.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq'); + } + console.warn(err.message); +} +var simpleWorker_SimpleWorkerProtocol = /** @class */ (function () { + function SimpleWorkerProtocol(handler) { + this._workerId = -1; + this._handler = handler; + this._lastSentReq = 0; + this._pendingReplies = Object.create(null); + } + SimpleWorkerProtocol.prototype.setWorkerId = function (workerId) { + this._workerId = workerId; + }; + SimpleWorkerProtocol.prototype.sendMessage = function (method, args) { + var _this = this; + var req = String(++this._lastSentReq); + return new Promise(function (resolve, reject) { + _this._pendingReplies[req] = { + resolve: resolve, + reject: reject + }; + _this._send({ + vsWorker: _this._workerId, + req: req, + method: method, + args: args + }); + }); + }; + SimpleWorkerProtocol.prototype.handleMessage = function (serializedMessage) { + var message; + try { + message = JSON.parse(serializedMessage); + } + catch (e) { + // nothing + return; + } + if (!message || !message.vsWorker) { + return; + } + if (this._workerId !== -1 && message.vsWorker !== this._workerId) { + return; + } + this._handleMessage(message); + }; + SimpleWorkerProtocol.prototype._handleMessage = function (msg) { + var _this = this; + if (msg.seq) { + var replyMessage = msg; + if (!this._pendingReplies[replyMessage.seq]) { + console.warn('Got reply to unknown seq'); + return; + } + var reply = this._pendingReplies[replyMessage.seq]; + delete this._pendingReplies[replyMessage.seq]; + if (replyMessage.err) { + var err = replyMessage.err; + if (replyMessage.err.$isError) { + err = new Error(); + err.name = replyMessage.err.name; + err.message = replyMessage.err.message; + err.stack = replyMessage.err.stack; + } + reply.reject(err); + return; + } + reply.resolve(replyMessage.res); + return; + } + var requestMessage = msg; + var req = requestMessage.req; + var result = this._handler.handleMessage(requestMessage.method, requestMessage.args); + result.then(function (r) { + _this._send({ + vsWorker: _this._workerId, + seq: req, + res: r, + err: undefined + }); + }, function (e) { + if (e.detail instanceof Error) { + // Loading errors have a detail property that points to the actual error + e.detail = transformErrorForSerialization(e.detail); + } + _this._send({ + vsWorker: _this._workerId, + seq: req, + res: undefined, + err: transformErrorForSerialization(e) + }); + }); + }; + SimpleWorkerProtocol.prototype._send = function (msg) { + var strMsg = JSON.stringify(msg); + // console.log('SENDING: ' + strMsg); + this._handler.sendMessage(strMsg); + }; + return SimpleWorkerProtocol; +}()); +/** + * Main thread side + */ +var SimpleWorkerClient = /** @class */ (function (_super) { + __extends(SimpleWorkerClient, _super); + function SimpleWorkerClient(workerFactory, moduleId) { + var _this = _super.call(this) || this; + var lazyProxyReject = null; + _this._worker = _this._register(workerFactory.create('vs/base/common/worker/simpleWorker', function (msg) { + _this._protocol.handleMessage(msg); + }, function (err) { + // in Firefox, web workers fail lazily :( + // we will reject the proxy + if (lazyProxyReject) { + lazyProxyReject(err); + } + })); + _this._protocol = new simpleWorker_SimpleWorkerProtocol({ + sendMessage: function (msg) { + _this._worker.postMessage(msg); + }, + handleMessage: function (method, args) { + // Intentionally not supporting worker -> main requests + return Promise.resolve(null); + } + }); + _this._protocol.setWorkerId(_this._worker.getId()); + // Gather loader configuration + var loaderConfiguration = null; + if (typeof self.require !== 'undefined' && typeof self.require.getConfig === 'function') { + // Get the configuration from the Monaco AMD Loader + loaderConfiguration = self.require.getConfig(); + } + else if (typeof self.requirejs !== 'undefined') { + // Get the configuration from requirejs + loaderConfiguration = self.requirejs.s.contexts._.config; + } + // Send initialize message + _this._onModuleLoaded = _this._protocol.sendMessage(INITIALIZE, [ + _this._worker.getId(), + moduleId, + loaderConfiguration + ]); + _this._lazyProxy = new Promise(function (resolve, reject) { + lazyProxyReject = reject; + _this._onModuleLoaded.then(function (availableMethods) { + var proxy = {}; + for (var _i = 0, availableMethods_1 = availableMethods; _i < availableMethods_1.length; _i++) { + var methodName = availableMethods_1[_i]; + proxy[methodName] = createProxyMethod(methodName, proxyMethodRequest); + } + resolve(proxy); + }, function (e) { + reject(e); + _this._onError('Worker failed to load ' + moduleId, e); + }); + }); + // Create proxy to loaded code + var proxyMethodRequest = function (method, args) { + return _this._request(method, args); + }; + var createProxyMethod = function (method, proxyMethodRequest) { + return function () { + var args = Array.prototype.slice.call(arguments, 0); + return proxyMethodRequest(method, args); + }; + }; + return _this; + } + SimpleWorkerClient.prototype.getProxyObject = function () { + return this._lazyProxy; + }; + SimpleWorkerClient.prototype._request = function (method, args) { + var _this = this; + return new Promise(function (resolve, reject) { + _this._onModuleLoaded.then(function () { + _this._protocol.sendMessage(method, args).then(resolve, reject); + }, reject); + }); + }; + SimpleWorkerClient.prototype._onError = function (message, error) { + console.error(message); + console.info(error); + }; + return SimpleWorkerClient; +}(Disposable)); + +/** + * Worker side + */ +var simpleWorker_SimpleWorkerServer = /** @class */ (function () { + function SimpleWorkerServer(postSerializedMessage, requestHandler) { + var _this = this; + this._requestHandler = requestHandler; + this._protocol = new simpleWorker_SimpleWorkerProtocol({ + sendMessage: function (msg) { + postSerializedMessage(msg); + }, + handleMessage: function (method, args) { return _this._handleMessage(method, args); } + }); + } + SimpleWorkerServer.prototype.onmessage = function (msg) { + this._protocol.handleMessage(msg); + }; + SimpleWorkerServer.prototype._handleMessage = function (method, args) { + if (method === INITIALIZE) { + return this.initialize(args[0], args[1], args[2]); + } + if (!this._requestHandler || typeof this._requestHandler[method] !== 'function') { + return Promise.reject(new Error('Missing requestHandler or method: ' + method)); + } + try { + return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args)); + } + catch (e) { + return Promise.reject(e); + } + }; + SimpleWorkerServer.prototype.initialize = function (workerId, moduleId, loaderConfig) { + var _this = this; + this._protocol.setWorkerId(workerId); + if (this._requestHandler) { + // static request handler + var methods = []; + for (var _i = 0, _a = getAllPropertyNames(this._requestHandler); _i < _a.length; _i++) { + var prop = _a[_i]; + if (typeof this._requestHandler[prop] === 'function') { + methods.push(prop); + } + } + return Promise.resolve(methods); + } + if (loaderConfig) { + // Remove 'baseUrl', handling it is beyond scope for now + if (typeof loaderConfig.baseUrl !== 'undefined') { + delete loaderConfig['baseUrl']; + } + if (typeof loaderConfig.paths !== 'undefined') { + if (typeof loaderConfig.paths.vs !== 'undefined') { + delete loaderConfig.paths['vs']; + } + } + // Since this is in a web worker, enable catching errors + loaderConfig.catchError = true; + self.require.config(loaderConfig); + } + return new Promise(function (resolve, reject) { + // Use the global require to be sure to get the global config + self.require([moduleId], function () { + var result = []; + for (var _i = 0; _i < arguments.length; _i++) { + result[_i] = arguments[_i]; + } + var handlerModule = result[0]; + _this._requestHandler = handlerModule.create(); + if (!_this._requestHandler) { + reject(new Error("No RequestHandler!")); + return; + } + var methods = []; + for (var _a = 0, _b = getAllPropertyNames(_this._requestHandler); _a < _b.length; _a++) { + var prop = _b[_a]; + if (typeof _this._requestHandler[prop] === 'function') { + methods.push(prop); + } + } + resolve(methods); + }, reject); + }); + }; + return SimpleWorkerServer; +}()); + +/** + * Called on the worker side + */ +function create(postMessage) { + return new simpleWorker_SimpleWorkerServer(postMessage, null); +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/arrays.js /** * Returns the last element of an array. * @param array The array. @@ -323,7 +1004,7 @@ function flatten(arr) { var _a; return (_a = []).concat.apply(_a, arr); } -function range(arg, to) { +function arrays_range(arg, to) { var from = typeof to === 'number' ? arg : 0; if (typeof to === 'number') { from = arg; @@ -378,161 +1059,43 @@ function asArray(x) { return Array.isArray(x) ? x : [x]; } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/cancellation.js ***! - \***********************************************************************/ -/*! exports provided: CancellationToken, CancellationTokenSource */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationToken", function() { return CancellationToken; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationTokenSource", function() { return CancellationTokenSource; }); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -var shortcutEvent = Object.freeze(function (callback, context) { - var handle = setTimeout(callback.bind(context), 0); - return { dispose: function () { clearTimeout(handle); } }; -}); -var CancellationToken; -(function (CancellationToken) { - function isCancellationToken(thing) { - if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) { - return true; - } - if (thing instanceof MutableToken) { - return true; - } - if (!thing || typeof thing !== 'object') { - return false; - } - return typeof thing.isCancellationRequested === 'boolean' - && typeof thing.onCancellationRequested === 'function'; +/** + * Represents information about a specific difference between two sequences. + */ +var DiffChange = /** @class */ (function () { + /** + * Constructs a new DiffChange with the given sequence information + * and content. + */ + function DiffChange(originalStart, originalLength, modifiedStart, modifiedLength) { + //Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0"); + this.originalStart = originalStart; + this.originalLength = originalLength; + this.modifiedStart = modifiedStart; + this.modifiedLength = modifiedLength; } - CancellationToken.isCancellationToken = isCancellationToken; - CancellationToken.None = Object.freeze({ - isCancellationRequested: false, - onCancellationRequested: _event_js__WEBPACK_IMPORTED_MODULE_0__["Event"].None - }); - CancellationToken.Cancelled = Object.freeze({ - isCancellationRequested: true, - onCancellationRequested: shortcutEvent - }); -})(CancellationToken || (CancellationToken = {})); -var MutableToken = /** @class */ (function () { - function MutableToken() { - this._isCancelled = false; - this._emitter = null; - } - MutableToken.prototype.cancel = function () { - if (!this._isCancelled) { - this._isCancelled = true; - if (this._emitter) { - this._emitter.fire(undefined); - this.dispose(); - } - } + /** + * The end point (exclusive) of the change in the original sequence. + */ + DiffChange.prototype.getOriginalEnd = function () { + return this.originalStart + this.originalLength; }; - Object.defineProperty(MutableToken.prototype, "isCancellationRequested", { - get: function () { - return this._isCancelled; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(MutableToken.prototype, "onCancellationRequested", { - get: function () { - if (this._isCancelled) { - return shortcutEvent; - } - if (!this._emitter) { - this._emitter = new _event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - } - return this._emitter.event; - }, - enumerable: true, - configurable: true - }); - MutableToken.prototype.dispose = function () { - if (this._emitter) { - this._emitter.dispose(); - this._emitter = null; - } + /** + * The end point (exclusive) of the change in the modified sequence. + */ + DiffChange.prototype.getModifiedEnd = function () { + return this.modifiedStart + this.modifiedLength; }; - return MutableToken; -}()); -var CancellationTokenSource = /** @class */ (function () { - function CancellationTokenSource(parent) { - this._token = undefined; - this._parentListener = undefined; - this._parentListener = parent && parent.onCancellationRequested(this.cancel, this); - } - Object.defineProperty(CancellationTokenSource.prototype, "token", { - get: function () { - if (!this._token) { - // be lazy and create the token only when - // actually needed - this._token = new MutableToken(); - } - return this._token; - }, - enumerable: true, - configurable: true - }); - CancellationTokenSource.prototype.cancel = function () { - if (!this._token) { - // save an object by returning the default - // cancelled token when cancellation happens - // before someone asks for the token - this._token = CancellationToken.Cancelled; - } - else if (this._token instanceof MutableToken) { - // actually cancel - this._token.cancel(); - } - }; - CancellationTokenSource.prototype.dispose = function () { - if (this._parentListener) { - this._parentListener.dispose(); - } - if (!this._token) { - // ensure to initialize with an empty token if we had none - this._token = CancellationToken.None; - } - else if (this._token instanceof MutableToken) { - // actually dispose - this._token.dispose(); - } - }; - return CancellationTokenSource; + return DiffChange; }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js ***! - \********************************************************************/ -/*! exports provided: stringDiff, Debug, MyArray, LcsDiff */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringDiff", function() { return stringDiff; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Debug", function() { return Debug; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MyArray", function() { return MyArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LcsDiff", function() { return LcsDiff; }); -/* harmony import */ var _diffChange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diffChange.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -545,7 +1108,7 @@ function createStringSequence(a) { }; } function stringDiff(original, modified, pretty) { - return new LcsDiff(createStringSequence(original), createStringSequence(modified)).ComputeDiff(pretty); + return new diff_LcsDiff(createStringSequence(original), createStringSequence(modified)).ComputeDiff(pretty); } // // The code below has been ported from a C# implementation in VS @@ -608,7 +1171,7 @@ var MaxDifferencesHistory = 1447; * distinct changes. At the end, the Changes property can be called to retrieve * the constructed changes. */ -var DiffChangeHelper = /** @class */ (function () { +var diff_DiffChangeHelper = /** @class */ (function () { /** * Constructs a new DiffChangeHelper for the given DiffSequences. */ @@ -626,7 +1189,7 @@ var DiffChangeHelper = /** @class */ (function () { // Only add to the list if there is something to add if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { // Add the new change to our list - this.m_changes.push(new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)); + this.m_changes.push(new DiffChange(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)); } // Reset for the next change this.m_originalCount = 0; @@ -687,7 +1250,7 @@ var DiffChangeHelper = /** @class */ (function () { * An implementation of the difference algorithm described in * "An O(ND) Difference Algorithm and its variations" by Eugene W. Myers */ -var LcsDiff = /** @class */ (function () { +var diff_LcsDiff = /** @class */ (function () { /** * Constructs the DiffFinder */ @@ -751,14 +1314,14 @@ var LcsDiff = /** @class */ (function () { Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd'); // All insertions changes = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1) + new DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1) ]; } else if (originalStart <= originalEnd) { Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd'); // All deletions changes = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, 0) + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0) ]; } else { @@ -793,20 +1356,20 @@ var LcsDiff = /** @class */ (function () { // We did't have time to finish the first half, so we don't have time to compute this half. // Consider the entire rest of the sequence different. rightChanges = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1) + new DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1) ]; } return this.ConcatenateChanges(leftChanges, rightChanges); } // If we hit here, we quit early, and so can't return anything meaningful return [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) ]; }; LcsDiff.prototype.WALKTRACE = function (diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) { var forwardChanges = null, reverseChanges = null; // First, walk backward through the forward diagonals history - var changeHelper = new DiffChangeHelper(); + var changeHelper = new diff_DiffChangeHelper(); var diagonalMin = diagonalForwardStart; var diagonalMax = diagonalForwardEnd; var diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalForwardOffset; @@ -860,12 +1423,12 @@ var LcsDiff = /** @class */ (function () { modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd()); } reverseChanges = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1) + new DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1) ]; } else { // Now walk backward through the reverse diagonals history - changeHelper = new DiffChangeHelper(); + changeHelper = new diff_DiffChangeHelper(); diagonalMin = diagonalReverseStart; diagonalMax = diagonalReverseEnd; diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalReverseOffset; @@ -1048,7 +1611,7 @@ var LcsDiff = /** @class */ (function () { originalStart++; modifiedStart++; return [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) ]; } } @@ -1279,7 +1842,7 @@ var LcsDiff = /** @class */ (function () { if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) { modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart; } - mergedChangeArr[0] = new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalLength, modifiedStart, modifiedLength); + mergedChangeArr[0] = new DiffChange(originalStart, originalLength, modifiedStart, modifiedLength); return true; } else { @@ -1322,952 +1885,12 @@ var LcsDiff = /** @class */ (function () { }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js ***! - \**************************************************************************/ -/*! exports provided: DiffChange */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffChange", function() { return DiffChange; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/iterator.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -/** - * Represents information about a specific difference between two sequences. - */ -var DiffChange = /** @class */ (function () { - /** - * Constructs a new DiffChange with the given sequence information - * and content. - */ - function DiffChange(originalStart, originalLength, modifiedStart, modifiedLength) { - //Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0"); - this.originalStart = originalStart; - this.originalLength = originalLength; - this.modifiedStart = modifiedStart; - this.modifiedLength = modifiedLength; - } - /** - * The end point (exclusive) of the change in the original sequence. - */ - DiffChange.prototype.getOriginalEnd = function () { - return this.originalStart + this.originalLength; - }; - /** - * The end point (exclusive) of the change in the modified sequence. - */ - DiffChange.prototype.getModifiedEnd = function () { - return this.modifiedStart + this.modifiedLength; - }; - return DiffChange; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/errors.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/errors.js ***! - \*****************************************************************/ -/*! exports provided: ErrorHandler, errorHandler, onUnexpectedError, onUnexpectedExternalError, transformErrorForSerialization, isPromiseCanceledError, canceled, illegalArgument, illegalState */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorHandler", function() { return ErrorHandler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "errorHandler", function() { return errorHandler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedError", function() { return onUnexpectedError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedExternalError", function() { return onUnexpectedExternalError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformErrorForSerialization", function() { return transformErrorForSerialization; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPromiseCanceledError", function() { return isPromiseCanceledError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canceled", function() { return canceled; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalArgument", function() { return illegalArgument; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalState", function() { return illegalState; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -// Avoid circular dependency on EventEmitter by implementing a subset of the interface. -var ErrorHandler = /** @class */ (function () { - function ErrorHandler() { - this.listeners = []; - this.unexpectedErrorHandler = function (e) { - setTimeout(function () { - if (e.stack) { - throw new Error(e.message + '\n\n' + e.stack); - } - throw e; - }, 0); - }; - } - ErrorHandler.prototype.emit = function (e) { - this.listeners.forEach(function (listener) { - listener(e); - }); - }; - ErrorHandler.prototype.onUnexpectedError = function (e) { - this.unexpectedErrorHandler(e); - this.emit(e); - }; - // For external errors, we don't want the listeners to be called - ErrorHandler.prototype.onUnexpectedExternalError = function (e) { - this.unexpectedErrorHandler(e); - }; - return ErrorHandler; -}()); - -var errorHandler = new ErrorHandler(); -function onUnexpectedError(e) { - // ignore errors from cancelled promises - if (!isPromiseCanceledError(e)) { - errorHandler.onUnexpectedError(e); - } - return undefined; -} -function onUnexpectedExternalError(e) { - // ignore errors from cancelled promises - if (!isPromiseCanceledError(e)) { - errorHandler.onUnexpectedExternalError(e); - } - return undefined; -} -function transformErrorForSerialization(error) { - if (error instanceof Error) { - var name_1 = error.name, message = error.message; - var stack = error.stacktrace || error.stack; - return { - $isError: true, - name: name_1, - message: message, - stack: stack - }; - } - // return as is - return error; -} -var canceledName = 'Canceled'; -/** - * Checks if the given error is a promise in canceled state - */ -function isPromiseCanceledError(error) { - return error instanceof Error && error.name === canceledName && error.message === canceledName; -} -/** - * Returns an error that signals cancellation. - */ -function canceled() { - var error = new Error(canceledName); - error.name = error.message; - return error; -} -function illegalArgument(name) { - if (name) { - return new Error("Illegal argument: " + name); - } - else { - return new Error('Illegal argument'); - } -} -function illegalState(name) { - if (name) { - return new Error("Illegal state: " + name); - } - else { - return new Error('Illegal state'); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/event.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/event.js ***! - \****************************************************************/ -/*! exports provided: Event, Emitter, PauseableEmitter, EventMultiplexer, EventBufferer, Relay */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Event", function() { return Event; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Emitter", function() { return Emitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PauseableEmitter", function() { return PauseableEmitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventMultiplexer", function() { return EventMultiplexer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventBufferer", function() { return EventBufferer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Relay", function() { return Relay; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _functional_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functional.js */ "./node_modules/monaco-editor/esm/vs/base/common/functional.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _linkedList_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./linkedList.js */ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -var Event; -(function (Event) { - var _disposable = { dispose: function () { } }; - Event.None = function () { return _disposable; }; - /** - * Given an event, returns another event which only fires once. - */ - function once(event) { - return function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - // we need this, in case the event fires during the listener call - var didFire = false; - var result; - result = event(function (e) { - if (didFire) { - return; - } - else if (result) { - result.dispose(); - } - else { - didFire = true; - } - return listener.call(thisArgs, e); - }, null, disposables); - if (didFire) { - result.dispose(); - } - return result; - }; - } - Event.once = once; - /** - * Given an event and a `map` function, returns another event which maps each element - * throught the mapping function. - */ - function map(event, map) { - return snapshot(function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return event(function (i) { return listener.call(thisArgs, map(i)); }, null, disposables); - }); - } - Event.map = map; - /** - * Given an event and an `each` function, returns another identical event and calls - * the `each` function per each element. - */ - function forEach(event, each) { - return snapshot(function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return event(function (i) { each(i); listener.call(thisArgs, i); }, null, disposables); - }); - } - Event.forEach = forEach; - function filter(event, filter) { - return snapshot(function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return event(function (e) { return filter(e) && listener.call(thisArgs, e); }, null, disposables); - }); - } - Event.filter = filter; - /** - * Given an event, returns the same event but typed as `Event`. - */ - function signal(event) { - return event; - } - Event.signal = signal; - /** - * Given a collection of events, returns a single event which emits - * whenever any of the provided events emit. - */ - function any() { - var events = []; - for (var _i = 0; _i < arguments.length; _i++) { - events[_i] = arguments[_i]; - } - return function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return Object(_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["combinedDisposable"])(events.map(function (event) { return event(function (e) { return listener.call(thisArgs, e); }, null, disposables); })); - }; - } - Event.any = any; - /** - * Given an event and a `merge` function, returns another event which maps each element - * and the cummulative result throught the `merge` function. Similar to `map`, but with memory. - */ - function reduce(event, merge, initial) { - var output = initial; - return map(event, function (e) { - output = merge(output, e); - return output; - }); - } - Event.reduce = reduce; - /** - * Given a chain of event processing functions (filter, map, etc), each - * function will be invoked per event & per listener. Snapshotting an event - * chain allows each function to be invoked just once per event. - */ - function snapshot(event) { - var listener; - var emitter = new Emitter({ - onFirstListenerAdd: function () { - listener = event(emitter.fire, emitter); - }, - onLastListenerRemove: function () { - listener.dispose(); - } - }); - return emitter.event; - } - Event.snapshot = snapshot; - function debounce(event, merge, delay, leading, leakWarningThreshold) { - if (delay === void 0) { delay = 100; } - if (leading === void 0) { leading = false; } - var subscription; - var output = undefined; - var handle = undefined; - var numDebouncedCalls = 0; - var emitter = new Emitter({ - leakWarningThreshold: leakWarningThreshold, - onFirstListenerAdd: function () { - subscription = event(function (cur) { - numDebouncedCalls++; - output = merge(output, cur); - if (leading && !handle) { - emitter.fire(output); - } - clearTimeout(handle); - handle = setTimeout(function () { - var _output = output; - output = undefined; - handle = undefined; - if (!leading || numDebouncedCalls > 1) { - emitter.fire(_output); - } - numDebouncedCalls = 0; - }, delay); - }); - }, - onLastListenerRemove: function () { - subscription.dispose(); - } - }); - return emitter.event; - } - Event.debounce = debounce; - /** - * Given an event, it returns another event which fires only once and as soon as - * the input event emits. The event data is the number of millis it took for the - * event to fire. - */ - function stopwatch(event) { - var start = new Date().getTime(); - return map(once(event), function (_) { return new Date().getTime() - start; }); - } - Event.stopwatch = stopwatch; - /** - * Given an event, it returns another event which fires only when the event - * element changes. - */ - function latch(event) { - var firstCall = true; - var cache; - return filter(event, function (value) { - var shouldEmit = firstCall || value !== cache; - firstCall = false; - cache = value; - return shouldEmit; - }); - } - Event.latch = latch; - /** - * Buffers the provided event until a first listener comes - * along, at which point fire all the events at once and - * pipe the event from then on. - * - * ```typescript - * const emitter = new Emitter(); - * const event = emitter.event; - * const bufferedEvent = buffer(event); - * - * emitter.fire(1); - * emitter.fire(2); - * emitter.fire(3); - * // nothing... - * - * const listener = bufferedEvent(num => console.log(num)); - * // 1, 2, 3 - * - * emitter.fire(4); - * // 4 - * ``` - */ - function buffer(event, nextTick, _buffer) { - if (nextTick === void 0) { nextTick = false; } - if (_buffer === void 0) { _buffer = []; } - var buffer = _buffer.slice(); - var listener = event(function (e) { - if (buffer) { - buffer.push(e); - } - else { - emitter.fire(e); - } - }); - var flush = function () { - if (buffer) { - buffer.forEach(function (e) { return emitter.fire(e); }); - } - buffer = null; - }; - var emitter = new Emitter({ - onFirstListenerAdd: function () { - if (!listener) { - listener = event(function (e) { return emitter.fire(e); }); - } - }, - onFirstListenerDidAdd: function () { - if (buffer) { - if (nextTick) { - setTimeout(flush); - } - else { - flush(); - } - } - }, - onLastListenerRemove: function () { - if (listener) { - listener.dispose(); - } - listener = null; - } - }); - return emitter.event; - } - Event.buffer = buffer; - var ChainableEvent = /** @class */ (function () { - function ChainableEvent(event) { - this.event = event; - } - ChainableEvent.prototype.map = function (fn) { - return new ChainableEvent(map(this.event, fn)); - }; - ChainableEvent.prototype.forEach = function (fn) { - return new ChainableEvent(forEach(this.event, fn)); - }; - ChainableEvent.prototype.filter = function (fn) { - return new ChainableEvent(filter(this.event, fn)); - }; - ChainableEvent.prototype.reduce = function (merge, initial) { - return new ChainableEvent(reduce(this.event, merge, initial)); - }; - ChainableEvent.prototype.latch = function () { - return new ChainableEvent(latch(this.event)); - }; - ChainableEvent.prototype.on = function (listener, thisArgs, disposables) { - return this.event(listener, thisArgs, disposables); - }; - ChainableEvent.prototype.once = function (listener, thisArgs, disposables) { - return once(this.event)(listener, thisArgs, disposables); - }; - return ChainableEvent; - }()); - function chain(event) { - return new ChainableEvent(event); - } - Event.chain = chain; - function fromNodeEventEmitter(emitter, eventName, map) { - if (map === void 0) { map = function (id) { return id; }; } - var fn = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return result.fire(map.apply(void 0, args)); - }; - var onFirstListenerAdd = function () { return emitter.on(eventName, fn); }; - var onLastListenerRemove = function () { return emitter.removeListener(eventName, fn); }; - var result = new Emitter({ onFirstListenerAdd: onFirstListenerAdd, onLastListenerRemove: onLastListenerRemove }); - return result.event; - } - Event.fromNodeEventEmitter = fromNodeEventEmitter; - function fromPromise(promise) { - var emitter = new Emitter(); - var shouldEmit = false; - promise - .then(undefined, function () { return null; }) - .then(function () { - if (!shouldEmit) { - setTimeout(function () { return emitter.fire(undefined); }, 0); - } - else { - emitter.fire(undefined); - } - }); - shouldEmit = true; - return emitter.event; - } - Event.fromPromise = fromPromise; - function toPromise(event) { - return new Promise(function (c) { return once(event)(c); }); - } - Event.toPromise = toPromise; -})(Event || (Event = {})); -var _globalLeakWarningThreshold = -1; -var LeakageMonitor = /** @class */ (function () { - function LeakageMonitor(customThreshold, name) { - if (name === void 0) { name = Math.random().toString(18).slice(2, 5); } - this.customThreshold = customThreshold; - this.name = name; - this._warnCountdown = 0; - } - LeakageMonitor.prototype.dispose = function () { - if (this._stacks) { - this._stacks.clear(); - } - }; - LeakageMonitor.prototype.check = function (listenerCount) { - var _this = this; - var threshold = _globalLeakWarningThreshold; - if (typeof this.customThreshold === 'number') { - threshold = this.customThreshold; - } - if (threshold <= 0 || listenerCount < threshold) { - return undefined; - } - if (!this._stacks) { - this._stacks = new Map(); - } - var stack = new Error().stack.split('\n').slice(3).join('\n'); - var count = (this._stacks.get(stack) || 0); - this._stacks.set(stack, count + 1); - this._warnCountdown -= 1; - if (this._warnCountdown <= 0) { - // only warn on first exceed and then every time the limit - // is exceeded by 50% again - this._warnCountdown = threshold * 0.5; - // find most frequent listener and print warning - var topStack_1; - var topCount_1 = 0; - this._stacks.forEach(function (count, stack) { - if (!topStack_1 || topCount_1 < count) { - topStack_1 = stack; - topCount_1 = count; - } - }); - console.warn("[" + this.name + "] potential listener LEAK detected, having " + listenerCount + " listeners already. MOST frequent listener (" + topCount_1 + "):"); - console.warn(topStack_1); - } - return function () { - var count = (_this._stacks.get(stack) || 0); - _this._stacks.set(stack, count - 1); - }; - }; - return LeakageMonitor; -}()); -/** - * The Emitter can be used to expose an Event to the public - * to fire it from the insides. - * Sample: - class Document { - - private _onDidChange = new Emitter<(value:string)=>any>(); - - public onDidChange = this._onDidChange.event; - - // getter-style - // get onDidChange(): Event<(value:string)=>any> { - // return this._onDidChange.event; - // } - - private _doIt() { - //... - this._onDidChange.fire(value); - } - } - */ -var Emitter = /** @class */ (function () { - function Emitter(options) { - this._disposed = false; - this._options = options; - this._leakageMon = _globalLeakWarningThreshold > 0 - ? new LeakageMonitor(this._options && this._options.leakWarningThreshold) - : undefined; - } - Object.defineProperty(Emitter.prototype, "event", { - /** - * For the public to allow to subscribe - * to events from this Emitter - */ - get: function () { - var _this = this; - if (!this._event) { - this._event = function (listener, thisArgs, disposables) { - if (!_this._listeners) { - _this._listeners = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"](); - } - var firstListener = _this._listeners.isEmpty(); - if (firstListener && _this._options && _this._options.onFirstListenerAdd) { - _this._options.onFirstListenerAdd(_this); - } - var remove = _this._listeners.push(!thisArgs ? listener : [listener, thisArgs]); - if (firstListener && _this._options && _this._options.onFirstListenerDidAdd) { - _this._options.onFirstListenerDidAdd(_this); - } - if (_this._options && _this._options.onListenerDidAdd) { - _this._options.onListenerDidAdd(_this, listener, thisArgs); - } - // check and record this emitter for potential leakage - var removeMonitor; - if (_this._leakageMon) { - removeMonitor = _this._leakageMon.check(_this._listeners.size); - } - var result; - result = { - dispose: function () { - if (removeMonitor) { - removeMonitor(); - } - result.dispose = Emitter._noop; - if (!_this._disposed) { - remove(); - if (_this._options && _this._options.onLastListenerRemove) { - var hasListeners = (_this._listeners && !_this._listeners.isEmpty()); - if (!hasListeners) { - _this._options.onLastListenerRemove(_this); - } - } - } - } - }; - if (Array.isArray(disposables)) { - disposables.push(result); - } - return result; - }; - } - return this._event; - }, - enumerable: true, - configurable: true - }); - /** - * To be kept private to fire an event to - * subscribers - */ - Emitter.prototype.fire = function (event) { - if (this._listeners) { - // put all [listener,event]-pairs into delivery queue - // then emit all event. an inner/nested event might be - // the driver of this - if (!this._deliveryQueue) { - this._deliveryQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"](); - } - for (var iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) { - this._deliveryQueue.push([e.value, event]); - } - while (this._deliveryQueue.size > 0) { - var _a = this._deliveryQueue.shift(), listener = _a[0], event_1 = _a[1]; - try { - if (typeof listener === 'function') { - listener.call(undefined, event_1); - } - else { - listener[0].call(listener[1], event_1); - } - } - catch (e) { - Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e); - } - } - } - }; - Emitter.prototype.dispose = function () { - if (this._listeners) { - this._listeners.clear(); - } - if (this._deliveryQueue) { - this._deliveryQueue.clear(); - } - if (this._leakageMon) { - this._leakageMon.dispose(); - } - this._disposed = true; - }; - Emitter._noop = function () { }; - return Emitter; -}()); - -var PauseableEmitter = /** @class */ (function (_super) { - __extends(PauseableEmitter, _super); - function PauseableEmitter(options) { - var _this = _super.call(this, options) || this; - _this._isPaused = 0; - _this._eventQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"](); - _this._mergeFn = options && options.merge; - return _this; - } - PauseableEmitter.prototype.pause = function () { - this._isPaused++; - }; - PauseableEmitter.prototype.resume = function () { - if (this._isPaused !== 0 && --this._isPaused === 0) { - if (this._mergeFn) { - // use the merge function to create a single composite - // event. make a copy in case firing pauses this emitter - var events = this._eventQueue.toArray(); - this._eventQueue.clear(); - _super.prototype.fire.call(this, this._mergeFn(events)); - } - else { - // no merging, fire each event individually and test - // that this emitter isn't paused halfway through - while (!this._isPaused && this._eventQueue.size !== 0) { - _super.prototype.fire.call(this, this._eventQueue.shift()); - } - } - } - }; - PauseableEmitter.prototype.fire = function (event) { - if (this._listeners) { - if (this._isPaused !== 0) { - this._eventQueue.push(event); - } - else { - _super.prototype.fire.call(this, event); - } - } - }; - return PauseableEmitter; -}(Emitter)); - -var EventMultiplexer = /** @class */ (function () { - function EventMultiplexer() { - var _this = this; - this.hasListeners = false; - this.events = []; - this.emitter = new Emitter({ - onFirstListenerAdd: function () { return _this.onFirstListenerAdd(); }, - onLastListenerRemove: function () { return _this.onLastListenerRemove(); } - }); - } - Object.defineProperty(EventMultiplexer.prototype, "event", { - get: function () { - return this.emitter.event; - }, - enumerable: true, - configurable: true - }); - EventMultiplexer.prototype.add = function (event) { - var _this = this; - var e = { event: event, listener: null }; - this.events.push(e); - if (this.hasListeners) { - this.hook(e); - } - var dispose = function () { - if (_this.hasListeners) { - _this.unhook(e); - } - var idx = _this.events.indexOf(e); - _this.events.splice(idx, 1); - }; - return Object(_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["toDisposable"])(Object(_functional_js__WEBPACK_IMPORTED_MODULE_1__["once"])(dispose)); - }; - EventMultiplexer.prototype.onFirstListenerAdd = function () { - var _this = this; - this.hasListeners = true; - this.events.forEach(function (e) { return _this.hook(e); }); - }; - EventMultiplexer.prototype.onLastListenerRemove = function () { - var _this = this; - this.hasListeners = false; - this.events.forEach(function (e) { return _this.unhook(e); }); - }; - EventMultiplexer.prototype.hook = function (e) { - var _this = this; - e.listener = e.event(function (r) { return _this.emitter.fire(r); }); - }; - EventMultiplexer.prototype.unhook = function (e) { - if (e.listener) { - e.listener.dispose(); - } - e.listener = null; - }; - EventMultiplexer.prototype.dispose = function () { - this.emitter.dispose(); - }; - return EventMultiplexer; -}()); - -/** - * The EventBufferer is useful in situations in which you want - * to delay firing your events during some code. - * You can wrap that code and be sure that the event will not - * be fired during that wrap. - * - * ``` - * const emitter: Emitter; - * const delayer = new EventDelayer(); - * const delayedEvent = delayer.wrapEvent(emitter.event); - * - * delayedEvent(console.log); - * - * delayer.bufferEvents(() => { - * emitter.fire(); // event will not be fired yet - * }); - * - * // event will only be fired at this point - * ``` - */ -var EventBufferer = /** @class */ (function () { - function EventBufferer() { - this.buffers = []; - } - EventBufferer.prototype.wrapEvent = function (event) { - var _this = this; - return function (listener, thisArgs, disposables) { - return event(function (i) { - var buffer = _this.buffers[_this.buffers.length - 1]; - if (buffer) { - buffer.push(function () { return listener.call(thisArgs, i); }); - } - else { - listener.call(thisArgs, i); - } - }, undefined, disposables); - }; - }; - EventBufferer.prototype.bufferEvents = function (fn) { - var buffer = []; - this.buffers.push(buffer); - var r = fn(); - this.buffers.pop(); - buffer.forEach(function (flush) { return flush(); }); - return r; - }; - return EventBufferer; -}()); - -/** - * A Relay is an event forwarder which functions as a replugabble event pipe. - * Once created, you can connect an input event to it and it will simply forward - * events from that input event through its own `event` property. The `input` - * can be changed at any point in time. - */ -var Relay = /** @class */ (function () { - function Relay() { - var _this = this; - this.listening = false; - this.inputEvent = Event.None; - this.inputEventListener = _lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"].None; - this.emitter = new Emitter({ - onFirstListenerDidAdd: function () { - _this.listening = true; - _this.inputEventListener = _this.inputEvent(_this.emitter.fire, _this.emitter); - }, - onLastListenerRemove: function () { - _this.listening = false; - _this.inputEventListener.dispose(); - } - }); - this.event = this.emitter.event; - } - Object.defineProperty(Relay.prototype, "input", { - set: function (event) { - this.inputEvent = event; - if (this.listening) { - this.inputEventListener.dispose(); - this.inputEventListener = event(this.emitter.fire, this.emitter); - } - }, - enumerable: true, - configurable: true - }); - Relay.prototype.dispose = function () { - this.inputEventListener.dispose(); - this.emitter.dispose(); - }; - return Relay; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/functional.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/functional.js ***! - \*********************************************************************/ -/*! exports provided: once */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "once", function() { return once; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function once(fn) { - var _this = this; - var didCall = false; - var result; - return function () { - if (didCall) { - return result; - } - didCall = true; - result = fn.apply(_this, arguments); - return result; - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/iterator.js ***! - \*******************************************************************/ -/*! exports provided: FIN, Iterator, getSequenceIterator, ArrayIterator, ArrayNavigator, MappedIterator */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FIN", function() { return FIN; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Iterator", function() { return Iterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSequenceIterator", function() { return getSequenceIterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayIterator", function() { return ArrayIterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayNavigator", function() { return ArrayNavigator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MappedIterator", function() { return MappedIterator; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { +var iterator_extends = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || @@ -2392,7 +2015,7 @@ var ArrayIterator = /** @class */ (function () { }()); var ArrayNavigator = /** @class */ (function (_super) { - __extends(ArrayNavigator, _super); + iterator_extends(ArrayNavigator, _super); function ArrayNavigator(items, start, end, index) { if (start === void 0) { start = 0; } if (end === void 0) { end = items.length; } @@ -2431,687 +2054,1057 @@ var MappedIterator = /** @class */ (function () { }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js ***! - \*******************************************************************/ -/*! exports provided: KeyCodeUtils, KeyChord, createKeybinding, createSimpleKeybinding, SimpleKeybinding, ChordKeybinding, ResolvedKeybindingPart, ResolvedKeybinding */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCodeUtils", function() { return KeyCodeUtils; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyChord", function() { return KeyChord; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createKeybinding", function() { return createKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSimpleKeybinding", function() { return createSimpleKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleKeybinding", function() { return SimpleKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChordKeybinding", function() { return ChordKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybindingPart", function() { return ResolvedKeybindingPart; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybinding", function() { return ResolvedKeybinding; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/uri.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -var KeyCodeStrMap = /** @class */ (function () { - function KeyCodeStrMap() { - this._keyCodeToStr = []; - this._strToKeyCode = Object.create(null); - } - KeyCodeStrMap.prototype.define = function (keyCode, str) { - this._keyCodeToStr[keyCode] = str; - this._strToKeyCode[str.toLowerCase()] = keyCode; +var uri_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); }; - KeyCodeStrMap.prototype.keyCodeToStr = function (keyCode) { - return this._keyCodeToStr[keyCode]; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; - KeyCodeStrMap.prototype.strToKeyCode = function (str) { - return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */; - }; - return KeyCodeStrMap; -}()); -var uiMap = new KeyCodeStrMap(); -var userSettingsUSMap = new KeyCodeStrMap(); -var userSettingsGeneralMap = new KeyCodeStrMap(); -(function () { - function define(keyCode, uiLabel, usUserSettingsLabel, generalUserSettingsLabel) { - if (usUserSettingsLabel === void 0) { usUserSettingsLabel = uiLabel; } - if (generalUserSettingsLabel === void 0) { generalUserSettingsLabel = usUserSettingsLabel; } - uiMap.define(keyCode, uiLabel); - userSettingsUSMap.define(keyCode, usUserSettingsLabel); - userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel); - } - define(0 /* Unknown */, 'unknown'); - define(1 /* Backspace */, 'Backspace'); - define(2 /* Tab */, 'Tab'); - define(3 /* Enter */, 'Enter'); - define(4 /* Shift */, 'Shift'); - define(5 /* Ctrl */, 'Ctrl'); - define(6 /* Alt */, 'Alt'); - define(7 /* PauseBreak */, 'PauseBreak'); - define(8 /* CapsLock */, 'CapsLock'); - define(9 /* Escape */, 'Escape'); - define(10 /* Space */, 'Space'); - define(11 /* PageUp */, 'PageUp'); - define(12 /* PageDown */, 'PageDown'); - define(13 /* End */, 'End'); - define(14 /* Home */, 'Home'); - define(15 /* LeftArrow */, 'LeftArrow', 'Left'); - define(16 /* UpArrow */, 'UpArrow', 'Up'); - define(17 /* RightArrow */, 'RightArrow', 'Right'); - define(18 /* DownArrow */, 'DownArrow', 'Down'); - define(19 /* Insert */, 'Insert'); - define(20 /* Delete */, 'Delete'); - define(21 /* KEY_0 */, '0'); - define(22 /* KEY_1 */, '1'); - define(23 /* KEY_2 */, '2'); - define(24 /* KEY_3 */, '3'); - define(25 /* KEY_4 */, '4'); - define(26 /* KEY_5 */, '5'); - define(27 /* KEY_6 */, '6'); - define(28 /* KEY_7 */, '7'); - define(29 /* KEY_8 */, '8'); - define(30 /* KEY_9 */, '9'); - define(31 /* KEY_A */, 'A'); - define(32 /* KEY_B */, 'B'); - define(33 /* KEY_C */, 'C'); - define(34 /* KEY_D */, 'D'); - define(35 /* KEY_E */, 'E'); - define(36 /* KEY_F */, 'F'); - define(37 /* KEY_G */, 'G'); - define(38 /* KEY_H */, 'H'); - define(39 /* KEY_I */, 'I'); - define(40 /* KEY_J */, 'J'); - define(41 /* KEY_K */, 'K'); - define(42 /* KEY_L */, 'L'); - define(43 /* KEY_M */, 'M'); - define(44 /* KEY_N */, 'N'); - define(45 /* KEY_O */, 'O'); - define(46 /* KEY_P */, 'P'); - define(47 /* KEY_Q */, 'Q'); - define(48 /* KEY_R */, 'R'); - define(49 /* KEY_S */, 'S'); - define(50 /* KEY_T */, 'T'); - define(51 /* KEY_U */, 'U'); - define(52 /* KEY_V */, 'V'); - define(53 /* KEY_W */, 'W'); - define(54 /* KEY_X */, 'X'); - define(55 /* KEY_Y */, 'Y'); - define(56 /* KEY_Z */, 'Z'); - define(57 /* Meta */, 'Meta'); - define(58 /* ContextMenu */, 'ContextMenu'); - define(59 /* F1 */, 'F1'); - define(60 /* F2 */, 'F2'); - define(61 /* F3 */, 'F3'); - define(62 /* F4 */, 'F4'); - define(63 /* F5 */, 'F5'); - define(64 /* F6 */, 'F6'); - define(65 /* F7 */, 'F7'); - define(66 /* F8 */, 'F8'); - define(67 /* F9 */, 'F9'); - define(68 /* F10 */, 'F10'); - define(69 /* F11 */, 'F11'); - define(70 /* F12 */, 'F12'); - define(71 /* F13 */, 'F13'); - define(72 /* F14 */, 'F14'); - define(73 /* F15 */, 'F15'); - define(74 /* F16 */, 'F16'); - define(75 /* F17 */, 'F17'); - define(76 /* F18 */, 'F18'); - define(77 /* F19 */, 'F19'); - define(78 /* NumLock */, 'NumLock'); - define(79 /* ScrollLock */, 'ScrollLock'); - define(80 /* US_SEMICOLON */, ';', ';', 'OEM_1'); - define(81 /* US_EQUAL */, '=', '=', 'OEM_PLUS'); - define(82 /* US_COMMA */, ',', ',', 'OEM_COMMA'); - define(83 /* US_MINUS */, '-', '-', 'OEM_MINUS'); - define(84 /* US_DOT */, '.', '.', 'OEM_PERIOD'); - define(85 /* US_SLASH */, '/', '/', 'OEM_2'); - define(86 /* US_BACKTICK */, '`', '`', 'OEM_3'); - define(110 /* ABNT_C1 */, 'ABNT_C1'); - define(111 /* ABNT_C2 */, 'ABNT_C2'); - define(87 /* US_OPEN_SQUARE_BRACKET */, '[', '[', 'OEM_4'); - define(88 /* US_BACKSLASH */, '\\', '\\', 'OEM_5'); - define(89 /* US_CLOSE_SQUARE_BRACKET */, ']', ']', 'OEM_6'); - define(90 /* US_QUOTE */, '\'', '\'', 'OEM_7'); - define(91 /* OEM_8 */, 'OEM_8'); - define(92 /* OEM_102 */, 'OEM_102'); - define(93 /* NUMPAD_0 */, 'NumPad0'); - define(94 /* NUMPAD_1 */, 'NumPad1'); - define(95 /* NUMPAD_2 */, 'NumPad2'); - define(96 /* NUMPAD_3 */, 'NumPad3'); - define(97 /* NUMPAD_4 */, 'NumPad4'); - define(98 /* NUMPAD_5 */, 'NumPad5'); - define(99 /* NUMPAD_6 */, 'NumPad6'); - define(100 /* NUMPAD_7 */, 'NumPad7'); - define(101 /* NUMPAD_8 */, 'NumPad8'); - define(102 /* NUMPAD_9 */, 'NumPad9'); - define(103 /* NUMPAD_MULTIPLY */, 'NumPad_Multiply'); - define(104 /* NUMPAD_ADD */, 'NumPad_Add'); - define(105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator'); - define(106 /* NUMPAD_SUBTRACT */, 'NumPad_Subtract'); - define(107 /* NUMPAD_DECIMAL */, 'NumPad_Decimal'); - define(108 /* NUMPAD_DIVIDE */, 'NumPad_Divide'); })(); -var KeyCodeUtils; -(function (KeyCodeUtils) { - function toString(keyCode) { - return uiMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toString = toString; - function fromString(key) { - return uiMap.strToKeyCode(key); - } - KeyCodeUtils.fromString = fromString; - function toUserSettingsUS(keyCode) { - return userSettingsUSMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toUserSettingsUS = toUserSettingsUS; - function toUserSettingsGeneral(keyCode) { - return userSettingsGeneralMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral; - function fromUserSettings(key) { - return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); - } - KeyCodeUtils.fromUserSettings = fromUserSettings; -})(KeyCodeUtils || (KeyCodeUtils = {})); -function KeyChord(firstPart, secondPart) { - var chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0; - return (firstPart | chordPart) >>> 0; -} -function createKeybinding(keybinding, OS) { - if (keybinding === 0) { - return null; - } - var firstPart = (keybinding & 0x0000FFFF) >>> 0; - var chordPart = (keybinding & 0xFFFF0000) >>> 16; - if (chordPart !== 0) { - return new ChordKeybinding([ - createSimpleKeybinding(firstPart, OS), - createSimpleKeybinding(chordPart, OS) - ]); - } - return new ChordKeybinding([createSimpleKeybinding(firstPart, OS)]); -} -function createSimpleKeybinding(keybinding, OS) { - var ctrlCmd = (keybinding & 2048 /* CtrlCmd */ ? true : false); - var winCtrl = (keybinding & 256 /* WinCtrl */ ? true : false); - var ctrlKey = (OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd); - var shiftKey = (keybinding & 1024 /* Shift */ ? true : false); - var altKey = (keybinding & 512 /* Alt */ ? true : false); - var metaKey = (OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl); - var keyCode = (keybinding & 255 /* KeyCode */); - return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode); -} -var SimpleKeybinding = /** @class */ (function () { - function SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode) { - this.ctrlKey = ctrlKey; - this.shiftKey = shiftKey; - this.altKey = altKey; - this.metaKey = metaKey; - this.keyCode = keyCode; - } - SimpleKeybinding.prototype.equals = function (other) { - return (this.ctrlKey === other.ctrlKey - && this.shiftKey === other.shiftKey - && this.altKey === other.altKey - && this.metaKey === other.metaKey - && this.keyCode === other.keyCode); - }; - SimpleKeybinding.prototype.isModifierKey = function () { - return (this.keyCode === 0 /* Unknown */ - || this.keyCode === 5 /* Ctrl */ - || this.keyCode === 57 /* Meta */ - || this.keyCode === 6 /* Alt */ - || this.keyCode === 4 /* Shift */); - }; - SimpleKeybinding.prototype.toChord = function () { - return new ChordKeybinding([this]); - }; - /** - * Does this keybinding refer to the key code of a modifier and it also has the modifier flag? - */ - SimpleKeybinding.prototype.isDuplicateModifierCase = function () { - return ((this.ctrlKey && this.keyCode === 5 /* Ctrl */) - || (this.shiftKey && this.keyCode === 4 /* Shift */) - || (this.altKey && this.keyCode === 6 /* Alt */) - || (this.metaKey && this.keyCode === 57 /* Meta */)); - }; - return SimpleKeybinding; -}()); +var uri_a; -var ChordKeybinding = /** @class */ (function () { - function ChordKeybinding(parts) { - if (parts.length === 0) { - throw Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["illegalArgument"])("parts"); - } - this.parts = parts; - } - ChordKeybinding.prototype.equals = function (other) { - if (other === null) { - return false; - } - if (this.parts.length !== other.parts.length) { - return false; - } - for (var i = 0; i < this.parts.length; i++) { - if (!this.parts[i].equals(other.parts[i])) { - return false; - } - } - return true; - }; - return ChordKeybinding; -}()); - -var ResolvedKeybindingPart = /** @class */ (function () { - function ResolvedKeybindingPart(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) { - this.ctrlKey = ctrlKey; - this.shiftKey = shiftKey; - this.altKey = altKey; - this.metaKey = metaKey; - this.keyLabel = kbLabel; - this.keyAriaLabel = kbAriaLabel; - } - return ResolvedKeybindingPart; -}()); - -/** - * A resolved keybinding. Can be a simple keybinding or a chord keybinding. - */ -var ResolvedKeybinding = /** @class */ (function () { - function ResolvedKeybinding() { - } - return ResolvedKeybinding; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js ***! - \********************************************************************/ -/*! exports provided: isDisposable, dispose, combinedDisposable, toDisposable, Disposable, ImmortalReference */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDisposable", function() { return isDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispose", function() { return dispose; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combinedDisposable", function() { return combinedDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toDisposable", function() { return toDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Disposable", function() { return Disposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImmortalReference", function() { return ImmortalReference; }); -function isDisposable(thing) { - return typeof thing.dispose === 'function' - && thing.dispose.length === 0; -} -function dispose(first) { - var rest = []; - for (var _i = 1; _i < arguments.length; _i++) { - rest[_i - 1] = arguments[_i]; - } - if (Array.isArray(first)) { - first.forEach(function (d) { return d && d.dispose(); }); - return []; - } - else if (rest.length === 0) { - if (first) { - first.dispose(); - return first; - } - return undefined; - } - else { - dispose(first); - dispose(rest); - return []; - } -} -function combinedDisposable(disposables) { - return { dispose: function () { return dispose(disposables); } }; -} -function toDisposable(fn) { - return { dispose: function () { fn(); } }; -} -var Disposable = /** @class */ (function () { - function Disposable() { - this._toDispose = []; - this._lifecycle_disposable_isDisposed = false; - } - Disposable.prototype.dispose = function () { - this._lifecycle_disposable_isDisposed = true; - this._toDispose = dispose(this._toDispose); - }; - Disposable.prototype._register = function (t) { - if (this._lifecycle_disposable_isDisposed) { - console.warn('Registering disposable on object that has already been disposed.'); - t.dispose(); +var _schemePattern = /^\w[\w\d+.-]*$/; +var _singleSlashStart = /^\//; +var _doubleSlashStart = /^\/\//; +var _throwOnMissingSchema = true; +function _validateUri(ret, _strict) { + // scheme, must be set + if (!ret.scheme) { + if (_strict || _throwOnMissingSchema) { + throw new Error("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); } else { - this._toDispose.push(t); + console.warn("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); } - return t; + } + // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 + // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) + if (ret.scheme && !_schemePattern.test(ret.scheme)) { + throw new Error('[UriError]: Scheme contains illegal characters.'); + } + // path, http://tools.ietf.org/html/rfc3986#section-3.3 + // If a URI contains an authority component, then the path component + // must either be empty or begin with a slash ("/") character. If a URI + // does not contain an authority component, then the path cannot begin + // with two slash characters ("//"). + if (ret.path) { + if (ret.authority) { + if (!_singleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); + } + } + else { + if (_doubleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); + } + } + } +} +// for a while we allowed uris *without* schemes and this is the migration +// for them, e.g. an uri without scheme and without strict-mode warns and falls +// back to the file-scheme. that should cause the least carnage and still be a +// clear warning +function _schemeFix(scheme, _strict) { + if (_strict || _throwOnMissingSchema) { + return scheme || _empty; + } + if (!scheme) { + console.trace('BAD uri lacks scheme, falling back to file-scheme.'); + scheme = 'file'; + } + return scheme; +} +// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 +function _referenceResolution(scheme, path) { + // the slash-character is our 'default base' as we don't + // support constructing URIs relative to other URIs. This + // also means that we alter and potentially break paths. + // see https://tools.ietf.org/html/rfc3986#section-5.1.4 + switch (scheme) { + case 'https': + case 'http': + case 'file': + if (!path) { + path = _slash; + } + else if (path[0] !== _slash) { + path = _slash + path; + } + break; + } + return path; +} +var _empty = ''; +var _slash = '/'; +var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; +/** + * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. + * This class is a simple parser which creates the basic component parts + * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation + * and encoding. + * + * foo://example.com:8042/over/there?name=ferret#nose + * \_/ \______________/\_________/ \_________/ \__/ + * | | | | | + * scheme authority path query fragment + * | _____________________|__ + * / \ / \ + * urn:example:animal:ferret:nose + */ +var uri_URI = /** @class */ (function () { + /** + * @internal + */ + function URI(schemeOrData, authority, path, query, fragment, _strict) { + if (_strict === void 0) { _strict = false; } + if (typeof schemeOrData === 'object') { + this.scheme = schemeOrData.scheme || _empty; + this.authority = schemeOrData.authority || _empty; + this.path = schemeOrData.path || _empty; + this.query = schemeOrData.query || _empty; + this.fragment = schemeOrData.fragment || _empty; + // no validation because it's this URI + // that creates uri components. + // _validateUri(this); + } + else { + this.scheme = _schemeFix(schemeOrData, _strict); + this.authority = authority || _empty; + this.path = _referenceResolution(this.scheme, path || _empty); + this.query = query || _empty; + this.fragment = fragment || _empty; + _validateUri(this, _strict); + } + } + URI.isUri = function (thing) { + if (thing instanceof URI) { + return true; + } + if (!thing) { + return false; + } + return typeof thing.authority === 'string' + && typeof thing.fragment === 'string' + && typeof thing.path === 'string' + && typeof thing.query === 'string' + && typeof thing.scheme === 'string' + && typeof thing.fsPath === 'function' + && typeof thing.with === 'function' + && typeof thing.toString === 'function'; }; - Disposable.None = Object.freeze({ dispose: function () { } }); - return Disposable; -}()); - -var ImmortalReference = /** @class */ (function () { - function ImmortalReference(object) { - this.object = object; - } - ImmortalReference.prototype.dispose = function () { }; - return ImmortalReference; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/linkedList.js ***! - \*********************************************************************/ -/*! exports provided: LinkedList */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkedList", function() { return LinkedList; }); -/* harmony import */ var _iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var Node = /** @class */ (function () { - function Node(element) { - this.element = element; - this.next = Node.Undefined; - this.prev = Node.Undefined; - } - Node.Undefined = new Node(undefined); - return Node; -}()); -var LinkedList = /** @class */ (function () { - function LinkedList() { - this._first = Node.Undefined; - this._last = Node.Undefined; - this._size = 0; - } - Object.defineProperty(LinkedList.prototype, "size", { + Object.defineProperty(URI.prototype, "fsPath", { + // ---- filesystem path ----------------------- + /** + * Returns a string representing the corresponding file system path of this URI. + * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the + * platform specific path separator. + * + * * Will *not* validate the path for invalid characters and semantics. + * * Will *not* look at the scheme of this URI. + * * The result shall *not* be used for display purposes but for accessing a file on disk. + * + * + * The *difference* to `URI#path` is the use of the platform specific separator and the handling + * of UNC paths. See the below sample of a file-uri with an authority (UNC path). + * + * ```ts + const u = URI.parse('file://server/c$/folder/file.txt') + u.authority === 'server' + u.path === '/shares/c$/file.txt' + u.fsPath === '\\server\c$\folder\file.txt' + ``` + * + * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, + * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working + * with URIs that represent files on disk (`file` scheme). + */ get: function () { - return this._size; + // if (this.scheme !== 'file') { + // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); + // } + return _makeFsPath(this); }, enumerable: true, configurable: true }); - LinkedList.prototype.isEmpty = function () { - return this._first === Node.Undefined; - }; - LinkedList.prototype.clear = function () { - this._first = Node.Undefined; - this._last = Node.Undefined; - this._size = 0; - }; - LinkedList.prototype.unshift = function (element) { - return this._insert(element, false); - }; - LinkedList.prototype.push = function (element) { - return this._insert(element, true); - }; - LinkedList.prototype._insert = function (element, atTheEnd) { - var _this = this; - var newNode = new Node(element); - if (this._first === Node.Undefined) { - this._first = newNode; - this._last = newNode; + // ---- modify to new ------------------------- + URI.prototype.with = function (change) { + if (!change) { + return this; } - else if (atTheEnd) { - // push - var oldLast = this._last; - this._last = newNode; - newNode.prev = oldLast; - oldLast.next = newNode; + var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment; + if (scheme === undefined) { + scheme = this.scheme; + } + else if (scheme === null) { + scheme = _empty; + } + if (authority === undefined) { + authority = this.authority; + } + else if (authority === null) { + authority = _empty; + } + if (path === undefined) { + path = this.path; + } + else if (path === null) { + path = _empty; + } + if (query === undefined) { + query = this.query; + } + else if (query === null) { + query = _empty; + } + if (fragment === undefined) { + fragment = this.fragment; + } + else if (fragment === null) { + fragment = _empty; + } + if (scheme === this.scheme + && authority === this.authority + && path === this.path + && query === this.query + && fragment === this.fragment) { + return this; + } + return new _URI(scheme, authority, path, query, fragment); + }; + // ---- parse & validate ------------------------ + /** + * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, + * `file:///usr/home`, or `scheme:with/path`. + * + * @param value A string which represents an URI (see `URI#toString`). + */ + URI.parse = function (value, _strict) { + if (_strict === void 0) { _strict = false; } + var match = _regexp.exec(value); + if (!match) { + return new _URI(_empty, _empty, _empty, _empty, _empty); + } + return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty), _strict); + }; + /** + * Creates a new URI from a file system path, e.g. `c:\my\files`, + * `/usr/home`, or `\\server\share\some\path`. + * + * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument + * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** + * `URI.parse('file://' + path)` because the path might contain characters that are + * interpreted (# and ?). See the following sample: + * ```ts + const good = URI.file('/coding/c#/project1'); + good.scheme === 'file'; + good.path === '/coding/c#/project1'; + good.fragment === ''; + const bad = URI.parse('file://' + '/coding/c#/project1'); + bad.scheme === 'file'; + bad.path === '/coding/c'; // path is now broken + bad.fragment === '/project1'; + ``` + * + * @param path A file system path (see `URI#fsPath`) + */ + URI.file = function (path) { + var authority = _empty; + // normalize to fwd-slashes on windows, + // on other systems bwd-slashes are valid + // filename character, eg /f\oo/ba\r.txt + if (isWindows) { + path = path.replace(/\\/g, _slash); + } + // check for authority as used in UNC shares + // or use the path as given + if (path[0] === _slash && path[1] === _slash) { + var idx = path.indexOf(_slash, 2); + if (idx === -1) { + authority = path.substring(2); + path = _slash; + } + else { + authority = path.substring(2, idx); + path = path.substring(idx) || _slash; + } + } + return new _URI('file', authority, path, _empty, _empty); + }; + URI.from = function (components) { + return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment); + }; + // ---- printing/externalize --------------------------- + /** + * Creates a string representation for this URI. It's guaranteed that calling + * `URI.parse` with the result of this function creates an URI which is equal + * to this URI. + * + * * The result shall *not* be used for display purposes but for externalization or transport. + * * The result will be encoded using the percentage encoding and encoding happens mostly + * ignore the scheme-specific encoding rules. + * + * @param skipEncoding Do not encode the result, default is `false` + */ + URI.prototype.toString = function (skipEncoding) { + if (skipEncoding === void 0) { skipEncoding = false; } + return _asFormatted(this, skipEncoding); + }; + URI.prototype.toJSON = function () { + return this; + }; + URI.revive = function (data) { + if (!data) { + return data; + } + else if (data instanceof URI) { + return data; } else { - // unshift - var oldFirst = this._first; - this._first = newNode; - newNode.next = oldFirst; - oldFirst.prev = newNode; - } - this._size += 1; - var didRemove = false; - return function () { - if (!didRemove) { - didRemove = true; - _this._remove(newNode); - } - }; - }; - LinkedList.prototype.shift = function () { - if (this._first === Node.Undefined) { - return undefined; - } - else { - var res = this._first.element; - this._remove(this._first); - return res; + var result = new _URI(data); + result._fsPath = data.fsPath; + result._formatted = data.external; + return result; } }; - LinkedList.prototype._remove = function (node) { - if (node.prev !== Node.Undefined && node.next !== Node.Undefined) { - // middle - var anchor = node.prev; - anchor.next = node.next; - node.next.prev = anchor; - } - else if (node.prev === Node.Undefined && node.next === Node.Undefined) { - // only node - this._first = Node.Undefined; - this._last = Node.Undefined; - } - else if (node.next === Node.Undefined) { - // last - this._last = this._last.prev; - this._last.next = Node.Undefined; - } - else if (node.prev === Node.Undefined) { - // first - this._first = this._first.next; - this._first.prev = Node.Undefined; - } - // done - this._size -= 1; - }; - LinkedList.prototype.iterator = function () { - var element; - var node = this._first; - return { - next: function () { - if (node === Node.Undefined) { - return _iterator_js__WEBPACK_IMPORTED_MODULE_0__["FIN"]; - } - if (!element) { - element = { done: false, value: node.element }; - } - else { - element.value = node.element; - } - node = node.next; - return element; - } - }; - }; - LinkedList.prototype.toArray = function () { - var result = []; - for (var node = this._first; node !== Node.Undefined; node = node.next) { - result.push(node.element); - } - return result; - }; - return LinkedList; + return URI; }()); +// tslint:disable-next-line:class-name +var _URI = /** @class */ (function (_super) { + uri_extends(_URI, _super); + function _URI() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._formatted = null; + _this._fsPath = null; + return _this; + } + Object.defineProperty(_URI.prototype, "fsPath", { + get: function () { + if (!this._fsPath) { + this._fsPath = _makeFsPath(this); + } + return this._fsPath; + }, + enumerable: true, + configurable: true + }); + _URI.prototype.toString = function (skipEncoding) { + if (skipEncoding === void 0) { skipEncoding = false; } + if (!skipEncoding) { + if (!this._formatted) { + this._formatted = _asFormatted(this, false); + } + return this._formatted; + } + else { + // we don't cache that + return _asFormatted(this, true); + } + }; + _URI.prototype.toJSON = function () { + var res = { + $mid: 1 + }; + // cached state + if (this._fsPath) { + res.fsPath = this._fsPath; + } + if (this._formatted) { + res.external = this._formatted; + } + // uri components + if (this.path) { + res.path = this.path; + } + if (this.scheme) { + res.scheme = this.scheme; + } + if (this.authority) { + res.authority = this.authority; + } + if (this.query) { + res.query = this.query; + } + if (this.fragment) { + res.fragment = this.fragment; + } + return res; + }; + return _URI; +}(uri_URI)); +// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 +var encodeTable = (uri_a = {}, + uri_a[58 /* Colon */] = '%3A', + uri_a[47 /* Slash */] = '%2F', + uri_a[63 /* QuestionMark */] = '%3F', + uri_a[35 /* Hash */] = '%23', + uri_a[91 /* OpenSquareBracket */] = '%5B', + uri_a[93 /* CloseSquareBracket */] = '%5D', + uri_a[64 /* AtSign */] = '%40', + uri_a[33 /* ExclamationMark */] = '%21', + uri_a[36 /* DollarSign */] = '%24', + uri_a[38 /* Ampersand */] = '%26', + uri_a[39 /* SingleQuote */] = '%27', + uri_a[40 /* OpenParen */] = '%28', + uri_a[41 /* CloseParen */] = '%29', + uri_a[42 /* Asterisk */] = '%2A', + uri_a[43 /* Plus */] = '%2B', + uri_a[44 /* Comma */] = '%2C', + uri_a[59 /* Semicolon */] = '%3B', + uri_a[61 /* Equals */] = '%3D', + uri_a[32 /* Space */] = '%20', + uri_a); +function encodeURIComponentFast(uriComponent, allowSlash) { + var res = undefined; + var nativeEncodePos = -1; + for (var pos = 0; pos < uriComponent.length; pos++) { + var code = uriComponent.charCodeAt(pos); + // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 + if ((code >= 97 /* a */ && code <= 122 /* z */) + || (code >= 65 /* A */ && code <= 90 /* Z */) + || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) + || code === 45 /* Dash */ + || code === 46 /* Period */ + || code === 95 /* Underline */ + || code === 126 /* Tilde */ + || (allowSlash && code === 47 /* Slash */)) { + // check if we are delaying native encode + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + // check if we write into a new string (by default we try to return the param) + if (res !== undefined) { + res += uriComponent.charAt(pos); + } + } + else { + // encoding needed, we need to allocate a new string + if (res === undefined) { + res = uriComponent.substr(0, pos); + } + // check with default table first + var escaped = encodeTable[code]; + if (escaped !== undefined) { + // check if we are delaying native encode + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + // append escaped variant to result + res += escaped; + } + else if (nativeEncodePos === -1) { + // use native encode only when needed + nativeEncodePos = pos; + } + } + } + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); + } + return res !== undefined ? res : uriComponent; +} +function encodeURIComponentMinimal(path) { + var res = undefined; + for (var pos = 0; pos < path.length; pos++) { + var code = path.charCodeAt(pos); + if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { + if (res === undefined) { + res = path.substr(0, pos); + } + res += encodeTable[code]; + } + else { + if (res !== undefined) { + res += path[pos]; + } + } + } + return res !== undefined ? res : path; +} +/** + * Compute `fsPath` for the given uri + */ +function _makeFsPath(uri) { + var value; + if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { + // unc path: file://shares/c$/far/boo + value = "//" + uri.authority + uri.path; + } + else if (uri.path.charCodeAt(0) === 47 /* Slash */ + && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) + && uri.path.charCodeAt(2) === 58 /* Colon */) { + // windows drive letter: file:///c:/far/boo + value = uri.path[1].toLowerCase() + uri.path.substr(2); + } + else { + // other path + value = uri.path; + } + if (isWindows) { + value = value.replace(/\//g, '\\'); + } + return value; +} +/** + * Create the external version of a uri + */ +function _asFormatted(uri, skipEncoding) { + var encoder = !skipEncoding + ? encodeURIComponentFast + : encodeURIComponentMinimal; + var res = ''; + var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment; + if (scheme) { + res += scheme; + res += ':'; + } + if (authority || scheme === 'file') { + res += _slash; + res += _slash; + } + if (authority) { + var idx = authority.indexOf('@'); + if (idx !== -1) { + // @ + var userinfo = authority.substr(0, idx); + authority = authority.substr(idx + 1); + idx = userinfo.indexOf(':'); + if (idx === -1) { + res += encoder(userinfo, false); + } + else { + // :@ + res += encoder(userinfo.substr(0, idx), false); + res += ':'; + res += encoder(userinfo.substr(idx + 1), false); + } + res += '@'; + } + authority = authority.toLowerCase(); + idx = authority.indexOf(':'); + if (idx === -1) { + res += encoder(authority, false); + } + else { + // : + res += encoder(authority.substr(0, idx), false); + res += authority.substr(idx); + } + } + if (path) { + // lower-case windows drive letters in /C:/fff or C:/fff + if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { + var code = path.charCodeAt(1); + if (code >= 65 /* A */ && code <= 90 /* Z */) { + path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3 + } + } + else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { + var code = path.charCodeAt(0); + if (code >= 65 /* A */ && code <= 90 /* Z */) { + path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3 + } + } + // encode the rest of the path + res += encoder(path, true); + } + if (query) { + res += '?'; + res += encoder(query, false); + } + if (fragment) { + res += '#'; + res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; + } + return res; +} - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/platform.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/platform.js ***! - \*******************************************************************/ -/*! exports provided: isWindows, isMacintosh, isLinux, isNative, isWeb, globals, setImmediate, OS */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWindows", function() { return isWindows; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMacintosh", function() { return isMacintosh; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinux", function() { return isLinux; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNative", function() { return isNative; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWeb", function() { return isWeb; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "globals", function() { return globals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setImmediate", function() { return setImmediate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OS", function() { return OS; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/position.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var LANGUAGE_DEFAULT = 'en'; -var _isWindows = false; -var _isMacintosh = false; -var _isLinux = false; -var _isNative = false; -var _isWeb = false; -var _locale = undefined; -var _language = LANGUAGE_DEFAULT; -var _translationsConfigFile = undefined; -var isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer'); -// OS detection -if (typeof navigator === 'object' && !isElectronRenderer) { - var userAgent = navigator.userAgent; - _isWindows = userAgent.indexOf('Windows') >= 0; - _isMacintosh = userAgent.indexOf('Macintosh') >= 0; - _isLinux = userAgent.indexOf('Linux') >= 0; - _isWeb = true; - _locale = navigator.language; - _language = _locale; -} -else if (typeof process === 'object') { - _isWindows = (process.platform === 'win32'); - _isMacintosh = (process.platform === 'darwin'); - _isLinux = (process.platform === 'linux'); - _locale = LANGUAGE_DEFAULT; - _language = LANGUAGE_DEFAULT; - var rawNlsConfig = process.env['VSCODE_NLS_CONFIG']; - if (rawNlsConfig) { - try { - var nlsConfig = JSON.parse(rawNlsConfig); - var resolved = nlsConfig.availableLanguages['*']; - _locale = nlsConfig.locale; - // VSCode's default language is 'en' - _language = resolved ? resolved : LANGUAGE_DEFAULT; - _translationsConfigFile = nlsConfig._translationsConfigFile; - } - catch (e) { - } +/** + * A position in the editor. + */ +var Position = /** @class */ (function () { + function Position(lineNumber, column) { + this.lineNumber = lineNumber; + this.column = column; } - _isNative = true; -} -var _platform = 0 /* Web */; -if (_isNative) { - if (_isMacintosh) { - _platform = 1 /* Mac */; - } - else if (_isWindows) { - _platform = 3 /* Windows */; - } - else if (_isLinux) { - _platform = 2 /* Linux */; - } -} -var isWindows = _isWindows; -var isMacintosh = _isMacintosh; -var isLinux = _isLinux; -var isNative = _isNative; -var isWeb = _isWeb; -var _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {}); -var globals = _globals; -var _setImmediate = null; -function setImmediate(callback) { - if (_setImmediate === null) { - if (globals.setImmediate) { - _setImmediate = globals.setImmediate.bind(globals); - } - else if (typeof process !== 'undefined' && typeof process.nextTick === 'function') { - _setImmediate = process.nextTick.bind(process); + /** + * Create a new postion from this position. + * + * @param newLineNumber new line number + * @param newColumn new column + */ + Position.prototype.with = function (newLineNumber, newColumn) { + if (newLineNumber === void 0) { newLineNumber = this.lineNumber; } + if (newColumn === void 0) { newColumn = this.column; } + if (newLineNumber === this.lineNumber && newColumn === this.column) { + return this; } else { - _setImmediate = globals.setTimeout.bind(globals); + return new Position(newLineNumber, newColumn); + } + }; + /** + * Derive a new position from this position. + * + * @param deltaLineNumber line number delta + * @param deltaColumn column delta + */ + Position.prototype.delta = function (deltaLineNumber, deltaColumn) { + if (deltaLineNumber === void 0) { deltaLineNumber = 0; } + if (deltaColumn === void 0) { deltaColumn = 0; } + return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn); + }; + /** + * Test if this position equals other position + */ + Position.prototype.equals = function (other) { + return Position.equals(this, other); + }; + /** + * Test if position `a` equals position `b` + */ + Position.equals = function (a, b) { + if (!a && !b) { + return true; + } + return (!!a && + !!b && + a.lineNumber === b.lineNumber && + a.column === b.column); + }; + /** + * Test if this position is before other position. + * If the two positions are equal, the result will be false. + */ + Position.prototype.isBefore = function (other) { + return Position.isBefore(this, other); + }; + /** + * Test if position `a` is before position `b`. + * If the two positions are equal, the result will be false. + */ + Position.isBefore = function (a, b) { + if (a.lineNumber < b.lineNumber) { + return true; + } + if (b.lineNumber < a.lineNumber) { + return false; + } + return a.column < b.column; + }; + /** + * Test if this position is before other position. + * If the two positions are equal, the result will be true. + */ + Position.prototype.isBeforeOrEqual = function (other) { + return Position.isBeforeOrEqual(this, other); + }; + /** + * Test if position `a` is before position `b`. + * If the two positions are equal, the result will be true. + */ + Position.isBeforeOrEqual = function (a, b) { + if (a.lineNumber < b.lineNumber) { + return true; + } + if (b.lineNumber < a.lineNumber) { + return false; + } + return a.column <= b.column; + }; + /** + * A function that compares positions, useful for sorting + */ + Position.compare = function (a, b) { + var aLineNumber = a.lineNumber | 0; + var bLineNumber = b.lineNumber | 0; + if (aLineNumber === bLineNumber) { + var aColumn = a.column | 0; + var bColumn = b.column | 0; + return aColumn - bColumn; + } + return aLineNumber - bLineNumber; + }; + /** + * Clone this position. + */ + Position.prototype.clone = function () { + return new Position(this.lineNumber, this.column); + }; + /** + * Convert to a human-readable representation. + */ + Position.prototype.toString = function () { + return '(' + this.lineNumber + ',' + this.column + ')'; + }; + // --- + /** + * Create a `Position` from an `IPosition`. + */ + Position.lift = function (pos) { + return new Position(pos.lineNumber, pos.column); + }; + /** + * Test if `obj` is an `IPosition`. + */ + Position.isIPosition = function (obj) { + return (obj + && (typeof obj.lineNumber === 'number') + && (typeof obj.column === 'number')); + }; + return Position; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/range.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/** + * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn) + */ +var range_Range = /** @class */ (function () { + function Range(startLineNumber, startColumn, endLineNumber, endColumn) { + if ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) { + this.startLineNumber = endLineNumber; + this.startColumn = endColumn; + this.endLineNumber = startLineNumber; + this.endColumn = startColumn; + } + else { + this.startLineNumber = startLineNumber; + this.startColumn = startColumn; + this.endLineNumber = endLineNumber; + this.endColumn = endColumn; } } - return _setImmediate(callback); -} -var OS = (_isMacintosh ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */)); + /** + * Test if this range is empty. + */ + Range.prototype.isEmpty = function () { + return Range.isEmpty(this); + }; + /** + * Test if `range` is empty. + */ + Range.isEmpty = function (range) { + return (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn); + }; + /** + * Test if position is in this range. If the position is at the edges, will return true. + */ + Range.prototype.containsPosition = function (position) { + return Range.containsPosition(this, position); + }; + /** + * Test if `position` is in `range`. If the position is at the edges, will return true. + */ + Range.containsPosition = function (range, position) { + if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) { + return false; + } + if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) { + return false; + } + if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) { + return false; + } + return true; + }; + /** + * Test if range is in this range. If the range is equal to this range, will return true. + */ + Range.prototype.containsRange = function (range) { + return Range.containsRange(this, range); + }; + /** + * Test if `otherRange` is in `range`. If the ranges are equal, will return true. + */ + Range.containsRange = function (range, otherRange) { + if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { + return false; + } + if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { + return false; + } + if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) { + return false; + } + if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) { + return false; + } + return true; + }; + /** + * A reunion of the two ranges. + * The smallest position will be used as the start point, and the largest one as the end point. + */ + Range.prototype.plusRange = function (range) { + return Range.plusRange(this, range); + }; + /** + * A reunion of the two ranges. + * The smallest position will be used as the start point, and the largest one as the end point. + */ + Range.plusRange = function (a, b) { + var startLineNumber; + var startColumn; + var endLineNumber; + var endColumn; + if (b.startLineNumber < a.startLineNumber) { + startLineNumber = b.startLineNumber; + startColumn = b.startColumn; + } + else if (b.startLineNumber === a.startLineNumber) { + startLineNumber = b.startLineNumber; + startColumn = Math.min(b.startColumn, a.startColumn); + } + else { + startLineNumber = a.startLineNumber; + startColumn = a.startColumn; + } + if (b.endLineNumber > a.endLineNumber) { + endLineNumber = b.endLineNumber; + endColumn = b.endColumn; + } + else if (b.endLineNumber === a.endLineNumber) { + endLineNumber = b.endLineNumber; + endColumn = Math.max(b.endColumn, a.endColumn); + } + else { + endLineNumber = a.endLineNumber; + endColumn = a.endColumn; + } + return new Range(startLineNumber, startColumn, endLineNumber, endColumn); + }; + /** + * A intersection of the two ranges. + */ + Range.prototype.intersectRanges = function (range) { + return Range.intersectRanges(this, range); + }; + /** + * A intersection of the two ranges. + */ + Range.intersectRanges = function (a, b) { + var resultStartLineNumber = a.startLineNumber; + var resultStartColumn = a.startColumn; + var resultEndLineNumber = a.endLineNumber; + var resultEndColumn = a.endColumn; + var otherStartLineNumber = b.startLineNumber; + var otherStartColumn = b.startColumn; + var otherEndLineNumber = b.endLineNumber; + var otherEndColumn = b.endColumn; + if (resultStartLineNumber < otherStartLineNumber) { + resultStartLineNumber = otherStartLineNumber; + resultStartColumn = otherStartColumn; + } + else if (resultStartLineNumber === otherStartLineNumber) { + resultStartColumn = Math.max(resultStartColumn, otherStartColumn); + } + if (resultEndLineNumber > otherEndLineNumber) { + resultEndLineNumber = otherEndLineNumber; + resultEndColumn = otherEndColumn; + } + else if (resultEndLineNumber === otherEndLineNumber) { + resultEndColumn = Math.min(resultEndColumn, otherEndColumn); + } + // Check if selection is now empty + if (resultStartLineNumber > resultEndLineNumber) { + return null; + } + if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) { + return null; + } + return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn); + }; + /** + * Test if this range equals other. + */ + Range.prototype.equalsRange = function (other) { + return Range.equalsRange(this, other); + }; + /** + * Test if range `a` equals `b`. + */ + Range.equalsRange = function (a, b) { + return (!!a && + !!b && + a.startLineNumber === b.startLineNumber && + a.startColumn === b.startColumn && + a.endLineNumber === b.endLineNumber && + a.endColumn === b.endColumn); + }; + /** + * Return the end position (which will be after or equal to the start position) + */ + Range.prototype.getEndPosition = function () { + return new Position(this.endLineNumber, this.endColumn); + }; + /** + * Return the start position (which will be before or equal to the end position) + */ + Range.prototype.getStartPosition = function () { + return new Position(this.startLineNumber, this.startColumn); + }; + /** + * Transform to a user presentable string representation. + */ + Range.prototype.toString = function () { + return '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']'; + }; + /** + * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position. + */ + Range.prototype.setEndPosition = function (endLineNumber, endColumn) { + return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn); + }; + /** + * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position. + */ + Range.prototype.setStartPosition = function (startLineNumber, startColumn) { + return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn); + }; + /** + * Create a new empty range using this range's start position. + */ + Range.prototype.collapseToStart = function () { + return Range.collapseToStart(this); + }; + /** + * Create a new empty range using this range's start position. + */ + Range.collapseToStart = function (range) { + return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn); + }; + // --- + Range.fromPositions = function (start, end) { + if (end === void 0) { end = start; } + return new Range(start.lineNumber, start.column, end.lineNumber, end.column); + }; + Range.lift = function (range) { + if (!range) { + return null; + } + return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); + }; + /** + * Test if `obj` is an `IRange`. + */ + Range.isIRange = function (obj) { + return (obj + && (typeof obj.startLineNumber === 'number') + && (typeof obj.startColumn === 'number') + && (typeof obj.endLineNumber === 'number') + && (typeof obj.endColumn === 'number')); + }; + /** + * Test if the two ranges are touching in any way. + */ + Range.areIntersectingOrTouching = function (a, b) { + // Check if `a` is before `b` + if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) { + return false; + } + // Check if `b` is before `a` + if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) { + return false; + } + // These ranges must intersect + return true; + }; + /** + * Test if the two ranges are intersecting. If the ranges are touching it returns true. + */ + Range.areIntersecting = function (a, b) { + // Check if `a` is before `b` + if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) { + return false; + } + // Check if `b` is before `a` + if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) { + return false; + } + // These ranges must intersect + return true; + }; + /** + * A function that compares ranges, useful for sorting ranges + * It will first compare ranges on the startPosition and then on the endPosition + */ + Range.compareRangesUsingStarts = function (a, b) { + if (a && b) { + var aStartLineNumber = a.startLineNumber | 0; + var bStartLineNumber = b.startLineNumber | 0; + if (aStartLineNumber === bStartLineNumber) { + var aStartColumn = a.startColumn | 0; + var bStartColumn = b.startColumn | 0; + if (aStartColumn === bStartColumn) { + var aEndLineNumber = a.endLineNumber | 0; + var bEndLineNumber = b.endLineNumber | 0; + if (aEndLineNumber === bEndLineNumber) { + var aEndColumn = a.endColumn | 0; + var bEndColumn = b.endColumn | 0; + return aEndColumn - bEndColumn; + } + return aEndLineNumber - bEndLineNumber; + } + return aStartColumn - bStartColumn; + } + return aStartLineNumber - bStartLineNumber; + } + var aExists = (a ? 1 : 0); + var bExists = (b ? 1 : 0); + return aExists - bExists; + }; + /** + * A function that compares ranges, useful for sorting ranges + * It will first compare ranges on the endPosition and then on the startPosition + */ + Range.compareRangesUsingEnds = function (a, b) { + if (a.endLineNumber === b.endLineNumber) { + if (a.endColumn === b.endColumn) { + if (a.startLineNumber === b.startLineNumber) { + return a.startColumn - b.startColumn; + } + return a.startLineNumber - b.startLineNumber; + } + return a.endColumn - b.endColumn; + } + return a.endLineNumber - b.endLineNumber; + }; + /** + * Test if the range spans multiple lines. + */ + Range.spansMultipleLines = function (range) { + return range.endLineNumber > range.startLineNumber; + }; + return Range; +}()); -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/strings.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/strings.js ***! - \******************************************************************/ -/*! exports provided: empty, isFalsyOrWhitespace, pad, format, escape, escapeRegExpCharacters, trim, ltrim, rtrim, convertSimple2RegExpPattern, startsWith, endsWith, createRegExp, regExpLeadsToEndlessLoop, regExpFlags, firstNonWhitespaceIndex, getLeadingWhitespace, lastNonWhitespaceIndex, compare, isLowerAsciiLetter, isUpperAsciiLetter, equalsIgnoreCase, startsWithIgnoreCase, commonPrefixLength, commonSuffixLength, isHighSurrogate, isLowSurrogate, containsRTL, containsEmoji, isBasicASCII, containsFullWidthCharacter, isFullWidthCharacter, UTF8_BOM_CHARACTER, startsWithUTF8BOM, safeBtoa, repeat */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFalsyOrWhitespace", function() { return isFalsyOrWhitespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return pad; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "format", function() { return format; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return escape; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeRegExpCharacters", function() { return escapeRegExpCharacters; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trim", function() { return trim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ltrim", function() { return ltrim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rtrim", function() { return rtrim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertSimple2RegExpPattern", function() { return convertSimple2RegExpPattern; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return startsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return endsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRegExp", function() { return createRegExp; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpLeadsToEndlessLoop", function() { return regExpLeadsToEndlessLoop; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpFlags", function() { return regExpFlags; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstNonWhitespaceIndex", function() { return firstNonWhitespaceIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLeadingWhitespace", function() { return getLeadingWhitespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lastNonWhitespaceIndex", function() { return lastNonWhitespaceIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compare", function() { return compare; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowerAsciiLetter", function() { return isLowerAsciiLetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUpperAsciiLetter", function() { return isUpperAsciiLetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equalsIgnoreCase", function() { return equalsIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithIgnoreCase", function() { return startsWithIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonPrefixLength", function() { return commonPrefixLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonSuffixLength", function() { return commonSuffixLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHighSurrogate", function() { return isHighSurrogate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowSurrogate", function() { return isLowSurrogate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsRTL", function() { return containsRTL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsEmoji", function() { return containsEmoji; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBasicASCII", function() { return isBasicASCII; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsFullWidthCharacter", function() { return containsFullWidthCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFullWidthCharacter", function() { return isFullWidthCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UTF8_BOM_CHARACTER", function() { return UTF8_BOM_CHARACTER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithUTF8BOM", function() { return startsWithUTF8BOM; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeBtoa", function() { return safeBtoa; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return repeat; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/strings.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -3164,7 +3157,7 @@ function format(value) { * Converts HTML characters inside the string to use entities instead. Makes the string safe from * being used e.g. in HTMLElement.innerHTML. */ -function escape(html) { +function strings_escape(html) { return html.replace(/[<>&]/g, function (match) { switch (match) { case '<': return '<'; @@ -3553,7 +3546,7 @@ function startsWithUTF8BOM(str) { function safeBtoa(str) { return btoa(encodeURIComponent(str)); // we use encodeURIComponent because btoa fails for non Latin 1 values } -function repeat(s, count) { +function strings_repeat(s, count) { var result = ''; for (var i = 0; i < count; i++) { result += s; @@ -3561,1964 +3554,7 @@ function repeat(s, count) { return result; } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/types.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/types.js ***! - \****************************************************************/ -/*! exports provided: isArray, isString, isObject, isNumber, isBoolean, isUndefined, isUndefinedOrNull, isEmptyObject, isFunction, validateConstraints, validateConstraint, getAllPropertyNames, withNullAsUndefined, withUndefinedAsNull */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return isArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return isString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return isNumber; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return isBoolean; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return isUndefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefinedOrNull", function() { return isUndefinedOrNull; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmptyObject", function() { return isEmptyObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraints", function() { return validateConstraints; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraint", function() { return validateConstraint; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllPropertyNames", function() { return getAllPropertyNames; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withNullAsUndefined", function() { return withNullAsUndefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withUndefinedAsNull", function() { return withUndefinedAsNull; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var _typeof = { - number: 'number', - string: 'string', - undefined: 'undefined', - object: 'object', - function: 'function' -}; -/** - * @returns whether the provided parameter is a JavaScript Array or not. - */ -function isArray(array) { - if (Array.isArray) { - return Array.isArray(array); - } - if (array && typeof (array.length) === _typeof.number && array.constructor === Array) { - return true; - } - return false; -} -/** - * @returns whether the provided parameter is a JavaScript String or not. - */ -function isString(str) { - if (typeof (str) === _typeof.string || str instanceof String) { - return true; - } - return false; -} -/** - * - * @returns whether the provided parameter is of type `object` but **not** - * `null`, an `array`, a `regexp`, nor a `date`. - */ -function isObject(obj) { - // The method can't do a type cast since there are type (like strings) which - // are subclasses of any put not positvely matched by the function. Hence type - // narrowing results in wrong results. - return typeof obj === _typeof.object - && obj !== null - && !Array.isArray(obj) - && !(obj instanceof RegExp) - && !(obj instanceof Date); -} -/** - * In **contrast** to just checking `typeof` this will return `false` for `NaN`. - * @returns whether the provided parameter is a JavaScript Number or not. - */ -function isNumber(obj) { - if ((typeof (obj) === _typeof.number || obj instanceof Number) && !isNaN(obj)) { - return true; - } - return false; -} -/** - * @returns whether the provided parameter is a JavaScript Boolean or not. - */ -function isBoolean(obj) { - return obj === true || obj === false; -} -/** - * @returns whether the provided parameter is undefined. - */ -function isUndefined(obj) { - return typeof (obj) === _typeof.undefined; -} -/** - * @returns whether the provided parameter is undefined or null. - */ -function isUndefinedOrNull(obj) { - return isUndefined(obj) || obj === null; -} -var hasOwnProperty = Object.prototype.hasOwnProperty; -/** - * @returns whether the provided parameter is an empty JavaScript Object or not. - */ -function isEmptyObject(obj) { - if (!isObject(obj)) { - return false; - } - for (var key in obj) { - if (hasOwnProperty.call(obj, key)) { - return false; - } - } - return true; -} -/** - * @returns whether the provided parameter is a JavaScript Function or not. - */ -function isFunction(obj) { - return typeof obj === _typeof.function; -} -function validateConstraints(args, constraints) { - var len = Math.min(args.length, constraints.length); - for (var i = 0; i < len; i++) { - validateConstraint(args[i], constraints[i]); - } -} -function validateConstraint(arg, constraint) { - if (isString(constraint)) { - if (typeof arg !== constraint) { - throw new Error("argument does not match constraint: typeof " + constraint); - } - } - else if (isFunction(constraint)) { - try { - if (arg instanceof constraint) { - return; - } - } - catch (_a) { - // ignore - } - if (!isUndefinedOrNull(arg) && arg.constructor === constraint) { - return; - } - if (constraint.length === 1 && constraint.call(undefined, arg) === true) { - return; - } - throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true"); - } -} -function getAllPropertyNames(obj) { - var res = []; - var proto = Object.getPrototypeOf(obj); - while (Object.prototype !== proto) { - res = res.concat(Object.getOwnPropertyNames(proto)); - proto = Object.getPrototypeOf(proto); - } - return res; -} -/** - * Converts null to undefined, passes all other values through. - */ -function withNullAsUndefined(x) { - return x === null ? undefined : x; -} -/** - * Converts undefined to null, passes all other values through. - */ -function withUndefinedAsNull(x) { - return typeof x === 'undefined' ? null : x; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/uri.js": -/*!**************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/uri.js ***! - \**************************************************************/ -/*! exports provided: URI */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "URI", function() { return URI; }); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var _a; - -var _schemePattern = /^\w[\w\d+.-]*$/; -var _singleSlashStart = /^\//; -var _doubleSlashStart = /^\/\//; -var _throwOnMissingSchema = true; -function _validateUri(ret, _strict) { - // scheme, must be set - if (!ret.scheme) { - if (_strict || _throwOnMissingSchema) { - throw new Error("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); - } - else { - console.warn("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); - } - } - // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 - // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - if (ret.scheme && !_schemePattern.test(ret.scheme)) { - throw new Error('[UriError]: Scheme contains illegal characters.'); - } - // path, http://tools.ietf.org/html/rfc3986#section-3.3 - // If a URI contains an authority component, then the path component - // must either be empty or begin with a slash ("/") character. If a URI - // does not contain an authority component, then the path cannot begin - // with two slash characters ("//"). - if (ret.path) { - if (ret.authority) { - if (!_singleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); - } - } - else { - if (_doubleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); - } - } - } -} -// for a while we allowed uris *without* schemes and this is the migration -// for them, e.g. an uri without scheme and without strict-mode warns and falls -// back to the file-scheme. that should cause the least carnage and still be a -// clear warning -function _schemeFix(scheme, _strict) { - if (_strict || _throwOnMissingSchema) { - return scheme || _empty; - } - if (!scheme) { - console.trace('BAD uri lacks scheme, falling back to file-scheme.'); - scheme = 'file'; - } - return scheme; -} -// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 -function _referenceResolution(scheme, path) { - // the slash-character is our 'default base' as we don't - // support constructing URIs relative to other URIs. This - // also means that we alter and potentially break paths. - // see https://tools.ietf.org/html/rfc3986#section-5.1.4 - switch (scheme) { - case 'https': - case 'http': - case 'file': - if (!path) { - path = _slash; - } - else if (path[0] !== _slash) { - path = _slash + path; - } - break; - } - return path; -} -var _empty = ''; -var _slash = '/'; -var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; -/** - * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. - * This class is a simple parser which creates the basic component parts - * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation - * and encoding. - * - * foo://example.com:8042/over/there?name=ferret#nose - * \_/ \______________/\_________/ \_________/ \__/ - * | | | | | - * scheme authority path query fragment - * | _____________________|__ - * / \ / \ - * urn:example:animal:ferret:nose - */ -var URI = /** @class */ (function () { - /** - * @internal - */ - function URI(schemeOrData, authority, path, query, fragment, _strict) { - if (_strict === void 0) { _strict = false; } - if (typeof schemeOrData === 'object') { - this.scheme = schemeOrData.scheme || _empty; - this.authority = schemeOrData.authority || _empty; - this.path = schemeOrData.path || _empty; - this.query = schemeOrData.query || _empty; - this.fragment = schemeOrData.fragment || _empty; - // no validation because it's this URI - // that creates uri components. - // _validateUri(this); - } - else { - this.scheme = _schemeFix(schemeOrData, _strict); - this.authority = authority || _empty; - this.path = _referenceResolution(this.scheme, path || _empty); - this.query = query || _empty; - this.fragment = fragment || _empty; - _validateUri(this, _strict); - } - } - URI.isUri = function (thing) { - if (thing instanceof URI) { - return true; - } - if (!thing) { - return false; - } - return typeof thing.authority === 'string' - && typeof thing.fragment === 'string' - && typeof thing.path === 'string' - && typeof thing.query === 'string' - && typeof thing.scheme === 'string' - && typeof thing.fsPath === 'function' - && typeof thing.with === 'function' - && typeof thing.toString === 'function'; - }; - Object.defineProperty(URI.prototype, "fsPath", { - // ---- filesystem path ----------------------- - /** - * Returns a string representing the corresponding file system path of this URI. - * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the - * platform specific path separator. - * - * * Will *not* validate the path for invalid characters and semantics. - * * Will *not* look at the scheme of this URI. - * * The result shall *not* be used for display purposes but for accessing a file on disk. - * - * - * The *difference* to `URI#path` is the use of the platform specific separator and the handling - * of UNC paths. See the below sample of a file-uri with an authority (UNC path). - * - * ```ts - const u = URI.parse('file://server/c$/folder/file.txt') - u.authority === 'server' - u.path === '/shares/c$/file.txt' - u.fsPath === '\\server\c$\folder\file.txt' - ``` - * - * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, - * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working - * with URIs that represent files on disk (`file` scheme). - */ - get: function () { - // if (this.scheme !== 'file') { - // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); - // } - return _makeFsPath(this); - }, - enumerable: true, - configurable: true - }); - // ---- modify to new ------------------------- - URI.prototype.with = function (change) { - if (!change) { - return this; - } - var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment; - if (scheme === undefined) { - scheme = this.scheme; - } - else if (scheme === null) { - scheme = _empty; - } - if (authority === undefined) { - authority = this.authority; - } - else if (authority === null) { - authority = _empty; - } - if (path === undefined) { - path = this.path; - } - else if (path === null) { - path = _empty; - } - if (query === undefined) { - query = this.query; - } - else if (query === null) { - query = _empty; - } - if (fragment === undefined) { - fragment = this.fragment; - } - else if (fragment === null) { - fragment = _empty; - } - if (scheme === this.scheme - && authority === this.authority - && path === this.path - && query === this.query - && fragment === this.fragment) { - return this; - } - return new _URI(scheme, authority, path, query, fragment); - }; - // ---- parse & validate ------------------------ - /** - * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, - * `file:///usr/home`, or `scheme:with/path`. - * - * @param value A string which represents an URI (see `URI#toString`). - */ - URI.parse = function (value, _strict) { - if (_strict === void 0) { _strict = false; } - var match = _regexp.exec(value); - if (!match) { - return new _URI(_empty, _empty, _empty, _empty, _empty); - } - return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty), _strict); - }; - /** - * Creates a new URI from a file system path, e.g. `c:\my\files`, - * `/usr/home`, or `\\server\share\some\path`. - * - * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument - * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** - * `URI.parse('file://' + path)` because the path might contain characters that are - * interpreted (# and ?). See the following sample: - * ```ts - const good = URI.file('/coding/c#/project1'); - good.scheme === 'file'; - good.path === '/coding/c#/project1'; - good.fragment === ''; - const bad = URI.parse('file://' + '/coding/c#/project1'); - bad.scheme === 'file'; - bad.path === '/coding/c'; // path is now broken - bad.fragment === '/project1'; - ``` - * - * @param path A file system path (see `URI#fsPath`) - */ - URI.file = function (path) { - var authority = _empty; - // normalize to fwd-slashes on windows, - // on other systems bwd-slashes are valid - // filename character, eg /f\oo/ba\r.txt - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) { - path = path.replace(/\\/g, _slash); - } - // check for authority as used in UNC shares - // or use the path as given - if (path[0] === _slash && path[1] === _slash) { - var idx = path.indexOf(_slash, 2); - if (idx === -1) { - authority = path.substring(2); - path = _slash; - } - else { - authority = path.substring(2, idx); - path = path.substring(idx) || _slash; - } - } - return new _URI('file', authority, path, _empty, _empty); - }; - URI.from = function (components) { - return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment); - }; - // ---- printing/externalize --------------------------- - /** - * Creates a string representation for this URI. It's guaranteed that calling - * `URI.parse` with the result of this function creates an URI which is equal - * to this URI. - * - * * The result shall *not* be used for display purposes but for externalization or transport. - * * The result will be encoded using the percentage encoding and encoding happens mostly - * ignore the scheme-specific encoding rules. - * - * @param skipEncoding Do not encode the result, default is `false` - */ - URI.prototype.toString = function (skipEncoding) { - if (skipEncoding === void 0) { skipEncoding = false; } - return _asFormatted(this, skipEncoding); - }; - URI.prototype.toJSON = function () { - return this; - }; - URI.revive = function (data) { - if (!data) { - return data; - } - else if (data instanceof URI) { - return data; - } - else { - var result = new _URI(data); - result._fsPath = data.fsPath; - result._formatted = data.external; - return result; - } - }; - return URI; -}()); - -// tslint:disable-next-line:class-name -var _URI = /** @class */ (function (_super) { - __extends(_URI, _super); - function _URI() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._formatted = null; - _this._fsPath = null; - return _this; - } - Object.defineProperty(_URI.prototype, "fsPath", { - get: function () { - if (!this._fsPath) { - this._fsPath = _makeFsPath(this); - } - return this._fsPath; - }, - enumerable: true, - configurable: true - }); - _URI.prototype.toString = function (skipEncoding) { - if (skipEncoding === void 0) { skipEncoding = false; } - if (!skipEncoding) { - if (!this._formatted) { - this._formatted = _asFormatted(this, false); - } - return this._formatted; - } - else { - // we don't cache that - return _asFormatted(this, true); - } - }; - _URI.prototype.toJSON = function () { - var res = { - $mid: 1 - }; - // cached state - if (this._fsPath) { - res.fsPath = this._fsPath; - } - if (this._formatted) { - res.external = this._formatted; - } - // uri components - if (this.path) { - res.path = this.path; - } - if (this.scheme) { - res.scheme = this.scheme; - } - if (this.authority) { - res.authority = this.authority; - } - if (this.query) { - res.query = this.query; - } - if (this.fragment) { - res.fragment = this.fragment; - } - return res; - }; - return _URI; -}(URI)); -// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 -var encodeTable = (_a = {}, - _a[58 /* Colon */] = '%3A', - _a[47 /* Slash */] = '%2F', - _a[63 /* QuestionMark */] = '%3F', - _a[35 /* Hash */] = '%23', - _a[91 /* OpenSquareBracket */] = '%5B', - _a[93 /* CloseSquareBracket */] = '%5D', - _a[64 /* AtSign */] = '%40', - _a[33 /* ExclamationMark */] = '%21', - _a[36 /* DollarSign */] = '%24', - _a[38 /* Ampersand */] = '%26', - _a[39 /* SingleQuote */] = '%27', - _a[40 /* OpenParen */] = '%28', - _a[41 /* CloseParen */] = '%29', - _a[42 /* Asterisk */] = '%2A', - _a[43 /* Plus */] = '%2B', - _a[44 /* Comma */] = '%2C', - _a[59 /* Semicolon */] = '%3B', - _a[61 /* Equals */] = '%3D', - _a[32 /* Space */] = '%20', - _a); -function encodeURIComponentFast(uriComponent, allowSlash) { - var res = undefined; - var nativeEncodePos = -1; - for (var pos = 0; pos < uriComponent.length; pos++) { - var code = uriComponent.charCodeAt(pos); - // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 - if ((code >= 97 /* a */ && code <= 122 /* z */) - || (code >= 65 /* A */ && code <= 90 /* Z */) - || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) - || code === 45 /* Dash */ - || code === 46 /* Period */ - || code === 95 /* Underline */ - || code === 126 /* Tilde */ - || (allowSlash && code === 47 /* Slash */)) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // check if we write into a new string (by default we try to return the param) - if (res !== undefined) { - res += uriComponent.charAt(pos); - } - } - else { - // encoding needed, we need to allocate a new string - if (res === undefined) { - res = uriComponent.substr(0, pos); - } - // check with default table first - var escaped = encodeTable[code]; - if (escaped !== undefined) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // append escaped variant to result - res += escaped; - } - else if (nativeEncodePos === -1) { - // use native encode only when needed - nativeEncodePos = pos; - } - } - } - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); - } - return res !== undefined ? res : uriComponent; -} -function encodeURIComponentMinimal(path) { - var res = undefined; - for (var pos = 0; pos < path.length; pos++) { - var code = path.charCodeAt(pos); - if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { - if (res === undefined) { - res = path.substr(0, pos); - } - res += encodeTable[code]; - } - else { - if (res !== undefined) { - res += path[pos]; - } - } - } - return res !== undefined ? res : path; -} -/** - * Compute `fsPath` for the given uri - */ -function _makeFsPath(uri) { - var value; - if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { - // unc path: file://shares/c$/far/boo - value = "//" + uri.authority + uri.path; - } - else if (uri.path.charCodeAt(0) === 47 /* Slash */ - && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) - && uri.path.charCodeAt(2) === 58 /* Colon */) { - // windows drive letter: file:///c:/far/boo - value = uri.path[1].toLowerCase() + uri.path.substr(2); - } - else { - // other path - value = uri.path; - } - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) { - value = value.replace(/\//g, '\\'); - } - return value; -} -/** - * Create the external version of a uri - */ -function _asFormatted(uri, skipEncoding) { - var encoder = !skipEncoding - ? encodeURIComponentFast - : encodeURIComponentMinimal; - var res = ''; - var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment; - if (scheme) { - res += scheme; - res += ':'; - } - if (authority || scheme === 'file') { - res += _slash; - res += _slash; - } - if (authority) { - var idx = authority.indexOf('@'); - if (idx !== -1) { - // @ - var userinfo = authority.substr(0, idx); - authority = authority.substr(idx + 1); - idx = userinfo.indexOf(':'); - if (idx === -1) { - res += encoder(userinfo, false); - } - else { - // :@ - res += encoder(userinfo.substr(0, idx), false); - res += ':'; - res += encoder(userinfo.substr(idx + 1), false); - } - res += '@'; - } - authority = authority.toLowerCase(); - idx = authority.indexOf(':'); - if (idx === -1) { - res += encoder(authority, false); - } - else { - // : - res += encoder(authority.substr(0, idx), false); - res += authority.substr(idx); - } - } - if (path) { - // lower-case windows drive letters in /C:/fff or C:/fff - if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { - var code = path.charCodeAt(1); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3 - } - } - else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { - var code = path.charCodeAt(0); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3 - } - } - // encode the rest of the path - res += encoder(path, true); - } - if (query) { - res += '?'; - res += encoder(query, false); - } - if (fragment) { - res += '#'; - res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; - } - return res; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js ***! - \******************************************************************************/ -/*! exports provided: logOnceWebWorkerWarning, SimpleWorkerClient, SimpleWorkerServer, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logOnceWebWorkerWarning", function() { return logOnceWebWorkerWarning; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerClient", function() { return SimpleWorkerClient; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerServer", function() { return SimpleWorkerServer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -var INITIALIZE = '$initialize'; -var webWorkerWarningLogged = false; -function logOnceWebWorkerWarning(err) { - if (!_platform_js__WEBPACK_IMPORTED_MODULE_2__["isWeb"]) { - // running tests - return; - } - if (!webWorkerWarningLogged) { - webWorkerWarningLogged = true; - console.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq'); - } - console.warn(err.message); -} -var SimpleWorkerProtocol = /** @class */ (function () { - function SimpleWorkerProtocol(handler) { - this._workerId = -1; - this._handler = handler; - this._lastSentReq = 0; - this._pendingReplies = Object.create(null); - } - SimpleWorkerProtocol.prototype.setWorkerId = function (workerId) { - this._workerId = workerId; - }; - SimpleWorkerProtocol.prototype.sendMessage = function (method, args) { - var _this = this; - var req = String(++this._lastSentReq); - return new Promise(function (resolve, reject) { - _this._pendingReplies[req] = { - resolve: resolve, - reject: reject - }; - _this._send({ - vsWorker: _this._workerId, - req: req, - method: method, - args: args - }); - }); - }; - SimpleWorkerProtocol.prototype.handleMessage = function (serializedMessage) { - var message; - try { - message = JSON.parse(serializedMessage); - } - catch (e) { - // nothing - return; - } - if (!message || !message.vsWorker) { - return; - } - if (this._workerId !== -1 && message.vsWorker !== this._workerId) { - return; - } - this._handleMessage(message); - }; - SimpleWorkerProtocol.prototype._handleMessage = function (msg) { - var _this = this; - if (msg.seq) { - var replyMessage = msg; - if (!this._pendingReplies[replyMessage.seq]) { - console.warn('Got reply to unknown seq'); - return; - } - var reply = this._pendingReplies[replyMessage.seq]; - delete this._pendingReplies[replyMessage.seq]; - if (replyMessage.err) { - var err = replyMessage.err; - if (replyMessage.err.$isError) { - err = new Error(); - err.name = replyMessage.err.name; - err.message = replyMessage.err.message; - err.stack = replyMessage.err.stack; - } - reply.reject(err); - return; - } - reply.resolve(replyMessage.res); - return; - } - var requestMessage = msg; - var req = requestMessage.req; - var result = this._handler.handleMessage(requestMessage.method, requestMessage.args); - result.then(function (r) { - _this._send({ - vsWorker: _this._workerId, - seq: req, - res: r, - err: undefined - }); - }, function (e) { - if (e.detail instanceof Error) { - // Loading errors have a detail property that points to the actual error - e.detail = Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e.detail); - } - _this._send({ - vsWorker: _this._workerId, - seq: req, - res: undefined, - err: Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e) - }); - }); - }; - SimpleWorkerProtocol.prototype._send = function (msg) { - var strMsg = JSON.stringify(msg); - // console.log('SENDING: ' + strMsg); - this._handler.sendMessage(strMsg); - }; - return SimpleWorkerProtocol; -}()); -/** - * Main thread side - */ -var SimpleWorkerClient = /** @class */ (function (_super) { - __extends(SimpleWorkerClient, _super); - function SimpleWorkerClient(workerFactory, moduleId) { - var _this = _super.call(this) || this; - var lazyProxyReject = null; - _this._worker = _this._register(workerFactory.create('vs/base/common/worker/simpleWorker', function (msg) { - _this._protocol.handleMessage(msg); - }, function (err) { - // in Firefox, web workers fail lazily :( - // we will reject the proxy - if (lazyProxyReject) { - lazyProxyReject(err); - } - })); - _this._protocol = new SimpleWorkerProtocol({ - sendMessage: function (msg) { - _this._worker.postMessage(msg); - }, - handleMessage: function (method, args) { - // Intentionally not supporting worker -> main requests - return Promise.resolve(null); - } - }); - _this._protocol.setWorkerId(_this._worker.getId()); - // Gather loader configuration - var loaderConfiguration = null; - if (typeof self.require !== 'undefined' && typeof self.require.getConfig === 'function') { - // Get the configuration from the Monaco AMD Loader - loaderConfiguration = self.require.getConfig(); - } - else if (typeof self.requirejs !== 'undefined') { - // Get the configuration from requirejs - loaderConfiguration = self.requirejs.s.contexts._.config; - } - // Send initialize message - _this._onModuleLoaded = _this._protocol.sendMessage(INITIALIZE, [ - _this._worker.getId(), - moduleId, - loaderConfiguration - ]); - _this._lazyProxy = new Promise(function (resolve, reject) { - lazyProxyReject = reject; - _this._onModuleLoaded.then(function (availableMethods) { - var proxy = {}; - for (var _i = 0, availableMethods_1 = availableMethods; _i < availableMethods_1.length; _i++) { - var methodName = availableMethods_1[_i]; - proxy[methodName] = createProxyMethod(methodName, proxyMethodRequest); - } - resolve(proxy); - }, function (e) { - reject(e); - _this._onError('Worker failed to load ' + moduleId, e); - }); - }); - // Create proxy to loaded code - var proxyMethodRequest = function (method, args) { - return _this._request(method, args); - }; - var createProxyMethod = function (method, proxyMethodRequest) { - return function () { - var args = Array.prototype.slice.call(arguments, 0); - return proxyMethodRequest(method, args); - }; - }; - return _this; - } - SimpleWorkerClient.prototype.getProxyObject = function () { - return this._lazyProxy; - }; - SimpleWorkerClient.prototype._request = function (method, args) { - var _this = this; - return new Promise(function (resolve, reject) { - _this._onModuleLoaded.then(function () { - _this._protocol.sendMessage(method, args).then(resolve, reject); - }, reject); - }); - }; - SimpleWorkerClient.prototype._onError = function (message, error) { - console.error(message); - console.info(error); - }; - return SimpleWorkerClient; -}(_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"])); - -/** - * Worker side - */ -var SimpleWorkerServer = /** @class */ (function () { - function SimpleWorkerServer(postSerializedMessage, requestHandler) { - var _this = this; - this._requestHandler = requestHandler; - this._protocol = new SimpleWorkerProtocol({ - sendMessage: function (msg) { - postSerializedMessage(msg); - }, - handleMessage: function (method, args) { return _this._handleMessage(method, args); } - }); - } - SimpleWorkerServer.prototype.onmessage = function (msg) { - this._protocol.handleMessage(msg); - }; - SimpleWorkerServer.prototype._handleMessage = function (method, args) { - if (method === INITIALIZE) { - return this.initialize(args[0], args[1], args[2]); - } - if (!this._requestHandler || typeof this._requestHandler[method] !== 'function') { - return Promise.reject(new Error('Missing requestHandler or method: ' + method)); - } - try { - return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args)); - } - catch (e) { - return Promise.reject(e); - } - }; - SimpleWorkerServer.prototype.initialize = function (workerId, moduleId, loaderConfig) { - var _this = this; - this._protocol.setWorkerId(workerId); - if (this._requestHandler) { - // static request handler - var methods = []; - for (var _i = 0, _a = Object(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllPropertyNames"])(this._requestHandler); _i < _a.length; _i++) { - var prop = _a[_i]; - if (typeof this._requestHandler[prop] === 'function') { - methods.push(prop); - } - } - return Promise.resolve(methods); - } - if (loaderConfig) { - // Remove 'baseUrl', handling it is beyond scope for now - if (typeof loaderConfig.baseUrl !== 'undefined') { - delete loaderConfig['baseUrl']; - } - if (typeof loaderConfig.paths !== 'undefined') { - if (typeof loaderConfig.paths.vs !== 'undefined') { - delete loaderConfig.paths['vs']; - } - } - // Since this is in a web worker, enable catching errors - loaderConfig.catchError = true; - self.require.config(loaderConfig); - } - return new Promise(function (resolve, reject) { - // Use the global require to be sure to get the global config - self.require([moduleId], function () { - var result = []; - for (var _i = 0; _i < arguments.length; _i++) { - result[_i] = arguments[_i]; - } - var handlerModule = result[0]; - _this._requestHandler = handlerModule.create(); - if (!_this._requestHandler) { - reject(new Error("No RequestHandler!")); - return; - } - var methods = []; - for (var _a = 0, _b = Object(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllPropertyNames"])(_this._requestHandler); _a < _b.length; _a++) { - var prop = _b[_a]; - if (typeof _this._requestHandler[prop] === 'function') { - methods.push(prop); - } - } - resolve(methods); - }, reject); - }); - }; - return SimpleWorkerServer; -}()); - -/** - * Called on the worker side - */ -function create(postMessage) { - return new SimpleWorkerServer(postMessage, null); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js ***! - \*************************************************************************************/ -/*! exports provided: CharacterClassifier, CharacterSet */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterClassifier", function() { return CharacterClassifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterSet", function() { return CharacterSet; }); -/* harmony import */ var _uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uint.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * A fast character classifier that uses a compact array for ASCII values. - */ -var CharacterClassifier = /** @class */ (function () { - function CharacterClassifier(_defaultValue) { - var defaultValue = Object(_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_defaultValue); - this._defaultValue = defaultValue; - this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue); - this._map = new Map(); - } - CharacterClassifier._createAsciiMap = function (defaultValue) { - var asciiMap = new Uint8Array(256); - for (var i = 0; i < 256; i++) { - asciiMap[i] = defaultValue; - } - return asciiMap; - }; - CharacterClassifier.prototype.set = function (charCode, _value) { - var value = Object(_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_value); - if (charCode >= 0 && charCode < 256) { - this._asciiMap[charCode] = value; - } - else { - this._map.set(charCode, value); - } - }; - CharacterClassifier.prototype.get = function (charCode) { - if (charCode >= 0 && charCode < 256) { - return this._asciiMap[charCode]; - } - else { - return (this._map.get(charCode) || this._defaultValue); - } - }; - return CharacterClassifier; -}()); - -var CharacterSet = /** @class */ (function () { - function CharacterSet() { - this._actual = new CharacterClassifier(0 /* False */); - } - CharacterSet.prototype.add = function (charCode) { - this._actual.set(charCode, 1 /* True */); - }; - CharacterSet.prototype.has = function (charCode) { - return (this._actual.get(charCode) === 1 /* True */); - }; - return CharacterSet; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/position.js ***! - \**************************************************************************/ -/*! exports provided: Position */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -/** - * A position in the editor. - */ -var Position = /** @class */ (function () { - function Position(lineNumber, column) { - this.lineNumber = lineNumber; - this.column = column; - } - /** - * Create a new postion from this position. - * - * @param newLineNumber new line number - * @param newColumn new column - */ - Position.prototype.with = function (newLineNumber, newColumn) { - if (newLineNumber === void 0) { newLineNumber = this.lineNumber; } - if (newColumn === void 0) { newColumn = this.column; } - if (newLineNumber === this.lineNumber && newColumn === this.column) { - return this; - } - else { - return new Position(newLineNumber, newColumn); - } - }; - /** - * Derive a new position from this position. - * - * @param deltaLineNumber line number delta - * @param deltaColumn column delta - */ - Position.prototype.delta = function (deltaLineNumber, deltaColumn) { - if (deltaLineNumber === void 0) { deltaLineNumber = 0; } - if (deltaColumn === void 0) { deltaColumn = 0; } - return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn); - }; - /** - * Test if this position equals other position - */ - Position.prototype.equals = function (other) { - return Position.equals(this, other); - }; - /** - * Test if position `a` equals position `b` - */ - Position.equals = function (a, b) { - if (!a && !b) { - return true; - } - return (!!a && - !!b && - a.lineNumber === b.lineNumber && - a.column === b.column); - }; - /** - * Test if this position is before other position. - * If the two positions are equal, the result will be false. - */ - Position.prototype.isBefore = function (other) { - return Position.isBefore(this, other); - }; - /** - * Test if position `a` is before position `b`. - * If the two positions are equal, the result will be false. - */ - Position.isBefore = function (a, b) { - if (a.lineNumber < b.lineNumber) { - return true; - } - if (b.lineNumber < a.lineNumber) { - return false; - } - return a.column < b.column; - }; - /** - * Test if this position is before other position. - * If the two positions are equal, the result will be true. - */ - Position.prototype.isBeforeOrEqual = function (other) { - return Position.isBeforeOrEqual(this, other); - }; - /** - * Test if position `a` is before position `b`. - * If the two positions are equal, the result will be true. - */ - Position.isBeforeOrEqual = function (a, b) { - if (a.lineNumber < b.lineNumber) { - return true; - } - if (b.lineNumber < a.lineNumber) { - return false; - } - return a.column <= b.column; - }; - /** - * A function that compares positions, useful for sorting - */ - Position.compare = function (a, b) { - var aLineNumber = a.lineNumber | 0; - var bLineNumber = b.lineNumber | 0; - if (aLineNumber === bLineNumber) { - var aColumn = a.column | 0; - var bColumn = b.column | 0; - return aColumn - bColumn; - } - return aLineNumber - bLineNumber; - }; - /** - * Clone this position. - */ - Position.prototype.clone = function () { - return new Position(this.lineNumber, this.column); - }; - /** - * Convert to a human-readable representation. - */ - Position.prototype.toString = function () { - return '(' + this.lineNumber + ',' + this.column + ')'; - }; - // --- - /** - * Create a `Position` from an `IPosition`. - */ - Position.lift = function (pos) { - return new Position(pos.lineNumber, pos.column); - }; - /** - * Test if `obj` is an `IPosition`. - */ - Position.isIPosition = function (obj) { - return (obj - && (typeof obj.lineNumber === 'number') - && (typeof obj.column === 'number')); - }; - return Position; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/range.js ***! - \***********************************************************************/ -/*! exports provided: Range */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; }); -/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn) - */ -var Range = /** @class */ (function () { - function Range(startLineNumber, startColumn, endLineNumber, endColumn) { - if ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) { - this.startLineNumber = endLineNumber; - this.startColumn = endColumn; - this.endLineNumber = startLineNumber; - this.endColumn = startColumn; - } - else { - this.startLineNumber = startLineNumber; - this.startColumn = startColumn; - this.endLineNumber = endLineNumber; - this.endColumn = endColumn; - } - } - /** - * Test if this range is empty. - */ - Range.prototype.isEmpty = function () { - return Range.isEmpty(this); - }; - /** - * Test if `range` is empty. - */ - Range.isEmpty = function (range) { - return (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn); - }; - /** - * Test if position is in this range. If the position is at the edges, will return true. - */ - Range.prototype.containsPosition = function (position) { - return Range.containsPosition(this, position); - }; - /** - * Test if `position` is in `range`. If the position is at the edges, will return true. - */ - Range.containsPosition = function (range, position) { - if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) { - return false; - } - if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) { - return false; - } - if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) { - return false; - } - return true; - }; - /** - * Test if range is in this range. If the range is equal to this range, will return true. - */ - Range.prototype.containsRange = function (range) { - return Range.containsRange(this, range); - }; - /** - * Test if `otherRange` is in `range`. If the ranges are equal, will return true. - */ - Range.containsRange = function (range, otherRange) { - if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { - return false; - } - if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { - return false; - } - if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) { - return false; - } - if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) { - return false; - } - return true; - }; - /** - * A reunion of the two ranges. - * The smallest position will be used as the start point, and the largest one as the end point. - */ - Range.prototype.plusRange = function (range) { - return Range.plusRange(this, range); - }; - /** - * A reunion of the two ranges. - * The smallest position will be used as the start point, and the largest one as the end point. - */ - Range.plusRange = function (a, b) { - var startLineNumber; - var startColumn; - var endLineNumber; - var endColumn; - if (b.startLineNumber < a.startLineNumber) { - startLineNumber = b.startLineNumber; - startColumn = b.startColumn; - } - else if (b.startLineNumber === a.startLineNumber) { - startLineNumber = b.startLineNumber; - startColumn = Math.min(b.startColumn, a.startColumn); - } - else { - startLineNumber = a.startLineNumber; - startColumn = a.startColumn; - } - if (b.endLineNumber > a.endLineNumber) { - endLineNumber = b.endLineNumber; - endColumn = b.endColumn; - } - else if (b.endLineNumber === a.endLineNumber) { - endLineNumber = b.endLineNumber; - endColumn = Math.max(b.endColumn, a.endColumn); - } - else { - endLineNumber = a.endLineNumber; - endColumn = a.endColumn; - } - return new Range(startLineNumber, startColumn, endLineNumber, endColumn); - }; - /** - * A intersection of the two ranges. - */ - Range.prototype.intersectRanges = function (range) { - return Range.intersectRanges(this, range); - }; - /** - * A intersection of the two ranges. - */ - Range.intersectRanges = function (a, b) { - var resultStartLineNumber = a.startLineNumber; - var resultStartColumn = a.startColumn; - var resultEndLineNumber = a.endLineNumber; - var resultEndColumn = a.endColumn; - var otherStartLineNumber = b.startLineNumber; - var otherStartColumn = b.startColumn; - var otherEndLineNumber = b.endLineNumber; - var otherEndColumn = b.endColumn; - if (resultStartLineNumber < otherStartLineNumber) { - resultStartLineNumber = otherStartLineNumber; - resultStartColumn = otherStartColumn; - } - else if (resultStartLineNumber === otherStartLineNumber) { - resultStartColumn = Math.max(resultStartColumn, otherStartColumn); - } - if (resultEndLineNumber > otherEndLineNumber) { - resultEndLineNumber = otherEndLineNumber; - resultEndColumn = otherEndColumn; - } - else if (resultEndLineNumber === otherEndLineNumber) { - resultEndColumn = Math.min(resultEndColumn, otherEndColumn); - } - // Check if selection is now empty - if (resultStartLineNumber > resultEndLineNumber) { - return null; - } - if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) { - return null; - } - return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn); - }; - /** - * Test if this range equals other. - */ - Range.prototype.equalsRange = function (other) { - return Range.equalsRange(this, other); - }; - /** - * Test if range `a` equals `b`. - */ - Range.equalsRange = function (a, b) { - return (!!a && - !!b && - a.startLineNumber === b.startLineNumber && - a.startColumn === b.startColumn && - a.endLineNumber === b.endLineNumber && - a.endColumn === b.endColumn); - }; - /** - * Return the end position (which will be after or equal to the start position) - */ - Range.prototype.getEndPosition = function () { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.endLineNumber, this.endColumn); - }; - /** - * Return the start position (which will be before or equal to the end position) - */ - Range.prototype.getStartPosition = function () { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.startLineNumber, this.startColumn); - }; - /** - * Transform to a user presentable string representation. - */ - Range.prototype.toString = function () { - return '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']'; - }; - /** - * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position. - */ - Range.prototype.setEndPosition = function (endLineNumber, endColumn) { - return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn); - }; - /** - * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position. - */ - Range.prototype.setStartPosition = function (startLineNumber, startColumn) { - return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn); - }; - /** - * Create a new empty range using this range's start position. - */ - Range.prototype.collapseToStart = function () { - return Range.collapseToStart(this); - }; - /** - * Create a new empty range using this range's start position. - */ - Range.collapseToStart = function (range) { - return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn); - }; - // --- - Range.fromPositions = function (start, end) { - if (end === void 0) { end = start; } - return new Range(start.lineNumber, start.column, end.lineNumber, end.column); - }; - Range.lift = function (range) { - if (!range) { - return null; - } - return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); - }; - /** - * Test if `obj` is an `IRange`. - */ - Range.isIRange = function (obj) { - return (obj - && (typeof obj.startLineNumber === 'number') - && (typeof obj.startColumn === 'number') - && (typeof obj.endLineNumber === 'number') - && (typeof obj.endColumn === 'number')); - }; - /** - * Test if the two ranges are touching in any way. - */ - Range.areIntersectingOrTouching = function (a, b) { - // Check if `a` is before `b` - if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) { - return false; - } - // Check if `b` is before `a` - if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) { - return false; - } - // These ranges must intersect - return true; - }; - /** - * Test if the two ranges are intersecting. If the ranges are touching it returns true. - */ - Range.areIntersecting = function (a, b) { - // Check if `a` is before `b` - if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) { - return false; - } - // Check if `b` is before `a` - if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) { - return false; - } - // These ranges must intersect - return true; - }; - /** - * A function that compares ranges, useful for sorting ranges - * It will first compare ranges on the startPosition and then on the endPosition - */ - Range.compareRangesUsingStarts = function (a, b) { - if (a && b) { - var aStartLineNumber = a.startLineNumber | 0; - var bStartLineNumber = b.startLineNumber | 0; - if (aStartLineNumber === bStartLineNumber) { - var aStartColumn = a.startColumn | 0; - var bStartColumn = b.startColumn | 0; - if (aStartColumn === bStartColumn) { - var aEndLineNumber = a.endLineNumber | 0; - var bEndLineNumber = b.endLineNumber | 0; - if (aEndLineNumber === bEndLineNumber) { - var aEndColumn = a.endColumn | 0; - var bEndColumn = b.endColumn | 0; - return aEndColumn - bEndColumn; - } - return aEndLineNumber - bEndLineNumber; - } - return aStartColumn - bStartColumn; - } - return aStartLineNumber - bStartLineNumber; - } - var aExists = (a ? 1 : 0); - var bExists = (b ? 1 : 0); - return aExists - bExists; - }; - /** - * A function that compares ranges, useful for sorting ranges - * It will first compare ranges on the endPosition and then on the startPosition - */ - Range.compareRangesUsingEnds = function (a, b) { - if (a.endLineNumber === b.endLineNumber) { - if (a.endColumn === b.endColumn) { - if (a.startLineNumber === b.startLineNumber) { - return a.startColumn - b.startColumn; - } - return a.startLineNumber - b.startLineNumber; - } - return a.endColumn - b.endColumn; - } - return a.endLineNumber - b.endLineNumber; - }; - /** - * Test if the range spans multiple lines. - */ - Range.spansMultipleLines = function (range) { - return range.endLineNumber > range.startLineNumber; - }; - return Range; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js ***! - \***************************************************************************/ -/*! exports provided: Selection */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Selection", function() { return Selection; }); -/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -/** - * A selection in the editor. - * The selection is a range that has an orientation. - */ -var Selection = /** @class */ (function (_super) { - __extends(Selection, _super); - function Selection(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) { - var _this = _super.call(this, selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) || this; - _this.selectionStartLineNumber = selectionStartLineNumber; - _this.selectionStartColumn = selectionStartColumn; - _this.positionLineNumber = positionLineNumber; - _this.positionColumn = positionColumn; - return _this; - } - /** - * Clone this selection. - */ - Selection.prototype.clone = function () { - return new Selection(this.selectionStartLineNumber, this.selectionStartColumn, this.positionLineNumber, this.positionColumn); - }; - /** - * Transform to a human-readable representation. - */ - Selection.prototype.toString = function () { - return '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']'; - }; - /** - * Test if equals other selection. - */ - Selection.prototype.equalsSelection = function (other) { - return (Selection.selectionsEqual(this, other)); - }; - /** - * Test if the two selections are equal. - */ - Selection.selectionsEqual = function (a, b) { - return (a.selectionStartLineNumber === b.selectionStartLineNumber && - a.selectionStartColumn === b.selectionStartColumn && - a.positionLineNumber === b.positionLineNumber && - a.positionColumn === b.positionColumn); - }; - /** - * Get directions (LTR or RTL). - */ - Selection.prototype.getDirection = function () { - if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) { - return 0 /* LTR */; - } - return 1 /* RTL */; - }; - /** - * Create a new selection with a different `positionLineNumber` and `positionColumn`. - */ - Selection.prototype.setEndPosition = function (endLineNumber, endColumn) { - if (this.getDirection() === 0 /* LTR */) { - return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn); - } - return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn); - }; - /** - * Get the position at `positionLineNumber` and `positionColumn`. - */ - Selection.prototype.getPosition = function () { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.positionLineNumber, this.positionColumn); - }; - /** - * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. - */ - Selection.prototype.setStartPosition = function (startLineNumber, startColumn) { - if (this.getDirection() === 0 /* LTR */) { - return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn); - } - return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn); - }; - // ---- - /** - * Create a `Selection` from one or two positions - */ - Selection.fromPositions = function (start, end) { - if (end === void 0) { end = start; } - return new Selection(start.lineNumber, start.column, end.lineNumber, end.column); - }; - /** - * Create a `Selection` from an `ISelection`. - */ - Selection.liftSelection = function (sel) { - return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn); - }; - /** - * `a` equals `b`. - */ - Selection.selectionsArrEqual = function (a, b) { - if (a && !b || !a && b) { - return false; - } - if (!a && !b) { - return true; - } - if (a.length !== b.length) { - return false; - } - for (var i = 0, len = a.length; i < len; i++) { - if (!this.selectionsEqual(a[i], b[i])) { - return false; - } - } - return true; - }; - /** - * Test if `obj` is an `ISelection`. - */ - Selection.isISelection = function (obj) { - return (obj - && (typeof obj.selectionStartLineNumber === 'number') - && (typeof obj.selectionStartColumn === 'number') - && (typeof obj.positionLineNumber === 'number') - && (typeof obj.positionColumn === 'number')); - }; - /** - * Create with a direction. - */ - Selection.createWithDirection = function (startLineNumber, startColumn, endLineNumber, endColumn, direction) { - if (direction === 0 /* LTR */) { - return new Selection(startLineNumber, startColumn, endLineNumber, endColumn); - } - return new Selection(endLineNumber, endColumn, startLineNumber, startColumn); - }; - return Selection; -}(_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"])); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/token.js ***! - \***********************************************************************/ -/*! exports provided: Token, TokenizationResult, TokenizationResult2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Token", function() { return Token; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult", function() { return TokenizationResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult2", function() { return TokenizationResult2; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var Token = /** @class */ (function () { - function Token(offset, type, language) { - this.offset = offset | 0; // @perf - this.type = type; - this.language = language; - } - Token.prototype.toString = function () { - return '(' + this.offset + ', ' + this.type + ')'; - }; - return Token; -}()); - -var TokenizationResult = /** @class */ (function () { - function TokenizationResult(tokens, endState) { - this.tokens = tokens; - this.endState = endState; - } - return TokenizationResult; -}()); - -var TokenizationResult2 = /** @class */ (function () { - function TokenizationResult2(tokens, endState) { - this.tokens = tokens; - this.endState = endState; - } - return TokenizationResult2; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js ***! - \**********************************************************************/ -/*! exports provided: Uint8Matrix, toUint8, toUint32, toUint32Array */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uint8Matrix", function() { return Uint8Matrix; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint8", function() { return toUint8; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint32", function() { return toUint32; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint32Array", function() { return toUint32Array; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var Uint8Matrix = /** @class */ (function () { - function Uint8Matrix(rows, cols, defaultValue) { - var data = new Uint8Array(rows * cols); - for (var i = 0, len = rows * cols; i < len; i++) { - data[i] = defaultValue; - } - this._data = data; - this.rows = rows; - this.cols = cols; - } - Uint8Matrix.prototype.get = function (row, col) { - return this._data[row * this.cols + col]; - }; - Uint8Matrix.prototype.set = function (row, col, value) { - this._data[row * this.cols + col] = value; - }; - return Uint8Matrix; -}()); - -function toUint8(v) { - if (v < 0) { - return 0; - } - if (v > 255 /* MAX_UINT_8 */) { - return 255 /* MAX_UINT_8 */; - } - return v | 0; -} -function toUint32(v) { - if (v < 0) { - return 0; - } - if (v > 4294967295 /* MAX_UINT_32 */) { - return 4294967295 /* MAX_UINT_32 */; - } - return v | 0; -} -function toUint32Array(arr) { - var len = arr.length; - var r = new Uint32Array(len); - for (var i = 0; i < len; i++) { - r[i] = toUint32(arr[i]); - } - return r; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js ***! - \******************************************************************************/ -/*! exports provided: DiffComputer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffComputer", function() { return DiffComputer; }); -/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -5528,10 +3564,10 @@ __webpack_require__.r(__webpack_exports__); var MAXIMUM_RUN_TIME = 5000; // 5 seconds var MINIMUM_MATCHING_CHARACTER_LENGTH = 3; function computeDiff(originalSequence, modifiedSequence, continueProcessingPredicate, pretty) { - var diffAlgo = new _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__["LcsDiff"](originalSequence, modifiedSequence, continueProcessingPredicate); + var diffAlgo = new diff_LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate); return diffAlgo.ComputeDiff(pretty); } -var LineMarkerSequence = /** @class */ (function () { +var diffComputer_LineMarkerSequence = /** @class */ (function () { function LineMarkerSequence(lines) { var startColumns = []; var endColumns = []; @@ -5556,14 +3592,14 @@ var LineMarkerSequence = /** @class */ (function () { return i + 1; }; LineMarkerSequence._getFirstNonBlankColumn = function (txt, defaultValue) { - var r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["firstNonWhitespaceIndex"](txt); + var r = firstNonWhitespaceIndex(txt); if (r === -1) { return defaultValue; } return r + 1; }; LineMarkerSequence._getLastNonBlankColumn = function (txt, defaultValue) { - var r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["lastNonWhitespaceIndex"](txt); + var r = lastNonWhitespaceIndex(txt); if (r === -1) { return defaultValue; } @@ -5743,8 +3779,8 @@ var DiffComputer = /** @class */ (function () { this.maximumRunTimeMs = MAXIMUM_RUN_TIME; this.originalLines = originalLines; this.modifiedLines = modifiedLines; - this.original = new LineMarkerSequence(originalLines); - this.modified = new LineMarkerSequence(modifiedLines); + this.original = new diffComputer_LineMarkerSequence(originalLines); + this.modified = new diffComputer_LineMarkerSequence(modifiedLines); } DiffComputer.prototype.computeDiff = function () { if (this.original.getLength() === 1 && this.original.getElementAtIndex(0).length === 0) { @@ -5812,8 +3848,8 @@ var DiffComputer = /** @class */ (function () { // These lines differ only in trim whitespace // Check the leading whitespace { - var originalStartColumn = LineMarkerSequence._getFirstNonBlankColumn(originalLine, 1); - var modifiedStartColumn = LineMarkerSequence._getFirstNonBlankColumn(modifiedLine, 1); + var originalStartColumn = diffComputer_LineMarkerSequence._getFirstNonBlankColumn(originalLine, 1); + var modifiedStartColumn = diffComputer_LineMarkerSequence._getFirstNonBlankColumn(modifiedLine, 1); while (originalStartColumn > 1 && modifiedStartColumn > 1) { var originalChar = originalLine.charCodeAt(originalStartColumn - 2); var modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2); @@ -5829,8 +3865,8 @@ var DiffComputer = /** @class */ (function () { } // Check the trailing whitespace { - var originalEndColumn = LineMarkerSequence._getLastNonBlankColumn(originalLine, 1); - var modifiedEndColumn = LineMarkerSequence._getLastNonBlankColumn(modifiedLine, 1); + var originalEndColumn = diffComputer_LineMarkerSequence._getLastNonBlankColumn(originalLine, 1); + var modifiedEndColumn = diffComputer_LineMarkerSequence._getLastNonBlankColumn(modifiedLine, 1); var originalMaxColumn = originalLine.length + 1; var modifiedMaxColumn = modifiedLine.length + 1; while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) { @@ -5901,28 +3937,267 @@ var DiffComputer = /** @class */ (function () { }()); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var Uint8Matrix = /** @class */ (function () { + function Uint8Matrix(rows, cols, defaultValue) { + var data = new Uint8Array(rows * cols); + for (var i = 0, len = rows * cols; i < len; i++) { + data[i] = defaultValue; + } + this._data = data; + this.rows = rows; + this.cols = cols; + } + Uint8Matrix.prototype.get = function (row, col) { + return this._data[row * this.cols + col]; + }; + Uint8Matrix.prototype.set = function (row, col, value) { + this._data[row * this.cols + col] = value; + }; + return Uint8Matrix; +}()); -/***/ }), +function toUint8(v) { + if (v < 0) { + return 0; + } + if (v > 255 /* MAX_UINT_8 */) { + return 255 /* MAX_UINT_8 */; + } + return v | 0; +} +function toUint32(v) { + if (v < 0) { + return 0; + } + if (v > 4294967295 /* MAX_UINT_32 */) { + return 4294967295 /* MAX_UINT_32 */; + } + return v | 0; +} +function toUint32Array(arr) { + var len = arr.length; + var r = new Uint32Array(len); + for (var i = 0; i < len; i++) { + r[i] = toUint32(arr[i]); + } + return r; +} -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js ***! - \**********************************************************************************/ -/*! exports provided: MirrorTextModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MirrorTextModel", function() { return MirrorTextModel; }); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../viewModel/prefixSumComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js"); +var PrefixSumIndexOfResult = /** @class */ (function () { + function PrefixSumIndexOfResult(index, remainder) { + this.index = index; + this.remainder = remainder; + } + return PrefixSumIndexOfResult; +}()); + +var prefixSumComputer_PrefixSumComputer = /** @class */ (function () { + function PrefixSumComputer(values) { + this.values = values; + this.prefixSum = new Uint32Array(values.length); + this.prefixSumValidIndex = new Int32Array(1); + this.prefixSumValidIndex[0] = -1; + } + PrefixSumComputer.prototype.getCount = function () { + return this.values.length; + }; + PrefixSumComputer.prototype.insertValues = function (insertIndex, insertValues) { + insertIndex = toUint32(insertIndex); + var oldValues = this.values; + var oldPrefixSum = this.prefixSum; + var insertValuesLen = insertValues.length; + if (insertValuesLen === 0) { + return false; + } + this.values = new Uint32Array(oldValues.length + insertValuesLen); + this.values.set(oldValues.subarray(0, insertIndex), 0); + this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen); + this.values.set(insertValues, insertIndex); + if (insertIndex - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = insertIndex - 1; + } + this.prefixSum = new Uint32Array(this.values.length); + if (this.prefixSumValidIndex[0] >= 0) { + this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); + } + return true; + }; + PrefixSumComputer.prototype.changeValue = function (index, value) { + index = toUint32(index); + value = toUint32(value); + if (this.values[index] === value) { + return false; + } + this.values[index] = value; + if (index - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = index - 1; + } + return true; + }; + PrefixSumComputer.prototype.removeValues = function (startIndex, cnt) { + startIndex = toUint32(startIndex); + cnt = toUint32(cnt); + var oldValues = this.values; + var oldPrefixSum = this.prefixSum; + if (startIndex >= oldValues.length) { + return false; + } + var maxCnt = oldValues.length - startIndex; + if (cnt >= maxCnt) { + cnt = maxCnt; + } + if (cnt === 0) { + return false; + } + this.values = new Uint32Array(oldValues.length - cnt); + this.values.set(oldValues.subarray(0, startIndex), 0); + this.values.set(oldValues.subarray(startIndex + cnt), startIndex); + this.prefixSum = new Uint32Array(this.values.length); + if (startIndex - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = startIndex - 1; + } + if (this.prefixSumValidIndex[0] >= 0) { + this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); + } + return true; + }; + PrefixSumComputer.prototype.getTotalValue = function () { + if (this.values.length === 0) { + return 0; + } + return this._getAccumulatedValue(this.values.length - 1); + }; + PrefixSumComputer.prototype.getAccumulatedValue = function (index) { + if (index < 0) { + return 0; + } + index = toUint32(index); + return this._getAccumulatedValue(index); + }; + PrefixSumComputer.prototype._getAccumulatedValue = function (index) { + if (index <= this.prefixSumValidIndex[0]) { + return this.prefixSum[index]; + } + var startIndex = this.prefixSumValidIndex[0] + 1; + if (startIndex === 0) { + this.prefixSum[0] = this.values[0]; + startIndex++; + } + if (index >= this.values.length) { + index = this.values.length - 1; + } + for (var i = startIndex; i <= index; i++) { + this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i]; + } + this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index); + return this.prefixSum[index]; + }; + PrefixSumComputer.prototype.getIndexOf = function (accumulatedValue) { + accumulatedValue = Math.floor(accumulatedValue); //@perf + // Compute all sums (to get a fully valid prefixSum) + this.getTotalValue(); + var low = 0; + var high = this.values.length - 1; + var mid = 0; + var midStop = 0; + var midStart = 0; + while (low <= high) { + mid = low + ((high - low) / 2) | 0; + midStop = this.prefixSum[mid]; + midStart = midStop - this.values[mid]; + if (accumulatedValue < midStart) { + high = mid - 1; + } + else if (accumulatedValue >= midStop) { + low = mid + 1; + } + else { + break; + } + } + return new PrefixSumIndexOfResult(mid, accumulatedValue - midStart); + }; + return PrefixSumComputer; +}()); + +var PrefixSumComputerWithCache = /** @class */ (function () { + function PrefixSumComputerWithCache(values) { + this._cacheAccumulatedValueStart = 0; + this._cache = null; + this._actual = new prefixSumComputer_PrefixSumComputer(values); + this._bustCache(); + } + PrefixSumComputerWithCache.prototype._bustCache = function () { + this._cacheAccumulatedValueStart = 0; + this._cache = null; + }; + PrefixSumComputerWithCache.prototype.insertValues = function (insertIndex, insertValues) { + if (this._actual.insertValues(insertIndex, insertValues)) { + this._bustCache(); + } + }; + PrefixSumComputerWithCache.prototype.changeValue = function (index, value) { + if (this._actual.changeValue(index, value)) { + this._bustCache(); + } + }; + PrefixSumComputerWithCache.prototype.removeValues = function (startIndex, cnt) { + if (this._actual.removeValues(startIndex, cnt)) { + this._bustCache(); + } + }; + PrefixSumComputerWithCache.prototype.getTotalValue = function () { + return this._actual.getTotalValue(); + }; + PrefixSumComputerWithCache.prototype.getAccumulatedValue = function (index) { + return this._actual.getAccumulatedValue(index); + }; + PrefixSumComputerWithCache.prototype.getIndexOf = function (accumulatedValue) { + accumulatedValue = Math.floor(accumulatedValue); //@perf + if (this._cache !== null) { + var cacheIndex = accumulatedValue - this._cacheAccumulatedValueStart; + if (cacheIndex >= 0 && cacheIndex < this._cache.length) { + // Cache hit! + return this._cache[cacheIndex]; + } + } + // Cache miss! + return this._actual.getIndexOf(accumulatedValue); + }; + /** + * Gives a hint that a lot of requests are about to come in for these accumulated values. + */ + PrefixSumComputerWithCache.prototype.warmUpCache = function (accumulatedValueStart, accumulatedValueEnd) { + var newCache = []; + for (var accumulatedValue = accumulatedValueStart; accumulatedValue <= accumulatedValueEnd; accumulatedValue++) { + newCache[accumulatedValue - accumulatedValueStart] = this.getIndexOf(accumulatedValue); + } + this._cache = newCache; + this._cacheAccumulatedValueStart = accumulatedValueStart; + }; + return PrefixSumComputerWithCache; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var MirrorTextModel = /** @class */ (function () { +var mirrorTextModel_MirrorTextModel = /** @class */ (function () { function MirrorTextModel(uri, lines, eol, versionId) { this._uri = uri; this._lines = lines; @@ -5946,7 +4221,7 @@ var MirrorTextModel = /** @class */ (function () { for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) { var change = changes_1[_i]; this._acceptDeleteRange(change.range); - this._acceptInsertText(new _core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](change.range.startLineNumber, change.range.startColumn), change.text); + this._acceptInsertText(new Position(change.range.startLineNumber, change.range.startColumn), change.text); } this._versionId = e.versionId; }; @@ -5958,7 +4233,7 @@ var MirrorTextModel = /** @class */ (function () { for (var i = 0; i < linesLength; i++) { lineStartValues[i] = this._lines[i].length + eolLength; } - this._lineStarts = new _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__["PrefixSumComputer"](lineStartValues); + this._lineStarts = new prefixSumComputer_PrefixSumComputer(lineStartValues); } }; /** @@ -6025,22 +4300,7 @@ var MirrorTextModel = /** @class */ (function () { }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js ***! - \*****************************************************************************/ -/*! exports provided: USUAL_WORD_SEPARATORS, DEFAULT_WORD_REGEXP, ensureValidWordDefinition, getWordAtText */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USUAL_WORD_SEPARATORS", function() { return USUAL_WORD_SEPARATORS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_WORD_REGEXP", function() { return DEFAULT_WORD_REGEXP; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureValidWordDefinition", function() { return ensureValidWordDefinition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWordAtText", function() { return getWordAtText; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -6154,30 +4414,71 @@ function getWordAtText(column, wordDefinition, text, textOffset) { return ret; } +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ -/***/ }), +/** + * A fast character classifier that uses a compact array for ASCII values. + */ +var characterClassifier_CharacterClassifier = /** @class */ (function () { + function CharacterClassifier(_defaultValue) { + var defaultValue = toUint8(_defaultValue); + this._defaultValue = defaultValue; + this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue); + this._map = new Map(); + } + CharacterClassifier._createAsciiMap = function (defaultValue) { + var asciiMap = new Uint8Array(256); + for (var i = 0; i < 256; i++) { + asciiMap[i] = defaultValue; + } + return asciiMap; + }; + CharacterClassifier.prototype.set = function (charCode, _value) { + var value = toUint8(_value); + if (charCode >= 0 && charCode < 256) { + this._asciiMap[charCode] = value; + } + else { + this._map.set(charCode, value); + } + }; + CharacterClassifier.prototype.get = function (charCode) { + if (charCode >= 0 && charCode < 256) { + return this._asciiMap[charCode]; + } + else { + return (this._map.get(charCode) || this._defaultValue); + } + }; + return CharacterClassifier; +}()); -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js ***! - \*******************************************************************************/ -/*! exports provided: StateMachine, LinkComputer, computeLinks */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +var CharacterSet = /** @class */ (function () { + function CharacterSet() { + this._actual = new characterClassifier_CharacterClassifier(0 /* False */); + } + CharacterSet.prototype.add = function (charCode) { + this._actual.set(charCode, 1 /* True */); + }; + CharacterSet.prototype.has = function (charCode) { + return (this._actual.get(charCode) === 1 /* True */); + }; + return CharacterSet; +}()); -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StateMachine", function() { return StateMachine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkComputer", function() { return LinkComputer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeLinks", function() { return computeLinks; }); -/* harmony import */ var _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/characterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js"); -/* harmony import */ var _core_uint_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/uint.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js"); + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var StateMachine = /** @class */ (function () { +var linkComputer_StateMachine = /** @class */ (function () { function StateMachine(edges) { var maxCharCode = 0; var maxState = 0 /* Invalid */; @@ -6195,7 +4496,7 @@ var StateMachine = /** @class */ (function () { } maxCharCode++; maxState++; - var states = new _core_uint_js__WEBPACK_IMPORTED_MODULE_1__["Uint8Matrix"](maxState, maxCharCode, 0 /* Invalid */); + var states = new Uint8Matrix(maxState, maxCharCode, 0 /* Invalid */); for (var i = 0, len = edges.length; i < len; i++) { var _b = edges[i], from = _b[0], chCode = _b[1], to = _b[2]; states.set(from, chCode, to); @@ -6216,7 +4517,7 @@ var StateMachine = /** @class */ (function () { var _stateMachine = null; function getStateMachine() { if (_stateMachine === null) { - _stateMachine = new StateMachine([ + _stateMachine = new linkComputer_StateMachine([ [1 /* Start */, 104 /* h */, 2 /* H */], [1 /* Start */, 72 /* H */, 2 /* H */], [1 /* Start */, 102 /* f */, 6 /* F */], @@ -6246,7 +4547,7 @@ function getStateMachine() { var _classifier = null; function getClassifier() { if (_classifier === null) { - _classifier = new _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__["CharacterClassifier"](0 /* None */); + _classifier = new characterClassifier_CharacterClassifier(0 /* None */); var FORCE_TERMINATION_CHARACTERS = ' \t<>\'\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…'; for (var i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) { _classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), 1 /* ForceTermination */); @@ -6412,19 +4713,7 @@ function computeLinks(model) { return LinkComputer.computeLinks(model); } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js ***! - \*************************************************************************************************/ -/*! exports provided: BasicInplaceReplace */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BasicInplaceReplace", function() { return BasicInplaceReplace; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -6513,40 +4802,171 @@ var BasicInplaceReplace = /** @class */ (function () { }()); +// EXTERNAL MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js +var polyfill = __webpack_require__("URDS"); -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js ***! - \****************************************************************************************/ -/*! exports provided: BaseEditorSimpleWorker, EditorSimpleWorkerImpl, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseEditorSimpleWorker", function() { return BaseEditorSimpleWorker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorSimpleWorkerImpl", function() { return EditorSimpleWorkerImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js"); -/* harmony import */ var _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../diff/diffComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js"); -/* harmony import */ var _model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../model/mirrorTextModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js"); -/* harmony import */ var _model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../model/wordHelper.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js"); -/* harmony import */ var _modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../modes/linkComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js"); -/* harmony import */ var _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../modes/supports/inplaceReplaceSupport.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js"); -/* harmony import */ var _standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../standalone/standaloneBase.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/functional.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { +function functional_once(fn) { + var _this = this; + var didCall = false; + var result; + return function () { + if (didCall) { + return result; + } + didCall = true; + result = fn.apply(_this, arguments); + return result; + }; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/linkedList.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var Node = /** @class */ (function () { + function Node(element) { + this.element = element; + this.next = Node.Undefined; + this.prev = Node.Undefined; + } + Node.Undefined = new Node(undefined); + return Node; +}()); +var linkedList_LinkedList = /** @class */ (function () { + function LinkedList() { + this._first = Node.Undefined; + this._last = Node.Undefined; + this._size = 0; + } + Object.defineProperty(LinkedList.prototype, "size", { + get: function () { + return this._size; + }, + enumerable: true, + configurable: true + }); + LinkedList.prototype.isEmpty = function () { + return this._first === Node.Undefined; + }; + LinkedList.prototype.clear = function () { + this._first = Node.Undefined; + this._last = Node.Undefined; + this._size = 0; + }; + LinkedList.prototype.unshift = function (element) { + return this._insert(element, false); + }; + LinkedList.prototype.push = function (element) { + return this._insert(element, true); + }; + LinkedList.prototype._insert = function (element, atTheEnd) { + var _this = this; + var newNode = new Node(element); + if (this._first === Node.Undefined) { + this._first = newNode; + this._last = newNode; + } + else if (atTheEnd) { + // push + var oldLast = this._last; + this._last = newNode; + newNode.prev = oldLast; + oldLast.next = newNode; + } + else { + // unshift + var oldFirst = this._first; + this._first = newNode; + newNode.next = oldFirst; + oldFirst.prev = newNode; + } + this._size += 1; + var didRemove = false; + return function () { + if (!didRemove) { + didRemove = true; + _this._remove(newNode); + } + }; + }; + LinkedList.prototype.shift = function () { + if (this._first === Node.Undefined) { + return undefined; + } + else { + var res = this._first.element; + this._remove(this._first); + return res; + } + }; + LinkedList.prototype._remove = function (node) { + if (node.prev !== Node.Undefined && node.next !== Node.Undefined) { + // middle + var anchor = node.prev; + anchor.next = node.next; + node.next.prev = anchor; + } + else if (node.prev === Node.Undefined && node.next === Node.Undefined) { + // only node + this._first = Node.Undefined; + this._last = Node.Undefined; + } + else if (node.next === Node.Undefined) { + // last + this._last = this._last.prev; + this._last.next = Node.Undefined; + } + else if (node.prev === Node.Undefined) { + // first + this._first = this._first.next; + this._first.prev = Node.Undefined; + } + // done + this._size -= 1; + }; + LinkedList.prototype.iterator = function () { + var element; + var node = this._first; + return { + next: function () { + if (node === Node.Undefined) { + return FIN; + } + if (!element) { + element = { done: false, value: node.element }; + } + else { + element.value = node.element; + } + node = node.next; + return element; + } + }; + }; + LinkedList.prototype.toArray = function () { + var result = []; + for (var node = this._first; node !== Node.Undefined; node = node.next) { + result.push(node.element); + } + return result; + }; + return LinkedList; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/event.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var event_extends = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || @@ -6563,944 +4983,1282 @@ var __extends = (undefined && undefined.__extends) || (function () { - - - - - - - - - - -/** - * @internal - */ -var MirrorModel = /** @class */ (function (_super) { - __extends(MirrorModel, _super); - function MirrorModel() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(MirrorModel.prototype, "uri", { - get: function () { - return this._uri; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(MirrorModel.prototype, "version", { - get: function () { - return this._versionId; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(MirrorModel.prototype, "eol", { - get: function () { - return this._eol; - }, - enumerable: true, - configurable: true - }); - MirrorModel.prototype.getValue = function () { - return this.getText(); - }; - MirrorModel.prototype.getLinesContent = function () { - return this._lines.slice(0); - }; - MirrorModel.prototype.getLineCount = function () { - return this._lines.length; - }; - MirrorModel.prototype.getLineContent = function (lineNumber) { - return this._lines[lineNumber - 1]; - }; - MirrorModel.prototype.getWordAtPosition = function (position, wordDefinition) { - var wordAtText = Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__["getWordAtText"])(position.column, Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__["ensureValidWordDefinition"])(wordDefinition), this._lines[position.lineNumber - 1], 0); - if (wordAtText) { - return new _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn); - } - return null; - }; - MirrorModel.prototype.getWordUntilPosition = function (position, wordDefinition) { - var wordAtPosition = this.getWordAtPosition(position, wordDefinition); - if (!wordAtPosition) { - return { - word: '', - startColumn: position.column, - endColumn: position.column - }; - } - return { - word: this._lines[position.lineNumber - 1].substring(wordAtPosition.startColumn - 1, position.column - 1), - startColumn: wordAtPosition.startColumn, - endColumn: position.column - }; - }; - MirrorModel.prototype.createWordIterator = function (wordDefinition) { - var _this = this; - var obj; - var lineNumber = 0; - var lineText; - var wordRangesIdx = 0; - var wordRanges = []; - var next = function () { - if (wordRangesIdx < wordRanges.length) { - var value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end); - wordRangesIdx += 1; - if (!obj) { - obj = { done: false, value: value }; +var event_Event; +(function (Event) { + var _disposable = { dispose: function () { } }; + Event.None = function () { return _disposable; }; + /** + * Given an event, returns another event which only fires once. + */ + function once(event) { + return function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + // we need this, in case the event fires during the listener call + var didFire = false; + var result; + result = event(function (e) { + if (didFire) { + return; + } + else if (result) { + result.dispose(); } else { - obj.value = value; + didFire = true; } - return obj; + return listener.call(thisArgs, e); + }, null, disposables); + if (didFire) { + result.dispose(); } - else if (lineNumber >= _this._lines.length) { - return _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_2__["FIN"]; + return result; + }; + } + Event.once = once; + /** + * Given an event and a `map` function, returns another event which maps each element + * throught the mapping function. + */ + function map(event, map) { + return snapshot(function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return event(function (i) { return listener.call(thisArgs, map(i)); }, null, disposables); + }); + } + Event.map = map; + /** + * Given an event and an `each` function, returns another identical event and calls + * the `each` function per each element. + */ + function forEach(event, each) { + return snapshot(function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return event(function (i) { each(i); listener.call(thisArgs, i); }, null, disposables); + }); + } + Event.forEach = forEach; + function filter(event, filter) { + return snapshot(function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return event(function (e) { return filter(e) && listener.call(thisArgs, e); }, null, disposables); + }); + } + Event.filter = filter; + /** + * Given an event, returns the same event but typed as `Event`. + */ + function signal(event) { + return event; + } + Event.signal = signal; + /** + * Given a collection of events, returns a single event which emits + * whenever any of the provided events emit. + */ + function any() { + var events = []; + for (var _i = 0; _i < arguments.length; _i++) { + events[_i] = arguments[_i]; + } + return function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return combinedDisposable(events.map(function (event) { return event(function (e) { return listener.call(thisArgs, e); }, null, disposables); })); + }; + } + Event.any = any; + /** + * Given an event and a `merge` function, returns another event which maps each element + * and the cummulative result throught the `merge` function. Similar to `map`, but with memory. + */ + function reduce(event, merge, initial) { + var output = initial; + return map(event, function (e) { + output = merge(output, e); + return output; + }); + } + Event.reduce = reduce; + /** + * Given a chain of event processing functions (filter, map, etc), each + * function will be invoked per event & per listener. Snapshotting an event + * chain allows each function to be invoked just once per event. + */ + function snapshot(event) { + var listener; + var emitter = new event_Emitter({ + onFirstListenerAdd: function () { + listener = event(emitter.fire, emitter); + }, + onLastListenerRemove: function () { + listener.dispose(); + } + }); + return emitter.event; + } + Event.snapshot = snapshot; + function debounce(event, merge, delay, leading, leakWarningThreshold) { + if (delay === void 0) { delay = 100; } + if (leading === void 0) { leading = false; } + var subscription; + var output = undefined; + var handle = undefined; + var numDebouncedCalls = 0; + var emitter = new event_Emitter({ + leakWarningThreshold: leakWarningThreshold, + onFirstListenerAdd: function () { + subscription = event(function (cur) { + numDebouncedCalls++; + output = merge(output, cur); + if (leading && !handle) { + emitter.fire(output); + } + clearTimeout(handle); + handle = setTimeout(function () { + var _output = output; + output = undefined; + handle = undefined; + if (!leading || numDebouncedCalls > 1) { + emitter.fire(_output); + } + numDebouncedCalls = 0; + }, delay); + }); + }, + onLastListenerRemove: function () { + subscription.dispose(); + } + }); + return emitter.event; + } + Event.debounce = debounce; + /** + * Given an event, it returns another event which fires only once and as soon as + * the input event emits. The event data is the number of millis it took for the + * event to fire. + */ + function stopwatch(event) { + var start = new Date().getTime(); + return map(once(event), function (_) { return new Date().getTime() - start; }); + } + Event.stopwatch = stopwatch; + /** + * Given an event, it returns another event which fires only when the event + * element changes. + */ + function latch(event) { + var firstCall = true; + var cache; + return filter(event, function (value) { + var shouldEmit = firstCall || value !== cache; + firstCall = false; + cache = value; + return shouldEmit; + }); + } + Event.latch = latch; + /** + * Buffers the provided event until a first listener comes + * along, at which point fire all the events at once and + * pipe the event from then on. + * + * ```typescript + * const emitter = new Emitter(); + * const event = emitter.event; + * const bufferedEvent = buffer(event); + * + * emitter.fire(1); + * emitter.fire(2); + * emitter.fire(3); + * // nothing... + * + * const listener = bufferedEvent(num => console.log(num)); + * // 1, 2, 3 + * + * emitter.fire(4); + * // 4 + * ``` + */ + function buffer(event, nextTick, _buffer) { + if (nextTick === void 0) { nextTick = false; } + if (_buffer === void 0) { _buffer = []; } + var buffer = _buffer.slice(); + var listener = event(function (e) { + if (buffer) { + buffer.push(e); } else { - lineText = _this._lines[lineNumber]; - wordRanges = _this._wordenize(lineText, wordDefinition); - wordRangesIdx = 0; - lineNumber += 1; - return next(); + emitter.fire(e); } + }); + var flush = function () { + if (buffer) { + buffer.forEach(function (e) { return emitter.fire(e); }); + } + buffer = null; }; - return { next: next }; - }; - MirrorModel.prototype.getLineWords = function (lineNumber, wordDefinition) { - var content = this._lines[lineNumber - 1]; - var ranges = this._wordenize(content, wordDefinition); - var words = []; - for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { - var range = ranges_1[_i]; - words.push({ - word: content.substring(range.start, range.end), - startColumn: range.start + 1, - endColumn: range.end + 1 - }); - } - return words; - }; - MirrorModel.prototype._wordenize = function (content, wordDefinition) { - var result = []; - var match; - wordDefinition.lastIndex = 0; // reset lastIndex just to be sure - while (match = wordDefinition.exec(content)) { - if (match[0].length === 0) { - // it did match the empty string - break; + var emitter = new event_Emitter({ + onFirstListenerAdd: function () { + if (!listener) { + listener = event(function (e) { return emitter.fire(e); }); + } + }, + onFirstListenerDidAdd: function () { + if (buffer) { + if (nextTick) { + setTimeout(flush); + } + else { + flush(); + } + } + }, + onLastListenerRemove: function () { + if (listener) { + listener.dispose(); + } + listener = null; } - result.push({ start: match.index, end: match.index + match[0].length }); - } - return result; - }; - MirrorModel.prototype.getValueInRange = function (range) { - range = this._validateRange(range); - if (range.startLineNumber === range.endLineNumber) { - return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); - } - var lineEnding = this._eol; - var startLineIndex = range.startLineNumber - 1; - var endLineIndex = range.endLineNumber - 1; - var resultLines = []; - resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); - for (var i = startLineIndex + 1; i < endLineIndex; i++) { - resultLines.push(this._lines[i]); - } - resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); - return resultLines.join(lineEnding); - }; - MirrorModel.prototype.offsetAt = function (position) { - position = this._validatePosition(position); - this._ensureLineStarts(); - return this._lineStarts.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1); - }; - MirrorModel.prototype.positionAt = function (offset) { - offset = Math.floor(offset); - offset = Math.max(0, offset); - this._ensureLineStarts(); - var out = this._lineStarts.getIndexOf(offset); - var lineLength = this._lines[out.index].length; - // Ensure we return a valid position - return { - lineNumber: 1 + out.index, - column: 1 + Math.min(out.remainder, lineLength) - }; - }; - MirrorModel.prototype._validateRange = function (range) { - var start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn }); - var end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn }); - if (start.lineNumber !== range.startLineNumber - || start.column !== range.startColumn - || end.lineNumber !== range.endLineNumber - || end.column !== range.endColumn) { - return { - startLineNumber: start.lineNumber, - startColumn: start.column, - endLineNumber: end.lineNumber, - endColumn: end.column - }; - } - return range; - }; - MirrorModel.prototype._validatePosition = function (position) { - if (!_core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"].isIPosition(position)) { - throw new Error('bad position'); - } - var lineNumber = position.lineNumber, column = position.column; - var hasChanged = false; - if (lineNumber < 1) { - lineNumber = 1; - column = 1; - hasChanged = true; - } - else if (lineNumber > this._lines.length) { - lineNumber = this._lines.length; - column = this._lines[lineNumber - 1].length + 1; - hasChanged = true; - } - else { - var maxCharacter = this._lines[lineNumber - 1].length + 1; - if (column < 1) { - column = 1; - hasChanged = true; - } - else if (column > maxCharacter) { - column = maxCharacter; - hasChanged = true; - } - } - if (!hasChanged) { - return position; - } - else { - return { lineNumber: lineNumber, column: column }; - } - }; - return MirrorModel; -}(_model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_8__["MirrorTextModel"])); -/** - * @internal - */ -var BaseEditorSimpleWorker = /** @class */ (function () { - function BaseEditorSimpleWorker(foreignModuleFactory) { - this._foreignModuleFactory = foreignModuleFactory; - this._foreignModule = null; + }); + return emitter.event; } - // ---- BEGIN diff -------------------------------------------------------------------------- - BaseEditorSimpleWorker.prototype.computeDiff = function (originalUrl, modifiedUrl, ignoreTrimWhitespace) { - var original = this._getModel(originalUrl); - var modified = this._getModel(modifiedUrl); - if (!original || !modified) { - return Promise.resolve(null); + Event.buffer = buffer; + var ChainableEvent = /** @class */ (function () { + function ChainableEvent(event) { + this.event = event; } - var originalLines = original.getLinesContent(); - var modifiedLines = modified.getLinesContent(); - var diffComputer = new _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_7__["DiffComputer"](originalLines, modifiedLines, { - shouldComputeCharChanges: true, - shouldPostProcessCharChanges: true, - shouldIgnoreTrimWhitespace: ignoreTrimWhitespace, - shouldMakePrettyDiff: true - }); - var changes = diffComputer.computeDiff(); - var identical = (changes.length > 0 ? false : this._modelsAreIdentical(original, modified)); - return Promise.resolve({ - identical: identical, - changes: changes - }); - }; - BaseEditorSimpleWorker.prototype._modelsAreIdentical = function (original, modified) { - var originalLineCount = original.getLineCount(); - var modifiedLineCount = modified.getLineCount(); - if (originalLineCount !== modifiedLineCount) { - return false; - } - for (var line = 1; line <= originalLineCount; line++) { - var originalLine = original.getLineContent(line); - var modifiedLine = modified.getLineContent(line); - if (originalLine !== modifiedLine) { - return false; - } - } - return true; - }; - BaseEditorSimpleWorker.prototype.computeMoreMinimalEdits = function (modelUrl, edits) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(edits); - } - var result = []; - var lastEol = undefined; - edits = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["mergeSort"])(edits, function (a, b) { - if (a.range && b.range) { - return _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].compareRangesUsingStarts(a.range, b.range); - } - // eol only changes should go to the end - var aRng = a.range ? 0 : 1; - var bRng = b.range ? 0 : 1; - return aRng - bRng; - }); - for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { - var _a = edits_1[_i], range = _a.range, text = _a.text, eol = _a.eol; - if (typeof eol === 'number') { - lastEol = eol; - } - if (_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].isEmpty(range) && !text) { - // empty change - continue; - } - var original = model.getValueInRange(range); - text = text.replace(/\r\n|\n|\r/g, model.eol); - if (original === text) { - // noop - continue; - } - // make sure diff won't take too long - if (Math.max(text.length, original.length) > BaseEditorSimpleWorker._diffLimit) { - result.push({ range: range, text: text }); - continue; - } - // compute diff between original and edit.text - var changes = Object(_base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__["stringDiff"])(original, text, false); - var editOffset = model.offsetAt(_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].lift(range).getStartPosition()); - for (var _b = 0, changes_1 = changes; _b < changes_1.length; _b++) { - var change = changes_1[_b]; - var start = model.positionAt(editOffset + change.originalStart); - var end = model.positionAt(editOffset + change.originalStart + change.originalLength); - var newEdit = { - text: text.substr(change.modifiedStart, change.modifiedLength), - range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column } - }; - if (model.getValueInRange(newEdit.range) !== newEdit.text) { - result.push(newEdit); - } - } - } - if (typeof lastEol === 'number') { - result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }); - } - return Promise.resolve(result); - }; - // ---- END minimal edits --------------------------------------------------------------- - BaseEditorSimpleWorker.prototype.computeLinks = function (modelUrl) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(null); - } - return Promise.resolve(Object(_modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_10__["computeLinks"])(model)); - }; - BaseEditorSimpleWorker.prototype.textualSuggest = function (modelUrl, position, wordDef, wordDefFlags) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(null); - } - var seen = Object.create(null); - var suggestions = []; - var wordDefRegExp = new RegExp(wordDef, wordDefFlags); - var wordUntil = model.getWordUntilPosition(position, wordDefRegExp); - var wordAt = model.getWordAtPosition(position, wordDefRegExp); - if (wordAt) { - seen[model.getValueInRange(wordAt)] = true; - } - for (var iter = model.createWordIterator(wordDefRegExp), e = iter.next(); !e.done && suggestions.length <= BaseEditorSimpleWorker._suggestionsLimit; e = iter.next()) { - var word = e.value; - if (seen[word]) { - continue; - } - seen[word] = true; - if (!isNaN(Number(word))) { - continue; - } - suggestions.push({ - kind: 18 /* Text */, - label: word, - insertText: word, - range: { startLineNumber: position.lineNumber, startColumn: wordUntil.startColumn, endLineNumber: position.lineNumber, endColumn: wordUntil.endColumn } - }); - } - return Promise.resolve({ suggestions: suggestions }); - }; - // ---- END suggest -------------------------------------------------------------------------- - //#region -- word ranges -- - BaseEditorSimpleWorker.prototype.computeWordRanges = function (modelUrl, range, wordDef, wordDefFlags) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(Object.create(null)); - } - var wordDefRegExp = new RegExp(wordDef, wordDefFlags); - var result = Object.create(null); - for (var line = range.startLineNumber; line < range.endLineNumber; line++) { - var words = model.getLineWords(line, wordDefRegExp); - for (var _i = 0, words_1 = words; _i < words_1.length; _i++) { - var word = words_1[_i]; - if (!isNaN(Number(word.word))) { - continue; - } - var array = result[word.word]; - if (!array) { - array = []; - result[word.word] = array; - } - array.push({ - startLineNumber: line, - startColumn: word.startColumn, - endLineNumber: line, - endColumn: word.endColumn - }); - } - } - return Promise.resolve(result); - }; - //#endregion - BaseEditorSimpleWorker.prototype.navigateValueSet = function (modelUrl, range, up, wordDef, wordDefFlags) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(null); - } - var wordDefRegExp = new RegExp(wordDef, wordDefFlags); - if (range.startColumn === range.endColumn) { - range = { - startLineNumber: range.startLineNumber, - startColumn: range.startColumn, - endLineNumber: range.endLineNumber, - endColumn: range.endColumn + 1 - }; - } - var selectionText = model.getValueInRange(range); - var wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp); - if (!wordRange) { - return Promise.resolve(null); - } - var word = model.getValueInRange(wordRange); - var result = _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_11__["BasicInplaceReplace"].INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up); - return Promise.resolve(result); - }; - // ---- BEGIN foreign module support -------------------------------------------------------------------------- - BaseEditorSimpleWorker.prototype.loadForeignModule = function (moduleId, createData) { - var _this = this; - var ctx = { - getMirrorModels: function () { - return _this._getModels(); - } + ChainableEvent.prototype.map = function (fn) { + return new ChainableEvent(map(this.event, fn)); }; - if (this._foreignModuleFactory) { - this._foreignModule = this._foreignModuleFactory(ctx, createData); - // static foreing module - var methods = []; - for (var _i = 0, _a = Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_13__["getAllPropertyNames"])(this._foreignModule); _i < _a.length; _i++) { - var prop = _a[_i]; - if (typeof this._foreignModule[prop] === 'function') { - methods.push(prop); + ChainableEvent.prototype.forEach = function (fn) { + return new ChainableEvent(forEach(this.event, fn)); + }; + ChainableEvent.prototype.filter = function (fn) { + return new ChainableEvent(filter(this.event, fn)); + }; + ChainableEvent.prototype.reduce = function (merge, initial) { + return new ChainableEvent(reduce(this.event, merge, initial)); + }; + ChainableEvent.prototype.latch = function () { + return new ChainableEvent(latch(this.event)); + }; + ChainableEvent.prototype.on = function (listener, thisArgs, disposables) { + return this.event(listener, thisArgs, disposables); + }; + ChainableEvent.prototype.once = function (listener, thisArgs, disposables) { + return once(this.event)(listener, thisArgs, disposables); + }; + return ChainableEvent; + }()); + function chain(event) { + return new ChainableEvent(event); + } + Event.chain = chain; + function fromNodeEventEmitter(emitter, eventName, map) { + if (map === void 0) { map = function (id) { return id; }; } + var fn = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return result.fire(map.apply(void 0, args)); + }; + var onFirstListenerAdd = function () { return emitter.on(eventName, fn); }; + var onLastListenerRemove = function () { return emitter.removeListener(eventName, fn); }; + var result = new event_Emitter({ onFirstListenerAdd: onFirstListenerAdd, onLastListenerRemove: onLastListenerRemove }); + return result.event; + } + Event.fromNodeEventEmitter = fromNodeEventEmitter; + function fromPromise(promise) { + var emitter = new event_Emitter(); + var shouldEmit = false; + promise + .then(undefined, function () { return null; }) + .then(function () { + if (!shouldEmit) { + setTimeout(function () { return emitter.fire(undefined); }, 0); + } + else { + emitter.fire(undefined); + } + }); + shouldEmit = true; + return emitter.event; + } + Event.fromPromise = fromPromise; + function toPromise(event) { + return new Promise(function (c) { return once(event)(c); }); + } + Event.toPromise = toPromise; +})(event_Event || (event_Event = {})); +var _globalLeakWarningThreshold = -1; +var LeakageMonitor = /** @class */ (function () { + function LeakageMonitor(customThreshold, name) { + if (name === void 0) { name = Math.random().toString(18).slice(2, 5); } + this.customThreshold = customThreshold; + this.name = name; + this._warnCountdown = 0; + } + LeakageMonitor.prototype.dispose = function () { + if (this._stacks) { + this._stacks.clear(); + } + }; + LeakageMonitor.prototype.check = function (listenerCount) { + var _this = this; + var threshold = _globalLeakWarningThreshold; + if (typeof this.customThreshold === 'number') { + threshold = this.customThreshold; + } + if (threshold <= 0 || listenerCount < threshold) { + return undefined; + } + if (!this._stacks) { + this._stacks = new Map(); + } + var stack = new Error().stack.split('\n').slice(3).join('\n'); + var count = (this._stacks.get(stack) || 0); + this._stacks.set(stack, count + 1); + this._warnCountdown -= 1; + if (this._warnCountdown <= 0) { + // only warn on first exceed and then every time the limit + // is exceeded by 50% again + this._warnCountdown = threshold * 0.5; + // find most frequent listener and print warning + var topStack_1; + var topCount_1 = 0; + this._stacks.forEach(function (count, stack) { + if (!topStack_1 || topCount_1 < count) { + topStack_1 = stack; + topCount_1 = count; + } + }); + console.warn("[" + this.name + "] potential listener LEAK detected, having " + listenerCount + " listeners already. MOST frequent listener (" + topCount_1 + "):"); + console.warn(topStack_1); + } + return function () { + var count = (_this._stacks.get(stack) || 0); + _this._stacks.set(stack, count - 1); + }; + }; + return LeakageMonitor; +}()); +/** + * The Emitter can be used to expose an Event to the public + * to fire it from the insides. + * Sample: + class Document { + + private _onDidChange = new Emitter<(value:string)=>any>(); + + public onDidChange = this._onDidChange.event; + + // getter-style + // get onDidChange(): Event<(value:string)=>any> { + // return this._onDidChange.event; + // } + + private _doIt() { + //... + this._onDidChange.fire(value); + } + } + */ +var event_Emitter = /** @class */ (function () { + function Emitter(options) { + this._disposed = false; + this._options = options; + this._leakageMon = _globalLeakWarningThreshold > 0 + ? new LeakageMonitor(this._options && this._options.leakWarningThreshold) + : undefined; + } + Object.defineProperty(Emitter.prototype, "event", { + /** + * For the public to allow to subscribe + * to events from this Emitter + */ + get: function () { + var _this = this; + if (!this._event) { + this._event = function (listener, thisArgs, disposables) { + if (!_this._listeners) { + _this._listeners = new linkedList_LinkedList(); + } + var firstListener = _this._listeners.isEmpty(); + if (firstListener && _this._options && _this._options.onFirstListenerAdd) { + _this._options.onFirstListenerAdd(_this); + } + var remove = _this._listeners.push(!thisArgs ? listener : [listener, thisArgs]); + if (firstListener && _this._options && _this._options.onFirstListenerDidAdd) { + _this._options.onFirstListenerDidAdd(_this); + } + if (_this._options && _this._options.onListenerDidAdd) { + _this._options.onListenerDidAdd(_this, listener, thisArgs); + } + // check and record this emitter for potential leakage + var removeMonitor; + if (_this._leakageMon) { + removeMonitor = _this._leakageMon.check(_this._listeners.size); + } + var result; + result = { + dispose: function () { + if (removeMonitor) { + removeMonitor(); + } + result.dispose = Emitter._noop; + if (!_this._disposed) { + remove(); + if (_this._options && _this._options.onLastListenerRemove) { + var hasListeners = (_this._listeners && !_this._listeners.isEmpty()); + if (!hasListeners) { + _this._options.onLastListenerRemove(_this); + } + } + } + } + }; + if (Array.isArray(disposables)) { + disposables.push(result); + } + return result; + }; + } + return this._event; + }, + enumerable: true, + configurable: true + }); + /** + * To be kept private to fire an event to + * subscribers + */ + Emitter.prototype.fire = function (event) { + if (this._listeners) { + // put all [listener,event]-pairs into delivery queue + // then emit all event. an inner/nested event might be + // the driver of this + if (!this._deliveryQueue) { + this._deliveryQueue = new linkedList_LinkedList(); + } + for (var iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) { + this._deliveryQueue.push([e.value, event]); + } + while (this._deliveryQueue.size > 0) { + var _a = this._deliveryQueue.shift(), listener = _a[0], event_1 = _a[1]; + try { + if (typeof listener === 'function') { + listener.call(undefined, event_1); + } + else { + listener[0].call(listener[1], event_1); + } + } + catch (e) { + onUnexpectedError(e); } } - return Promise.resolve(methods); - } - // ESM-comment-begin - // return new Promise((resolve, reject) => { - // require([moduleId], (foreignModule: { create: IForeignModuleFactory }) => { - // this._foreignModule = foreignModule.create(ctx, createData); - // - // let methods: string[] = []; - // for (const prop of getAllPropertyNames(this._foreignModule)) { - // if (typeof this._foreignModule[prop] === 'function') { - // methods.push(prop); - // } - // } - // - // resolve(methods); - // - // }, reject); - // }); - // ESM-comment-end - // ESM-uncomment-begin - return Promise.reject(new Error("Unexpected usage")); - // ESM-uncomment-end - }; - // foreign method request - BaseEditorSimpleWorker.prototype.fmr = function (method, args) { - if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') { - return Promise.reject(new Error('Missing requestHandler or method: ' + method)); - } - try { - return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args)); - } - catch (e) { - return Promise.reject(e); } }; - // ---- END diff -------------------------------------------------------------------------- - // ---- BEGIN minimal edits --------------------------------------------------------------- - BaseEditorSimpleWorker._diffLimit = 100000; - // ---- BEGIN suggest -------------------------------------------------------------------------- - BaseEditorSimpleWorker._suggestionsLimit = 10000; - return BaseEditorSimpleWorker; + Emitter.prototype.dispose = function () { + if (this._listeners) { + this._listeners.clear(); + } + if (this._deliveryQueue) { + this._deliveryQueue.clear(); + } + if (this._leakageMon) { + this._leakageMon.dispose(); + } + this._disposed = true; + }; + Emitter._noop = function () { }; + return Emitter; +}()); + +var event_PauseableEmitter = /** @class */ (function (_super) { + event_extends(PauseableEmitter, _super); + function PauseableEmitter(options) { + var _this = _super.call(this, options) || this; + _this._isPaused = 0; + _this._eventQueue = new linkedList_LinkedList(); + _this._mergeFn = options && options.merge; + return _this; + } + PauseableEmitter.prototype.pause = function () { + this._isPaused++; + }; + PauseableEmitter.prototype.resume = function () { + if (this._isPaused !== 0 && --this._isPaused === 0) { + if (this._mergeFn) { + // use the merge function to create a single composite + // event. make a copy in case firing pauses this emitter + var events = this._eventQueue.toArray(); + this._eventQueue.clear(); + _super.prototype.fire.call(this, this._mergeFn(events)); + } + else { + // no merging, fire each event individually and test + // that this emitter isn't paused halfway through + while (!this._isPaused && this._eventQueue.size !== 0) { + _super.prototype.fire.call(this, this._eventQueue.shift()); + } + } + } + }; + PauseableEmitter.prototype.fire = function (event) { + if (this._listeners) { + if (this._isPaused !== 0) { + this._eventQueue.push(event); + } + else { + _super.prototype.fire.call(this, event); + } + } + }; + return PauseableEmitter; +}(event_Emitter)); + +var event_EventMultiplexer = /** @class */ (function () { + function EventMultiplexer() { + var _this = this; + this.hasListeners = false; + this.events = []; + this.emitter = new event_Emitter({ + onFirstListenerAdd: function () { return _this.onFirstListenerAdd(); }, + onLastListenerRemove: function () { return _this.onLastListenerRemove(); } + }); + } + Object.defineProperty(EventMultiplexer.prototype, "event", { + get: function () { + return this.emitter.event; + }, + enumerable: true, + configurable: true + }); + EventMultiplexer.prototype.add = function (event) { + var _this = this; + var e = { event: event, listener: null }; + this.events.push(e); + if (this.hasListeners) { + this.hook(e); + } + var dispose = function () { + if (_this.hasListeners) { + _this.unhook(e); + } + var idx = _this.events.indexOf(e); + _this.events.splice(idx, 1); + }; + return toDisposable(functional_once(dispose)); + }; + EventMultiplexer.prototype.onFirstListenerAdd = function () { + var _this = this; + this.hasListeners = true; + this.events.forEach(function (e) { return _this.hook(e); }); + }; + EventMultiplexer.prototype.onLastListenerRemove = function () { + var _this = this; + this.hasListeners = false; + this.events.forEach(function (e) { return _this.unhook(e); }); + }; + EventMultiplexer.prototype.hook = function (e) { + var _this = this; + e.listener = e.event(function (r) { return _this.emitter.fire(r); }); + }; + EventMultiplexer.prototype.unhook = function (e) { + if (e.listener) { + e.listener.dispose(); + } + e.listener = null; + }; + EventMultiplexer.prototype.dispose = function () { + this.emitter.dispose(); + }; + return EventMultiplexer; }()); /** - * @internal + * The EventBufferer is useful in situations in which you want + * to delay firing your events during some code. + * You can wrap that code and be sure that the event will not + * be fired during that wrap. + * + * ``` + * const emitter: Emitter; + * const delayer = new EventDelayer(); + * const delayedEvent = delayer.wrapEvent(emitter.event); + * + * delayedEvent(console.log); + * + * delayer.bufferEvents(() => { + * emitter.fire(); // event will not be fired yet + * }); + * + * // event will only be fired at this point + * ``` */ -var EditorSimpleWorkerImpl = /** @class */ (function (_super) { - __extends(EditorSimpleWorkerImpl, _super); - function EditorSimpleWorkerImpl(foreignModuleFactory) { - var _this = _super.call(this, foreignModuleFactory) || this; - _this._models = Object.create(null); - return _this; +var EventBufferer = /** @class */ (function () { + function EventBufferer() { + this.buffers = []; } - EditorSimpleWorkerImpl.prototype.dispose = function () { - this._models = Object.create(null); - }; - EditorSimpleWorkerImpl.prototype._getModel = function (uri) { - return this._models[uri]; - }; - EditorSimpleWorkerImpl.prototype._getModels = function () { + EventBufferer.prototype.wrapEvent = function (event) { var _this = this; - var all = []; - Object.keys(this._models).forEach(function (key) { return all.push(_this._models[key]); }); - return all; + return function (listener, thisArgs, disposables) { + return event(function (i) { + var buffer = _this.buffers[_this.buffers.length - 1]; + if (buffer) { + buffer.push(function () { return listener.call(thisArgs, i); }); + } + else { + listener.call(thisArgs, i); + } + }, undefined, disposables); + }; }; - EditorSimpleWorkerImpl.prototype.acceptNewModel = function (data) { - this._models[data.url] = new MirrorModel(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"].parse(data.url), data.lines, data.EOL, data.versionId); + EventBufferer.prototype.bufferEvents = function (fn) { + var buffer = []; + this.buffers.push(buffer); + var r = fn(); + this.buffers.pop(); + buffer.forEach(function (flush) { return flush(); }); + return r; }; - EditorSimpleWorkerImpl.prototype.acceptModelChanged = function (strURL, e) { - if (!this._models[strURL]) { - return; - } - var model = this._models[strURL]; - model.onEvents(e); - }; - EditorSimpleWorkerImpl.prototype.acceptRemovedModel = function (strURL) { - if (!this._models[strURL]) { - return; - } - delete this._models[strURL]; - }; - return EditorSimpleWorkerImpl; -}(BaseEditorSimpleWorker)); + return EventBufferer; +}()); /** - * Called on the worker side - * @internal + * A Relay is an event forwarder which functions as a replugabble event pipe. + * Once created, you can connect an input event to it and it will simply forward + * events from that input event through its own `event` property. The `input` + * can be changed at any point in time. */ -function create() { - return new EditorSimpleWorkerImpl(null); -} -if (typeof importScripts === 'function') { - // Running in a web worker - _base_common_platform_js__WEBPACK_IMPORTED_MODULE_3__["globals"].monaco = Object(_standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_12__["createMonacoBaseAPI"])(); -} +var event_Relay = /** @class */ (function () { + function Relay() { + var _this = this; + this.listening = false; + this.inputEvent = event_Event.None; + this.inputEventListener = Disposable.None; + this.emitter = new event_Emitter({ + onFirstListenerDidAdd: function () { + _this.listening = true; + _this.inputEventListener = _this.inputEvent(_this.emitter.fire, _this.emitter); + }, + onLastListenerRemove: function () { + _this.listening = false; + _this.inputEventListener.dispose(); + } + }); + this.event = this.emitter.event; + } + Object.defineProperty(Relay.prototype, "input", { + set: function (event) { + this.inputEvent = event; + if (this.listening) { + this.inputEventListener.dispose(); + this.inputEventListener = event(this.emitter.fire, this.emitter); + } + }, + enumerable: true, + configurable: true + }); + Relay.prototype.dispose = function () { + this.inputEventListener.dispose(); + this.emitter.dispose(); + }; + return Relay; +}()); -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js ***! - \*************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/*! -Copyright (c) 2014 Taylor Hakes -Copyright (c) 2014 Forbes Lindesay - */ -(function (global, factory) { - true ? factory() : - undefined; -}(this, (function () { - 'use strict'; - - /** - * @this {Promise} - */ - function finallyConstructor(callback) { - var constructor = this.constructor; - return this.then( - function (value) { - return constructor.resolve(callback()).then(function () { - return value; - }); - }, - function (reason) { - return constructor.resolve(callback()).then(function () { - return constructor.reject(reason); - }); - } - ); - } - - // Store setTimeout reference so promise-polyfill will be unaffected by - // other code modifying setTimeout (like sinon.useFakeTimers()) - var setTimeoutFunc = setTimeout; - - function noop() { } - - // Polyfill for Function.prototype.bind - function bind(fn, thisArg) { - return function () { - fn.apply(thisArg, arguments); - }; - } - - /** - * @constructor - * @param {Function} fn - */ - function Promise(fn) { - if (!(this instanceof Promise)) - throw new TypeError('Promises must be constructed via new'); - if (typeof fn !== 'function') throw new TypeError('not a function'); - /** @type {!number} */ - this._state = 0; - /** @type {!boolean} */ - this._handled = false; - /** @type {Promise|undefined} */ - this._value = undefined; - /** @type {!Array} */ - this._deferreds = []; - - doResolve(fn, this); - } - - function handle(self, deferred) { - while (self._state === 3) { - self = self._value; - } - if (self._state === 0) { - self._deferreds.push(deferred); - return; - } - self._handled = true; - Promise._immediateFn(function () { - var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; - if (cb === null) { - (self._state === 1 ? resolve : reject)(deferred.promise, self._value); - return; - } - var ret; - try { - ret = cb(self._value); - } catch (e) { - reject(deferred.promise, e); - return; - } - resolve(deferred.promise, ret); - }); - } - - function resolve(self, newValue) { - try { - // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure - if (newValue === self) - throw new TypeError('A promise cannot be resolved with itself.'); - if ( - newValue && - (typeof newValue === 'object' || typeof newValue === 'function') - ) { - var then = newValue.then; - if (newValue instanceof Promise) { - self._state = 3; - self._value = newValue; - finale(self); - return; - } else if (typeof then === 'function') { - doResolve(bind(then, newValue), self); - return; - } - } - self._state = 1; - self._value = newValue; - finale(self); - } catch (e) { - reject(self, e); - } - } - - function reject(self, newValue) { - self._state = 2; - self._value = newValue; - finale(self); - } - - function finale(self) { - if (self._state === 2 && self._deferreds.length === 0) { - Promise._immediateFn(function () { - if (!self._handled) { - Promise._unhandledRejectionFn(self._value); - } - }); - } - - for (var i = 0, len = self._deferreds.length; i < len; i++) { - handle(self, self._deferreds[i]); - } - self._deferreds = null; - } - - /** - * @constructor - */ - function Handler(onFulfilled, onRejected, promise) { - this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; - this.onRejected = typeof onRejected === 'function' ? onRejected : null; - this.promise = promise; - } - - /** - * Take a potentially misbehaving resolver function and make sure - * onFulfilled and onRejected are only called once. - * - * Makes no guarantees about asynchrony. - */ - function doResolve(fn, self) { - var done = false; - try { - fn( - function (value) { - if (done) return; - done = true; - resolve(self, value); - }, - function (reason) { - if (done) return; - done = true; - reject(self, reason); - } - ); - } catch (ex) { - if (done) return; - done = true; - reject(self, ex); - } - } - - Promise.prototype['catch'] = function (onRejected) { - return this.then(null, onRejected); - }; - - Promise.prototype.then = function (onFulfilled, onRejected) { - // @ts-ignore - var prom = new this.constructor(noop); - - handle(this, new Handler(onFulfilled, onRejected, prom)); - return prom; - }; - - Promise.prototype['finally'] = finallyConstructor; - - Promise.all = function (arr) { - return new Promise(function (resolve, reject) { - if (!arr || typeof arr.length === 'undefined') - throw new TypeError('Promise.all accepts an array'); - var args = Array.prototype.slice.call(arr); - if (args.length === 0) return resolve([]); - var remaining = args.length; - - function res(i, val) { - try { - if (val && (typeof val === 'object' || typeof val === 'function')) { - var then = val.then; - if (typeof then === 'function') { - then.call( - val, - function (val) { - res(i, val); - }, - reject - ); - return; - } - } - args[i] = val; - if (--remaining === 0) { - resolve(args); - } - } catch (ex) { - reject(ex); - } - } - - for (var i = 0; i < args.length; i++) { - res(i, args[i]); - } - }); - }; - - Promise.resolve = function (value) { - if (value && typeof value === 'object' && value.constructor === Promise) { - return value; - } - - return new Promise(function (resolve) { - resolve(value); - }); - }; - - Promise.reject = function (value) { - return new Promise(function (resolve, reject) { - reject(value); - }); - }; - - Promise.race = function (values) { - return new Promise(function (resolve, reject) { - for (var i = 0, len = values.length; i < len; i++) { - values[i].then(resolve, reject); - } - }); - }; - - // Use polyfill for setImmediate for performance gains - Promise._immediateFn = - (typeof setImmediate === 'function' && - function (fn) { - setImmediate(fn); - }) || - function (fn) { - setTimeoutFunc(fn, 0); - }; - - Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { - if (typeof console !== 'undefined' && console) { - console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console - } - }; - - /** @suppress {undefinedVars} */ - var globalNS = (function () { - // the only reliable means to get the global object is - // `Function('return this')()` - // However, this causes CSP violations in Chrome apps. - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('unable to locate global object'); - })(); - - if (!('Promise' in globalNS)) { - globalNS['Promise'] = Promise; - } else if (!globalNS.Promise.prototype['finally']) { - globalNS.Promise.prototype['finally'] = finallyConstructor; - } - -}))); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js ***! - \**************************************************************************************/ -/*! exports provided: KeyMod, createMonacoBaseAPI */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyMod", function() { return KeyMod; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMonacoBaseAPI", function() { return createMonacoBaseAPI; }); -/* harmony import */ var _promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./promise-polyfill/polyfill.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js"); -/* harmony import */ var _promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _core_token_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../core/token.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js"); -/* harmony import */ var _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./standaloneEnums.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/cancellation.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - - - - - - - - - -var KeyMod = /** @class */ (function () { - function KeyMod() { +var shortcutEvent = Object.freeze(function (callback, context) { + var handle = setTimeout(callback.bind(context), 0); + return { dispose: function () { clearTimeout(handle); } }; +}); +var cancellation_CancellationToken; +(function (CancellationToken) { + function isCancellationToken(thing) { + if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) { + return true; + } + if (thing instanceof cancellation_MutableToken) { + return true; + } + if (!thing || typeof thing !== 'object') { + return false; + } + return typeof thing.isCancellationRequested === 'boolean' + && typeof thing.onCancellationRequested === 'function'; } - KeyMod.chord = function (firstPart, secondPart) { - return Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_3__["KeyChord"])(firstPart, secondPart); + CancellationToken.isCancellationToken = isCancellationToken; + CancellationToken.None = Object.freeze({ + isCancellationRequested: false, + onCancellationRequested: event_Event.None + }); + CancellationToken.Cancelled = Object.freeze({ + isCancellationRequested: true, + onCancellationRequested: shortcutEvent + }); +})(cancellation_CancellationToken || (cancellation_CancellationToken = {})); +var cancellation_MutableToken = /** @class */ (function () { + function MutableToken() { + this._isCancelled = false; + this._emitter = null; + } + MutableToken.prototype.cancel = function () { + if (!this._isCancelled) { + this._isCancelled = true; + if (this._emitter) { + this._emitter.fire(undefined); + this.dispose(); + } + } }; - KeyMod.CtrlCmd = 2048 /* CtrlCmd */; - KeyMod.Shift = 1024 /* Shift */; - KeyMod.Alt = 512 /* Alt */; - KeyMod.WinCtrl = 256 /* WinCtrl */; - return KeyMod; + Object.defineProperty(MutableToken.prototype, "isCancellationRequested", { + get: function () { + return this._isCancelled; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MutableToken.prototype, "onCancellationRequested", { + get: function () { + if (this._isCancelled) { + return shortcutEvent; + } + if (!this._emitter) { + this._emitter = new event_Emitter(); + } + return this._emitter.event; + }, + enumerable: true, + configurable: true + }); + MutableToken.prototype.dispose = function () { + if (this._emitter) { + this._emitter.dispose(); + this._emitter = null; + } + }; + return MutableToken; +}()); +var CancellationTokenSource = /** @class */ (function () { + function CancellationTokenSource(parent) { + this._token = undefined; + this._parentListener = undefined; + this._parentListener = parent && parent.onCancellationRequested(this.cancel, this); + } + Object.defineProperty(CancellationTokenSource.prototype, "token", { + get: function () { + if (!this._token) { + // be lazy and create the token only when + // actually needed + this._token = new cancellation_MutableToken(); + } + return this._token; + }, + enumerable: true, + configurable: true + }); + CancellationTokenSource.prototype.cancel = function () { + if (!this._token) { + // save an object by returning the default + // cancelled token when cancellation happens + // before someone asks for the token + this._token = cancellation_CancellationToken.Cancelled; + } + else if (this._token instanceof cancellation_MutableToken) { + // actually cancel + this._token.cancel(); + } + }; + CancellationTokenSource.prototype.dispose = function () { + if (this._parentListener) { + this._parentListener.dispose(); + } + if (!this._token) { + // ensure to initialize with an empty token if we had none + this._token = cancellation_CancellationToken.None; + } + else if (this._token instanceof cancellation_MutableToken) { + // actually dispose + this._token.dispose(); + } + }; + return CancellationTokenSource; }()); -function createMonacoBaseAPI() { - return { - editor: undefined, - languages: undefined, - CancellationTokenSource: _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationTokenSource"], - Emitter: _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"], - KeyCode: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["KeyCode"], - KeyMod: KeyMod, - Position: _core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"], - Range: _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"], - Selection: _core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"], - SelectionDirection: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["SelectionDirection"], - MarkerSeverity: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["MarkerSeverity"], - MarkerTag: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["MarkerTag"], - Uri: _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"], - Token: _core_token_js__WEBPACK_IMPORTED_MODULE_8__["Token"] + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var KeyCodeStrMap = /** @class */ (function () { + function KeyCodeStrMap() { + this._keyCodeToStr = []; + this._strToKeyCode = Object.create(null); + } + KeyCodeStrMap.prototype.define = function (keyCode, str) { + this._keyCodeToStr[keyCode] = str; + this._strToKeyCode[str.toLowerCase()] = keyCode; }; + KeyCodeStrMap.prototype.keyCodeToStr = function (keyCode) { + return this._keyCodeToStr[keyCode]; + }; + KeyCodeStrMap.prototype.strToKeyCode = function (str) { + return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */; + }; + return KeyCodeStrMap; +}()); +var uiMap = new KeyCodeStrMap(); +var userSettingsUSMap = new KeyCodeStrMap(); +var userSettingsGeneralMap = new KeyCodeStrMap(); +(function () { + function define(keyCode, uiLabel, usUserSettingsLabel, generalUserSettingsLabel) { + if (usUserSettingsLabel === void 0) { usUserSettingsLabel = uiLabel; } + if (generalUserSettingsLabel === void 0) { generalUserSettingsLabel = usUserSettingsLabel; } + uiMap.define(keyCode, uiLabel); + userSettingsUSMap.define(keyCode, usUserSettingsLabel); + userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel); + } + define(0 /* Unknown */, 'unknown'); + define(1 /* Backspace */, 'Backspace'); + define(2 /* Tab */, 'Tab'); + define(3 /* Enter */, 'Enter'); + define(4 /* Shift */, 'Shift'); + define(5 /* Ctrl */, 'Ctrl'); + define(6 /* Alt */, 'Alt'); + define(7 /* PauseBreak */, 'PauseBreak'); + define(8 /* CapsLock */, 'CapsLock'); + define(9 /* Escape */, 'Escape'); + define(10 /* Space */, 'Space'); + define(11 /* PageUp */, 'PageUp'); + define(12 /* PageDown */, 'PageDown'); + define(13 /* End */, 'End'); + define(14 /* Home */, 'Home'); + define(15 /* LeftArrow */, 'LeftArrow', 'Left'); + define(16 /* UpArrow */, 'UpArrow', 'Up'); + define(17 /* RightArrow */, 'RightArrow', 'Right'); + define(18 /* DownArrow */, 'DownArrow', 'Down'); + define(19 /* Insert */, 'Insert'); + define(20 /* Delete */, 'Delete'); + define(21 /* KEY_0 */, '0'); + define(22 /* KEY_1 */, '1'); + define(23 /* KEY_2 */, '2'); + define(24 /* KEY_3 */, '3'); + define(25 /* KEY_4 */, '4'); + define(26 /* KEY_5 */, '5'); + define(27 /* KEY_6 */, '6'); + define(28 /* KEY_7 */, '7'); + define(29 /* KEY_8 */, '8'); + define(30 /* KEY_9 */, '9'); + define(31 /* KEY_A */, 'A'); + define(32 /* KEY_B */, 'B'); + define(33 /* KEY_C */, 'C'); + define(34 /* KEY_D */, 'D'); + define(35 /* KEY_E */, 'E'); + define(36 /* KEY_F */, 'F'); + define(37 /* KEY_G */, 'G'); + define(38 /* KEY_H */, 'H'); + define(39 /* KEY_I */, 'I'); + define(40 /* KEY_J */, 'J'); + define(41 /* KEY_K */, 'K'); + define(42 /* KEY_L */, 'L'); + define(43 /* KEY_M */, 'M'); + define(44 /* KEY_N */, 'N'); + define(45 /* KEY_O */, 'O'); + define(46 /* KEY_P */, 'P'); + define(47 /* KEY_Q */, 'Q'); + define(48 /* KEY_R */, 'R'); + define(49 /* KEY_S */, 'S'); + define(50 /* KEY_T */, 'T'); + define(51 /* KEY_U */, 'U'); + define(52 /* KEY_V */, 'V'); + define(53 /* KEY_W */, 'W'); + define(54 /* KEY_X */, 'X'); + define(55 /* KEY_Y */, 'Y'); + define(56 /* KEY_Z */, 'Z'); + define(57 /* Meta */, 'Meta'); + define(58 /* ContextMenu */, 'ContextMenu'); + define(59 /* F1 */, 'F1'); + define(60 /* F2 */, 'F2'); + define(61 /* F3 */, 'F3'); + define(62 /* F4 */, 'F4'); + define(63 /* F5 */, 'F5'); + define(64 /* F6 */, 'F6'); + define(65 /* F7 */, 'F7'); + define(66 /* F8 */, 'F8'); + define(67 /* F9 */, 'F9'); + define(68 /* F10 */, 'F10'); + define(69 /* F11 */, 'F11'); + define(70 /* F12 */, 'F12'); + define(71 /* F13 */, 'F13'); + define(72 /* F14 */, 'F14'); + define(73 /* F15 */, 'F15'); + define(74 /* F16 */, 'F16'); + define(75 /* F17 */, 'F17'); + define(76 /* F18 */, 'F18'); + define(77 /* F19 */, 'F19'); + define(78 /* NumLock */, 'NumLock'); + define(79 /* ScrollLock */, 'ScrollLock'); + define(80 /* US_SEMICOLON */, ';', ';', 'OEM_1'); + define(81 /* US_EQUAL */, '=', '=', 'OEM_PLUS'); + define(82 /* US_COMMA */, ',', ',', 'OEM_COMMA'); + define(83 /* US_MINUS */, '-', '-', 'OEM_MINUS'); + define(84 /* US_DOT */, '.', '.', 'OEM_PERIOD'); + define(85 /* US_SLASH */, '/', '/', 'OEM_2'); + define(86 /* US_BACKTICK */, '`', '`', 'OEM_3'); + define(110 /* ABNT_C1 */, 'ABNT_C1'); + define(111 /* ABNT_C2 */, 'ABNT_C2'); + define(87 /* US_OPEN_SQUARE_BRACKET */, '[', '[', 'OEM_4'); + define(88 /* US_BACKSLASH */, '\\', '\\', 'OEM_5'); + define(89 /* US_CLOSE_SQUARE_BRACKET */, ']', ']', 'OEM_6'); + define(90 /* US_QUOTE */, '\'', '\'', 'OEM_7'); + define(91 /* OEM_8 */, 'OEM_8'); + define(92 /* OEM_102 */, 'OEM_102'); + define(93 /* NUMPAD_0 */, 'NumPad0'); + define(94 /* NUMPAD_1 */, 'NumPad1'); + define(95 /* NUMPAD_2 */, 'NumPad2'); + define(96 /* NUMPAD_3 */, 'NumPad3'); + define(97 /* NUMPAD_4 */, 'NumPad4'); + define(98 /* NUMPAD_5 */, 'NumPad5'); + define(99 /* NUMPAD_6 */, 'NumPad6'); + define(100 /* NUMPAD_7 */, 'NumPad7'); + define(101 /* NUMPAD_8 */, 'NumPad8'); + define(102 /* NUMPAD_9 */, 'NumPad9'); + define(103 /* NUMPAD_MULTIPLY */, 'NumPad_Multiply'); + define(104 /* NUMPAD_ADD */, 'NumPad_Add'); + define(105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator'); + define(106 /* NUMPAD_SUBTRACT */, 'NumPad_Subtract'); + define(107 /* NUMPAD_DECIMAL */, 'NumPad_Decimal'); + define(108 /* NUMPAD_DIVIDE */, 'NumPad_Divide'); +})(); +var KeyCodeUtils; +(function (KeyCodeUtils) { + function toString(keyCode) { + return uiMap.keyCodeToStr(keyCode); + } + KeyCodeUtils.toString = toString; + function fromString(key) { + return uiMap.strToKeyCode(key); + } + KeyCodeUtils.fromString = fromString; + function toUserSettingsUS(keyCode) { + return userSettingsUSMap.keyCodeToStr(keyCode); + } + KeyCodeUtils.toUserSettingsUS = toUserSettingsUS; + function toUserSettingsGeneral(keyCode) { + return userSettingsGeneralMap.keyCodeToStr(keyCode); + } + KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral; + function fromUserSettings(key) { + return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); + } + KeyCodeUtils.fromUserSettings = fromUserSettings; +})(KeyCodeUtils || (KeyCodeUtils = {})); +function KeyChord(firstPart, secondPart) { + var chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0; + return (firstPart | chordPart) >>> 0; } +function createKeybinding(keybinding, OS) { + if (keybinding === 0) { + return null; + } + var firstPart = (keybinding & 0x0000FFFF) >>> 0; + var chordPart = (keybinding & 0xFFFF0000) >>> 16; + if (chordPart !== 0) { + return new keyCodes_ChordKeybinding([ + createSimpleKeybinding(firstPart, OS), + createSimpleKeybinding(chordPart, OS) + ]); + } + return new keyCodes_ChordKeybinding([createSimpleKeybinding(firstPart, OS)]); +} +function createSimpleKeybinding(keybinding, OS) { + var ctrlCmd = (keybinding & 2048 /* CtrlCmd */ ? true : false); + var winCtrl = (keybinding & 256 /* WinCtrl */ ? true : false); + var ctrlKey = (OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd); + var shiftKey = (keybinding & 1024 /* Shift */ ? true : false); + var altKey = (keybinding & 512 /* Alt */ ? true : false); + var metaKey = (OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl); + var keyCode = (keybinding & 255 /* KeyCode */); + return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode); +} +var SimpleKeybinding = /** @class */ (function () { + function SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode) { + this.ctrlKey = ctrlKey; + this.shiftKey = shiftKey; + this.altKey = altKey; + this.metaKey = metaKey; + this.keyCode = keyCode; + } + SimpleKeybinding.prototype.equals = function (other) { + return (this.ctrlKey === other.ctrlKey + && this.shiftKey === other.shiftKey + && this.altKey === other.altKey + && this.metaKey === other.metaKey + && this.keyCode === other.keyCode); + }; + SimpleKeybinding.prototype.isModifierKey = function () { + return (this.keyCode === 0 /* Unknown */ + || this.keyCode === 5 /* Ctrl */ + || this.keyCode === 57 /* Meta */ + || this.keyCode === 6 /* Alt */ + || this.keyCode === 4 /* Shift */); + }; + SimpleKeybinding.prototype.toChord = function () { + return new keyCodes_ChordKeybinding([this]); + }; + /** + * Does this keybinding refer to the key code of a modifier and it also has the modifier flag? + */ + SimpleKeybinding.prototype.isDuplicateModifierCase = function () { + return ((this.ctrlKey && this.keyCode === 5 /* Ctrl */) + || (this.shiftKey && this.keyCode === 4 /* Shift */) + || (this.altKey && this.keyCode === 6 /* Alt */) + || (this.metaKey && this.keyCode === 57 /* Meta */)); + }; + return SimpleKeybinding; +}()); + +var keyCodes_ChordKeybinding = /** @class */ (function () { + function ChordKeybinding(parts) { + if (parts.length === 0) { + throw illegalArgument("parts"); + } + this.parts = parts; + } + ChordKeybinding.prototype.equals = function (other) { + if (other === null) { + return false; + } + if (this.parts.length !== other.parts.length) { + return false; + } + for (var i = 0; i < this.parts.length; i++) { + if (!this.parts[i].equals(other.parts[i])) { + return false; + } + } + return true; + }; + return ChordKeybinding; +}()); + +var ResolvedKeybindingPart = /** @class */ (function () { + function ResolvedKeybindingPart(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) { + this.ctrlKey = ctrlKey; + this.shiftKey = shiftKey; + this.altKey = altKey; + this.metaKey = metaKey; + this.keyLabel = kbLabel; + this.keyAriaLabel = kbAriaLabel; + } + return ResolvedKeybindingPart; +}()); + +/** + * A resolved keybinding. Can be a simple keybinding or a chord keybinding. + */ +var ResolvedKeybinding = /** @class */ (function () { + function ResolvedKeybinding() { + } + return ResolvedKeybinding; +}()); -/***/ }), +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var selection_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js ***! - \***************************************************************************************/ -/*! exports provided: MarkerTag, MarkerSeverity, KeyCode, SelectionDirection, ScrollbarVisibility, OverviewRulerLane, EndOfLinePreference, DefaultEndOfLine, EndOfLineSequence, TrackedRangeStickiness, ScrollType, CursorChangeReason, RenderMinimap, WrappingIndent, TextEditorCursorBlinkingStyle, TextEditorCursorStyle, RenderLineNumbersType, ContentWidgetPositionPreference, OverlayWidgetPositionPreference, MouseTargetType, IndentAction, CompletionItemKind, CompletionItemInsertTextRule, CompletionTriggerKind, SignatureHelpTriggerKind, DocumentHighlightKind, SymbolKind */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerTag", function() { return MarkerTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerSeverity", function() { return MarkerSeverity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCode", function() { return KeyCode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionDirection", function() { return SelectionDirection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollbarVisibility", function() { return ScrollbarVisibility; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverviewRulerLane", function() { return OverviewRulerLane; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLinePreference", function() { return EndOfLinePreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultEndOfLine", function() { return DefaultEndOfLine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLineSequence", function() { return EndOfLineSequence; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackedRangeStickiness", function() { return TrackedRangeStickiness; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollType", function() { return ScrollType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorChangeReason", function() { return CursorChangeReason; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderMinimap", function() { return RenderMinimap; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WrappingIndent", function() { return WrappingIndent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorBlinkingStyle", function() { return TextEditorCursorBlinkingStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorStyle", function() { return TextEditorCursorStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderLineNumbersType", function() { return RenderLineNumbersType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentWidgetPositionPreference", function() { return ContentWidgetPositionPreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverlayWidgetPositionPreference", function() { return OverlayWidgetPositionPreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MouseTargetType", function() { return MouseTargetType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentAction", function() { return IndentAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemInsertTextRule", function() { return CompletionItemInsertTextRule; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionTriggerKind", function() { return CompletionTriggerKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureHelpTriggerKind", function() { return SignatureHelpTriggerKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; }); +/** + * A selection in the editor. + * The selection is a range that has an orientation. + */ +var selection_Selection = /** @class */ (function (_super) { + selection_extends(Selection, _super); + function Selection(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) { + var _this = _super.call(this, selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) || this; + _this.selectionStartLineNumber = selectionStartLineNumber; + _this.selectionStartColumn = selectionStartColumn; + _this.positionLineNumber = positionLineNumber; + _this.positionColumn = positionColumn; + return _this; + } + /** + * Clone this selection. + */ + Selection.prototype.clone = function () { + return new Selection(this.selectionStartLineNumber, this.selectionStartColumn, this.positionLineNumber, this.positionColumn); + }; + /** + * Transform to a human-readable representation. + */ + Selection.prototype.toString = function () { + return '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']'; + }; + /** + * Test if equals other selection. + */ + Selection.prototype.equalsSelection = function (other) { + return (Selection.selectionsEqual(this, other)); + }; + /** + * Test if the two selections are equal. + */ + Selection.selectionsEqual = function (a, b) { + return (a.selectionStartLineNumber === b.selectionStartLineNumber && + a.selectionStartColumn === b.selectionStartColumn && + a.positionLineNumber === b.positionLineNumber && + a.positionColumn === b.positionColumn); + }; + /** + * Get directions (LTR or RTL). + */ + Selection.prototype.getDirection = function () { + if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) { + return 0 /* LTR */; + } + return 1 /* RTL */; + }; + /** + * Create a new selection with a different `positionLineNumber` and `positionColumn`. + */ + Selection.prototype.setEndPosition = function (endLineNumber, endColumn) { + if (this.getDirection() === 0 /* LTR */) { + return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn); + } + return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn); + }; + /** + * Get the position at `positionLineNumber` and `positionColumn`. + */ + Selection.prototype.getPosition = function () { + return new Position(this.positionLineNumber, this.positionColumn); + }; + /** + * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. + */ + Selection.prototype.setStartPosition = function (startLineNumber, startColumn) { + if (this.getDirection() === 0 /* LTR */) { + return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn); + } + return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn); + }; + // ---- + /** + * Create a `Selection` from one or two positions + */ + Selection.fromPositions = function (start, end) { + if (end === void 0) { end = start; } + return new Selection(start.lineNumber, start.column, end.lineNumber, end.column); + }; + /** + * Create a `Selection` from an `ISelection`. + */ + Selection.liftSelection = function (sel) { + return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn); + }; + /** + * `a` equals `b`. + */ + Selection.selectionsArrEqual = function (a, b) { + if (a && !b || !a && b) { + return false; + } + if (!a && !b) { + return true; + } + if (a.length !== b.length) { + return false; + } + for (var i = 0, len = a.length; i < len; i++) { + if (!this.selectionsEqual(a[i], b[i])) { + return false; + } + } + return true; + }; + /** + * Test if `obj` is an `ISelection`. + */ + Selection.isISelection = function (obj) { + return (obj + && (typeof obj.selectionStartLineNumber === 'number') + && (typeof obj.selectionStartColumn === 'number') + && (typeof obj.positionLineNumber === 'number') + && (typeof obj.positionColumn === 'number')); + }; + /** + * Create with a direction. + */ + Selection.createWithDirection = function (startLineNumber, startColumn, endLineNumber, endColumn, direction) { + if (direction === 0 /* LTR */) { + return new Selection(startLineNumber, startColumn, endLineNumber, endColumn); + } + return new Selection(endLineNumber, endColumn, startLineNumber, startColumn); + }; + return Selection; +}(range_Range)); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/token.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var Token = /** @class */ (function () { + function Token(offset, type, language) { + this.offset = offset | 0; // @perf + this.type = type; + this.language = language; + } + Token.prototype.toString = function () { + return '(' + this.offset + ', ' + this.type + ')'; + }; + return Token; +}()); + +var TokenizationResult = /** @class */ (function () { + function TokenizationResult(tokens, endState) { + this.tokens = tokens; + this.endState = endState; + } + return TokenizationResult; +}()); + +var TokenizationResult2 = /** @class */ (function () { + function TokenizationResult2(tokens, endState) { + this.tokens = tokens; + this.endState = endState; + } + return TokenizationResult2; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -8151,238 +6909,603 @@ var SymbolKind; SymbolKind[SymbolKind["TypeParameter"] = 25] = "TypeParameter"; })(SymbolKind || (SymbolKind = {})); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js ***! - \****************************************************************************************/ -/*! exports provided: PrefixSumIndexOfResult, PrefixSumComputer, PrefixSumComputerWithCache */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumIndexOfResult", function() { return PrefixSumIndexOfResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumComputer", function() { return PrefixSumComputer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumComputerWithCache", function() { return PrefixSumComputerWithCache; }); -/* harmony import */ var _core_uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/uint.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var PrefixSumIndexOfResult = /** @class */ (function () { - function PrefixSumIndexOfResult(index, remainder) { - this.index = index; - this.remainder = remainder; + + + + + + + + + +var standaloneBase_KeyMod = /** @class */ (function () { + function KeyMod() { } - return PrefixSumIndexOfResult; + KeyMod.chord = function (firstPart, secondPart) { + return KeyChord(firstPart, secondPart); + }; + KeyMod.CtrlCmd = 2048 /* CtrlCmd */; + KeyMod.Shift = 1024 /* Shift */; + KeyMod.Alt = 512 /* Alt */; + KeyMod.WinCtrl = 256 /* WinCtrl */; + return KeyMod; }()); -var PrefixSumComputer = /** @class */ (function () { - function PrefixSumComputer(values) { - this.values = values; - this.prefixSum = new Uint32Array(values.length); - this.prefixSumValidIndex = new Int32Array(1); - this.prefixSumValidIndex[0] = -1; +function createMonacoBaseAPI() { + return { + editor: undefined, + languages: undefined, + CancellationTokenSource: CancellationTokenSource, + Emitter: event_Emitter, + KeyCode: KeyCode, + KeyMod: standaloneBase_KeyMod, + Position: Position, + Range: range_Range, + Selection: selection_Selection, + SelectionDirection: SelectionDirection, + MarkerSeverity: MarkerSeverity, + MarkerTag: MarkerTag, + Uri: uri_URI, + Token: Token + }; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var editorSimpleWorker_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + + + + + + + + + + + +/** + * @internal + */ +var editorSimpleWorker_MirrorModel = /** @class */ (function (_super) { + editorSimpleWorker_extends(MirrorModel, _super); + function MirrorModel() { + return _super !== null && _super.apply(this, arguments) || this; } - PrefixSumComputer.prototype.getCount = function () { - return this.values.length; + Object.defineProperty(MirrorModel.prototype, "uri", { + get: function () { + return this._uri; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MirrorModel.prototype, "version", { + get: function () { + return this._versionId; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MirrorModel.prototype, "eol", { + get: function () { + return this._eol; + }, + enumerable: true, + configurable: true + }); + MirrorModel.prototype.getValue = function () { + return this.getText(); }; - PrefixSumComputer.prototype.insertValues = function (insertIndex, insertValues) { - insertIndex = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(insertIndex); - var oldValues = this.values; - var oldPrefixSum = this.prefixSum; - var insertValuesLen = insertValues.length; - if (insertValuesLen === 0) { - return false; - } - this.values = new Uint32Array(oldValues.length + insertValuesLen); - this.values.set(oldValues.subarray(0, insertIndex), 0); - this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen); - this.values.set(insertValues, insertIndex); - if (insertIndex - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = insertIndex - 1; - } - this.prefixSum = new Uint32Array(this.values.length); - if (this.prefixSumValidIndex[0] >= 0) { - this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); - } - return true; + MirrorModel.prototype.getLinesContent = function () { + return this._lines.slice(0); }; - PrefixSumComputer.prototype.changeValue = function (index, value) { - index = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index); - value = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(value); - if (this.values[index] === value) { - return false; - } - this.values[index] = value; - if (index - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = index - 1; - } - return true; + MirrorModel.prototype.getLineCount = function () { + return this._lines.length; }; - PrefixSumComputer.prototype.removeValues = function (startIndex, cnt) { - startIndex = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(startIndex); - cnt = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(cnt); - var oldValues = this.values; - var oldPrefixSum = this.prefixSum; - if (startIndex >= oldValues.length) { - return false; - } - var maxCnt = oldValues.length - startIndex; - if (cnt >= maxCnt) { - cnt = maxCnt; - } - if (cnt === 0) { - return false; - } - this.values = new Uint32Array(oldValues.length - cnt); - this.values.set(oldValues.subarray(0, startIndex), 0); - this.values.set(oldValues.subarray(startIndex + cnt), startIndex); - this.prefixSum = new Uint32Array(this.values.length); - if (startIndex - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = startIndex - 1; - } - if (this.prefixSumValidIndex[0] >= 0) { - this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); - } - return true; + MirrorModel.prototype.getLineContent = function (lineNumber) { + return this._lines[lineNumber - 1]; }; - PrefixSumComputer.prototype.getTotalValue = function () { - if (this.values.length === 0) { - return 0; + MirrorModel.prototype.getWordAtPosition = function (position, wordDefinition) { + var wordAtText = getWordAtText(position.column, ensureValidWordDefinition(wordDefinition), this._lines[position.lineNumber - 1], 0); + if (wordAtText) { + return new range_Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn); } - return this._getAccumulatedValue(this.values.length - 1); + return null; }; - PrefixSumComputer.prototype.getAccumulatedValue = function (index) { - if (index < 0) { - return 0; + MirrorModel.prototype.getWordUntilPosition = function (position, wordDefinition) { + var wordAtPosition = this.getWordAtPosition(position, wordDefinition); + if (!wordAtPosition) { + return { + word: '', + startColumn: position.column, + endColumn: position.column + }; } - index = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index); - return this._getAccumulatedValue(index); + return { + word: this._lines[position.lineNumber - 1].substring(wordAtPosition.startColumn - 1, position.column - 1), + startColumn: wordAtPosition.startColumn, + endColumn: position.column + }; }; - PrefixSumComputer.prototype._getAccumulatedValue = function (index) { - if (index <= this.prefixSumValidIndex[0]) { - return this.prefixSum[index]; - } - var startIndex = this.prefixSumValidIndex[0] + 1; - if (startIndex === 0) { - this.prefixSum[0] = this.values[0]; - startIndex++; - } - if (index >= this.values.length) { - index = this.values.length - 1; - } - for (var i = startIndex; i <= index; i++) { - this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i]; - } - this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index); - return this.prefixSum[index]; - }; - PrefixSumComputer.prototype.getIndexOf = function (accumulatedValue) { - accumulatedValue = Math.floor(accumulatedValue); //@perf - // Compute all sums (to get a fully valid prefixSum) - this.getTotalValue(); - var low = 0; - var high = this.values.length - 1; - var mid = 0; - var midStop = 0; - var midStart = 0; - while (low <= high) { - mid = low + ((high - low) / 2) | 0; - midStop = this.prefixSum[mid]; - midStart = midStop - this.values[mid]; - if (accumulatedValue < midStart) { - high = mid - 1; + MirrorModel.prototype.createWordIterator = function (wordDefinition) { + var _this = this; + var obj; + var lineNumber = 0; + var lineText; + var wordRangesIdx = 0; + var wordRanges = []; + var next = function () { + if (wordRangesIdx < wordRanges.length) { + var value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end); + wordRangesIdx += 1; + if (!obj) { + obj = { done: false, value: value }; + } + else { + obj.value = value; + } + return obj; } - else if (accumulatedValue >= midStop) { - low = mid + 1; + else if (lineNumber >= _this._lines.length) { + return FIN; } else { + lineText = _this._lines[lineNumber]; + wordRanges = _this._wordenize(lineText, wordDefinition); + wordRangesIdx = 0; + lineNumber += 1; + return next(); + } + }; + return { next: next }; + }; + MirrorModel.prototype.getLineWords = function (lineNumber, wordDefinition) { + var content = this._lines[lineNumber - 1]; + var ranges = this._wordenize(content, wordDefinition); + var words = []; + for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { + var range = ranges_1[_i]; + words.push({ + word: content.substring(range.start, range.end), + startColumn: range.start + 1, + endColumn: range.end + 1 + }); + } + return words; + }; + MirrorModel.prototype._wordenize = function (content, wordDefinition) { + var result = []; + var match; + wordDefinition.lastIndex = 0; // reset lastIndex just to be sure + while (match = wordDefinition.exec(content)) { + if (match[0].length === 0) { + // it did match the empty string break; } + result.push({ start: match.index, end: match.index + match[0].length }); } - return new PrefixSumIndexOfResult(mid, accumulatedValue - midStart); + return result; }; - return PrefixSumComputer; -}()); - -var PrefixSumComputerWithCache = /** @class */ (function () { - function PrefixSumComputerWithCache(values) { - this._cacheAccumulatedValueStart = 0; - this._cache = null; - this._actual = new PrefixSumComputer(values); - this._bustCache(); - } - PrefixSumComputerWithCache.prototype._bustCache = function () { - this._cacheAccumulatedValueStart = 0; - this._cache = null; - }; - PrefixSumComputerWithCache.prototype.insertValues = function (insertIndex, insertValues) { - if (this._actual.insertValues(insertIndex, insertValues)) { - this._bustCache(); + MirrorModel.prototype.getValueInRange = function (range) { + range = this._validateRange(range); + if (range.startLineNumber === range.endLineNumber) { + return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); } - }; - PrefixSumComputerWithCache.prototype.changeValue = function (index, value) { - if (this._actual.changeValue(index, value)) { - this._bustCache(); + var lineEnding = this._eol; + var startLineIndex = range.startLineNumber - 1; + var endLineIndex = range.endLineNumber - 1; + var resultLines = []; + resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); + for (var i = startLineIndex + 1; i < endLineIndex; i++) { + resultLines.push(this._lines[i]); } + resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); + return resultLines.join(lineEnding); }; - PrefixSumComputerWithCache.prototype.removeValues = function (startIndex, cnt) { - if (this._actual.removeValues(startIndex, cnt)) { - this._bustCache(); + MirrorModel.prototype.offsetAt = function (position) { + position = this._validatePosition(position); + this._ensureLineStarts(); + return this._lineStarts.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1); + }; + MirrorModel.prototype.positionAt = function (offset) { + offset = Math.floor(offset); + offset = Math.max(0, offset); + this._ensureLineStarts(); + var out = this._lineStarts.getIndexOf(offset); + var lineLength = this._lines[out.index].length; + // Ensure we return a valid position + return { + lineNumber: 1 + out.index, + column: 1 + Math.min(out.remainder, lineLength) + }; + }; + MirrorModel.prototype._validateRange = function (range) { + var start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn }); + var end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn }); + if (start.lineNumber !== range.startLineNumber + || start.column !== range.startColumn + || end.lineNumber !== range.endLineNumber + || end.column !== range.endColumn) { + return { + startLineNumber: start.lineNumber, + startColumn: start.column, + endLineNumber: end.lineNumber, + endColumn: end.column + }; } + return range; }; - PrefixSumComputerWithCache.prototype.getTotalValue = function () { - return this._actual.getTotalValue(); - }; - PrefixSumComputerWithCache.prototype.getAccumulatedValue = function (index) { - return this._actual.getAccumulatedValue(index); - }; - PrefixSumComputerWithCache.prototype.getIndexOf = function (accumulatedValue) { - accumulatedValue = Math.floor(accumulatedValue); //@perf - if (this._cache !== null) { - var cacheIndex = accumulatedValue - this._cacheAccumulatedValueStart; - if (cacheIndex >= 0 && cacheIndex < this._cache.length) { - // Cache hit! - return this._cache[cacheIndex]; + MirrorModel.prototype._validatePosition = function (position) { + if (!Position.isIPosition(position)) { + throw new Error('bad position'); + } + var lineNumber = position.lineNumber, column = position.column; + var hasChanged = false; + if (lineNumber < 1) { + lineNumber = 1; + column = 1; + hasChanged = true; + } + else if (lineNumber > this._lines.length) { + lineNumber = this._lines.length; + column = this._lines[lineNumber - 1].length + 1; + hasChanged = true; + } + else { + var maxCharacter = this._lines[lineNumber - 1].length + 1; + if (column < 1) { + column = 1; + hasChanged = true; + } + else if (column > maxCharacter) { + column = maxCharacter; + hasChanged = true; } } - // Cache miss! - return this._actual.getIndexOf(accumulatedValue); - }; - /** - * Gives a hint that a lot of requests are about to come in for these accumulated values. - */ - PrefixSumComputerWithCache.prototype.warmUpCache = function (accumulatedValueStart, accumulatedValueEnd) { - var newCache = []; - for (var accumulatedValue = accumulatedValueStart; accumulatedValue <= accumulatedValueEnd; accumulatedValue++) { - newCache[accumulatedValue - accumulatedValueStart] = this.getIndexOf(accumulatedValue); + if (!hasChanged) { + return position; + } + else { + return { lineNumber: lineNumber, column: column }; } - this._cache = newCache; - this._cacheAccumulatedValueStart = accumulatedValueStart; }; - return PrefixSumComputerWithCache; + return MirrorModel; +}(mirrorTextModel_MirrorTextModel)); +/** + * @internal + */ +var editorSimpleWorker_BaseEditorSimpleWorker = /** @class */ (function () { + function BaseEditorSimpleWorker(foreignModuleFactory) { + this._foreignModuleFactory = foreignModuleFactory; + this._foreignModule = null; + } + // ---- BEGIN diff -------------------------------------------------------------------------- + BaseEditorSimpleWorker.prototype.computeDiff = function (originalUrl, modifiedUrl, ignoreTrimWhitespace) { + var original = this._getModel(originalUrl); + var modified = this._getModel(modifiedUrl); + if (!original || !modified) { + return Promise.resolve(null); + } + var originalLines = original.getLinesContent(); + var modifiedLines = modified.getLinesContent(); + var diffComputer = new DiffComputer(originalLines, modifiedLines, { + shouldComputeCharChanges: true, + shouldPostProcessCharChanges: true, + shouldIgnoreTrimWhitespace: ignoreTrimWhitespace, + shouldMakePrettyDiff: true + }); + var changes = diffComputer.computeDiff(); + var identical = (changes.length > 0 ? false : this._modelsAreIdentical(original, modified)); + return Promise.resolve({ + identical: identical, + changes: changes + }); + }; + BaseEditorSimpleWorker.prototype._modelsAreIdentical = function (original, modified) { + var originalLineCount = original.getLineCount(); + var modifiedLineCount = modified.getLineCount(); + if (originalLineCount !== modifiedLineCount) { + return false; + } + for (var line = 1; line <= originalLineCount; line++) { + var originalLine = original.getLineContent(line); + var modifiedLine = modified.getLineContent(line); + if (originalLine !== modifiedLine) { + return false; + } + } + return true; + }; + BaseEditorSimpleWorker.prototype.computeMoreMinimalEdits = function (modelUrl, edits) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(edits); + } + var result = []; + var lastEol = undefined; + edits = mergeSort(edits, function (a, b) { + if (a.range && b.range) { + return range_Range.compareRangesUsingStarts(a.range, b.range); + } + // eol only changes should go to the end + var aRng = a.range ? 0 : 1; + var bRng = b.range ? 0 : 1; + return aRng - bRng; + }); + for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { + var _a = edits_1[_i], range = _a.range, text = _a.text, eol = _a.eol; + if (typeof eol === 'number') { + lastEol = eol; + } + if (range_Range.isEmpty(range) && !text) { + // empty change + continue; + } + var original = model.getValueInRange(range); + text = text.replace(/\r\n|\n|\r/g, model.eol); + if (original === text) { + // noop + continue; + } + // make sure diff won't take too long + if (Math.max(text.length, original.length) > BaseEditorSimpleWorker._diffLimit) { + result.push({ range: range, text: text }); + continue; + } + // compute diff between original and edit.text + var changes = stringDiff(original, text, false); + var editOffset = model.offsetAt(range_Range.lift(range).getStartPosition()); + for (var _b = 0, changes_1 = changes; _b < changes_1.length; _b++) { + var change = changes_1[_b]; + var start = model.positionAt(editOffset + change.originalStart); + var end = model.positionAt(editOffset + change.originalStart + change.originalLength); + var newEdit = { + text: text.substr(change.modifiedStart, change.modifiedLength), + range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column } + }; + if (model.getValueInRange(newEdit.range) !== newEdit.text) { + result.push(newEdit); + } + } + } + if (typeof lastEol === 'number') { + result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }); + } + return Promise.resolve(result); + }; + // ---- END minimal edits --------------------------------------------------------------- + BaseEditorSimpleWorker.prototype.computeLinks = function (modelUrl) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(null); + } + return Promise.resolve(computeLinks(model)); + }; + BaseEditorSimpleWorker.prototype.textualSuggest = function (modelUrl, position, wordDef, wordDefFlags) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(null); + } + var seen = Object.create(null); + var suggestions = []; + var wordDefRegExp = new RegExp(wordDef, wordDefFlags); + var wordUntil = model.getWordUntilPosition(position, wordDefRegExp); + var wordAt = model.getWordAtPosition(position, wordDefRegExp); + if (wordAt) { + seen[model.getValueInRange(wordAt)] = true; + } + for (var iter = model.createWordIterator(wordDefRegExp), e = iter.next(); !e.done && suggestions.length <= BaseEditorSimpleWorker._suggestionsLimit; e = iter.next()) { + var word = e.value; + if (seen[word]) { + continue; + } + seen[word] = true; + if (!isNaN(Number(word))) { + continue; + } + suggestions.push({ + kind: 18 /* Text */, + label: word, + insertText: word, + range: { startLineNumber: position.lineNumber, startColumn: wordUntil.startColumn, endLineNumber: position.lineNumber, endColumn: wordUntil.endColumn } + }); + } + return Promise.resolve({ suggestions: suggestions }); + }; + // ---- END suggest -------------------------------------------------------------------------- + //#region -- word ranges -- + BaseEditorSimpleWorker.prototype.computeWordRanges = function (modelUrl, range, wordDef, wordDefFlags) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(Object.create(null)); + } + var wordDefRegExp = new RegExp(wordDef, wordDefFlags); + var result = Object.create(null); + for (var line = range.startLineNumber; line < range.endLineNumber; line++) { + var words = model.getLineWords(line, wordDefRegExp); + for (var _i = 0, words_1 = words; _i < words_1.length; _i++) { + var word = words_1[_i]; + if (!isNaN(Number(word.word))) { + continue; + } + var array = result[word.word]; + if (!array) { + array = []; + result[word.word] = array; + } + array.push({ + startLineNumber: line, + startColumn: word.startColumn, + endLineNumber: line, + endColumn: word.endColumn + }); + } + } + return Promise.resolve(result); + }; + //#endregion + BaseEditorSimpleWorker.prototype.navigateValueSet = function (modelUrl, range, up, wordDef, wordDefFlags) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(null); + } + var wordDefRegExp = new RegExp(wordDef, wordDefFlags); + if (range.startColumn === range.endColumn) { + range = { + startLineNumber: range.startLineNumber, + startColumn: range.startColumn, + endLineNumber: range.endLineNumber, + endColumn: range.endColumn + 1 + }; + } + var selectionText = model.getValueInRange(range); + var wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp); + if (!wordRange) { + return Promise.resolve(null); + } + var word = model.getValueInRange(wordRange); + var result = BasicInplaceReplace.INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up); + return Promise.resolve(result); + }; + // ---- BEGIN foreign module support -------------------------------------------------------------------------- + BaseEditorSimpleWorker.prototype.loadForeignModule = function (moduleId, createData) { + var _this = this; + var ctx = { + getMirrorModels: function () { + return _this._getModels(); + } + }; + if (this._foreignModuleFactory) { + this._foreignModule = this._foreignModuleFactory(ctx, createData); + // static foreing module + var methods = []; + for (var _i = 0, _a = getAllPropertyNames(this._foreignModule); _i < _a.length; _i++) { + var prop = _a[_i]; + if (typeof this._foreignModule[prop] === 'function') { + methods.push(prop); + } + } + return Promise.resolve(methods); + } + // ESM-comment-begin + // return new Promise((resolve, reject) => { + // require([moduleId], (foreignModule: { create: IForeignModuleFactory }) => { + // this._foreignModule = foreignModule.create(ctx, createData); + // + // let methods: string[] = []; + // for (const prop of getAllPropertyNames(this._foreignModule)) { + // if (typeof this._foreignModule[prop] === 'function') { + // methods.push(prop); + // } + // } + // + // resolve(methods); + // + // }, reject); + // }); + // ESM-comment-end + // ESM-uncomment-begin + return Promise.reject(new Error("Unexpected usage")); + // ESM-uncomment-end + }; + // foreign method request + BaseEditorSimpleWorker.prototype.fmr = function (method, args) { + if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') { + return Promise.reject(new Error('Missing requestHandler or method: ' + method)); + } + try { + return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args)); + } + catch (e) { + return Promise.reject(e); + } + }; + // ---- END diff -------------------------------------------------------------------------- + // ---- BEGIN minimal edits --------------------------------------------------------------- + BaseEditorSimpleWorker._diffLimit = 100000; + // ---- BEGIN suggest -------------------------------------------------------------------------- + BaseEditorSimpleWorker._suggestionsLimit = 10000; + return BaseEditorSimpleWorker; }()); +/** + * @internal + */ +var editorSimpleWorker_EditorSimpleWorkerImpl = /** @class */ (function (_super) { + editorSimpleWorker_extends(EditorSimpleWorkerImpl, _super); + function EditorSimpleWorkerImpl(foreignModuleFactory) { + var _this = _super.call(this, foreignModuleFactory) || this; + _this._models = Object.create(null); + return _this; + } + EditorSimpleWorkerImpl.prototype.dispose = function () { + this._models = Object.create(null); + }; + EditorSimpleWorkerImpl.prototype._getModel = function (uri) { + return this._models[uri]; + }; + EditorSimpleWorkerImpl.prototype._getModels = function () { + var _this = this; + var all = []; + Object.keys(this._models).forEach(function (key) { return all.push(_this._models[key]); }); + return all; + }; + EditorSimpleWorkerImpl.prototype.acceptNewModel = function (data) { + this._models[data.url] = new editorSimpleWorker_MirrorModel(uri_URI.parse(data.url), data.lines, data.EOL, data.versionId); + }; + EditorSimpleWorkerImpl.prototype.acceptModelChanged = function (strURL, e) { + if (!this._models[strURL]) { + return; + } + var model = this._models[strURL]; + model.onEvents(e); + }; + EditorSimpleWorkerImpl.prototype.acceptRemovedModel = function (strURL) { + if (!this._models[strURL]) { + return; + } + delete this._models[strURL]; + }; + return EditorSimpleWorkerImpl; +}(editorSimpleWorker_BaseEditorSimpleWorker)); +/** + * Called on the worker side + * @internal + */ +function editorSimpleWorker_create() { + return new editorSimpleWorker_EditorSimpleWorkerImpl(null); +} +if (typeof importScripts === 'function') { + // Running in a web worker + globals.monaco = createMonacoBaseAPI(); +} -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/editor.worker.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/editor.worker.js ***! - \*******************************************************************/ -/*! exports provided: initialize */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initialize", function() { return initialize; }); -/* harmony import */ var _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/common/worker/simpleWorker.js */ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js"); -/* harmony import */ var _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/services/editorSimpleWorker.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/editor.worker.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -8395,8 +7518,8 @@ function initialize(foreignModule) { return; } initialized = true; - var editorWorker = new _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__["EditorSimpleWorkerImpl"](foreignModule); - var simpleWorker = new _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__["SimpleWorkerServer"](function (msg) { + var editorWorker = new editorSimpleWorker_EditorSimpleWorkerImpl(foreignModule); + var simpleWorker = new simpleWorker_SimpleWorkerServer(function (msg) { self.postMessage(msg); }, editorWorker); self.onmessage = function (e) { @@ -8410,256 +7533,2439 @@ self.onmessage = function (e) { } }; - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/cssLanguageService.js": -/*!***************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/cssLanguageService.js ***! - \***************************************************************************************************************/ -/*! exports provided: getCSSLanguageService, getSCSSLanguageService, getLESSLanguageService, Range, TextEdit, Position, SelectionRangeKind, Location, LocationLink, Color, ColorInformation, ColorPresentation, FoldingRangeKind, FoldingRange, DiagnosticRelatedInformation, DiagnosticSeverity, Diagnostic, Command, TextDocumentEdit, CreateFile, RenameFile, DeleteFile, WorkspaceEdit, WorkspaceChange, TextDocumentIdentifier, VersionedTextDocumentIdentifier, TextDocumentItem, MarkupKind, MarkupContent, CompletionItemKind, InsertTextFormat, CompletionItem, CompletionList, MarkedString, Hover, ParameterInformation, SignatureInformation, DocumentHighlightKind, DocumentHighlight, SymbolKind, SymbolInformation, DocumentSymbol, CodeActionKind, CodeActionContext, CodeAction, CodeLens, FormattingOptions, DocumentLink, EOL, TextDocument, TextDocumentSaveReason */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCSSLanguageService", function() { return getCSSLanguageService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSCSSLanguageService", function() { return getSCSSLanguageService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLESSLanguageService", function() { return getLESSLanguageService; }); -/* harmony import */ var _parser_cssParser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parser/cssParser.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssParser.js"); -/* harmony import */ var _services_cssCompletion_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./services/cssCompletion.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssCompletion.js"); -/* harmony import */ var _services_cssHover_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./services/cssHover.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssHover.js"); -/* harmony import */ var _services_cssNavigation_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/cssNavigation.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssNavigation.js"); -/* harmony import */ var _services_cssCodeActions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./services/cssCodeActions.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssCodeActions.js"); -/* harmony import */ var _services_cssValidation_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./services/cssValidation.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssValidation.js"); -/* harmony import */ var _parser_scssParser_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parser/scssParser.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/scssParser.js"); -/* harmony import */ var _services_scssCompletion_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./services/scssCompletion.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/scssCompletion.js"); -/* harmony import */ var _parser_lessParser_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./parser/lessParser.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/lessParser.js"); -/* harmony import */ var _services_lessCompletion_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./services/lessCompletion.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lessCompletion.js"); -/* harmony import */ var _services_cssFolding_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./services/cssFolding.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssFolding.js"); -/* harmony import */ var _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./languageFacts/facts.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/facts.js"); -/* harmony import */ var _services_cssSelectionRange_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./services/cssSelectionRange.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssSelectionRange.js"); -/* harmony import */ var _cssLanguageTypes_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./cssLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/cssLanguageTypes.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return _cssLanguageTypes_js__WEBPACK_IMPORTED_MODULE_13__["Range"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextEdit", function() { return _cssLanguageTypes_js__WEBPACK_IMPORTED_MODULE_13__["TextEdit"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return _cssLanguageTypes_js__WEBPACK_IMPORTED_MODULE_13__["Position"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectionRangeKind", function() { return _cssLanguageTypes_js__WEBPACK_IMPORTED_MODULE_13__["SelectionRangeKind"]; }); - -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-languageserver-types/main.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Location", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["Location"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LocationLink", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["LocationLink"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["Color"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorInformation", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["ColorInformation"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorPresentation", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["ColorPresentation"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FoldingRangeKind", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["FoldingRangeKind"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FoldingRange", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["FoldingRange"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DiagnosticRelatedInformation", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["DiagnosticRelatedInformation"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DiagnosticSeverity", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["DiagnosticSeverity"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Diagnostic", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["Diagnostic"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["Command"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextDocumentEdit", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["TextDocumentEdit"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CreateFile", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["CreateFile"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RenameFile", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["RenameFile"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DeleteFile", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["DeleteFile"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WorkspaceEdit", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["WorkspaceEdit"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "WorkspaceChange", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["WorkspaceChange"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextDocumentIdentifier", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["TextDocumentIdentifier"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VersionedTextDocumentIdentifier", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["VersionedTextDocumentIdentifier"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextDocumentItem", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["TextDocumentItem"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkupKind", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["MarkupKind"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkupContent", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["MarkupContent"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["CompletionItemKind"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InsertTextFormat", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["InsertTextFormat"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CompletionItem", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["CompletionItem"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CompletionList", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["CompletionList"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkedString", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["MarkedString"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Hover", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["Hover"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ParameterInformation", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["ParameterInformation"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SignatureInformation", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["SignatureInformation"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["DocumentHighlightKind"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlight", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["DocumentHighlight"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["SymbolKind"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SymbolInformation", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["SymbolInformation"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentSymbol", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["DocumentSymbol"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CodeActionKind", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["CodeActionKind"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CodeActionContext", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["CodeActionContext"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CodeAction", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["CodeAction"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CodeLens", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["CodeLens"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormattingOptions", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["FormattingOptions"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DocumentLink", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["DocumentLink"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EOL", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["EOL"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextDocument", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["TextDocument"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextDocumentSaveReason", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_14__["TextDocumentSaveReason"]; }); - +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssScanner.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - - - -function createFacade(parser, completion, hover, navigation, codeActions, validation) { - return { - configure: validation.configure.bind(validation), - doValidation: validation.doValidation.bind(validation), - parseStylesheet: parser.parseStylesheet.bind(parser), - doComplete: completion.doComplete.bind(completion), - setCompletionParticipants: completion.setCompletionParticipants.bind(completion), - doHover: hover.doHover.bind(hover), - findDefinition: navigation.findDefinition.bind(navigation), - findReferences: navigation.findReferences.bind(navigation), - findDocumentHighlights: navigation.findDocumentHighlights.bind(navigation), - findDocumentLinks: navigation.findDocumentLinks.bind(navigation), - findDocumentSymbols: navigation.findDocumentSymbols.bind(navigation), - doCodeActions: codeActions.doCodeActions.bind(codeActions), - doCodeActions2: codeActions.doCodeActions2.bind(codeActions), - findColorSymbols: function (d, s) { return navigation.findDocumentColors(d, s).map(function (s) { return s.range; }); }, - findDocumentColors: navigation.findDocumentColors.bind(navigation), - getColorPresentations: navigation.getColorPresentations.bind(navigation), - doRename: navigation.doRename.bind(navigation), - getFoldingRanges: _services_cssFolding_js__WEBPACK_IMPORTED_MODULE_10__["getFoldingRanges"], - getSelectionRanges: _services_cssSelectionRange_js__WEBPACK_IMPORTED_MODULE_12__["getSelectionRanges"] +var TokenType; +(function (TokenType) { + TokenType[TokenType["Ident"] = 0] = "Ident"; + TokenType[TokenType["AtKeyword"] = 1] = "AtKeyword"; + TokenType[TokenType["String"] = 2] = "String"; + TokenType[TokenType["BadString"] = 3] = "BadString"; + TokenType[TokenType["UnquotedString"] = 4] = "UnquotedString"; + TokenType[TokenType["Hash"] = 5] = "Hash"; + TokenType[TokenType["Num"] = 6] = "Num"; + TokenType[TokenType["Percentage"] = 7] = "Percentage"; + TokenType[TokenType["Dimension"] = 8] = "Dimension"; + TokenType[TokenType["UnicodeRange"] = 9] = "UnicodeRange"; + TokenType[TokenType["CDO"] = 10] = "CDO"; + TokenType[TokenType["CDC"] = 11] = "CDC"; + TokenType[TokenType["Colon"] = 12] = "Colon"; + TokenType[TokenType["SemiColon"] = 13] = "SemiColon"; + TokenType[TokenType["CurlyL"] = 14] = "CurlyL"; + TokenType[TokenType["CurlyR"] = 15] = "CurlyR"; + TokenType[TokenType["ParenthesisL"] = 16] = "ParenthesisL"; + TokenType[TokenType["ParenthesisR"] = 17] = "ParenthesisR"; + TokenType[TokenType["BracketL"] = 18] = "BracketL"; + TokenType[TokenType["BracketR"] = 19] = "BracketR"; + TokenType[TokenType["Whitespace"] = 20] = "Whitespace"; + TokenType[TokenType["Includes"] = 21] = "Includes"; + TokenType[TokenType["Dashmatch"] = 22] = "Dashmatch"; + TokenType[TokenType["SubstringOperator"] = 23] = "SubstringOperator"; + TokenType[TokenType["PrefixOperator"] = 24] = "PrefixOperator"; + TokenType[TokenType["SuffixOperator"] = 25] = "SuffixOperator"; + TokenType[TokenType["Delim"] = 26] = "Delim"; + TokenType[TokenType["EMS"] = 27] = "EMS"; + TokenType[TokenType["EXS"] = 28] = "EXS"; + TokenType[TokenType["Length"] = 29] = "Length"; + TokenType[TokenType["Angle"] = 30] = "Angle"; + TokenType[TokenType["Time"] = 31] = "Time"; + TokenType[TokenType["Freq"] = 32] = "Freq"; + TokenType[TokenType["Exclamation"] = 33] = "Exclamation"; + TokenType[TokenType["Resolution"] = 34] = "Resolution"; + TokenType[TokenType["Comma"] = 35] = "Comma"; + TokenType[TokenType["Charset"] = 36] = "Charset"; + TokenType[TokenType["EscapedJavaScript"] = 37] = "EscapedJavaScript"; + TokenType[TokenType["BadEscapedJavaScript"] = 38] = "BadEscapedJavaScript"; + TokenType[TokenType["Comment"] = 39] = "Comment"; + TokenType[TokenType["SingleLineComment"] = 40] = "SingleLineComment"; + TokenType[TokenType["EOF"] = 41] = "EOF"; + TokenType[TokenType["CustomToken"] = 42] = "CustomToken"; +})(TokenType || (TokenType = {})); +var MultiLineStream = /** @class */ (function () { + function MultiLineStream(source) { + this.source = source; + this.len = source.length; + this.position = 0; + } + MultiLineStream.prototype.substring = function (from, to) { + if (to === void 0) { to = this.position; } + return this.source.substring(from, to); }; + MultiLineStream.prototype.eos = function () { + return this.len <= this.position; + }; + MultiLineStream.prototype.pos = function () { + return this.position; + }; + MultiLineStream.prototype.goBackTo = function (pos) { + this.position = pos; + }; + MultiLineStream.prototype.goBack = function (n) { + this.position -= n; + }; + MultiLineStream.prototype.advance = function (n) { + this.position += n; + }; + MultiLineStream.prototype.nextChar = function () { + return this.source.charCodeAt(this.position++) || 0; + }; + MultiLineStream.prototype.peekChar = function (n) { + if (n === void 0) { n = 0; } + return this.source.charCodeAt(this.position + n) || 0; + }; + MultiLineStream.prototype.lookbackChar = function (n) { + if (n === void 0) { n = 0; } + return this.source.charCodeAt(this.position - n) || 0; + }; + MultiLineStream.prototype.advanceIfChar = function (ch) { + if (ch === this.source.charCodeAt(this.position)) { + this.position++; + return true; + } + return false; + }; + MultiLineStream.prototype.advanceIfChars = function (ch) { + if (this.position + ch.length > this.source.length) { + return false; + } + var i = 0; + for (; i < ch.length; i++) { + if (this.source.charCodeAt(this.position + i) !== ch[i]) { + return false; + } + } + this.advance(i); + return true; + }; + MultiLineStream.prototype.advanceWhileChar = function (condition) { + var posNow = this.position; + while (this.position < this.len && condition(this.source.charCodeAt(this.position))) { + this.position++; + } + return this.position - posNow; + }; + return MultiLineStream; +}()); + +var cssScanner_a = 'a'.charCodeAt(0); +var cssScanner_f = 'f'.charCodeAt(0); +var _z = 'z'.charCodeAt(0); +var _A = 'A'.charCodeAt(0); +var _F = 'F'.charCodeAt(0); +var _Z = 'Z'.charCodeAt(0); +var _0 = '0'.charCodeAt(0); +var _9 = '9'.charCodeAt(0); +var _TLD = '~'.charCodeAt(0); +var _HAT = '^'.charCodeAt(0); +var _EQS = '='.charCodeAt(0); +var _PIP = '|'.charCodeAt(0); +var _MIN = '-'.charCodeAt(0); +var _USC = '_'.charCodeAt(0); +var _PRC = '%'.charCodeAt(0); +var _MUL = '*'.charCodeAt(0); +var _LPA = '('.charCodeAt(0); +var _RPA = ')'.charCodeAt(0); +var _LAN = '<'.charCodeAt(0); +var _RAN = '>'.charCodeAt(0); +var _ATS = '@'.charCodeAt(0); +var _HSH = '#'.charCodeAt(0); +var _DLR = '$'.charCodeAt(0); +var _BSL = '\\'.charCodeAt(0); +var _FSL = '/'.charCodeAt(0); +var _NWL = '\n'.charCodeAt(0); +var _CAR = '\r'.charCodeAt(0); +var _LFD = '\f'.charCodeAt(0); +var _DQO = '"'.charCodeAt(0); +var _SQO = '\''.charCodeAt(0); +var _WSP = ' '.charCodeAt(0); +var _TAB = '\t'.charCodeAt(0); +var _SEM = ';'.charCodeAt(0); +var _COL = ':'.charCodeAt(0); +var _CUL = '{'.charCodeAt(0); +var _CUR = '}'.charCodeAt(0); +var _BRL = '['.charCodeAt(0); +var _BRR = ']'.charCodeAt(0); +var _CMA = ','.charCodeAt(0); +var _DOT = '.'.charCodeAt(0); +var _BNG = '!'.charCodeAt(0); +var staticTokenTable = {}; +staticTokenTable[_SEM] = TokenType.SemiColon; +staticTokenTable[_COL] = TokenType.Colon; +staticTokenTable[_CUL] = TokenType.CurlyL; +staticTokenTable[_CUR] = TokenType.CurlyR; +staticTokenTable[_BRR] = TokenType.BracketR; +staticTokenTable[_BRL] = TokenType.BracketL; +staticTokenTable[_LPA] = TokenType.ParenthesisL; +staticTokenTable[_RPA] = TokenType.ParenthesisR; +staticTokenTable[_CMA] = TokenType.Comma; +var staticUnitTable = {}; +staticUnitTable['em'] = TokenType.EMS; +staticUnitTable['ex'] = TokenType.EXS; +staticUnitTable['px'] = TokenType.Length; +staticUnitTable['cm'] = TokenType.Length; +staticUnitTable['mm'] = TokenType.Length; +staticUnitTable['in'] = TokenType.Length; +staticUnitTable['pt'] = TokenType.Length; +staticUnitTable['pc'] = TokenType.Length; +staticUnitTable['deg'] = TokenType.Angle; +staticUnitTable['rad'] = TokenType.Angle; +staticUnitTable['grad'] = TokenType.Angle; +staticUnitTable['ms'] = TokenType.Time; +staticUnitTable['s'] = TokenType.Time; +staticUnitTable['hz'] = TokenType.Freq; +staticUnitTable['khz'] = TokenType.Freq; +staticUnitTable['%'] = TokenType.Percentage; +staticUnitTable['fr'] = TokenType.Percentage; +staticUnitTable['dpi'] = TokenType.Resolution; +staticUnitTable['dpcm'] = TokenType.Resolution; +var Scanner = /** @class */ (function () { + function Scanner() { + this.stream = new MultiLineStream(''); + this.ignoreComment = true; + this.ignoreWhitespace = true; + this.inURL = false; + } + Scanner.prototype.setSource = function (input) { + this.stream = new MultiLineStream(input); + }; + Scanner.prototype.finishToken = function (offset, type, text) { + return { + offset: offset, + len: this.stream.pos() - offset, + type: type, + text: text || this.stream.substring(offset) + }; + }; + Scanner.prototype.substring = function (offset, len) { + return this.stream.substring(offset, offset + len); + }; + Scanner.prototype.pos = function () { + return this.stream.pos(); + }; + Scanner.prototype.goBackTo = function (pos) { + this.stream.goBackTo(pos); + }; + Scanner.prototype.scanUnquotedString = function () { + var offset = this.stream.pos(); + var content = []; + if (this._unquotedString(content)) { + return this.finishToken(offset, TokenType.UnquotedString, content.join('')); + } + return null; + }; + Scanner.prototype.scan = function () { + // processes all whitespaces and comments + var triviaToken = this.trivia(); + if (triviaToken !== null) { + return triviaToken; + } + var offset = this.stream.pos(); + // End of file/input + if (this.stream.eos()) { + return this.finishToken(offset, TokenType.EOF); + } + return this.scanNext(offset); + }; + Scanner.prototype.scanNext = function (offset) { + // CDO + if (this.stream.advanceIfChars([_MIN, _MIN, _RAN])) { + return this.finishToken(offset, TokenType.CDC); + } + var content = []; + if (this.ident(content)) { + return this.finishToken(offset, TokenType.Ident, content.join('')); + } + // at-keyword + if (this.stream.advanceIfChar(_ATS)) { + content = ['@']; + if (this._name(content)) { + var keywordText = content.join(''); + if (keywordText === '@charset') { + return this.finishToken(offset, TokenType.Charset, keywordText); + } + return this.finishToken(offset, TokenType.AtKeyword, keywordText); + } + else { + return this.finishToken(offset, TokenType.Delim); + } + } + // hash + if (this.stream.advanceIfChar(_HSH)) { + content = ['#']; + if (this._name(content)) { + return this.finishToken(offset, TokenType.Hash, content.join('')); + } + else { + return this.finishToken(offset, TokenType.Delim); + } + } + // Important + if (this.stream.advanceIfChar(_BNG)) { + return this.finishToken(offset, TokenType.Exclamation); + } + // Numbers + if (this._number()) { + var pos = this.stream.pos(); + content = [this.stream.substring(offset, pos)]; + if (this.stream.advanceIfChar(_PRC)) { + // Percentage 43% + return this.finishToken(offset, TokenType.Percentage); + } + else if (this.ident(content)) { + var dim = this.stream.substring(pos).toLowerCase(); + var tokenType_1 = staticUnitTable[dim]; + if (typeof tokenType_1 !== 'undefined') { + // Known dimension 43px + return this.finishToken(offset, tokenType_1, content.join('')); + } + else { + // Unknown dimension 43ft + return this.finishToken(offset, TokenType.Dimension, content.join('')); + } + } + return this.finishToken(offset, TokenType.Num); + } + // String, BadString + content = []; + var tokenType = this._string(content); + if (tokenType !== null) { + return this.finishToken(offset, tokenType, content.join('')); + } + // single character tokens + tokenType = staticTokenTable[this.stream.peekChar()]; + if (typeof tokenType !== 'undefined') { + this.stream.advance(1); + return this.finishToken(offset, tokenType); + } + // includes ~= + if (this.stream.peekChar(0) === _TLD && this.stream.peekChar(1) === _EQS) { + this.stream.advance(2); + return this.finishToken(offset, TokenType.Includes); + } + // DashMatch |= + if (this.stream.peekChar(0) === _PIP && this.stream.peekChar(1) === _EQS) { + this.stream.advance(2); + return this.finishToken(offset, TokenType.Dashmatch); + } + // Substring operator *= + if (this.stream.peekChar(0) === _MUL && this.stream.peekChar(1) === _EQS) { + this.stream.advance(2); + return this.finishToken(offset, TokenType.SubstringOperator); + } + // Substring operator ^= + if (this.stream.peekChar(0) === _HAT && this.stream.peekChar(1) === _EQS) { + this.stream.advance(2); + return this.finishToken(offset, TokenType.PrefixOperator); + } + // Substring operator $= + if (this.stream.peekChar(0) === _DLR && this.stream.peekChar(1) === _EQS) { + this.stream.advance(2); + return this.finishToken(offset, TokenType.SuffixOperator); + } + // Delim + this.stream.nextChar(); + return this.finishToken(offset, TokenType.Delim); + }; + Scanner.prototype._matchWordAnyCase = function (characters) { + var index = 0; + this.stream.advanceWhileChar(function (ch) { + var result = characters[index] === ch || characters[index + 1] === ch; + if (result) { + index += 2; + } + return result; + }); + if (index === characters.length) { + return true; + } + else { + this.stream.goBack(index / 2); + return false; + } + }; + Scanner.prototype.trivia = function () { + while (true) { + var offset = this.stream.pos(); + if (this._whitespace()) { + if (!this.ignoreWhitespace) { + return this.finishToken(offset, TokenType.Whitespace); + } + } + else if (this.comment()) { + if (!this.ignoreComment) { + return this.finishToken(offset, TokenType.Comment); + } + } + else { + return null; + } + } + }; + Scanner.prototype.comment = function () { + if (this.stream.advanceIfChars([_FSL, _MUL])) { + var success_1 = false, hot_1 = false; + this.stream.advanceWhileChar(function (ch) { + if (hot_1 && ch === _FSL) { + success_1 = true; + return false; + } + hot_1 = ch === _MUL; + return true; + }); + if (success_1) { + this.stream.advance(1); + } + return true; + } + return false; + }; + Scanner.prototype._number = function () { + var npeek = 0, ch; + if (this.stream.peekChar() === _DOT) { + npeek = 1; + } + ch = this.stream.peekChar(npeek); + if (ch >= _0 && ch <= _9) { + this.stream.advance(npeek + 1); + this.stream.advanceWhileChar(function (ch) { + return ch >= _0 && ch <= _9 || npeek === 0 && ch === _DOT; + }); + return true; + } + return false; + }; + Scanner.prototype._newline = function (result) { + var ch = this.stream.peekChar(); + switch (ch) { + case _CAR: + case _LFD: + case _NWL: + this.stream.advance(1); + result.push(String.fromCharCode(ch)); + if (ch === _CAR && this.stream.advanceIfChar(_NWL)) { + result.push('\n'); + } + return true; + } + return false; + }; + Scanner.prototype._escape = function (result, includeNewLines) { + var ch = this.stream.peekChar(); + if (ch === _BSL) { + this.stream.advance(1); + ch = this.stream.peekChar(); + var hexNumCount = 0; + while (hexNumCount < 6 && (ch >= _0 && ch <= _9 || ch >= cssScanner_a && ch <= cssScanner_f || ch >= _A && ch <= _F)) { + this.stream.advance(1); + ch = this.stream.peekChar(); + hexNumCount++; + } + if (hexNumCount > 0) { + try { + var hexVal = parseInt(this.stream.substring(this.stream.pos() - hexNumCount), 16); + if (hexVal) { + result.push(String.fromCharCode(hexVal)); + } + } + catch (e) { + // ignore + } + // optional whitespace or new line, not part of result text + if (ch === _WSP || ch === _TAB) { + this.stream.advance(1); + } + else { + this._newline([]); + } + return true; + } + if (ch !== _CAR && ch !== _LFD && ch !== _NWL) { + this.stream.advance(1); + result.push(String.fromCharCode(ch)); + return true; + } + else if (includeNewLines) { + return this._newline(result); + } + } + return false; + }; + Scanner.prototype._stringChar = function (closeQuote, result) { + // not closeQuote, not backslash, not newline + var ch = this.stream.peekChar(); + if (ch !== 0 && ch !== closeQuote && ch !== _BSL && ch !== _CAR && ch !== _LFD && ch !== _NWL) { + this.stream.advance(1); + result.push(String.fromCharCode(ch)); + return true; + } + return false; + }; + Scanner.prototype._string = function (result) { + if (this.stream.peekChar() === _SQO || this.stream.peekChar() === _DQO) { + var closeQuote = this.stream.nextChar(); + result.push(String.fromCharCode(closeQuote)); + while (this._stringChar(closeQuote, result) || this._escape(result, true)) { + // loop + } + if (this.stream.peekChar() === closeQuote) { + this.stream.nextChar(); + result.push(String.fromCharCode(closeQuote)); + return TokenType.String; + } + else { + return TokenType.BadString; + } + } + return null; + }; + Scanner.prototype._unquotedChar = function (result) { + // not closeQuote, not backslash, not newline + var ch = this.stream.peekChar(); + if (ch !== 0 && ch !== _BSL && ch !== _SQO && ch !== _DQO && ch !== _LPA && ch !== _RPA && ch !== _WSP && ch !== _TAB && ch !== _NWL && ch !== _LFD && ch !== _CAR) { + this.stream.advance(1); + result.push(String.fromCharCode(ch)); + return true; + } + return false; + }; + Scanner.prototype._unquotedString = function (result) { + var hasContent = false; + while (this._unquotedChar(result) || this._escape(result)) { + hasContent = true; + } + return hasContent; + }; + Scanner.prototype._whitespace = function () { + var n = this.stream.advanceWhileChar(function (ch) { + return ch === _WSP || ch === _TAB || ch === _NWL || ch === _LFD || ch === _CAR; + }); + return n > 0; + }; + Scanner.prototype._name = function (result) { + var matched = false; + while (this._identChar(result) || this._escape(result)) { + matched = true; + } + return matched; + }; + Scanner.prototype.ident = function (result) { + var pos = this.stream.pos(); + var hasMinus = this._minus(result); + if (hasMinus && this._minus(result) /* -- */) { + if (this._identFirstChar(result) || this._escape(result)) { + while (this._identChar(result) || this._escape(result)) { + // loop + } + return true; + } + } + else if (this._identFirstChar(result) || this._escape(result)) { + while (this._identChar(result) || this._escape(result)) { + // loop + } + return true; + } + this.stream.goBackTo(pos); + return false; + }; + Scanner.prototype._identFirstChar = function (result) { + var ch = this.stream.peekChar(); + if (ch === _USC || // _ + ch >= cssScanner_a && ch <= _z || // a-z + ch >= _A && ch <= _Z || // A-Z + ch >= 0x80 && ch <= 0xFFFF) { // nonascii + this.stream.advance(1); + result.push(String.fromCharCode(ch)); + return true; + } + return false; + }; + Scanner.prototype._minus = function (result) { + var ch = this.stream.peekChar(); + if (ch === _MIN) { + this.stream.advance(1); + result.push(String.fromCharCode(ch)); + return true; + } + return false; + }; + Scanner.prototype._identChar = function (result) { + var ch = this.stream.peekChar(); + if (ch === _USC || // _ + ch === _MIN || // - + ch >= cssScanner_a && ch <= _z || // a-z + ch >= _A && ch <= _Z || // A-Z + ch >= _0 && ch <= _9 || // 0/9 + ch >= 0x80 && ch <= 0xFFFF) { // nonascii + this.stream.advance(1); + result.push(String.fromCharCode(ch)); + return true; + } + return false; + }; + return Scanner; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var cssNodes_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +/// +/// Nodes for the css 2.1 specification. See for reference: +/// http://www.w3.org/TR/CSS21/grammar.html#grammar +/// +var NodeType; +(function (NodeType) { + NodeType[NodeType["Undefined"] = 0] = "Undefined"; + NodeType[NodeType["Identifier"] = 1] = "Identifier"; + NodeType[NodeType["Stylesheet"] = 2] = "Stylesheet"; + NodeType[NodeType["Ruleset"] = 3] = "Ruleset"; + NodeType[NodeType["Selector"] = 4] = "Selector"; + NodeType[NodeType["SimpleSelector"] = 5] = "SimpleSelector"; + NodeType[NodeType["SelectorInterpolation"] = 6] = "SelectorInterpolation"; + NodeType[NodeType["SelectorCombinator"] = 7] = "SelectorCombinator"; + NodeType[NodeType["SelectorCombinatorParent"] = 8] = "SelectorCombinatorParent"; + NodeType[NodeType["SelectorCombinatorSibling"] = 9] = "SelectorCombinatorSibling"; + NodeType[NodeType["SelectorCombinatorAllSiblings"] = 10] = "SelectorCombinatorAllSiblings"; + NodeType[NodeType["SelectorCombinatorShadowPiercingDescendant"] = 11] = "SelectorCombinatorShadowPiercingDescendant"; + NodeType[NodeType["Page"] = 12] = "Page"; + NodeType[NodeType["PageBoxMarginBox"] = 13] = "PageBoxMarginBox"; + NodeType[NodeType["ClassSelector"] = 14] = "ClassSelector"; + NodeType[NodeType["IdentifierSelector"] = 15] = "IdentifierSelector"; + NodeType[NodeType["ElementNameSelector"] = 16] = "ElementNameSelector"; + NodeType[NodeType["PseudoSelector"] = 17] = "PseudoSelector"; + NodeType[NodeType["AttributeSelector"] = 18] = "AttributeSelector"; + NodeType[NodeType["Declaration"] = 19] = "Declaration"; + NodeType[NodeType["Declarations"] = 20] = "Declarations"; + NodeType[NodeType["Property"] = 21] = "Property"; + NodeType[NodeType["Expression"] = 22] = "Expression"; + NodeType[NodeType["BinaryExpression"] = 23] = "BinaryExpression"; + NodeType[NodeType["Term"] = 24] = "Term"; + NodeType[NodeType["Operator"] = 25] = "Operator"; + NodeType[NodeType["Value"] = 26] = "Value"; + NodeType[NodeType["StringLiteral"] = 27] = "StringLiteral"; + NodeType[NodeType["URILiteral"] = 28] = "URILiteral"; + NodeType[NodeType["EscapedValue"] = 29] = "EscapedValue"; + NodeType[NodeType["Function"] = 30] = "Function"; + NodeType[NodeType["NumericValue"] = 31] = "NumericValue"; + NodeType[NodeType["HexColorValue"] = 32] = "HexColorValue"; + NodeType[NodeType["MixinDeclaration"] = 33] = "MixinDeclaration"; + NodeType[NodeType["MixinReference"] = 34] = "MixinReference"; + NodeType[NodeType["VariableName"] = 35] = "VariableName"; + NodeType[NodeType["VariableDeclaration"] = 36] = "VariableDeclaration"; + NodeType[NodeType["Prio"] = 37] = "Prio"; + NodeType[NodeType["Interpolation"] = 38] = "Interpolation"; + NodeType[NodeType["NestedProperties"] = 39] = "NestedProperties"; + NodeType[NodeType["ExtendsReference"] = 40] = "ExtendsReference"; + NodeType[NodeType["SelectorPlaceholder"] = 41] = "SelectorPlaceholder"; + NodeType[NodeType["Debug"] = 42] = "Debug"; + NodeType[NodeType["If"] = 43] = "If"; + NodeType[NodeType["Else"] = 44] = "Else"; + NodeType[NodeType["For"] = 45] = "For"; + NodeType[NodeType["Each"] = 46] = "Each"; + NodeType[NodeType["While"] = 47] = "While"; + NodeType[NodeType["MixinContent"] = 48] = "MixinContent"; + NodeType[NodeType["Media"] = 49] = "Media"; + NodeType[NodeType["Keyframe"] = 50] = "Keyframe"; + NodeType[NodeType["FontFace"] = 51] = "FontFace"; + NodeType[NodeType["Import"] = 52] = "Import"; + NodeType[NodeType["Namespace"] = 53] = "Namespace"; + NodeType[NodeType["Invocation"] = 54] = "Invocation"; + NodeType[NodeType["FunctionDeclaration"] = 55] = "FunctionDeclaration"; + NodeType[NodeType["ReturnStatement"] = 56] = "ReturnStatement"; + NodeType[NodeType["MediaQuery"] = 57] = "MediaQuery"; + NodeType[NodeType["FunctionParameter"] = 58] = "FunctionParameter"; + NodeType[NodeType["FunctionArgument"] = 59] = "FunctionArgument"; + NodeType[NodeType["KeyframeSelector"] = 60] = "KeyframeSelector"; + NodeType[NodeType["ViewPort"] = 61] = "ViewPort"; + NodeType[NodeType["Document"] = 62] = "Document"; + NodeType[NodeType["AtApplyRule"] = 63] = "AtApplyRule"; + NodeType[NodeType["CustomPropertyDeclaration"] = 64] = "CustomPropertyDeclaration"; + NodeType[NodeType["CustomPropertySet"] = 65] = "CustomPropertySet"; + NodeType[NodeType["ListEntry"] = 66] = "ListEntry"; + NodeType[NodeType["Supports"] = 67] = "Supports"; + NodeType[NodeType["SupportsCondition"] = 68] = "SupportsCondition"; + NodeType[NodeType["NamespacePrefix"] = 69] = "NamespacePrefix"; + NodeType[NodeType["GridLine"] = 70] = "GridLine"; + NodeType[NodeType["Plugin"] = 71] = "Plugin"; + NodeType[NodeType["UnknownAtRule"] = 72] = "UnknownAtRule"; +})(NodeType || (NodeType = {})); +var ReferenceType; +(function (ReferenceType) { + ReferenceType[ReferenceType["Mixin"] = 0] = "Mixin"; + ReferenceType[ReferenceType["Rule"] = 1] = "Rule"; + ReferenceType[ReferenceType["Variable"] = 2] = "Variable"; + ReferenceType[ReferenceType["Function"] = 3] = "Function"; + ReferenceType[ReferenceType["Keyframe"] = 4] = "Keyframe"; + ReferenceType[ReferenceType["Unknown"] = 5] = "Unknown"; +})(ReferenceType || (ReferenceType = {})); +function getNodeAtOffset(node, offset) { + var candidate = null; + if (!node || offset < node.offset || offset > node.end) { + return null; + } + // Find the shortest node at the position + node.accept(function (node) { + if (node.offset === -1 && node.length === -1) { + return true; + } + if (node.offset <= offset && node.end >= offset) { + if (!candidate) { + candidate = node; + } + else if (node.length <= candidate.length) { + candidate = node; + } + return true; + } + return false; + }); + return candidate; } -function handleCustomData(options) { - if (options && options.customDataProviders) { - _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_11__["cssDataManager"].addDataProviders(options.customDataProviders); +function getNodePath(node, offset) { + var candidate = getNodeAtOffset(node, offset); + var path = []; + while (candidate) { + path.unshift(candidate); + candidate = candidate.parent; + } + return path; +} +function getParentDeclaration(node) { + var decl = node.findParent(NodeType.Declaration); + if (decl && decl.getValue() && decl.getValue().encloses(node)) { + return decl; + } + return null; +} +var cssNodes_Node = /** @class */ (function () { + function Node(offset, len, nodeType) { + if (offset === void 0) { offset = -1; } + if (len === void 0) { len = -1; } + this.parent = null; + this.offset = offset; + this.length = len; + if (nodeType) { + this.nodeType = nodeType; + } + } + Object.defineProperty(Node.prototype, "end", { + get: function () { return this.offset + this.length; }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Node.prototype, "type", { + get: function () { + return this.nodeType || NodeType.Undefined; + }, + set: function (type) { + this.nodeType = type; + }, + enumerable: true, + configurable: true + }); + Node.prototype.getTextProvider = function () { + var node = this; + while (node && !node.textProvider) { + node = node.parent; + } + if (node) { + return node.textProvider; + } + return function () { return 'unknown'; }; + }; + Node.prototype.getText = function () { + return this.getTextProvider()(this.offset, this.length); + }; + Node.prototype.matches = function (str) { + return this.length === str.length && this.getTextProvider()(this.offset, this.length) === str; + }; + Node.prototype.startsWith = function (str) { + return this.length >= str.length && this.getTextProvider()(this.offset, str.length) === str; + }; + Node.prototype.endsWith = function (str) { + return this.length >= str.length && this.getTextProvider()(this.end - str.length, str.length) === str; + }; + Node.prototype.accept = function (visitor) { + if (visitor(this) && this.children) { + for (var _i = 0, _a = this.children; _i < _a.length; _i++) { + var child = _a[_i]; + child.accept(visitor); + } + } + }; + Node.prototype.acceptVisitor = function (visitor) { + this.accept(visitor.visitNode.bind(visitor)); + }; + Node.prototype.adoptChild = function (node, index) { + if (index === void 0) { index = -1; } + if (node.parent && node.parent.children) { + var idx = node.parent.children.indexOf(node); + if (idx >= 0) { + node.parent.children.splice(idx, 1); + } + } + node.parent = this; + var children = this.children; + if (!children) { + children = this.children = []; + } + if (index !== -1) { + children.splice(index, 0, node); + } + else { + children.push(node); + } + return node; + }; + Node.prototype.attachTo = function (parent, index) { + if (index === void 0) { index = -1; } + if (parent) { + parent.adoptChild(this, index); + } + return this; + }; + Node.prototype.collectIssues = function (results) { + if (this.issues) { + results.push.apply(results, this.issues); + } + }; + Node.prototype.addIssue = function (issue) { + if (!this.issues) { + this.issues = []; + } + this.issues.push(issue); + }; + Node.prototype.hasIssue = function (rule) { + return Array.isArray(this.issues) && this.issues.some(function (i) { return i.getRule() === rule; }); + }; + Node.prototype.isErroneous = function (recursive) { + if (recursive === void 0) { recursive = false; } + if (this.issues && this.issues.length > 0) { + return true; + } + return recursive && Array.isArray(this.children) && this.children.some(function (c) { return c.isErroneous(true); }); + }; + Node.prototype.setNode = function (field, node, index) { + if (index === void 0) { index = -1; } + if (node) { + node.attachTo(this, index); + this[field] = node; + return true; + } + return false; + }; + Node.prototype.addChild = function (node) { + if (node) { + if (!this.children) { + this.children = []; + } + node.attachTo(this); + this.updateOffsetAndLength(node); + return true; + } + return false; + }; + Node.prototype.updateOffsetAndLength = function (node) { + if (node.offset < this.offset || this.offset === -1) { + this.offset = node.offset; + } + var nodeEnd = node.end; + if ((nodeEnd > this.end) || this.length === -1) { + this.length = nodeEnd - this.offset; + } + }; + Node.prototype.hasChildren = function () { + return this.children && this.children.length > 0; + }; + Node.prototype.getChildren = function () { + return this.children ? this.children.slice(0) : []; + }; + Node.prototype.getChild = function (index) { + if (this.children && index < this.children.length) { + return this.children[index]; + } + return null; + }; + Node.prototype.addChildren = function (nodes) { + for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { + var node = nodes_1[_i]; + this.addChild(node); + } + }; + Node.prototype.findFirstChildBeforeOffset = function (offset) { + if (this.children) { + var current = null; + for (var i = this.children.length - 1; i >= 0; i--) { + // iterate until we find a child that has a start offset smaller than the input offset + current = this.children[i]; + if (current.offset <= offset) { + return current; + } + } + } + return null; + }; + Node.prototype.findChildAtOffset = function (offset, goDeep) { + var current = this.findFirstChildBeforeOffset(offset); + if (current && current.end >= offset) { + if (goDeep) { + return current.findChildAtOffset(offset, true) || current; + } + return current; + } + return null; + }; + Node.prototype.encloses = function (candidate) { + return this.offset <= candidate.offset && this.offset + this.length >= candidate.offset + candidate.length; + }; + Node.prototype.getParent = function () { + var result = this.parent; + while (result instanceof Nodelist) { + result = result.parent; + } + return result; + }; + Node.prototype.findParent = function (type) { + var result = this; + while (result && result.type !== type) { + result = result.parent; + } + return result; + }; + Node.prototype.findAParent = function () { + var types = []; + for (var _i = 0; _i < arguments.length; _i++) { + types[_i] = arguments[_i]; + } + var result = this; + while (result && !types.some(function (t) { return result.type === t; })) { + result = result.parent; + } + return result; + }; + Node.prototype.setData = function (key, value) { + if (!this.options) { + this.options = {}; + } + this.options[key] = value; + }; + Node.prototype.getData = function (key) { + if (!this.options || !this.options.hasOwnProperty(key)) { + return null; + } + return this.options[key]; + }; + return Node; +}()); + +var Nodelist = /** @class */ (function (_super) { + cssNodes_extends(Nodelist, _super); + function Nodelist(parent, index) { + if (index === void 0) { index = -1; } + var _this = _super.call(this, -1, -1) || this; + _this.attachTo(parent, index); + _this.offset = -1; + _this.length = -1; + return _this; + } + return Nodelist; +}(cssNodes_Node)); + +var Identifier = /** @class */ (function (_super) { + cssNodes_extends(Identifier, _super); + function Identifier(offset, length) { + var _this = _super.call(this, offset, length) || this; + _this.isCustomProperty = false; + return _this; + } + Object.defineProperty(Identifier.prototype, "type", { + get: function () { + return NodeType.Identifier; + }, + enumerable: true, + configurable: true + }); + Identifier.prototype.containsInterpolation = function () { + return this.hasChildren(); + }; + return Identifier; +}(cssNodes_Node)); + +var Stylesheet = /** @class */ (function (_super) { + cssNodes_extends(Stylesheet, _super); + function Stylesheet(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Stylesheet.prototype, "type", { + get: function () { + return NodeType.Stylesheet; + }, + enumerable: true, + configurable: true + }); + Stylesheet.prototype.setName = function (value) { + this.name = value; + }; + return Stylesheet; +}(cssNodes_Node)); + +var Declarations = /** @class */ (function (_super) { + cssNodes_extends(Declarations, _super); + function Declarations(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Declarations.prototype, "type", { + get: function () { + return NodeType.Declarations; + }, + enumerable: true, + configurable: true + }); + return Declarations; +}(cssNodes_Node)); + +var BodyDeclaration = /** @class */ (function (_super) { + cssNodes_extends(BodyDeclaration, _super); + function BodyDeclaration(offset, length) { + return _super.call(this, offset, length) || this; + } + BodyDeclaration.prototype.getDeclarations = function () { + return this.declarations; + }; + BodyDeclaration.prototype.setDeclarations = function (decls) { + return this.setNode('declarations', decls); + }; + return BodyDeclaration; +}(cssNodes_Node)); + +var RuleSet = /** @class */ (function (_super) { + cssNodes_extends(RuleSet, _super); + function RuleSet(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(RuleSet.prototype, "type", { + get: function () { + return NodeType.Ruleset; + }, + enumerable: true, + configurable: true + }); + RuleSet.prototype.getSelectors = function () { + if (!this.selectors) { + this.selectors = new Nodelist(this); + } + return this.selectors; + }; + RuleSet.prototype.isNested = function () { + return !!this.parent && this.parent.findParent(NodeType.Declarations) !== null; + }; + return RuleSet; +}(BodyDeclaration)); + +var Selector = /** @class */ (function (_super) { + cssNodes_extends(Selector, _super); + function Selector(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Selector.prototype, "type", { + get: function () { + return NodeType.Selector; + }, + enumerable: true, + configurable: true + }); + return Selector; +}(cssNodes_Node)); + +var SimpleSelector = /** @class */ (function (_super) { + cssNodes_extends(SimpleSelector, _super); + function SimpleSelector(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(SimpleSelector.prototype, "type", { + get: function () { + return NodeType.SimpleSelector; + }, + enumerable: true, + configurable: true + }); + return SimpleSelector; +}(cssNodes_Node)); + +var AtApplyRule = /** @class */ (function (_super) { + cssNodes_extends(AtApplyRule, _super); + function AtApplyRule(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(AtApplyRule.prototype, "type", { + get: function () { + return NodeType.AtApplyRule; + }, + enumerable: true, + configurable: true + }); + AtApplyRule.prototype.setIdentifier = function (node) { + return this.setNode('identifier', node, 0); + }; + AtApplyRule.prototype.getIdentifier = function () { + return this.identifier; + }; + AtApplyRule.prototype.getName = function () { + return this.identifier ? this.identifier.getText() : ''; + }; + return AtApplyRule; +}(cssNodes_Node)); + +var AbstractDeclaration = /** @class */ (function (_super) { + cssNodes_extends(AbstractDeclaration, _super); + function AbstractDeclaration(offset, length) { + return _super.call(this, offset, length) || this; + } + return AbstractDeclaration; +}(cssNodes_Node)); + +var CustomPropertyDeclaration = /** @class */ (function (_super) { + cssNodes_extends(CustomPropertyDeclaration, _super); + function CustomPropertyDeclaration(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(CustomPropertyDeclaration.prototype, "type", { + get: function () { + return NodeType.CustomPropertyDeclaration; + }, + enumerable: true, + configurable: true + }); + CustomPropertyDeclaration.prototype.setProperty = function (node) { + return this.setNode('property', node); + }; + CustomPropertyDeclaration.prototype.getProperty = function () { + return this.property; + }; + CustomPropertyDeclaration.prototype.setValue = function (value) { + return this.setNode('value', value); + }; + CustomPropertyDeclaration.prototype.getValue = function () { + return this.value; + }; + CustomPropertyDeclaration.prototype.setPropertySet = function (value) { + return this.setNode('propertySet', value); + }; + CustomPropertyDeclaration.prototype.getPropertySet = function () { + return this.propertySet; + }; + return CustomPropertyDeclaration; +}(AbstractDeclaration)); + +var CustomPropertySet = /** @class */ (function (_super) { + cssNodes_extends(CustomPropertySet, _super); + function CustomPropertySet(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(CustomPropertySet.prototype, "type", { + get: function () { + return NodeType.CustomPropertySet; + }, + enumerable: true, + configurable: true + }); + return CustomPropertySet; +}(BodyDeclaration)); + +var Declaration = /** @class */ (function (_super) { + cssNodes_extends(Declaration, _super); + function Declaration(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Declaration.prototype, "type", { + get: function () { + return NodeType.Declaration; + }, + enumerable: true, + configurable: true + }); + Declaration.prototype.setProperty = function (node) { + return this.setNode('property', node); + }; + Declaration.prototype.getProperty = function () { + return this.property; + }; + Declaration.prototype.getFullPropertyName = function () { + var propertyName = this.property ? this.property.getName() : 'unknown'; + if (this.parent instanceof Declarations && this.parent.getParent() instanceof NestedProperties) { + var parentDecl = this.parent.getParent().getParent(); + if (parentDecl instanceof Declaration) { + return parentDecl.getFullPropertyName() + propertyName; + } + } + return propertyName; + }; + Declaration.prototype.getNonPrefixedPropertyName = function () { + var propertyName = this.getFullPropertyName(); + if (propertyName && propertyName.charAt(0) === '-') { + var vendorPrefixEnd = propertyName.indexOf('-', 1); + if (vendorPrefixEnd !== -1) { + return propertyName.substring(vendorPrefixEnd + 1); + } + } + return propertyName; + }; + Declaration.prototype.setValue = function (value) { + return this.setNode('value', value); + }; + Declaration.prototype.getValue = function () { + return this.value; + }; + Declaration.prototype.setNestedProperties = function (value) { + return this.setNode('nestedProperties', value); + }; + Declaration.prototype.getNestedProperties = function () { + return this.nestedProperties; + }; + return Declaration; +}(AbstractDeclaration)); + +var Property = /** @class */ (function (_super) { + cssNodes_extends(Property, _super); + function Property(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Property.prototype, "type", { + get: function () { + return NodeType.Property; + }, + enumerable: true, + configurable: true + }); + Property.prototype.setIdentifier = function (value) { + return this.setNode('identifier', value); + }; + Property.prototype.getIdentifier = function () { + return this.identifier; + }; + Property.prototype.getName = function () { + return this.getText(); + }; + Property.prototype.isCustomProperty = function () { + return this.identifier.isCustomProperty; + }; + return Property; +}(cssNodes_Node)); + +var Invocation = /** @class */ (function (_super) { + cssNodes_extends(Invocation, _super); + function Invocation(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Invocation.prototype, "type", { + get: function () { + return NodeType.Invocation; + }, + enumerable: true, + configurable: true + }); + Invocation.prototype.getArguments = function () { + if (!this.arguments) { + this.arguments = new Nodelist(this); + } + return this.arguments; + }; + return Invocation; +}(cssNodes_Node)); + +var Function = /** @class */ (function (_super) { + cssNodes_extends(Function, _super); + function Function(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Function.prototype, "type", { + get: function () { + return NodeType.Function; + }, + enumerable: true, + configurable: true + }); + Function.prototype.setIdentifier = function (node) { + return this.setNode('identifier', node, 0); + }; + Function.prototype.getIdentifier = function () { + return this.identifier; + }; + Function.prototype.getName = function () { + return this.identifier ? this.identifier.getText() : ''; + }; + return Function; +}(Invocation)); + +var FunctionParameter = /** @class */ (function (_super) { + cssNodes_extends(FunctionParameter, _super); + function FunctionParameter(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(FunctionParameter.prototype, "type", { + get: function () { + return NodeType.FunctionParameter; + }, + enumerable: true, + configurable: true + }); + FunctionParameter.prototype.setIdentifier = function (node) { + return this.setNode('identifier', node, 0); + }; + FunctionParameter.prototype.getIdentifier = function () { + return this.identifier; + }; + FunctionParameter.prototype.getName = function () { + return this.identifier ? this.identifier.getText() : ''; + }; + FunctionParameter.prototype.setDefaultValue = function (node) { + return this.setNode('defaultValue', node, 0); + }; + FunctionParameter.prototype.getDefaultValue = function () { + return this.defaultValue; + }; + return FunctionParameter; +}(cssNodes_Node)); + +var FunctionArgument = /** @class */ (function (_super) { + cssNodes_extends(FunctionArgument, _super); + function FunctionArgument(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(FunctionArgument.prototype, "type", { + get: function () { + return NodeType.FunctionArgument; + }, + enumerable: true, + configurable: true + }); + FunctionArgument.prototype.setIdentifier = function (node) { + return this.setNode('identifier', node, 0); + }; + FunctionArgument.prototype.getIdentifier = function () { + return this.identifier; + }; + FunctionArgument.prototype.getName = function () { + return this.identifier ? this.identifier.getText() : ''; + }; + FunctionArgument.prototype.setValue = function (node) { + return this.setNode('value', node, 0); + }; + FunctionArgument.prototype.getValue = function () { + return this.value; + }; + return FunctionArgument; +}(cssNodes_Node)); + +var IfStatement = /** @class */ (function (_super) { + cssNodes_extends(IfStatement, _super); + function IfStatement(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(IfStatement.prototype, "type", { + get: function () { + return NodeType.If; + }, + enumerable: true, + configurable: true + }); + IfStatement.prototype.setExpression = function (node) { + return this.setNode('expression', node, 0); + }; + IfStatement.prototype.setElseClause = function (elseClause) { + return this.setNode('elseClause', elseClause); + }; + return IfStatement; +}(BodyDeclaration)); + +var ForStatement = /** @class */ (function (_super) { + cssNodes_extends(ForStatement, _super); + function ForStatement(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(ForStatement.prototype, "type", { + get: function () { + return NodeType.For; + }, + enumerable: true, + configurable: true + }); + ForStatement.prototype.setVariable = function (node) { + return this.setNode('variable', node, 0); + }; + return ForStatement; +}(BodyDeclaration)); + +var EachStatement = /** @class */ (function (_super) { + cssNodes_extends(EachStatement, _super); + function EachStatement(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(EachStatement.prototype, "type", { + get: function () { + return NodeType.Each; + }, + enumerable: true, + configurable: true + }); + EachStatement.prototype.getVariables = function () { + if (!this.variables) { + this.variables = new Nodelist(this); + } + return this.variables; + }; + return EachStatement; +}(BodyDeclaration)); + +var WhileStatement = /** @class */ (function (_super) { + cssNodes_extends(WhileStatement, _super); + function WhileStatement(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(WhileStatement.prototype, "type", { + get: function () { + return NodeType.While; + }, + enumerable: true, + configurable: true + }); + return WhileStatement; +}(BodyDeclaration)); + +var ElseStatement = /** @class */ (function (_super) { + cssNodes_extends(ElseStatement, _super); + function ElseStatement(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(ElseStatement.prototype, "type", { + get: function () { + return NodeType.Else; + }, + enumerable: true, + configurable: true + }); + return ElseStatement; +}(BodyDeclaration)); + +var FunctionDeclaration = /** @class */ (function (_super) { + cssNodes_extends(FunctionDeclaration, _super); + function FunctionDeclaration(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(FunctionDeclaration.prototype, "type", { + get: function () { + return NodeType.FunctionDeclaration; + }, + enumerable: true, + configurable: true + }); + FunctionDeclaration.prototype.setIdentifier = function (node) { + return this.setNode('identifier', node, 0); + }; + FunctionDeclaration.prototype.getIdentifier = function () { + return this.identifier; + }; + FunctionDeclaration.prototype.getName = function () { + return this.identifier ? this.identifier.getText() : ''; + }; + FunctionDeclaration.prototype.getParameters = function () { + if (!this.parameters) { + this.parameters = new Nodelist(this); + } + return this.parameters; + }; + return FunctionDeclaration; +}(BodyDeclaration)); + +var ViewPort = /** @class */ (function (_super) { + cssNodes_extends(ViewPort, _super); + function ViewPort(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(ViewPort.prototype, "type", { + get: function () { + return NodeType.ViewPort; + }, + enumerable: true, + configurable: true + }); + return ViewPort; +}(BodyDeclaration)); + +var FontFace = /** @class */ (function (_super) { + cssNodes_extends(FontFace, _super); + function FontFace(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(FontFace.prototype, "type", { + get: function () { + return NodeType.FontFace; + }, + enumerable: true, + configurable: true + }); + return FontFace; +}(BodyDeclaration)); + +var NestedProperties = /** @class */ (function (_super) { + cssNodes_extends(NestedProperties, _super); + function NestedProperties(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(NestedProperties.prototype, "type", { + get: function () { + return NodeType.NestedProperties; + }, + enumerable: true, + configurable: true + }); + return NestedProperties; +}(BodyDeclaration)); + +var Keyframe = /** @class */ (function (_super) { + cssNodes_extends(Keyframe, _super); + function Keyframe(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Keyframe.prototype, "type", { + get: function () { + return NodeType.Keyframe; + }, + enumerable: true, + configurable: true + }); + Keyframe.prototype.setKeyword = function (keyword) { + return this.setNode('keyword', keyword, 0); + }; + Keyframe.prototype.getKeyword = function () { + return this.keyword; + }; + Keyframe.prototype.setIdentifier = function (node) { + return this.setNode('identifier', node, 0); + }; + Keyframe.prototype.getIdentifier = function () { + return this.identifier; + }; + Keyframe.prototype.getName = function () { + return this.identifier ? this.identifier.getText() : ''; + }; + return Keyframe; +}(BodyDeclaration)); + +var KeyframeSelector = /** @class */ (function (_super) { + cssNodes_extends(KeyframeSelector, _super); + function KeyframeSelector(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(KeyframeSelector.prototype, "type", { + get: function () { + return NodeType.KeyframeSelector; + }, + enumerable: true, + configurable: true + }); + return KeyframeSelector; +}(BodyDeclaration)); + +var Import = /** @class */ (function (_super) { + cssNodes_extends(Import, _super); + function Import(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Import.prototype, "type", { + get: function () { + return NodeType.Import; + }, + enumerable: true, + configurable: true + }); + Import.prototype.setMedialist = function (node) { + if (node) { + node.attachTo(this); + this.medialist = node; + return true; + } + return false; + }; + return Import; +}(cssNodes_Node)); + +var Namespace = /** @class */ (function (_super) { + cssNodes_extends(Namespace, _super); + function Namespace(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Namespace.prototype, "type", { + get: function () { + return NodeType.Namespace; + }, + enumerable: true, + configurable: true + }); + return Namespace; +}(cssNodes_Node)); + +var Media = /** @class */ (function (_super) { + cssNodes_extends(Media, _super); + function Media(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Media.prototype, "type", { + get: function () { + return NodeType.Media; + }, + enumerable: true, + configurable: true + }); + return Media; +}(BodyDeclaration)); + +var Supports = /** @class */ (function (_super) { + cssNodes_extends(Supports, _super); + function Supports(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Supports.prototype, "type", { + get: function () { + return NodeType.Supports; + }, + enumerable: true, + configurable: true + }); + return Supports; +}(BodyDeclaration)); + +var Document = /** @class */ (function (_super) { + cssNodes_extends(Document, _super); + function Document(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Document.prototype, "type", { + get: function () { + return NodeType.Document; + }, + enumerable: true, + configurable: true + }); + return Document; +}(BodyDeclaration)); + +var Medialist = /** @class */ (function (_super) { + cssNodes_extends(Medialist, _super); + function Medialist(offset, length) { + return _super.call(this, offset, length) || this; + } + Medialist.prototype.getMediums = function () { + if (!this.mediums) { + this.mediums = new Nodelist(this); + } + return this.mediums; + }; + return Medialist; +}(cssNodes_Node)); + +var MediaQuery = /** @class */ (function (_super) { + cssNodes_extends(MediaQuery, _super); + function MediaQuery(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(MediaQuery.prototype, "type", { + get: function () { + return NodeType.MediaQuery; + }, + enumerable: true, + configurable: true + }); + return MediaQuery; +}(cssNodes_Node)); + +var SupportsCondition = /** @class */ (function (_super) { + cssNodes_extends(SupportsCondition, _super); + function SupportsCondition(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(SupportsCondition.prototype, "type", { + get: function () { + return NodeType.SupportsCondition; + }, + enumerable: true, + configurable: true + }); + return SupportsCondition; +}(cssNodes_Node)); + +var Page = /** @class */ (function (_super) { + cssNodes_extends(Page, _super); + function Page(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Page.prototype, "type", { + get: function () { + return NodeType.Page; + }, + enumerable: true, + configurable: true + }); + return Page; +}(BodyDeclaration)); + +var PageBoxMarginBox = /** @class */ (function (_super) { + cssNodes_extends(PageBoxMarginBox, _super); + function PageBoxMarginBox(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(PageBoxMarginBox.prototype, "type", { + get: function () { + return NodeType.PageBoxMarginBox; + }, + enumerable: true, + configurable: true + }); + return PageBoxMarginBox; +}(BodyDeclaration)); + +var Expression = /** @class */ (function (_super) { + cssNodes_extends(Expression, _super); + function Expression(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Expression.prototype, "type", { + get: function () { + return NodeType.Expression; + }, + enumerable: true, + configurable: true + }); + return Expression; +}(cssNodes_Node)); + +var BinaryExpression = /** @class */ (function (_super) { + cssNodes_extends(BinaryExpression, _super); + function BinaryExpression(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(BinaryExpression.prototype, "type", { + get: function () { + return NodeType.BinaryExpression; + }, + enumerable: true, + configurable: true + }); + BinaryExpression.prototype.setLeft = function (left) { + return this.setNode('left', left); + }; + BinaryExpression.prototype.getLeft = function () { + return this.left; + }; + BinaryExpression.prototype.setRight = function (right) { + return this.setNode('right', right); + }; + BinaryExpression.prototype.getRight = function () { + return this.right; + }; + BinaryExpression.prototype.setOperator = function (value) { + return this.setNode('operator', value); + }; + BinaryExpression.prototype.getOperator = function () { + return this.operator; + }; + return BinaryExpression; +}(cssNodes_Node)); + +var Term = /** @class */ (function (_super) { + cssNodes_extends(Term, _super); + function Term(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Term.prototype, "type", { + get: function () { + return NodeType.Term; + }, + enumerable: true, + configurable: true + }); + Term.prototype.setOperator = function (value) { + return this.setNode('operator', value); + }; + Term.prototype.getOperator = function () { + return this.operator; + }; + Term.prototype.setExpression = function (value) { + return this.setNode('expression', value); + }; + Term.prototype.getExpression = function () { + return this.expression; + }; + return Term; +}(cssNodes_Node)); + +var AttributeSelector = /** @class */ (function (_super) { + cssNodes_extends(AttributeSelector, _super); + function AttributeSelector(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(AttributeSelector.prototype, "type", { + get: function () { + return NodeType.AttributeSelector; + }, + enumerable: true, + configurable: true + }); + AttributeSelector.prototype.setNamespacePrefix = function (value) { + return this.setNode('namespacePrefix', value); + }; + AttributeSelector.prototype.getNamespacePrefix = function () { + return this.namespacePrefix; + }; + AttributeSelector.prototype.setIdentifier = function (value) { + return this.setNode('identifier', value); + }; + AttributeSelector.prototype.getIdentifier = function () { + return this.identifier; + }; + AttributeSelector.prototype.setOperator = function (operator) { + return this.setNode('operator', operator); + }; + AttributeSelector.prototype.getOperator = function () { + return this.operator; + }; + AttributeSelector.prototype.setValue = function (value) { + return this.setNode('value', value); + }; + AttributeSelector.prototype.getValue = function () { + return this.value; + }; + return AttributeSelector; +}(cssNodes_Node)); + +var Operator = /** @class */ (function (_super) { + cssNodes_extends(Operator, _super); + function Operator(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Operator.prototype, "type", { + get: function () { + return NodeType.Operator; + }, + enumerable: true, + configurable: true + }); + return Operator; +}(cssNodes_Node)); + +var HexColorValue = /** @class */ (function (_super) { + cssNodes_extends(HexColorValue, _super); + function HexColorValue(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(HexColorValue.prototype, "type", { + get: function () { + return NodeType.HexColorValue; + }, + enumerable: true, + configurable: true + }); + return HexColorValue; +}(cssNodes_Node)); + +var _dot = '.'.charCodeAt(0), cssNodes_0 = '0'.charCodeAt(0), cssNodes_9 = '9'.charCodeAt(0); +var NumericValue = /** @class */ (function (_super) { + cssNodes_extends(NumericValue, _super); + function NumericValue(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(NumericValue.prototype, "type", { + get: function () { + return NodeType.NumericValue; + }, + enumerable: true, + configurable: true + }); + NumericValue.prototype.getValue = function () { + var raw = this.getText(); + var unitIdx = 0; + var code; + for (var i = 0, len = raw.length; i < len; i++) { + code = raw.charCodeAt(i); + if (!(cssNodes_0 <= code && code <= cssNodes_9 || code === _dot)) { + break; + } + unitIdx += 1; + } + return { + value: raw.substring(0, unitIdx), + unit: unitIdx < raw.length ? raw.substring(unitIdx) : undefined + }; + }; + return NumericValue; +}(cssNodes_Node)); + +var VariableDeclaration = /** @class */ (function (_super) { + cssNodes_extends(VariableDeclaration, _super); + function VariableDeclaration(offset, length) { + var _this = _super.call(this, offset, length) || this; + _this.needsSemicolon = true; + return _this; + } + Object.defineProperty(VariableDeclaration.prototype, "type", { + get: function () { + return NodeType.VariableDeclaration; + }, + enumerable: true, + configurable: true + }); + VariableDeclaration.prototype.setVariable = function (node) { + if (node) { + node.attachTo(this); + this.variable = node; + return true; + } + return false; + }; + VariableDeclaration.prototype.getVariable = function () { + return this.variable; + }; + VariableDeclaration.prototype.getName = function () { + return this.variable ? this.variable.getName() : ''; + }; + VariableDeclaration.prototype.setValue = function (node) { + if (node) { + node.attachTo(this); + this.value = node; + return true; + } + return false; + }; + VariableDeclaration.prototype.getValue = function () { + return this.value; + }; + return VariableDeclaration; +}(AbstractDeclaration)); + +var Interpolation = /** @class */ (function (_super) { + cssNodes_extends(Interpolation, _super); + function Interpolation(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Interpolation.prototype, "type", { + get: function () { + return NodeType.Interpolation; + }, + enumerable: true, + configurable: true + }); + return Interpolation; +}(cssNodes_Node)); + +var Variable = /** @class */ (function (_super) { + cssNodes_extends(Variable, _super); + function Variable(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(Variable.prototype, "type", { + get: function () { + return NodeType.VariableName; + }, + enumerable: true, + configurable: true + }); + Variable.prototype.getName = function () { + return this.getText(); + }; + return Variable; +}(cssNodes_Node)); + +var ExtendsReference = /** @class */ (function (_super) { + cssNodes_extends(ExtendsReference, _super); + function ExtendsReference(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(ExtendsReference.prototype, "type", { + get: function () { + return NodeType.ExtendsReference; + }, + enumerable: true, + configurable: true + }); + ExtendsReference.prototype.getSelectors = function () { + if (!this.selectors) { + this.selectors = new Nodelist(this); + } + return this.selectors; + }; + return ExtendsReference; +}(cssNodes_Node)); + +var MixinReference = /** @class */ (function (_super) { + cssNodes_extends(MixinReference, _super); + function MixinReference(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(MixinReference.prototype, "type", { + get: function () { + return NodeType.MixinReference; + }, + enumerable: true, + configurable: true + }); + MixinReference.prototype.getNamespaces = function () { + if (!this.namespaces) { + this.namespaces = new Nodelist(this); + } + return this.namespaces; + }; + MixinReference.prototype.setIdentifier = function (node) { + return this.setNode('identifier', node, 0); + }; + MixinReference.prototype.getIdentifier = function () { + return this.identifier; + }; + MixinReference.prototype.getName = function () { + return this.identifier ? this.identifier.getText() : ''; + }; + MixinReference.prototype.getArguments = function () { + if (!this.arguments) { + this.arguments = new Nodelist(this); + } + return this.arguments; + }; + MixinReference.prototype.setContent = function (node) { + return this.setNode('content', node); + }; + MixinReference.prototype.getContent = function () { + return this.content; + }; + return MixinReference; +}(cssNodes_Node)); + +var MixinDeclaration = /** @class */ (function (_super) { + cssNodes_extends(MixinDeclaration, _super); + function MixinDeclaration(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(MixinDeclaration.prototype, "type", { + get: function () { + return NodeType.MixinDeclaration; + }, + enumerable: true, + configurable: true + }); + MixinDeclaration.prototype.setIdentifier = function (node) { + return this.setNode('identifier', node, 0); + }; + MixinDeclaration.prototype.getIdentifier = function () { + return this.identifier; + }; + MixinDeclaration.prototype.getName = function () { + return this.identifier ? this.identifier.getText() : ''; + }; + MixinDeclaration.prototype.getParameters = function () { + if (!this.parameters) { + this.parameters = new Nodelist(this); + } + return this.parameters; + }; + MixinDeclaration.prototype.setGuard = function (node) { + if (node) { + node.attachTo(this); + this.guard = node; + } + return false; + }; + return MixinDeclaration; +}(BodyDeclaration)); + +var UnknownAtRule = /** @class */ (function (_super) { + cssNodes_extends(UnknownAtRule, _super); + function UnknownAtRule(offset, length) { + return _super.call(this, offset, length) || this; + } + Object.defineProperty(UnknownAtRule.prototype, "type", { + get: function () { + return NodeType.UnknownAtRule; + }, + enumerable: true, + configurable: true + }); + UnknownAtRule.prototype.setAtRuleName = function (atRuleName) { + this.atRuleName = atRuleName; + }; + UnknownAtRule.prototype.getAtRuleName = function (atRuleName) { + return this.atRuleName; + }; + return UnknownAtRule; +}(BodyDeclaration)); + +var ListEntry = /** @class */ (function (_super) { + cssNodes_extends(ListEntry, _super); + function ListEntry() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(ListEntry.prototype, "type", { + get: function () { + return NodeType.ListEntry; + }, + enumerable: true, + configurable: true + }); + ListEntry.prototype.setKey = function (node) { + return this.setNode('key', node, 0); + }; + ListEntry.prototype.setValue = function (node) { + return this.setNode('value', node, 1); + }; + return ListEntry; +}(cssNodes_Node)); + +var LessGuard = /** @class */ (function (_super) { + cssNodes_extends(LessGuard, _super); + function LessGuard() { + return _super !== null && _super.apply(this, arguments) || this; + } + LessGuard.prototype.getConditions = function () { + if (!this.conditions) { + this.conditions = new Nodelist(this); + } + return this.conditions; + }; + return LessGuard; +}(cssNodes_Node)); + +var GuardCondition = /** @class */ (function (_super) { + cssNodes_extends(GuardCondition, _super); + function GuardCondition() { + return _super !== null && _super.apply(this, arguments) || this; + } + GuardCondition.prototype.setVariable = function (node) { + return this.setNode('variable', node); + }; + return GuardCondition; +}(cssNodes_Node)); + +var Level; +(function (Level) { + Level[Level["Ignore"] = 1] = "Ignore"; + Level[Level["Warning"] = 2] = "Warning"; + Level[Level["Error"] = 4] = "Error"; +})(Level || (Level = {})); +var Marker = /** @class */ (function () { + function Marker(node, rule, level, message, offset, length) { + if (offset === void 0) { offset = node.offset; } + if (length === void 0) { length = node.length; } + this.node = node; + this.rule = rule; + this.level = level; + this.message = message || rule.message; + this.offset = offset; + this.length = length; + } + Marker.prototype.getRule = function () { + return this.rule; + }; + Marker.prototype.getLevel = function () { + return this.level; + }; + Marker.prototype.getOffset = function () { + return this.offset; + }; + Marker.prototype.getLength = function () { + return this.length; + }; + Marker.prototype.getNode = function () { + return this.node; + }; + Marker.prototype.getMessage = function () { + return this.message; + }; + return Marker; +}()); + +/* +export class DefaultVisitor implements IVisitor { + + public visitNode(node:Node):boolean { + switch (node.type) { + case NodeType.Stylesheet: + return this.visitStylesheet( node); + case NodeType.FontFace: + return this.visitFontFace( node); + case NodeType.Ruleset: + return this.visitRuleSet( node); + case NodeType.Selector: + return this.visitSelector( node); + case NodeType.SimpleSelector: + return this.visitSimpleSelector( node); + case NodeType.Declaration: + return this.visitDeclaration( node); + case NodeType.Function: + return this.visitFunction( node); + case NodeType.FunctionDeclaration: + return this.visitFunctionDeclaration( node); + case NodeType.FunctionParameter: + return this.visitFunctionParameter( node); + case NodeType.FunctionArgument: + return this.visitFunctionArgument( node); + case NodeType.Term: + return this.visitTerm( node); + case NodeType.Declaration: + return this.visitExpression( node); + case NodeType.NumericValue: + return this.visitNumericValue( node); + case NodeType.Page: + return this.visitPage( node); + case NodeType.PageBoxMarginBox: + return this.visitPageBoxMarginBox( node); + case NodeType.Property: + return this.visitProperty( node); + case NodeType.NumericValue: + return this.visitNodelist( node); + case NodeType.Import: + return this.visitImport( node); + case NodeType.Namespace: + return this.visitNamespace( node); + case NodeType.Keyframe: + return this.visitKeyframe( node); + case NodeType.KeyframeSelector: + return this.visitKeyframeSelector( node); + case NodeType.MixinDeclaration: + return this.visitMixinDeclaration( node); + case NodeType.MixinReference: + return this.visitMixinReference( node); + case NodeType.Variable: + return this.visitVariable( node); + case NodeType.VariableDeclaration: + return this.visitVariableDeclaration( node); + } + return this.visitUnknownNode(node); + } + + public visitFontFace(node:FontFace):boolean { + return true; + } + + public visitKeyframe(node:Keyframe):boolean { + return true; + } + + public visitKeyframeSelector(node:KeyframeSelector):boolean { + return true; + } + + public visitStylesheet(node:Stylesheet):boolean { + return true; + } + + public visitProperty(Node:Property):boolean { + return true; + } + + public visitRuleSet(node:RuleSet):boolean { + return true; + } + + public visitSelector(node:Selector):boolean { + return true; + } + + public visitSimpleSelector(node:SimpleSelector):boolean { + return true; + } + + public visitDeclaration(node:Declaration):boolean { + return true; + } + + public visitFunction(node:Function):boolean { + return true; + } + + public visitFunctionDeclaration(node:FunctionDeclaration):boolean { + return true; + } + + public visitInvocation(node:Invocation):boolean { + return true; + } + + public visitTerm(node:Term):boolean { + return true; + } + + public visitImport(node:Import):boolean { + return true; + } + + public visitNamespace(node:Namespace):boolean { + return true; + } + + public visitExpression(node:Expression):boolean { + return true; + } + + public visitNumericValue(node:NumericValue):boolean { + return true; + } + + public visitPage(node:Page):boolean { + return true; + } + + public visitPageBoxMarginBox(node:PageBoxMarginBox):boolean { + return true; + } + + public visitNodelist(node:Nodelist):boolean { + return true; + } + + public visitVariableDeclaration(node:VariableDeclaration):boolean { + return true; + } + + public visitVariable(node:Variable):boolean { + return true; + } + + public visitMixinDeclaration(node:MixinDeclaration):boolean { + return true; + } + + public visitMixinReference(node:MixinReference):boolean { + return true; + } + + public visitUnknownNode(node:Node):boolean { + return true; } } -function getCSSLanguageService(options) { - handleCustomData(options); - return createFacade(new _parser_cssParser_js__WEBPACK_IMPORTED_MODULE_0__["Parser"](), new _services_cssCompletion_js__WEBPACK_IMPORTED_MODULE_1__["CSSCompletion"](), new _services_cssHover_js__WEBPACK_IMPORTED_MODULE_2__["CSSHover"](), new _services_cssNavigation_js__WEBPACK_IMPORTED_MODULE_3__["CSSNavigation"](), new _services_cssCodeActions_js__WEBPACK_IMPORTED_MODULE_4__["CSSCodeActions"](), new _services_cssValidation_js__WEBPACK_IMPORTED_MODULE_5__["CSSValidation"]()); +*/ +var ParseErrorCollector = /** @class */ (function () { + function ParseErrorCollector() { + this.entries = []; + } + ParseErrorCollector.entries = function (node) { + var visitor = new ParseErrorCollector(); + node.acceptVisitor(visitor); + return visitor.entries; + }; + ParseErrorCollector.prototype.visitNode = function (node) { + if (node.isErroneous()) { + node.collectIssues(this.entries); + } + return true; + }; + return ParseErrorCollector; +}()); + + +// 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 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 getSCSSLanguageService(options) { - handleCustomData(options); - return createFacade(new _parser_scssParser_js__WEBPACK_IMPORTED_MODULE_6__["SCSSParser"](), new _services_scssCompletion_js__WEBPACK_IMPORTED_MODULE_7__["SCSSCompletion"](), new _services_cssHover_js__WEBPACK_IMPORTED_MODULE_2__["CSSHover"](), new _services_cssNavigation_js__WEBPACK_IMPORTED_MODULE_3__["CSSNavigation"](), new _services_cssCodeActions_js__WEBPACK_IMPORTED_MODULE_4__["CSSCodeActions"](), new _services_cssValidation_js__WEBPACK_IMPORTED_MODULE_5__["CSSValidation"]()); +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 getLESSLanguageService(options) { - handleCustomData(options); - return createFacade(new _parser_lessParser_js__WEBPACK_IMPORTED_MODULE_8__["LESSParser"](), new _services_lessCompletion_js__WEBPACK_IMPORTED_MODULE_9__["LESSCompletion"](), new _services_cssHover_js__WEBPACK_IMPORTED_MODULE_2__["CSSHover"](), new _services_cssNavigation_js__WEBPACK_IMPORTED_MODULE_3__["CSSNavigation"](), new _services_cssCodeActions_js__WEBPACK_IMPORTED_MODULE_4__["CSSCodeActions"](), new _services_cssValidation_js__WEBPACK_IMPORTED_MODULE_5__["CSSValidation"]()); +function loadMessageBundle(file) { + return localize; +} +function config(opt) { + return loadMessageBundle; } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/cssLanguageTypes.js": -/*!*************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/cssLanguageTypes.js ***! - \*************************************************************************************************************/ -/*! exports provided: Range, TextEdit, Position, SelectionRangeKind */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionRangeKind", function() { return SelectionRangeKind; }); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-languageserver-types/main.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Range"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextEdit", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextEdit"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Position"]; }); - +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssErrors.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +var cssErrors_localize = loadMessageBundle(); +var CSSIssueType = /** @class */ (function () { + function CSSIssueType(id, message) { + this.id = id; + this.message = message; + } + return CSSIssueType; +}()); -// #region Proposed types, remove once added to vscode-languageserver-types -/** - * Enum of known selection range kinds - */ -var SelectionRangeKind; -(function (SelectionRangeKind) { - /** - * Empty Kind. - */ - SelectionRangeKind["Empty"] = ""; - /** - * The statment kind, its value is `statement`, possible extensions can be - * `statement.if` etc - */ - SelectionRangeKind["Statement"] = "statement"; - /** - * The declaration kind, its value is `declaration`, possible extensions can be - * `declaration.function`, `declaration.class` etc. - */ - SelectionRangeKind["Declaration"] = "declaration"; -})(SelectionRangeKind || (SelectionRangeKind = {})); +var ParseError = { + NumberExpected: new CSSIssueType('css-numberexpected', cssErrors_localize('expected.number', "number expected")), + ConditionExpected: new CSSIssueType('css-conditionexpected', cssErrors_localize('expected.condt', "condition expected")), + RuleOrSelectorExpected: new CSSIssueType('css-ruleorselectorexpected', cssErrors_localize('expected.ruleorselector', "at-rule or selector expected")), + DotExpected: new CSSIssueType('css-dotexpected', cssErrors_localize('expected.dot', "dot expected")), + ColonExpected: new CSSIssueType('css-colonexpected', cssErrors_localize('expected.colon', "colon expected")), + SemiColonExpected: new CSSIssueType('css-semicolonexpected', cssErrors_localize('expected.semicolon', "semi-colon expected")), + TermExpected: new CSSIssueType('css-termexpected', cssErrors_localize('expected.term', "term expected")), + ExpressionExpected: new CSSIssueType('css-expressionexpected', cssErrors_localize('expected.expression', "expression expected")), + OperatorExpected: new CSSIssueType('css-operatorexpected', cssErrors_localize('expected.operator', "operator expected")), + IdentifierExpected: new CSSIssueType('css-identifierexpected', cssErrors_localize('expected.ident', "identifier expected")), + PercentageExpected: new CSSIssueType('css-percentageexpected', cssErrors_localize('expected.percentage', "percentage expected")), + URIOrStringExpected: new CSSIssueType('css-uriorstringexpected', cssErrors_localize('expected.uriorstring', "uri or string expected")), + URIExpected: new CSSIssueType('css-uriexpected', cssErrors_localize('expected.uri', "URI expected")), + VariableNameExpected: new CSSIssueType('css-varnameexpected', cssErrors_localize('expected.varname', "variable name expected")), + VariableValueExpected: new CSSIssueType('css-varvalueexpected', cssErrors_localize('expected.varvalue', "variable value expected")), + PropertyValueExpected: new CSSIssueType('css-propertyvalueexpected', cssErrors_localize('expected.propvalue', "property value expected")), + LeftCurlyExpected: new CSSIssueType('css-lcurlyexpected', cssErrors_localize('expected.lcurly', "{ expected")), + RightCurlyExpected: new CSSIssueType('css-rcurlyexpected', cssErrors_localize('expected.rcurly', "} expected")), + LeftSquareBracketExpected: new CSSIssueType('css-rbracketexpected', cssErrors_localize('expected.lsquare', "[ expected")), + RightSquareBracketExpected: new CSSIssueType('css-lbracketexpected', cssErrors_localize('expected.rsquare', "] expected")), + LeftParenthesisExpected: new CSSIssueType('css-lparentexpected', cssErrors_localize('expected.lparen', "( expected")), + RightParenthesisExpected: new CSSIssueType('css-rparentexpected', cssErrors_localize('expected.rparent', ") expected")), + CommaExpected: new CSSIssueType('css-commaexpected', cssErrors_localize('expected.comma', "comma expected")), + PageDirectiveOrDeclarationExpected: new CSSIssueType('css-pagedirordeclexpected', cssErrors_localize('expected.pagedirordecl', "page directive or declaraton expected")), + UnknownAtRule: new CSSIssueType('css-unknownatrule', cssErrors_localize('unknown.atrule', "at-rule unknown")), + UnknownKeyword: new CSSIssueType('css-unknownkeyword', cssErrors_localize('unknown.keyword', "unknown keyword")), + SelectorExpected: new CSSIssueType('css-selectorexpected', cssErrors_localize('expected.selector', "selector expected")), + StringLiteralExpected: new CSSIssueType('css-stringliteralexpected', cssErrors_localize('expected.stringliteral', "string literal expected")), + WhitespaceExpected: new CSSIssueType('css-whitespaceexpected', cssErrors_localize('expected.whitespace', "whitespace expected")), + MediaQueryExpected: new CSSIssueType('css-mediaqueryexpected', cssErrors_localize('expected.mediaquery', "media query expected")) +}; - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/data/browsers.js": -/*!**********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/data/browsers.js ***! - \**********************************************************************************************************/ -/*! exports provided: cssData, descriptions */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cssData", function() { return cssData; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "descriptions", function() { return descriptions; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/data/browsers.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -25618,208 +26924,260 @@ var descriptions = { "vertical-rl": "Right-to-left block flow direction. The writing mode is vertical." }; - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/builtinData.js": -/*!**********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/builtinData.js ***! - \**********************************************************************************************************************/ -/*! exports provided: positionKeywords, repeatStyleKeywords, lineStyleKeywords, lineWidthKeywords, boxKeywords, geometryBoxKeywords, cssWideKeywords, imageFunctions, transitionTimingFunctions, basicShapeFunctions, units, html5Tags, svgElements, pageBoxDirectives */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionKeywords", function() { return positionKeywords; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeatStyleKeywords", function() { return repeatStyleKeywords; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lineStyleKeywords", function() { return lineStyleKeywords; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lineWidthKeywords", function() { return lineWidthKeywords; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "boxKeywords", function() { return boxKeywords; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "geometryBoxKeywords", function() { return geometryBoxKeywords; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cssWideKeywords", function() { return cssWideKeywords; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "imageFunctions", function() { return imageFunctions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transitionTimingFunctions", function() { return transitionTimingFunctions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "basicShapeFunctions", function() { return basicShapeFunctions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "units", function() { return units; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "html5Tags", function() { return html5Tags; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "svgElements", function() { return svgElements; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pageBoxDirectives", function() { return pageBoxDirectives; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/utils/objects.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var positionKeywords = { - 'bottom': 'Computes to ‘100%’ for the vertical position if one or two values are given, otherwise specifies the bottom edge as the origin for the next offset.', - 'center': 'Computes to ‘50%’ (‘left 50%’) for the horizontal position if the horizontal position is not otherwise specified, or ‘50%’ (‘top 50%’) for the vertical position if it is.', - 'left': 'Computes to ‘0%’ for the horizontal position if one or two values are given, otherwise specifies the left edge as the origin for the next offset.', - 'right': 'Computes to ‘100%’ for the horizontal position if one or two values are given, otherwise specifies the right edge as the origin for the next offset.', - 'top': 'Computes to ‘0%’ for the vertical position if one or two values are given, otherwise specifies the top edge as the origin for the next offset.' -}; -var repeatStyleKeywords = { - 'no-repeat': 'Placed once and not repeated in this direction.', - 'repeat': 'Repeated in this direction as often as needed to cover the background painting area.', - 'repeat-x': 'Computes to ‘repeat no-repeat’.', - 'repeat-y': 'Computes to ‘no-repeat repeat’.', - 'round': 'Repeated as often as will fit within the background positioning area. If it doesn’t fit a whole number of times, it is rescaled so that it does.', - 'space': 'Repeated as often as will fit within the background positioning area without being clipped and then the images are spaced out to fill the area.' -}; -var lineStyleKeywords = { - 'dashed': 'A series of square-ended dashes.', - 'dotted': 'A series of round dots.', - 'double': 'Two parallel solid lines with some space between them.', - 'groove': 'Looks as if it were carved in the canvas.', - 'hidden': 'Same as ‘none’, but has different behavior in the border conflict resolution rules for border-collapsed tables.', - 'inset': 'Looks as if the content on the inside of the border is sunken into the canvas.', - 'none': 'No border. Color and width are ignored.', - 'outset': 'Looks as if the content on the inside of the border is coming out of the canvas.', - 'ridge': 'Looks as if it were coming out of the canvas.', - 'solid': 'A single line segment.' -}; -var lineWidthKeywords = ['medium', 'thick', 'thin']; -var boxKeywords = { - 'border-box': 'The background is painted within (clipped to) the border box.', - 'content-box': 'The background is painted within (clipped to) the content box.', - 'padding-box': 'The background is painted within (clipped to) the padding box.' -}; -var geometryBoxKeywords = { - 'margin-box': 'Uses the margin box as reference box.', - 'fill-box': 'Uses the object bounding box as reference box.', - 'stroke-box': 'Uses the stroke bounding box as reference box.', - 'view-box': 'Uses the nearest SVG viewport as reference box.' -}; -var cssWideKeywords = { - 'initial': 'Represents the value specified as the property’s initial value.', - 'inherit': 'Represents the computed value of the property on the element’s parent.', - 'unset': 'Acts as either `inherit` or `initial`, depending on whether the property is inherited or not.' -}; -var imageFunctions = { - 'url()': 'Reference an image file by URL', - 'image()': 'Provide image fallbacks and annotations.', - '-webkit-image-set()': 'Provide multiple resolutions. Remember to use unprefixed image-set() in addition.', - 'image-set()': 'Provide multiple resolutions of an image and const the UA decide which is most appropriate in a given situation.', - '-moz-element()': 'Use an element in the document as an image. Remember to use unprefixed element() in addition.', - 'element()': 'Use an element in the document as an image.', - 'cross-fade()': 'Indicates the two images to be combined and how far along in the transition the combination is.', - '-webkit-gradient()': 'Deprecated. Use modern linear-gradient() or radial-gradient() instead.', - '-webkit-linear-gradient()': 'Linear gradient. Remember to use unprefixed version in addition.', - '-moz-linear-gradient()': 'Linear gradient. Remember to use unprefixed version in addition.', - '-o-linear-gradient()': 'Linear gradient. Remember to use unprefixed version in addition.', - 'linear-gradient()': 'A linear gradient is created by specifying a straight gradient line, and then several colors placed along that line.', - '-webkit-repeating-linear-gradient()': 'Repeating Linear gradient. Remember to use unprefixed version in addition.', - '-moz-repeating-linear-gradient()': 'Repeating Linear gradient. Remember to use unprefixed version in addition.', - '-o-repeating-linear-gradient()': 'RepeatingLinear gradient. Remember to use unprefixed version in addition.', - 'repeating-linear-gradient()': 'Same as linear-gradient, except the color-stops are repeated infinitely in both directions, with their positions shifted by multiples of the difference between the last specified color-stop’s position and the first specified color-stop’s position.', - '-webkit-radial-gradient()': 'Radial gradient. Remember to use unprefixed version in addition.', - '-moz-radial-gradient()': 'Radial gradient. Remember to use unprefixed version in addition.', - 'radial-gradient()': 'Colors emerge from a single point and smoothly spread outward in a circular or elliptical shape.', - '-webkit-repeating-radial-gradient()': 'Repeating radial gradient. Remember to use unprefixed version in addition.', - '-moz-repeating-radial-gradient()': 'Repeating radial gradient. Remember to use unprefixed version in addition.', - 'repeating-radial-gradient()': 'Same as radial-gradient, except the color-stops are repeated infinitely in both directions, with their positions shifted by multiples of the difference between the last specified color-stop’s position and the first specified color-stop’s position.' -}; -var transitionTimingFunctions = { - 'ease': 'Equivalent to cubic-bezier(0.25, 0.1, 0.25, 1.0).', - 'ease-in': 'Equivalent to cubic-bezier(0.42, 0, 1.0, 1.0).', - 'ease-in-out': 'Equivalent to cubic-bezier(0.42, 0, 0.58, 1.0).', - 'ease-out': 'Equivalent to cubic-bezier(0, 0, 0.58, 1.0).', - 'linear': 'Equivalent to cubic-bezier(0.0, 0.0, 1.0, 1.0).', - 'step-end': 'Equivalent to steps(1, end).', - 'step-start': 'Equivalent to steps(1, start).', - 'steps()': 'The first parameter specifies the number of intervals in the function. The second parameter, which is optional, is either the value “start” or “end”.', - 'cubic-bezier()': 'Specifies a cubic-bezier curve. The four values specify points P1 and P2 of the curve as (x1, y1, x2, y2).', - 'cubic-bezier(0.6, -0.28, 0.735, 0.045)': 'Ease-in Back. Overshoots.', - 'cubic-bezier(0.68, -0.55, 0.265, 1.55)': 'Ease-in-out Back. Overshoots.', - 'cubic-bezier(0.175, 0.885, 0.32, 1.275)': 'Ease-out Back. Overshoots.', - 'cubic-bezier(0.6, 0.04, 0.98, 0.335)': 'Ease-in Circular. Based on half circle.', - 'cubic-bezier(0.785, 0.135, 0.15, 0.86)': 'Ease-in-out Circular. Based on half circle.', - 'cubic-bezier(0.075, 0.82, 0.165, 1)': 'Ease-out Circular. Based on half circle.', - 'cubic-bezier(0.55, 0.055, 0.675, 0.19)': 'Ease-in Cubic. Based on power of three.', - 'cubic-bezier(0.645, 0.045, 0.355, 1)': 'Ease-in-out Cubic. Based on power of three.', - 'cubic-bezier(0.215, 0.610, 0.355, 1)': 'Ease-out Cubic. Based on power of three.', - 'cubic-bezier(0.95, 0.05, 0.795, 0.035)': 'Ease-in Exponential. Based on two to the power ten.', - 'cubic-bezier(1, 0, 0, 1)': 'Ease-in-out Exponential. Based on two to the power ten.', - 'cubic-bezier(0.19, 1, 0.22, 1)': 'Ease-out Exponential. Based on two to the power ten.', - 'cubic-bezier(0.47, 0, 0.745, 0.715)': 'Ease-in Sine.', - 'cubic-bezier(0.445, 0.05, 0.55, 0.95)': 'Ease-in-out Sine.', - 'cubic-bezier(0.39, 0.575, 0.565, 1)': 'Ease-out Sine.', - 'cubic-bezier(0.55, 0.085, 0.68, 0.53)': 'Ease-in Quadratic. Based on power of two.', - 'cubic-bezier(0.455, 0.03, 0.515, 0.955)': 'Ease-in-out Quadratic. Based on power of two.', - 'cubic-bezier(0.25, 0.46, 0.45, 0.94)': 'Ease-out Quadratic. Based on power of two.', - 'cubic-bezier(0.895, 0.03, 0.685, 0.22)': 'Ease-in Quartic. Based on power of four.', - 'cubic-bezier(0.77, 0, 0.175, 1)': 'Ease-in-out Quartic. Based on power of four.', - 'cubic-bezier(0.165, 0.84, 0.44, 1)': 'Ease-out Quartic. Based on power of four.', - 'cubic-bezier(0.755, 0.05, 0.855, 0.06)': 'Ease-in Quintic. Based on power of five.', - 'cubic-bezier(0.86, 0, 0.07, 1)': 'Ease-in-out Quintic. Based on power of five.', - 'cubic-bezier(0.23, 1, 0.320, 1)': 'Ease-out Quintic. Based on power of five.' -}; -var basicShapeFunctions = { - 'circle()': 'Defines a circle.', - 'ellipse()': 'Defines an ellipse.', - 'inset()': 'Defines an inset rectangle.', - 'polygon()': 'Defines a polygon.' -}; -var units = { - 'length': ['em', 'rem', 'ex', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ch', 'vw', 'vh', 'vmin', 'vmax'], - 'angle': ['deg', 'rad', 'grad', 'turn'], - 'time': ['ms', 's'], - 'frequency': ['Hz', 'kHz'], - 'resolution': ['dpi', 'dpcm', 'dppx'], - 'percentage': ['%', 'fr'] -}; -var html5Tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', - 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', - 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', - 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', - 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', - 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'const', 'video', 'wbr']; -var svgElements = ['circle', 'clipPath', 'cursor', 'defs', 'desc', 'ellipse', 'feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', - 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', - 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence', 'filter', 'foreignObject', 'g', 'hatch', 'hatchpath', 'image', 'line', 'linearGradient', - 'marker', 'mask', 'mesh', 'meshpatch', 'meshrow', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'set', 'solidcolor', 'stop', 'svg', 'switch', - 'symbol', 'text', 'textPath', 'tspan', 'use', 'view']; -var pageBoxDirectives = [ - '@bottom-center', '@bottom-left', '@bottom-left-corner', '@bottom-right', '@bottom-right-corner', - '@left-bottom', '@left-middle', '@left-top', '@right-bottom', '@right-middle', '@right-top', - '@top-center', '@top-left', '@top-left-corner', '@top-right', '@top-right-corner' -]; +function values(obj) { + return Object.keys(obj).map(function (k) { return obj[k]; }); +} - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/colors.js": -/*!*****************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/colors.js ***! - \*****************************************************************************************************************/ -/*! exports provided: colorFunctions, colors, colorKeywords, isColorConstructor, isColorValue, hexDigit, colorFromHex, colorFrom256RGB, colorFromHSL, hslFromColor, getColorValue */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colorFunctions", function() { return colorFunctions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colors", function() { return colors; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colorKeywords", function() { return colorKeywords; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isColorConstructor", function() { return isColorConstructor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isColorValue", function() { return isColorValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hexDigit", function() { return hexDigit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colorFromHex", function() { return colorFromHex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colorFrom256RGB", function() { return colorFrom256RGB; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colorFromHSL", function() { return colorFromHSL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hslFromColor", function() { return hslFromColor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getColorValue", function() { return getColorValue; }); -/* harmony import */ var _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/cssNodes.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./node_modules/monaco-editor/esm/vs/language/css/fillers/vscode-nls.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/dataManager.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_1__["loadMessageBundle"](); +var dataManager_CSSDataManager = /** @class */ (function () { + function CSSDataManager(dataProviders) { + this.dataProviders = dataProviders; + this._propertySet = {}; + this._atDirectiveSet = {}; + this._pseudoClassSet = {}; + this._pseudoElementSet = {}; + this._properties = []; + this._atDirectives = []; + this._pseudoClasses = []; + this._pseudoElements = []; + this.collectData(); + } + CSSDataManager.prototype.addDataProviders = function (providers) { + this.dataProviders = this.dataProviders.concat(providers); + this.collectData(); + }; + /** + * Collect all data & handle duplicates + */ + CSSDataManager.prototype.collectData = function () { + var _this = this; + this.dataProviders.forEach(function (provider) { + provider.provideProperties().forEach(function (p) { + if (!_this._propertySet[p.name]) { + _this._propertySet[p.name] = p; + } + }); + provider.provideAtDirectives().forEach(function (p) { + if (!_this._atDirectiveSet[p.name]) { + _this._atDirectiveSet[p.name] = p; + } + }); + provider.providePseudoClasses().forEach(function (p) { + if (!_this._pseudoClassSet[p.name]) { + _this._pseudoClassSet[p.name] = p; + } + }); + provider.providePseudoElements().forEach(function (p) { + if (!_this._pseudoElementSet[p.name]) { + _this._pseudoElementSet[p.name] = p; + } + }); + }); + this._properties = values(this._propertySet); + this._atDirectives = values(this._atDirectiveSet); + this._pseudoClasses = values(this._pseudoClassSet); + this._pseudoElements = values(this._pseudoElementSet); + }; + CSSDataManager.prototype.getProperty = function (name) { return this._propertySet[name]; }; + CSSDataManager.prototype.getAtDirective = function (name) { return this._atDirectiveSet[name]; }; + CSSDataManager.prototype.getPseudoClass = function (name) { return this._pseudoClassSet[name]; }; + CSSDataManager.prototype.getPseudoElement = function (name) { return this._pseudoElementSet[name]; }; + CSSDataManager.prototype.getProperties = function (majorBrowserSupport) { + if (majorBrowserSupport === void 0) { majorBrowserSupport = true; } + if (!majorBrowserSupport) { + return this._properties; + } + else { + return this._properties.filter(supportedInMoreThanOneBrowser); + } + }; + CSSDataManager.prototype.getAtDirectives = function (majorBrowserSupport) { + if (majorBrowserSupport === void 0) { majorBrowserSupport = true; } + if (!majorBrowserSupport) { + return this._atDirectives; + } + else { + return this._atDirectives.filter(supportedInMoreThanOneBrowser); + } + }; + CSSDataManager.prototype.getPseudoClasses = function (majorBrowserSupport) { + if (majorBrowserSupport === void 0) { majorBrowserSupport = true; } + if (!majorBrowserSupport) { + return this._pseudoClasses; + } + else { + return this._pseudoClasses.filter(supportedInMoreThanOneBrowser); + } + }; + CSSDataManager.prototype.getPseudoElements = function (majorBrowserSupport) { + if (majorBrowserSupport === void 0) { majorBrowserSupport = true; } + if (!majorBrowserSupport) { + return this._pseudoElements; + } + else { + return this._pseudoElements.filter(supportedInMoreThanOneBrowser); + } + }; + CSSDataManager.prototype.isKnownProperty = function (name) { + return name.toLowerCase() in this._propertySet; + }; + CSSDataManager.prototype.isStandardProperty = function (name) { + return this.isKnownProperty(name) && + (!this._propertySet[name.toLowerCase()].status || this._propertySet[name.toLowerCase()].status === 'standard'); + }; + return CSSDataManager; +}()); + +function supportedInMoreThanOneBrowser(entry) { + if (!entry.browsers) { + return true; + } + return entry.browsers.length > 1; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/dataProvider.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var CSSDataProvider = /** @class */ (function () { + /** + * Currently, unversioned data uses the V1 implementation + * In the future when the provider handles multiple versions of HTML custom data, + * use the latest implementation for unversioned data + */ + function CSSDataProvider(data) { + this._properties = []; + this._atDirectives = []; + this._pseudoClasses = []; + this._pseudoElements = []; + this.addData(data); + } + CSSDataProvider.prototype.provideProperties = function () { + return this._properties; + }; + CSSDataProvider.prototype.provideAtDirectives = function () { + return this._atDirectives; + }; + CSSDataProvider.prototype.providePseudoClasses = function () { + return this._pseudoClasses; + }; + CSSDataProvider.prototype.providePseudoElements = function () { + return this._pseudoElements; + }; + CSSDataProvider.prototype.addData = function (data) { + if (data.properties) { + this._properties = this._properties.concat(data.properties); + } + if (data.atDirectives) { + this._atDirectives = this._atDirectives.concat(data.atDirectives); + } + if (data.pseudoClasses) { + this._pseudoClasses = this._pseudoClasses.concat(data.pseudoClasses); + } + if (data.pseudoElements) { + this._pseudoElements = this._pseudoElements.concat(data.pseudoElements); + } + }; + return CSSDataProvider; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/entry.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var browserNames = { + E: 'Edge', + FF: 'Firefox', + S: 'Safari', + C: 'Chrome', + IE: 'IE', + O: 'Opera' +}; +function getEntryStatus(status) { + switch (status) { + case 'experimental': + return '⚠️ Property is experimental. Be cautious when using it.️\n\n'; + case 'nonstandard': + return '🚨️ Property is nonstandard. Avoid using it.\n\n'; + case 'obsolete': + return '🚨️️️ Property is obsolete. Avoid using it.\n\n'; + default: + return ''; + } +} +function getEntryDescription(entry) { + if (!entry.description || entry.description === '') { + return null; + } + var result = ''; + if (entry.status) { + result += getEntryStatus(entry.status); + } + result += entry.description; + var browserLabel = getBrowserLabel(entry.browsers); + if (browserLabel) { + result += '\n(' + browserLabel + ')'; + } + if ('syntax' in entry) { + result += "\n\nSyntax: " + entry.syntax; + } + return result; +} +/** + * Input is like `["E12","FF49","C47","IE","O"]` + * Output is like `Edge 12, Firefox 49, Chrome 47, IE, Opera` + */ +function getBrowserLabel(browsers) { + if (!browsers || browsers.length === 0) { + return null; + } + return browsers + .map(function (b) { + var result = ''; + var matches = b.match(/([A-Z]+)(\d+)?/); + var name = matches[1]; + var version = matches[2]; + if (name in browserNames) { + result += browserNames[name]; + } + if (version) { + result += ' ' + version; + } + return result; + }) + .join(', '); +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/colors.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + +var colors_localize = loadMessageBundle(); var colorFunctions = [ - { func: 'rgb($red, $green, $blue)', desc: localize('css.builtin.rgb', 'Creates a Color from red, green, and blue values.') }, - { func: 'rgba($red, $green, $blue, $alpha)', desc: localize('css.builtin.rgba', 'Creates a Color from red, green, blue, and alpha values.') }, - { func: 'hsl($hue, $saturation, $lightness)', desc: localize('css.builtin.hsl', 'Creates a Color from hue, saturation, and lightness values.') }, - { func: 'hsla($hue, $saturation, $lightness, $alpha)', desc: localize('css.builtin.hsla', 'Creates a Color from hue, saturation, lightness, and alpha values.') } + { func: 'rgb($red, $green, $blue)', desc: colors_localize('css.builtin.rgb', 'Creates a Color from red, green, and blue values.') }, + { func: 'rgba($red, $green, $blue, $alpha)', desc: colors_localize('css.builtin.rgba', 'Creates a Color from red, green, blue, and alpha values.') }, + { func: 'hsl($hue, $saturation, $lightness)', desc: colors_localize('css.builtin.hsl', 'Creates a Color from hue, saturation, and lightness values.') }, + { func: 'hsla($hue, $saturation, $lightness, $alpha)', desc: colors_localize('css.builtin.hsla', 'Creates a Color from hue, saturation, lightness, and alpha values.') } ]; var colors = { aliceblue: '#f0f8ff', @@ -26010,14 +27368,14 @@ function isColorConstructor(node) { * as color name. */ function isColorValue(node) { - if (node.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].HexColorValue) { + if (node.type === NodeType.HexColorValue) { return true; } - else if (node.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Function) { + else if (node.type === NodeType.Function) { return isColorConstructor(node); } - else if (node.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Identifier) { - if (node.parent && node.parent.type !== _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Term) { + else if (node.type === NodeType.Identifier) { + if (node.parent && node.parent.type !== NodeType.Term) { return false; } var candidateColor = node.getText().toLowerCase(); @@ -26034,7 +27392,7 @@ var Digit0 = 48; var Digit9 = 57; var A = 65; var F = 70; -var a = 97; +var colors_a = 97; var f = 102; function hexDigit(charCode) { if (charCode < Digit0) { @@ -26043,11 +27401,11 @@ function hexDigit(charCode) { if (charCode <= Digit9) { return charCode - Digit0; } - if (charCode < a) { - charCode += (a - A); + if (charCode < colors_a) { + charCode += (colors_a - A); } - if (charCode >= a && charCode <= f) { - return charCode - a + 10; + if (charCode >= colors_a && charCode <= f) { + return charCode - colors_a + 10; } return 0; } @@ -26156,11 +27514,11 @@ function hslFromColor(rgba) { return { h: h, s: s, l: l, a: a }; } function getColorValue(node) { - if (node.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].HexColorValue) { + if (node.type === NodeType.HexColorValue) { var text = node.getText(); return colorFromHex(text); } - else if (node.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Function) { + else if (node.type === NodeType.Function) { var functionNode = node; var name = functionNode.getName(); var colorValues = functionNode.getArguments().getChildren(); @@ -26189,14 +27547,14 @@ function getColorValue(node) { return null; } } - else if (node.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Identifier) { - if (node.parent && node.parent.type !== _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Term) { + else if (node.type === NodeType.Identifier) { + if (node.parent && node.parent.type !== NodeType.Term) { return null; } var term = node.parent; - if (term.parent && term.parent.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].BinaryExpression) { + if (term.parent && term.parent.type === NodeType.BinaryExpression) { var expression = term.parent; - if (expression.parent && expression.parent.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].ListEntry && expression.parent.key === expression) { + if (expression.parent && expression.parent.type === NodeType.ListEntry && expression.parent.key === expression) { return null; } } @@ -26212,358 +27570,147 @@ function getColorValue(node) { return null; } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/dataManager.js": -/*!**********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/dataManager.js ***! - \**********************************************************************************************************************/ -/*! exports provided: CSSDataManager, supportedInMoreThanOneBrowser */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CSSDataManager", function() { return CSSDataManager; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportedInMoreThanOneBrowser", function() { return supportedInMoreThanOneBrowser; }); -/* harmony import */ var _utils_objects_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/objects.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/utils/objects.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/builtinData.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -var CSSDataManager = /** @class */ (function () { - function CSSDataManager(dataProviders) { - this.dataProviders = dataProviders; - this._propertySet = {}; - this._atDirectiveSet = {}; - this._pseudoClassSet = {}; - this._pseudoElementSet = {}; - this._properties = []; - this._atDirectives = []; - this._pseudoClasses = []; - this._pseudoElements = []; - this.collectData(); - } - CSSDataManager.prototype.addDataProviders = function (providers) { - this.dataProviders = this.dataProviders.concat(providers); - this.collectData(); - }; - /** - * Collect all data & handle duplicates - */ - CSSDataManager.prototype.collectData = function () { - var _this = this; - this.dataProviders.forEach(function (provider) { - provider.provideProperties().forEach(function (p) { - if (!_this._propertySet[p.name]) { - _this._propertySet[p.name] = p; - } - }); - provider.provideAtDirectives().forEach(function (p) { - if (!_this._atDirectiveSet[p.name]) { - _this._atDirectiveSet[p.name] = p; - } - }); - provider.providePseudoClasses().forEach(function (p) { - if (!_this._pseudoClassSet[p.name]) { - _this._pseudoClassSet[p.name] = p; - } - }); - provider.providePseudoElements().forEach(function (p) { - if (!_this._pseudoElementSet[p.name]) { - _this._pseudoElementSet[p.name] = p; - } - }); - }); - this._properties = _utils_objects_js__WEBPACK_IMPORTED_MODULE_0__["values"](this._propertySet); - this._atDirectives = _utils_objects_js__WEBPACK_IMPORTED_MODULE_0__["values"](this._atDirectiveSet); - this._pseudoClasses = _utils_objects_js__WEBPACK_IMPORTED_MODULE_0__["values"](this._pseudoClassSet); - this._pseudoElements = _utils_objects_js__WEBPACK_IMPORTED_MODULE_0__["values"](this._pseudoElementSet); - }; - CSSDataManager.prototype.getProperty = function (name) { return this._propertySet[name]; }; - CSSDataManager.prototype.getAtDirective = function (name) { return this._atDirectiveSet[name]; }; - CSSDataManager.prototype.getPseudoClass = function (name) { return this._pseudoClassSet[name]; }; - CSSDataManager.prototype.getPseudoElement = function (name) { return this._pseudoElementSet[name]; }; - CSSDataManager.prototype.getProperties = function (majorBrowserSupport) { - if (majorBrowserSupport === void 0) { majorBrowserSupport = true; } - if (!majorBrowserSupport) { - return this._properties; - } - else { - return this._properties.filter(supportedInMoreThanOneBrowser); - } - }; - CSSDataManager.prototype.getAtDirectives = function (majorBrowserSupport) { - if (majorBrowserSupport === void 0) { majorBrowserSupport = true; } - if (!majorBrowserSupport) { - return this._atDirectives; - } - else { - return this._atDirectives.filter(supportedInMoreThanOneBrowser); - } - }; - CSSDataManager.prototype.getPseudoClasses = function (majorBrowserSupport) { - if (majorBrowserSupport === void 0) { majorBrowserSupport = true; } - if (!majorBrowserSupport) { - return this._pseudoClasses; - } - else { - return this._pseudoClasses.filter(supportedInMoreThanOneBrowser); - } - }; - CSSDataManager.prototype.getPseudoElements = function (majorBrowserSupport) { - if (majorBrowserSupport === void 0) { majorBrowserSupport = true; } - if (!majorBrowserSupport) { - return this._pseudoElements; - } - else { - return this._pseudoElements.filter(supportedInMoreThanOneBrowser); - } - }; - CSSDataManager.prototype.isKnownProperty = function (name) { - return name.toLowerCase() in this._propertySet; - }; - CSSDataManager.prototype.isStandardProperty = function (name) { - return this.isKnownProperty(name) && - (!this._propertySet[name.toLowerCase()].status || this._propertySet[name.toLowerCase()].status === 'standard'); - }; - return CSSDataManager; -}()); - -function supportedInMoreThanOneBrowser(entry) { - if (!entry.browsers) { - return true; - } - return entry.browsers.length > 1; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/dataProvider.js": -/*!***********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/dataProvider.js ***! - \***********************************************************************************************************************/ -/*! exports provided: CSSDataProvider */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CSSDataProvider", function() { return CSSDataProvider; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var CSSDataProvider = /** @class */ (function () { - /** - * Currently, unversioned data uses the V1 implementation - * In the future when the provider handles multiple versions of HTML custom data, - * use the latest implementation for unversioned data - */ - function CSSDataProvider(data) { - this._properties = []; - this._atDirectives = []; - this._pseudoClasses = []; - this._pseudoElements = []; - this.addData(data); - } - CSSDataProvider.prototype.provideProperties = function () { - return this._properties; - }; - CSSDataProvider.prototype.provideAtDirectives = function () { - return this._atDirectives; - }; - CSSDataProvider.prototype.providePseudoClasses = function () { - return this._pseudoClasses; - }; - CSSDataProvider.prototype.providePseudoElements = function () { - return this._pseudoElements; - }; - CSSDataProvider.prototype.addData = function (data) { - if (data.properties) { - this._properties = this._properties.concat(data.properties); - } - if (data.atDirectives) { - this._atDirectives = this._atDirectives.concat(data.atDirectives); - } - if (data.pseudoClasses) { - this._pseudoClasses = this._pseudoClasses.concat(data.pseudoClasses); - } - if (data.pseudoElements) { - this._pseudoElements = this._pseudoElements.concat(data.pseudoElements); - } - }; - return CSSDataProvider; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/entry.js": -/*!****************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/entry.js ***! - \****************************************************************************************************************/ -/*! exports provided: browserNames, getEntryDescription, getBrowserLabel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "browserNames", function() { return browserNames; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEntryDescription", function() { return getEntryDescription; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBrowserLabel", function() { return getBrowserLabel; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var browserNames = { - E: 'Edge', - FF: 'Firefox', - S: 'Safari', - C: 'Chrome', - IE: 'IE', - O: 'Opera' +var positionKeywords = { + 'bottom': 'Computes to ‘100%’ for the vertical position if one or two values are given, otherwise specifies the bottom edge as the origin for the next offset.', + 'center': 'Computes to ‘50%’ (‘left 50%’) for the horizontal position if the horizontal position is not otherwise specified, or ‘50%’ (‘top 50%’) for the vertical position if it is.', + 'left': 'Computes to ‘0%’ for the horizontal position if one or two values are given, otherwise specifies the left edge as the origin for the next offset.', + 'right': 'Computes to ‘100%’ for the horizontal position if one or two values are given, otherwise specifies the right edge as the origin for the next offset.', + 'top': 'Computes to ‘0%’ for the vertical position if one or two values are given, otherwise specifies the top edge as the origin for the next offset.' }; -function getEntryStatus(status) { - switch (status) { - case 'experimental': - return '⚠️ Property is experimental. Be cautious when using it.️\n\n'; - case 'nonstandard': - return '🚨️ Property is nonstandard. Avoid using it.\n\n'; - case 'obsolete': - return '🚨️️️ Property is obsolete. Avoid using it.\n\n'; - default: - return ''; - } -} -function getEntryDescription(entry) { - if (!entry.description || entry.description === '') { - return null; - } - var result = ''; - if (entry.status) { - result += getEntryStatus(entry.status); - } - result += entry.description; - var browserLabel = getBrowserLabel(entry.browsers); - if (browserLabel) { - result += '\n(' + browserLabel + ')'; - } - if ('syntax' in entry) { - result += "\n\nSyntax: " + entry.syntax; - } - return result; -} -/** - * Input is like `["E12","FF49","C47","IE","O"]` - * Output is like `Edge 12, Firefox 49, Chrome 47, IE, Opera` - */ -function getBrowserLabel(browsers) { - if (!browsers || browsers.length === 0) { - return null; - } - return browsers - .map(function (b) { - var result = ''; - var matches = b.match(/([A-Z]+)(\d+)?/); - var name = matches[1]; - var version = matches[2]; - if (name in browserNames) { - result += browserNames[name]; - } - if (version) { - result += ' ' + version; - } - return result; - }) - .join(', '); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/facts.js": -/*!****************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/facts.js ***! - \****************************************************************************************************************/ -/*! exports provided: cssDataManager, browserNames, getEntryDescription, getBrowserLabel, colorFunctions, colors, colorKeywords, isColorConstructor, isColorValue, hexDigit, colorFromHex, colorFrom256RGB, colorFromHSL, hslFromColor, getColorValue, positionKeywords, repeatStyleKeywords, lineStyleKeywords, lineWidthKeywords, boxKeywords, geometryBoxKeywords, cssWideKeywords, imageFunctions, transitionTimingFunctions, basicShapeFunctions, units, html5Tags, svgElements, pageBoxDirectives, CSSDataProvider, CSSDataManager, supportedInMoreThanOneBrowser */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cssDataManager", function() { return cssDataManager; }); -/* harmony import */ var _data_browsers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../data/browsers.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/data/browsers.js"); -/* harmony import */ var _dataManager_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dataManager.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/dataManager.js"); -/* harmony import */ var _dataProvider_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dataProvider.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/dataProvider.js"); -/* harmony import */ var _entry_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./entry.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/entry.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "browserNames", function() { return _entry_js__WEBPACK_IMPORTED_MODULE_3__["browserNames"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getEntryDescription", function() { return _entry_js__WEBPACK_IMPORTED_MODULE_3__["getEntryDescription"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getBrowserLabel", function() { return _entry_js__WEBPACK_IMPORTED_MODULE_3__["getBrowserLabel"]; }); - -/* harmony import */ var _colors_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./colors.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/colors.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "colorFunctions", function() { return _colors_js__WEBPACK_IMPORTED_MODULE_4__["colorFunctions"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "colors", function() { return _colors_js__WEBPACK_IMPORTED_MODULE_4__["colors"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "colorKeywords", function() { return _colors_js__WEBPACK_IMPORTED_MODULE_4__["colorKeywords"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isColorConstructor", function() { return _colors_js__WEBPACK_IMPORTED_MODULE_4__["isColorConstructor"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isColorValue", function() { return _colors_js__WEBPACK_IMPORTED_MODULE_4__["isColorValue"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hexDigit", function() { return _colors_js__WEBPACK_IMPORTED_MODULE_4__["hexDigit"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "colorFromHex", function() { return _colors_js__WEBPACK_IMPORTED_MODULE_4__["colorFromHex"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "colorFrom256RGB", function() { return _colors_js__WEBPACK_IMPORTED_MODULE_4__["colorFrom256RGB"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "colorFromHSL", function() { return _colors_js__WEBPACK_IMPORTED_MODULE_4__["colorFromHSL"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "hslFromColor", function() { return _colors_js__WEBPACK_IMPORTED_MODULE_4__["hslFromColor"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getColorValue", function() { return _colors_js__WEBPACK_IMPORTED_MODULE_4__["getColorValue"]; }); - -/* harmony import */ var _builtinData_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./builtinData.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/builtinData.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "positionKeywords", function() { return _builtinData_js__WEBPACK_IMPORTED_MODULE_5__["positionKeywords"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeatStyleKeywords", function() { return _builtinData_js__WEBPACK_IMPORTED_MODULE_5__["repeatStyleKeywords"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lineStyleKeywords", function() { return _builtinData_js__WEBPACK_IMPORTED_MODULE_5__["lineStyleKeywords"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "lineWidthKeywords", function() { return _builtinData_js__WEBPACK_IMPORTED_MODULE_5__["lineWidthKeywords"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "boxKeywords", function() { return _builtinData_js__WEBPACK_IMPORTED_MODULE_5__["boxKeywords"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "geometryBoxKeywords", function() { return _builtinData_js__WEBPACK_IMPORTED_MODULE_5__["geometryBoxKeywords"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "cssWideKeywords", function() { return _builtinData_js__WEBPACK_IMPORTED_MODULE_5__["cssWideKeywords"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "imageFunctions", function() { return _builtinData_js__WEBPACK_IMPORTED_MODULE_5__["imageFunctions"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "transitionTimingFunctions", function() { return _builtinData_js__WEBPACK_IMPORTED_MODULE_5__["transitionTimingFunctions"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "basicShapeFunctions", function() { return _builtinData_js__WEBPACK_IMPORTED_MODULE_5__["basicShapeFunctions"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "units", function() { return _builtinData_js__WEBPACK_IMPORTED_MODULE_5__["units"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "html5Tags", function() { return _builtinData_js__WEBPACK_IMPORTED_MODULE_5__["html5Tags"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "svgElements", function() { return _builtinData_js__WEBPACK_IMPORTED_MODULE_5__["svgElements"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pageBoxDirectives", function() { return _builtinData_js__WEBPACK_IMPORTED_MODULE_5__["pageBoxDirectives"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CSSDataProvider", function() { return _dataProvider_js__WEBPACK_IMPORTED_MODULE_2__["CSSDataProvider"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CSSDataManager", function() { return _dataManager_js__WEBPACK_IMPORTED_MODULE_1__["CSSDataManager"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "supportedInMoreThanOneBrowser", function() { return _dataManager_js__WEBPACK_IMPORTED_MODULE_1__["supportedInMoreThanOneBrowser"]; }); +var repeatStyleKeywords = { + 'no-repeat': 'Placed once and not repeated in this direction.', + 'repeat': 'Repeated in this direction as often as needed to cover the background painting area.', + 'repeat-x': 'Computes to ‘repeat no-repeat’.', + 'repeat-y': 'Computes to ‘no-repeat repeat’.', + 'round': 'Repeated as often as will fit within the background positioning area. If it doesn’t fit a whole number of times, it is rescaled so that it does.', + 'space': 'Repeated as often as will fit within the background positioning area without being clipped and then the images are spaced out to fill the area.' +}; +var lineStyleKeywords = { + 'dashed': 'A series of square-ended dashes.', + 'dotted': 'A series of round dots.', + 'double': 'Two parallel solid lines with some space between them.', + 'groove': 'Looks as if it were carved in the canvas.', + 'hidden': 'Same as ‘none’, but has different behavior in the border conflict resolution rules for border-collapsed tables.', + 'inset': 'Looks as if the content on the inside of the border is sunken into the canvas.', + 'none': 'No border. Color and width are ignored.', + 'outset': 'Looks as if the content on the inside of the border is coming out of the canvas.', + 'ridge': 'Looks as if it were coming out of the canvas.', + 'solid': 'A single line segment.' +}; +var lineWidthKeywords = ['medium', 'thick', 'thin']; +var boxKeywords = { + 'border-box': 'The background is painted within (clipped to) the border box.', + 'content-box': 'The background is painted within (clipped to) the content box.', + 'padding-box': 'The background is painted within (clipped to) the padding box.' +}; +var geometryBoxKeywords = { + 'margin-box': 'Uses the margin box as reference box.', + 'fill-box': 'Uses the object bounding box as reference box.', + 'stroke-box': 'Uses the stroke bounding box as reference box.', + 'view-box': 'Uses the nearest SVG viewport as reference box.' +}; +var cssWideKeywords = { + 'initial': 'Represents the value specified as the property’s initial value.', + 'inherit': 'Represents the computed value of the property on the element’s parent.', + 'unset': 'Acts as either `inherit` or `initial`, depending on whether the property is inherited or not.' +}; +var imageFunctions = { + 'url()': 'Reference an image file by URL', + 'image()': 'Provide image fallbacks and annotations.', + '-webkit-image-set()': 'Provide multiple resolutions. Remember to use unprefixed image-set() in addition.', + 'image-set()': 'Provide multiple resolutions of an image and const the UA decide which is most appropriate in a given situation.', + '-moz-element()': 'Use an element in the document as an image. Remember to use unprefixed element() in addition.', + 'element()': 'Use an element in the document as an image.', + 'cross-fade()': 'Indicates the two images to be combined and how far along in the transition the combination is.', + '-webkit-gradient()': 'Deprecated. Use modern linear-gradient() or radial-gradient() instead.', + '-webkit-linear-gradient()': 'Linear gradient. Remember to use unprefixed version in addition.', + '-moz-linear-gradient()': 'Linear gradient. Remember to use unprefixed version in addition.', + '-o-linear-gradient()': 'Linear gradient. Remember to use unprefixed version in addition.', + 'linear-gradient()': 'A linear gradient is created by specifying a straight gradient line, and then several colors placed along that line.', + '-webkit-repeating-linear-gradient()': 'Repeating Linear gradient. Remember to use unprefixed version in addition.', + '-moz-repeating-linear-gradient()': 'Repeating Linear gradient. Remember to use unprefixed version in addition.', + '-o-repeating-linear-gradient()': 'RepeatingLinear gradient. Remember to use unprefixed version in addition.', + 'repeating-linear-gradient()': 'Same as linear-gradient, except the color-stops are repeated infinitely in both directions, with their positions shifted by multiples of the difference between the last specified color-stop’s position and the first specified color-stop’s position.', + '-webkit-radial-gradient()': 'Radial gradient. Remember to use unprefixed version in addition.', + '-moz-radial-gradient()': 'Radial gradient. Remember to use unprefixed version in addition.', + 'radial-gradient()': 'Colors emerge from a single point and smoothly spread outward in a circular or elliptical shape.', + '-webkit-repeating-radial-gradient()': 'Repeating radial gradient. Remember to use unprefixed version in addition.', + '-moz-repeating-radial-gradient()': 'Repeating radial gradient. Remember to use unprefixed version in addition.', + 'repeating-radial-gradient()': 'Same as radial-gradient, except the color-stops are repeated infinitely in both directions, with their positions shifted by multiples of the difference between the last specified color-stop’s position and the first specified color-stop’s position.' +}; +var transitionTimingFunctions = { + 'ease': 'Equivalent to cubic-bezier(0.25, 0.1, 0.25, 1.0).', + 'ease-in': 'Equivalent to cubic-bezier(0.42, 0, 1.0, 1.0).', + 'ease-in-out': 'Equivalent to cubic-bezier(0.42, 0, 0.58, 1.0).', + 'ease-out': 'Equivalent to cubic-bezier(0, 0, 0.58, 1.0).', + 'linear': 'Equivalent to cubic-bezier(0.0, 0.0, 1.0, 1.0).', + 'step-end': 'Equivalent to steps(1, end).', + 'step-start': 'Equivalent to steps(1, start).', + 'steps()': 'The first parameter specifies the number of intervals in the function. The second parameter, which is optional, is either the value “start” or “end”.', + 'cubic-bezier()': 'Specifies a cubic-bezier curve. The four values specify points P1 and P2 of the curve as (x1, y1, x2, y2).', + 'cubic-bezier(0.6, -0.28, 0.735, 0.045)': 'Ease-in Back. Overshoots.', + 'cubic-bezier(0.68, -0.55, 0.265, 1.55)': 'Ease-in-out Back. Overshoots.', + 'cubic-bezier(0.175, 0.885, 0.32, 1.275)': 'Ease-out Back. Overshoots.', + 'cubic-bezier(0.6, 0.04, 0.98, 0.335)': 'Ease-in Circular. Based on half circle.', + 'cubic-bezier(0.785, 0.135, 0.15, 0.86)': 'Ease-in-out Circular. Based on half circle.', + 'cubic-bezier(0.075, 0.82, 0.165, 1)': 'Ease-out Circular. Based on half circle.', + 'cubic-bezier(0.55, 0.055, 0.675, 0.19)': 'Ease-in Cubic. Based on power of three.', + 'cubic-bezier(0.645, 0.045, 0.355, 1)': 'Ease-in-out Cubic. Based on power of three.', + 'cubic-bezier(0.215, 0.610, 0.355, 1)': 'Ease-out Cubic. Based on power of three.', + 'cubic-bezier(0.95, 0.05, 0.795, 0.035)': 'Ease-in Exponential. Based on two to the power ten.', + 'cubic-bezier(1, 0, 0, 1)': 'Ease-in-out Exponential. Based on two to the power ten.', + 'cubic-bezier(0.19, 1, 0.22, 1)': 'Ease-out Exponential. Based on two to the power ten.', + 'cubic-bezier(0.47, 0, 0.745, 0.715)': 'Ease-in Sine.', + 'cubic-bezier(0.445, 0.05, 0.55, 0.95)': 'Ease-in-out Sine.', + 'cubic-bezier(0.39, 0.575, 0.565, 1)': 'Ease-out Sine.', + 'cubic-bezier(0.55, 0.085, 0.68, 0.53)': 'Ease-in Quadratic. Based on power of two.', + 'cubic-bezier(0.455, 0.03, 0.515, 0.955)': 'Ease-in-out Quadratic. Based on power of two.', + 'cubic-bezier(0.25, 0.46, 0.45, 0.94)': 'Ease-out Quadratic. Based on power of two.', + 'cubic-bezier(0.895, 0.03, 0.685, 0.22)': 'Ease-in Quartic. Based on power of four.', + 'cubic-bezier(0.77, 0, 0.175, 1)': 'Ease-in-out Quartic. Based on power of four.', + 'cubic-bezier(0.165, 0.84, 0.44, 1)': 'Ease-out Quartic. Based on power of four.', + 'cubic-bezier(0.755, 0.05, 0.855, 0.06)': 'Ease-in Quintic. Based on power of five.', + 'cubic-bezier(0.86, 0, 0.07, 1)': 'Ease-in-out Quintic. Based on power of five.', + 'cubic-bezier(0.23, 1, 0.320, 1)': 'Ease-out Quintic. Based on power of five.' +}; +var basicShapeFunctions = { + 'circle()': 'Defines a circle.', + 'ellipse()': 'Defines an ellipse.', + 'inset()': 'Defines an inset rectangle.', + 'polygon()': 'Defines a polygon.' +}; +var builtinData_units = { + 'length': ['em', 'rem', 'ex', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ch', 'vw', 'vh', 'vmin', 'vmax'], + 'angle': ['deg', 'rad', 'grad', 'turn'], + 'time': ['ms', 's'], + 'frequency': ['Hz', 'kHz'], + 'resolution': ['dpi', 'dpcm', 'dppx'], + 'percentage': ['%', 'fr'] +}; +var html5Tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', + 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', + 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', + 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', + 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', + 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'const', 'video', 'wbr']; +var svgElements = ['circle', 'clipPath', 'cursor', 'defs', 'desc', 'ellipse', 'feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', + 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', + 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence', 'filter', 'foreignObject', 'g', 'hatch', 'hatchpath', 'image', 'line', 'linearGradient', + 'marker', 'mask', 'mesh', 'meshpatch', 'meshrow', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'set', 'solidcolor', 'stop', 'svg', 'switch', + 'symbol', 'text', 'textPath', 'tspan', 'use', 'view']; +var pageBoxDirectives = [ + '@bottom-center', '@bottom-left', '@bottom-left-corner', '@bottom-right', '@bottom-right-corner', + '@left-bottom', '@left-middle', '@left-top', '@right-bottom', '@right-middle', '@right-top', + '@top-center', '@top-left', '@top-left-corner', '@top-right', '@top-right-corner' +]; +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/facts.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -26577,1935 +27724,11 @@ __webpack_require__.r(__webpack_exports__); -var cssDataManager = new _dataManager_js__WEBPACK_IMPORTED_MODULE_1__["CSSDataManager"]([ - new _dataProvider_js__WEBPACK_IMPORTED_MODULE_2__["CSSDataProvider"](_data_browsers_js__WEBPACK_IMPORTED_MODULE_0__["cssData"]) +var cssDataManager = new dataManager_CSSDataManager([ + new CSSDataProvider(cssData) ]); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssErrors.js": -/*!*************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssErrors.js ***! - \*************************************************************************************************************/ -/*! exports provided: CSSIssueType, ParseError */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CSSIssueType", function() { return CSSIssueType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParseError", function() { return ParseError; }); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./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. - *--------------------------------------------------------------------------------------------*/ - - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_0__["loadMessageBundle"](); -var CSSIssueType = /** @class */ (function () { - function CSSIssueType(id, message) { - this.id = id; - this.message = message; - } - return CSSIssueType; -}()); - -var ParseError = { - NumberExpected: new CSSIssueType('css-numberexpected', localize('expected.number', "number expected")), - ConditionExpected: new CSSIssueType('css-conditionexpected', localize('expected.condt', "condition expected")), - RuleOrSelectorExpected: new CSSIssueType('css-ruleorselectorexpected', localize('expected.ruleorselector', "at-rule or selector expected")), - DotExpected: new CSSIssueType('css-dotexpected', localize('expected.dot', "dot expected")), - ColonExpected: new CSSIssueType('css-colonexpected', localize('expected.colon', "colon expected")), - SemiColonExpected: new CSSIssueType('css-semicolonexpected', localize('expected.semicolon', "semi-colon expected")), - TermExpected: new CSSIssueType('css-termexpected', localize('expected.term', "term expected")), - ExpressionExpected: new CSSIssueType('css-expressionexpected', localize('expected.expression', "expression expected")), - OperatorExpected: new CSSIssueType('css-operatorexpected', localize('expected.operator', "operator expected")), - IdentifierExpected: new CSSIssueType('css-identifierexpected', localize('expected.ident', "identifier expected")), - PercentageExpected: new CSSIssueType('css-percentageexpected', localize('expected.percentage', "percentage expected")), - URIOrStringExpected: new CSSIssueType('css-uriorstringexpected', localize('expected.uriorstring', "uri or string expected")), - URIExpected: new CSSIssueType('css-uriexpected', localize('expected.uri', "URI expected")), - VariableNameExpected: new CSSIssueType('css-varnameexpected', localize('expected.varname', "variable name expected")), - VariableValueExpected: new CSSIssueType('css-varvalueexpected', localize('expected.varvalue', "variable value expected")), - PropertyValueExpected: new CSSIssueType('css-propertyvalueexpected', localize('expected.propvalue', "property value expected")), - LeftCurlyExpected: new CSSIssueType('css-lcurlyexpected', localize('expected.lcurly', "{ expected")), - RightCurlyExpected: new CSSIssueType('css-rcurlyexpected', localize('expected.rcurly', "} expected")), - LeftSquareBracketExpected: new CSSIssueType('css-rbracketexpected', localize('expected.lsquare', "[ expected")), - RightSquareBracketExpected: new CSSIssueType('css-lbracketexpected', localize('expected.rsquare', "] expected")), - LeftParenthesisExpected: new CSSIssueType('css-lparentexpected', localize('expected.lparen', "( expected")), - RightParenthesisExpected: new CSSIssueType('css-rparentexpected', localize('expected.rparent', ") expected")), - CommaExpected: new CSSIssueType('css-commaexpected', localize('expected.comma', "comma expected")), - PageDirectiveOrDeclarationExpected: new CSSIssueType('css-pagedirordeclexpected', localize('expected.pagedirordecl', "page directive or declaraton expected")), - UnknownAtRule: new CSSIssueType('css-unknownatrule', localize('unknown.atrule', "at-rule unknown")), - UnknownKeyword: new CSSIssueType('css-unknownkeyword', localize('unknown.keyword', "unknown keyword")), - SelectorExpected: new CSSIssueType('css-selectorexpected', localize('expected.selector', "selector expected")), - StringLiteralExpected: new CSSIssueType('css-stringliteralexpected', localize('expected.stringliteral', "string literal expected")), - WhitespaceExpected: new CSSIssueType('css-whitespaceexpected', localize('expected.whitespace', "whitespace expected")), - MediaQueryExpected: new CSSIssueType('css-mediaqueryexpected', localize('expected.mediaquery', "media query expected")) -}; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js": -/*!************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js ***! - \************************************************************************************************************/ -/*! exports provided: NodeType, ReferenceType, getNodeAtOffset, getNodePath, getParentDeclaration, Node, Nodelist, Identifier, Stylesheet, Declarations, BodyDeclaration, RuleSet, Selector, SimpleSelector, AtApplyRule, AbstractDeclaration, CustomPropertyDeclaration, CustomPropertySet, Declaration, Property, Invocation, Function, FunctionParameter, FunctionArgument, IfStatement, ForStatement, EachStatement, WhileStatement, ElseStatement, FunctionDeclaration, ViewPort, FontFace, NestedProperties, Keyframe, KeyframeSelector, Import, Namespace, Media, Supports, Document, Medialist, MediaQuery, SupportsCondition, Page, PageBoxMarginBox, Expression, BinaryExpression, Term, AttributeSelector, Operator, HexColorValue, NumericValue, VariableDeclaration, Interpolation, Variable, ExtendsReference, MixinReference, MixinDeclaration, UnknownAtRule, ListEntry, LessGuard, GuardCondition, Level, Marker, ParseErrorCollector */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NodeType", function() { return NodeType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReferenceType", function() { return ReferenceType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeAtOffset", function() { return getNodeAtOffset; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodePath", function() { return getNodePath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getParentDeclaration", function() { return getParentDeclaration; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Node", function() { return Node; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Nodelist", function() { return Nodelist; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Identifier", function() { return Identifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Stylesheet", function() { return Stylesheet; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Declarations", function() { return Declarations; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BodyDeclaration", function() { return BodyDeclaration; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RuleSet", function() { return RuleSet; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Selector", function() { return Selector; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleSelector", function() { return SimpleSelector; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AtApplyRule", function() { return AtApplyRule; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractDeclaration", function() { return AbstractDeclaration; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CustomPropertyDeclaration", function() { return CustomPropertyDeclaration; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CustomPropertySet", function() { return CustomPropertySet; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Declaration", function() { return Declaration; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Property", function() { return Property; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Invocation", function() { return Invocation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Function", function() { return Function; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionParameter", function() { return FunctionParameter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionArgument", function() { return FunctionArgument; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IfStatement", function() { return IfStatement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ForStatement", function() { return ForStatement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EachStatement", function() { return EachStatement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WhileStatement", function() { return WhileStatement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ElseStatement", function() { return ElseStatement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FunctionDeclaration", function() { return FunctionDeclaration; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewPort", function() { return ViewPort; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FontFace", function() { return FontFace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NestedProperties", function() { return NestedProperties; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Keyframe", function() { return Keyframe; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyframeSelector", function() { return KeyframeSelector; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Import", function() { return Import; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Namespace", function() { return Namespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Media", function() { return Media; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Supports", function() { return Supports; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Document", function() { return Document; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Medialist", function() { return Medialist; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MediaQuery", function() { return MediaQuery; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SupportsCondition", function() { return SupportsCondition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Page", function() { return Page; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PageBoxMarginBox", function() { return PageBoxMarginBox; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Expression", function() { return Expression; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BinaryExpression", function() { return BinaryExpression; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Term", function() { return Term; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AttributeSelector", function() { return AttributeSelector; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Operator", function() { return Operator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HexColorValue", function() { return HexColorValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumericValue", function() { return NumericValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VariableDeclaration", function() { return VariableDeclaration; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Interpolation", function() { return Interpolation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Variable", function() { return Variable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExtendsReference", function() { return ExtendsReference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MixinReference", function() { return MixinReference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MixinDeclaration", function() { return MixinDeclaration; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnknownAtRule", function() { return UnknownAtRule; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ListEntry", function() { return ListEntry; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LessGuard", function() { return LessGuard; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GuardCondition", function() { return GuardCondition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Level", function() { return Level; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Marker", function() { return Marker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParseErrorCollector", function() { return ParseErrorCollector; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -/// -/// Nodes for the css 2.1 specification. See for reference: -/// http://www.w3.org/TR/CSS21/grammar.html#grammar -/// -var NodeType; -(function (NodeType) { - NodeType[NodeType["Undefined"] = 0] = "Undefined"; - NodeType[NodeType["Identifier"] = 1] = "Identifier"; - NodeType[NodeType["Stylesheet"] = 2] = "Stylesheet"; - NodeType[NodeType["Ruleset"] = 3] = "Ruleset"; - NodeType[NodeType["Selector"] = 4] = "Selector"; - NodeType[NodeType["SimpleSelector"] = 5] = "SimpleSelector"; - NodeType[NodeType["SelectorInterpolation"] = 6] = "SelectorInterpolation"; - NodeType[NodeType["SelectorCombinator"] = 7] = "SelectorCombinator"; - NodeType[NodeType["SelectorCombinatorParent"] = 8] = "SelectorCombinatorParent"; - NodeType[NodeType["SelectorCombinatorSibling"] = 9] = "SelectorCombinatorSibling"; - NodeType[NodeType["SelectorCombinatorAllSiblings"] = 10] = "SelectorCombinatorAllSiblings"; - NodeType[NodeType["SelectorCombinatorShadowPiercingDescendant"] = 11] = "SelectorCombinatorShadowPiercingDescendant"; - NodeType[NodeType["Page"] = 12] = "Page"; - NodeType[NodeType["PageBoxMarginBox"] = 13] = "PageBoxMarginBox"; - NodeType[NodeType["ClassSelector"] = 14] = "ClassSelector"; - NodeType[NodeType["IdentifierSelector"] = 15] = "IdentifierSelector"; - NodeType[NodeType["ElementNameSelector"] = 16] = "ElementNameSelector"; - NodeType[NodeType["PseudoSelector"] = 17] = "PseudoSelector"; - NodeType[NodeType["AttributeSelector"] = 18] = "AttributeSelector"; - NodeType[NodeType["Declaration"] = 19] = "Declaration"; - NodeType[NodeType["Declarations"] = 20] = "Declarations"; - NodeType[NodeType["Property"] = 21] = "Property"; - NodeType[NodeType["Expression"] = 22] = "Expression"; - NodeType[NodeType["BinaryExpression"] = 23] = "BinaryExpression"; - NodeType[NodeType["Term"] = 24] = "Term"; - NodeType[NodeType["Operator"] = 25] = "Operator"; - NodeType[NodeType["Value"] = 26] = "Value"; - NodeType[NodeType["StringLiteral"] = 27] = "StringLiteral"; - NodeType[NodeType["URILiteral"] = 28] = "URILiteral"; - NodeType[NodeType["EscapedValue"] = 29] = "EscapedValue"; - NodeType[NodeType["Function"] = 30] = "Function"; - NodeType[NodeType["NumericValue"] = 31] = "NumericValue"; - NodeType[NodeType["HexColorValue"] = 32] = "HexColorValue"; - NodeType[NodeType["MixinDeclaration"] = 33] = "MixinDeclaration"; - NodeType[NodeType["MixinReference"] = 34] = "MixinReference"; - NodeType[NodeType["VariableName"] = 35] = "VariableName"; - NodeType[NodeType["VariableDeclaration"] = 36] = "VariableDeclaration"; - NodeType[NodeType["Prio"] = 37] = "Prio"; - NodeType[NodeType["Interpolation"] = 38] = "Interpolation"; - NodeType[NodeType["NestedProperties"] = 39] = "NestedProperties"; - NodeType[NodeType["ExtendsReference"] = 40] = "ExtendsReference"; - NodeType[NodeType["SelectorPlaceholder"] = 41] = "SelectorPlaceholder"; - NodeType[NodeType["Debug"] = 42] = "Debug"; - NodeType[NodeType["If"] = 43] = "If"; - NodeType[NodeType["Else"] = 44] = "Else"; - NodeType[NodeType["For"] = 45] = "For"; - NodeType[NodeType["Each"] = 46] = "Each"; - NodeType[NodeType["While"] = 47] = "While"; - NodeType[NodeType["MixinContent"] = 48] = "MixinContent"; - NodeType[NodeType["Media"] = 49] = "Media"; - NodeType[NodeType["Keyframe"] = 50] = "Keyframe"; - NodeType[NodeType["FontFace"] = 51] = "FontFace"; - NodeType[NodeType["Import"] = 52] = "Import"; - NodeType[NodeType["Namespace"] = 53] = "Namespace"; - NodeType[NodeType["Invocation"] = 54] = "Invocation"; - NodeType[NodeType["FunctionDeclaration"] = 55] = "FunctionDeclaration"; - NodeType[NodeType["ReturnStatement"] = 56] = "ReturnStatement"; - NodeType[NodeType["MediaQuery"] = 57] = "MediaQuery"; - NodeType[NodeType["FunctionParameter"] = 58] = "FunctionParameter"; - NodeType[NodeType["FunctionArgument"] = 59] = "FunctionArgument"; - NodeType[NodeType["KeyframeSelector"] = 60] = "KeyframeSelector"; - NodeType[NodeType["ViewPort"] = 61] = "ViewPort"; - NodeType[NodeType["Document"] = 62] = "Document"; - NodeType[NodeType["AtApplyRule"] = 63] = "AtApplyRule"; - NodeType[NodeType["CustomPropertyDeclaration"] = 64] = "CustomPropertyDeclaration"; - NodeType[NodeType["CustomPropertySet"] = 65] = "CustomPropertySet"; - NodeType[NodeType["ListEntry"] = 66] = "ListEntry"; - NodeType[NodeType["Supports"] = 67] = "Supports"; - NodeType[NodeType["SupportsCondition"] = 68] = "SupportsCondition"; - NodeType[NodeType["NamespacePrefix"] = 69] = "NamespacePrefix"; - NodeType[NodeType["GridLine"] = 70] = "GridLine"; - NodeType[NodeType["Plugin"] = 71] = "Plugin"; - NodeType[NodeType["UnknownAtRule"] = 72] = "UnknownAtRule"; -})(NodeType || (NodeType = {})); -var ReferenceType; -(function (ReferenceType) { - ReferenceType[ReferenceType["Mixin"] = 0] = "Mixin"; - ReferenceType[ReferenceType["Rule"] = 1] = "Rule"; - ReferenceType[ReferenceType["Variable"] = 2] = "Variable"; - ReferenceType[ReferenceType["Function"] = 3] = "Function"; - ReferenceType[ReferenceType["Keyframe"] = 4] = "Keyframe"; - ReferenceType[ReferenceType["Unknown"] = 5] = "Unknown"; -})(ReferenceType || (ReferenceType = {})); -function getNodeAtOffset(node, offset) { - var candidate = null; - if (!node || offset < node.offset || offset > node.end) { - return null; - } - // Find the shortest node at the position - node.accept(function (node) { - if (node.offset === -1 && node.length === -1) { - return true; - } - if (node.offset <= offset && node.end >= offset) { - if (!candidate) { - candidate = node; - } - else if (node.length <= candidate.length) { - candidate = node; - } - return true; - } - return false; - }); - return candidate; -} -function getNodePath(node, offset) { - var candidate = getNodeAtOffset(node, offset); - var path = []; - while (candidate) { - path.unshift(candidate); - candidate = candidate.parent; - } - return path; -} -function getParentDeclaration(node) { - var decl = node.findParent(NodeType.Declaration); - if (decl && decl.getValue() && decl.getValue().encloses(node)) { - return decl; - } - return null; -} -var Node = /** @class */ (function () { - function Node(offset, len, nodeType) { - if (offset === void 0) { offset = -1; } - if (len === void 0) { len = -1; } - this.parent = null; - this.offset = offset; - this.length = len; - if (nodeType) { - this.nodeType = nodeType; - } - } - Object.defineProperty(Node.prototype, "end", { - get: function () { return this.offset + this.length; }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Node.prototype, "type", { - get: function () { - return this.nodeType || NodeType.Undefined; - }, - set: function (type) { - this.nodeType = type; - }, - enumerable: true, - configurable: true - }); - Node.prototype.getTextProvider = function () { - var node = this; - while (node && !node.textProvider) { - node = node.parent; - } - if (node) { - return node.textProvider; - } - return function () { return 'unknown'; }; - }; - Node.prototype.getText = function () { - return this.getTextProvider()(this.offset, this.length); - }; - Node.prototype.matches = function (str) { - return this.length === str.length && this.getTextProvider()(this.offset, this.length) === str; - }; - Node.prototype.startsWith = function (str) { - return this.length >= str.length && this.getTextProvider()(this.offset, str.length) === str; - }; - Node.prototype.endsWith = function (str) { - return this.length >= str.length && this.getTextProvider()(this.end - str.length, str.length) === str; - }; - Node.prototype.accept = function (visitor) { - if (visitor(this) && this.children) { - for (var _i = 0, _a = this.children; _i < _a.length; _i++) { - var child = _a[_i]; - child.accept(visitor); - } - } - }; - Node.prototype.acceptVisitor = function (visitor) { - this.accept(visitor.visitNode.bind(visitor)); - }; - Node.prototype.adoptChild = function (node, index) { - if (index === void 0) { index = -1; } - if (node.parent && node.parent.children) { - var idx = node.parent.children.indexOf(node); - if (idx >= 0) { - node.parent.children.splice(idx, 1); - } - } - node.parent = this; - var children = this.children; - if (!children) { - children = this.children = []; - } - if (index !== -1) { - children.splice(index, 0, node); - } - else { - children.push(node); - } - return node; - }; - Node.prototype.attachTo = function (parent, index) { - if (index === void 0) { index = -1; } - if (parent) { - parent.adoptChild(this, index); - } - return this; - }; - Node.prototype.collectIssues = function (results) { - if (this.issues) { - results.push.apply(results, this.issues); - } - }; - Node.prototype.addIssue = function (issue) { - if (!this.issues) { - this.issues = []; - } - this.issues.push(issue); - }; - Node.prototype.hasIssue = function (rule) { - return Array.isArray(this.issues) && this.issues.some(function (i) { return i.getRule() === rule; }); - }; - Node.prototype.isErroneous = function (recursive) { - if (recursive === void 0) { recursive = false; } - if (this.issues && this.issues.length > 0) { - return true; - } - return recursive && Array.isArray(this.children) && this.children.some(function (c) { return c.isErroneous(true); }); - }; - Node.prototype.setNode = function (field, node, index) { - if (index === void 0) { index = -1; } - if (node) { - node.attachTo(this, index); - this[field] = node; - return true; - } - return false; - }; - Node.prototype.addChild = function (node) { - if (node) { - if (!this.children) { - this.children = []; - } - node.attachTo(this); - this.updateOffsetAndLength(node); - return true; - } - return false; - }; - Node.prototype.updateOffsetAndLength = function (node) { - if (node.offset < this.offset || this.offset === -1) { - this.offset = node.offset; - } - var nodeEnd = node.end; - if ((nodeEnd > this.end) || this.length === -1) { - this.length = nodeEnd - this.offset; - } - }; - Node.prototype.hasChildren = function () { - return this.children && this.children.length > 0; - }; - Node.prototype.getChildren = function () { - return this.children ? this.children.slice(0) : []; - }; - Node.prototype.getChild = function (index) { - if (this.children && index < this.children.length) { - return this.children[index]; - } - return null; - }; - Node.prototype.addChildren = function (nodes) { - for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { - var node = nodes_1[_i]; - this.addChild(node); - } - }; - Node.prototype.findFirstChildBeforeOffset = function (offset) { - if (this.children) { - var current = null; - for (var i = this.children.length - 1; i >= 0; i--) { - // iterate until we find a child that has a start offset smaller than the input offset - current = this.children[i]; - if (current.offset <= offset) { - return current; - } - } - } - return null; - }; - Node.prototype.findChildAtOffset = function (offset, goDeep) { - var current = this.findFirstChildBeforeOffset(offset); - if (current && current.end >= offset) { - if (goDeep) { - return current.findChildAtOffset(offset, true) || current; - } - return current; - } - return null; - }; - Node.prototype.encloses = function (candidate) { - return this.offset <= candidate.offset && this.offset + this.length >= candidate.offset + candidate.length; - }; - Node.prototype.getParent = function () { - var result = this.parent; - while (result instanceof Nodelist) { - result = result.parent; - } - return result; - }; - Node.prototype.findParent = function (type) { - var result = this; - while (result && result.type !== type) { - result = result.parent; - } - return result; - }; - Node.prototype.findAParent = function () { - var types = []; - for (var _i = 0; _i < arguments.length; _i++) { - types[_i] = arguments[_i]; - } - var result = this; - while (result && !types.some(function (t) { return result.type === t; })) { - result = result.parent; - } - return result; - }; - Node.prototype.setData = function (key, value) { - if (!this.options) { - this.options = {}; - } - this.options[key] = value; - }; - Node.prototype.getData = function (key) { - if (!this.options || !this.options.hasOwnProperty(key)) { - return null; - } - return this.options[key]; - }; - return Node; -}()); - -var Nodelist = /** @class */ (function (_super) { - __extends(Nodelist, _super); - function Nodelist(parent, index) { - if (index === void 0) { index = -1; } - var _this = _super.call(this, -1, -1) || this; - _this.attachTo(parent, index); - _this.offset = -1; - _this.length = -1; - return _this; - } - return Nodelist; -}(Node)); - -var Identifier = /** @class */ (function (_super) { - __extends(Identifier, _super); - function Identifier(offset, length) { - var _this = _super.call(this, offset, length) || this; - _this.isCustomProperty = false; - return _this; - } - Object.defineProperty(Identifier.prototype, "type", { - get: function () { - return NodeType.Identifier; - }, - enumerable: true, - configurable: true - }); - Identifier.prototype.containsInterpolation = function () { - return this.hasChildren(); - }; - return Identifier; -}(Node)); - -var Stylesheet = /** @class */ (function (_super) { - __extends(Stylesheet, _super); - function Stylesheet(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Stylesheet.prototype, "type", { - get: function () { - return NodeType.Stylesheet; - }, - enumerable: true, - configurable: true - }); - Stylesheet.prototype.setName = function (value) { - this.name = value; - }; - return Stylesheet; -}(Node)); - -var Declarations = /** @class */ (function (_super) { - __extends(Declarations, _super); - function Declarations(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Declarations.prototype, "type", { - get: function () { - return NodeType.Declarations; - }, - enumerable: true, - configurable: true - }); - return Declarations; -}(Node)); - -var BodyDeclaration = /** @class */ (function (_super) { - __extends(BodyDeclaration, _super); - function BodyDeclaration(offset, length) { - return _super.call(this, offset, length) || this; - } - BodyDeclaration.prototype.getDeclarations = function () { - return this.declarations; - }; - BodyDeclaration.prototype.setDeclarations = function (decls) { - return this.setNode('declarations', decls); - }; - return BodyDeclaration; -}(Node)); - -var RuleSet = /** @class */ (function (_super) { - __extends(RuleSet, _super); - function RuleSet(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(RuleSet.prototype, "type", { - get: function () { - return NodeType.Ruleset; - }, - enumerable: true, - configurable: true - }); - RuleSet.prototype.getSelectors = function () { - if (!this.selectors) { - this.selectors = new Nodelist(this); - } - return this.selectors; - }; - RuleSet.prototype.isNested = function () { - return !!this.parent && this.parent.findParent(NodeType.Declarations) !== null; - }; - return RuleSet; -}(BodyDeclaration)); - -var Selector = /** @class */ (function (_super) { - __extends(Selector, _super); - function Selector(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Selector.prototype, "type", { - get: function () { - return NodeType.Selector; - }, - enumerable: true, - configurable: true - }); - return Selector; -}(Node)); - -var SimpleSelector = /** @class */ (function (_super) { - __extends(SimpleSelector, _super); - function SimpleSelector(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(SimpleSelector.prototype, "type", { - get: function () { - return NodeType.SimpleSelector; - }, - enumerable: true, - configurable: true - }); - return SimpleSelector; -}(Node)); - -var AtApplyRule = /** @class */ (function (_super) { - __extends(AtApplyRule, _super); - function AtApplyRule(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(AtApplyRule.prototype, "type", { - get: function () { - return NodeType.AtApplyRule; - }, - enumerable: true, - configurable: true - }); - AtApplyRule.prototype.setIdentifier = function (node) { - return this.setNode('identifier', node, 0); - }; - AtApplyRule.prototype.getIdentifier = function () { - return this.identifier; - }; - AtApplyRule.prototype.getName = function () { - return this.identifier ? this.identifier.getText() : ''; - }; - return AtApplyRule; -}(Node)); - -var AbstractDeclaration = /** @class */ (function (_super) { - __extends(AbstractDeclaration, _super); - function AbstractDeclaration(offset, length) { - return _super.call(this, offset, length) || this; - } - return AbstractDeclaration; -}(Node)); - -var CustomPropertyDeclaration = /** @class */ (function (_super) { - __extends(CustomPropertyDeclaration, _super); - function CustomPropertyDeclaration(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(CustomPropertyDeclaration.prototype, "type", { - get: function () { - return NodeType.CustomPropertyDeclaration; - }, - enumerable: true, - configurable: true - }); - CustomPropertyDeclaration.prototype.setProperty = function (node) { - return this.setNode('property', node); - }; - CustomPropertyDeclaration.prototype.getProperty = function () { - return this.property; - }; - CustomPropertyDeclaration.prototype.setValue = function (value) { - return this.setNode('value', value); - }; - CustomPropertyDeclaration.prototype.getValue = function () { - return this.value; - }; - CustomPropertyDeclaration.prototype.setPropertySet = function (value) { - return this.setNode('propertySet', value); - }; - CustomPropertyDeclaration.prototype.getPropertySet = function () { - return this.propertySet; - }; - return CustomPropertyDeclaration; -}(AbstractDeclaration)); - -var CustomPropertySet = /** @class */ (function (_super) { - __extends(CustomPropertySet, _super); - function CustomPropertySet(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(CustomPropertySet.prototype, "type", { - get: function () { - return NodeType.CustomPropertySet; - }, - enumerable: true, - configurable: true - }); - return CustomPropertySet; -}(BodyDeclaration)); - -var Declaration = /** @class */ (function (_super) { - __extends(Declaration, _super); - function Declaration(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Declaration.prototype, "type", { - get: function () { - return NodeType.Declaration; - }, - enumerable: true, - configurable: true - }); - Declaration.prototype.setProperty = function (node) { - return this.setNode('property', node); - }; - Declaration.prototype.getProperty = function () { - return this.property; - }; - Declaration.prototype.getFullPropertyName = function () { - var propertyName = this.property ? this.property.getName() : 'unknown'; - if (this.parent instanceof Declarations && this.parent.getParent() instanceof NestedProperties) { - var parentDecl = this.parent.getParent().getParent(); - if (parentDecl instanceof Declaration) { - return parentDecl.getFullPropertyName() + propertyName; - } - } - return propertyName; - }; - Declaration.prototype.getNonPrefixedPropertyName = function () { - var propertyName = this.getFullPropertyName(); - if (propertyName && propertyName.charAt(0) === '-') { - var vendorPrefixEnd = propertyName.indexOf('-', 1); - if (vendorPrefixEnd !== -1) { - return propertyName.substring(vendorPrefixEnd + 1); - } - } - return propertyName; - }; - Declaration.prototype.setValue = function (value) { - return this.setNode('value', value); - }; - Declaration.prototype.getValue = function () { - return this.value; - }; - Declaration.prototype.setNestedProperties = function (value) { - return this.setNode('nestedProperties', value); - }; - Declaration.prototype.getNestedProperties = function () { - return this.nestedProperties; - }; - return Declaration; -}(AbstractDeclaration)); - -var Property = /** @class */ (function (_super) { - __extends(Property, _super); - function Property(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Property.prototype, "type", { - get: function () { - return NodeType.Property; - }, - enumerable: true, - configurable: true - }); - Property.prototype.setIdentifier = function (value) { - return this.setNode('identifier', value); - }; - Property.prototype.getIdentifier = function () { - return this.identifier; - }; - Property.prototype.getName = function () { - return this.getText(); - }; - Property.prototype.isCustomProperty = function () { - return this.identifier.isCustomProperty; - }; - return Property; -}(Node)); - -var Invocation = /** @class */ (function (_super) { - __extends(Invocation, _super); - function Invocation(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Invocation.prototype, "type", { - get: function () { - return NodeType.Invocation; - }, - enumerable: true, - configurable: true - }); - Invocation.prototype.getArguments = function () { - if (!this.arguments) { - this.arguments = new Nodelist(this); - } - return this.arguments; - }; - return Invocation; -}(Node)); - -var Function = /** @class */ (function (_super) { - __extends(Function, _super); - function Function(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Function.prototype, "type", { - get: function () { - return NodeType.Function; - }, - enumerable: true, - configurable: true - }); - Function.prototype.setIdentifier = function (node) { - return this.setNode('identifier', node, 0); - }; - Function.prototype.getIdentifier = function () { - return this.identifier; - }; - Function.prototype.getName = function () { - return this.identifier ? this.identifier.getText() : ''; - }; - return Function; -}(Invocation)); - -var FunctionParameter = /** @class */ (function (_super) { - __extends(FunctionParameter, _super); - function FunctionParameter(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(FunctionParameter.prototype, "type", { - get: function () { - return NodeType.FunctionParameter; - }, - enumerable: true, - configurable: true - }); - FunctionParameter.prototype.setIdentifier = function (node) { - return this.setNode('identifier', node, 0); - }; - FunctionParameter.prototype.getIdentifier = function () { - return this.identifier; - }; - FunctionParameter.prototype.getName = function () { - return this.identifier ? this.identifier.getText() : ''; - }; - FunctionParameter.prototype.setDefaultValue = function (node) { - return this.setNode('defaultValue', node, 0); - }; - FunctionParameter.prototype.getDefaultValue = function () { - return this.defaultValue; - }; - return FunctionParameter; -}(Node)); - -var FunctionArgument = /** @class */ (function (_super) { - __extends(FunctionArgument, _super); - function FunctionArgument(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(FunctionArgument.prototype, "type", { - get: function () { - return NodeType.FunctionArgument; - }, - enumerable: true, - configurable: true - }); - FunctionArgument.prototype.setIdentifier = function (node) { - return this.setNode('identifier', node, 0); - }; - FunctionArgument.prototype.getIdentifier = function () { - return this.identifier; - }; - FunctionArgument.prototype.getName = function () { - return this.identifier ? this.identifier.getText() : ''; - }; - FunctionArgument.prototype.setValue = function (node) { - return this.setNode('value', node, 0); - }; - FunctionArgument.prototype.getValue = function () { - return this.value; - }; - return FunctionArgument; -}(Node)); - -var IfStatement = /** @class */ (function (_super) { - __extends(IfStatement, _super); - function IfStatement(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(IfStatement.prototype, "type", { - get: function () { - return NodeType.If; - }, - enumerable: true, - configurable: true - }); - IfStatement.prototype.setExpression = function (node) { - return this.setNode('expression', node, 0); - }; - IfStatement.prototype.setElseClause = function (elseClause) { - return this.setNode('elseClause', elseClause); - }; - return IfStatement; -}(BodyDeclaration)); - -var ForStatement = /** @class */ (function (_super) { - __extends(ForStatement, _super); - function ForStatement(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(ForStatement.prototype, "type", { - get: function () { - return NodeType.For; - }, - enumerable: true, - configurable: true - }); - ForStatement.prototype.setVariable = function (node) { - return this.setNode('variable', node, 0); - }; - return ForStatement; -}(BodyDeclaration)); - -var EachStatement = /** @class */ (function (_super) { - __extends(EachStatement, _super); - function EachStatement(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(EachStatement.prototype, "type", { - get: function () { - return NodeType.Each; - }, - enumerable: true, - configurable: true - }); - EachStatement.prototype.getVariables = function () { - if (!this.variables) { - this.variables = new Nodelist(this); - } - return this.variables; - }; - return EachStatement; -}(BodyDeclaration)); - -var WhileStatement = /** @class */ (function (_super) { - __extends(WhileStatement, _super); - function WhileStatement(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(WhileStatement.prototype, "type", { - get: function () { - return NodeType.While; - }, - enumerable: true, - configurable: true - }); - return WhileStatement; -}(BodyDeclaration)); - -var ElseStatement = /** @class */ (function (_super) { - __extends(ElseStatement, _super); - function ElseStatement(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(ElseStatement.prototype, "type", { - get: function () { - return NodeType.Else; - }, - enumerable: true, - configurable: true - }); - return ElseStatement; -}(BodyDeclaration)); - -var FunctionDeclaration = /** @class */ (function (_super) { - __extends(FunctionDeclaration, _super); - function FunctionDeclaration(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(FunctionDeclaration.prototype, "type", { - get: function () { - return NodeType.FunctionDeclaration; - }, - enumerable: true, - configurable: true - }); - FunctionDeclaration.prototype.setIdentifier = function (node) { - return this.setNode('identifier', node, 0); - }; - FunctionDeclaration.prototype.getIdentifier = function () { - return this.identifier; - }; - FunctionDeclaration.prototype.getName = function () { - return this.identifier ? this.identifier.getText() : ''; - }; - FunctionDeclaration.prototype.getParameters = function () { - if (!this.parameters) { - this.parameters = new Nodelist(this); - } - return this.parameters; - }; - return FunctionDeclaration; -}(BodyDeclaration)); - -var ViewPort = /** @class */ (function (_super) { - __extends(ViewPort, _super); - function ViewPort(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(ViewPort.prototype, "type", { - get: function () { - return NodeType.ViewPort; - }, - enumerable: true, - configurable: true - }); - return ViewPort; -}(BodyDeclaration)); - -var FontFace = /** @class */ (function (_super) { - __extends(FontFace, _super); - function FontFace(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(FontFace.prototype, "type", { - get: function () { - return NodeType.FontFace; - }, - enumerable: true, - configurable: true - }); - return FontFace; -}(BodyDeclaration)); - -var NestedProperties = /** @class */ (function (_super) { - __extends(NestedProperties, _super); - function NestedProperties(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(NestedProperties.prototype, "type", { - get: function () { - return NodeType.NestedProperties; - }, - enumerable: true, - configurable: true - }); - return NestedProperties; -}(BodyDeclaration)); - -var Keyframe = /** @class */ (function (_super) { - __extends(Keyframe, _super); - function Keyframe(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Keyframe.prototype, "type", { - get: function () { - return NodeType.Keyframe; - }, - enumerable: true, - configurable: true - }); - Keyframe.prototype.setKeyword = function (keyword) { - return this.setNode('keyword', keyword, 0); - }; - Keyframe.prototype.getKeyword = function () { - return this.keyword; - }; - Keyframe.prototype.setIdentifier = function (node) { - return this.setNode('identifier', node, 0); - }; - Keyframe.prototype.getIdentifier = function () { - return this.identifier; - }; - Keyframe.prototype.getName = function () { - return this.identifier ? this.identifier.getText() : ''; - }; - return Keyframe; -}(BodyDeclaration)); - -var KeyframeSelector = /** @class */ (function (_super) { - __extends(KeyframeSelector, _super); - function KeyframeSelector(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(KeyframeSelector.prototype, "type", { - get: function () { - return NodeType.KeyframeSelector; - }, - enumerable: true, - configurable: true - }); - return KeyframeSelector; -}(BodyDeclaration)); - -var Import = /** @class */ (function (_super) { - __extends(Import, _super); - function Import(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Import.prototype, "type", { - get: function () { - return NodeType.Import; - }, - enumerable: true, - configurable: true - }); - Import.prototype.setMedialist = function (node) { - if (node) { - node.attachTo(this); - this.medialist = node; - return true; - } - return false; - }; - return Import; -}(Node)); - -var Namespace = /** @class */ (function (_super) { - __extends(Namespace, _super); - function Namespace(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Namespace.prototype, "type", { - get: function () { - return NodeType.Namespace; - }, - enumerable: true, - configurable: true - }); - return Namespace; -}(Node)); - -var Media = /** @class */ (function (_super) { - __extends(Media, _super); - function Media(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Media.prototype, "type", { - get: function () { - return NodeType.Media; - }, - enumerable: true, - configurable: true - }); - return Media; -}(BodyDeclaration)); - -var Supports = /** @class */ (function (_super) { - __extends(Supports, _super); - function Supports(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Supports.prototype, "type", { - get: function () { - return NodeType.Supports; - }, - enumerable: true, - configurable: true - }); - return Supports; -}(BodyDeclaration)); - -var Document = /** @class */ (function (_super) { - __extends(Document, _super); - function Document(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Document.prototype, "type", { - get: function () { - return NodeType.Document; - }, - enumerable: true, - configurable: true - }); - return Document; -}(BodyDeclaration)); - -var Medialist = /** @class */ (function (_super) { - __extends(Medialist, _super); - function Medialist(offset, length) { - return _super.call(this, offset, length) || this; - } - Medialist.prototype.getMediums = function () { - if (!this.mediums) { - this.mediums = new Nodelist(this); - } - return this.mediums; - }; - return Medialist; -}(Node)); - -var MediaQuery = /** @class */ (function (_super) { - __extends(MediaQuery, _super); - function MediaQuery(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(MediaQuery.prototype, "type", { - get: function () { - return NodeType.MediaQuery; - }, - enumerable: true, - configurable: true - }); - return MediaQuery; -}(Node)); - -var SupportsCondition = /** @class */ (function (_super) { - __extends(SupportsCondition, _super); - function SupportsCondition(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(SupportsCondition.prototype, "type", { - get: function () { - return NodeType.SupportsCondition; - }, - enumerable: true, - configurable: true - }); - return SupportsCondition; -}(Node)); - -var Page = /** @class */ (function (_super) { - __extends(Page, _super); - function Page(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Page.prototype, "type", { - get: function () { - return NodeType.Page; - }, - enumerable: true, - configurable: true - }); - return Page; -}(BodyDeclaration)); - -var PageBoxMarginBox = /** @class */ (function (_super) { - __extends(PageBoxMarginBox, _super); - function PageBoxMarginBox(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(PageBoxMarginBox.prototype, "type", { - get: function () { - return NodeType.PageBoxMarginBox; - }, - enumerable: true, - configurable: true - }); - return PageBoxMarginBox; -}(BodyDeclaration)); - -var Expression = /** @class */ (function (_super) { - __extends(Expression, _super); - function Expression(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Expression.prototype, "type", { - get: function () { - return NodeType.Expression; - }, - enumerable: true, - configurable: true - }); - return Expression; -}(Node)); - -var BinaryExpression = /** @class */ (function (_super) { - __extends(BinaryExpression, _super); - function BinaryExpression(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(BinaryExpression.prototype, "type", { - get: function () { - return NodeType.BinaryExpression; - }, - enumerable: true, - configurable: true - }); - BinaryExpression.prototype.setLeft = function (left) { - return this.setNode('left', left); - }; - BinaryExpression.prototype.getLeft = function () { - return this.left; - }; - BinaryExpression.prototype.setRight = function (right) { - return this.setNode('right', right); - }; - BinaryExpression.prototype.getRight = function () { - return this.right; - }; - BinaryExpression.prototype.setOperator = function (value) { - return this.setNode('operator', value); - }; - BinaryExpression.prototype.getOperator = function () { - return this.operator; - }; - return BinaryExpression; -}(Node)); - -var Term = /** @class */ (function (_super) { - __extends(Term, _super); - function Term(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Term.prototype, "type", { - get: function () { - return NodeType.Term; - }, - enumerable: true, - configurable: true - }); - Term.prototype.setOperator = function (value) { - return this.setNode('operator', value); - }; - Term.prototype.getOperator = function () { - return this.operator; - }; - Term.prototype.setExpression = function (value) { - return this.setNode('expression', value); - }; - Term.prototype.getExpression = function () { - return this.expression; - }; - return Term; -}(Node)); - -var AttributeSelector = /** @class */ (function (_super) { - __extends(AttributeSelector, _super); - function AttributeSelector(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(AttributeSelector.prototype, "type", { - get: function () { - return NodeType.AttributeSelector; - }, - enumerable: true, - configurable: true - }); - AttributeSelector.prototype.setNamespacePrefix = function (value) { - return this.setNode('namespacePrefix', value); - }; - AttributeSelector.prototype.getNamespacePrefix = function () { - return this.namespacePrefix; - }; - AttributeSelector.prototype.setIdentifier = function (value) { - return this.setNode('identifier', value); - }; - AttributeSelector.prototype.getIdentifier = function () { - return this.identifier; - }; - AttributeSelector.prototype.setOperator = function (operator) { - return this.setNode('operator', operator); - }; - AttributeSelector.prototype.getOperator = function () { - return this.operator; - }; - AttributeSelector.prototype.setValue = function (value) { - return this.setNode('value', value); - }; - AttributeSelector.prototype.getValue = function () { - return this.value; - }; - return AttributeSelector; -}(Node)); - -var Operator = /** @class */ (function (_super) { - __extends(Operator, _super); - function Operator(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Operator.prototype, "type", { - get: function () { - return NodeType.Operator; - }, - enumerable: true, - configurable: true - }); - return Operator; -}(Node)); - -var HexColorValue = /** @class */ (function (_super) { - __extends(HexColorValue, _super); - function HexColorValue(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(HexColorValue.prototype, "type", { - get: function () { - return NodeType.HexColorValue; - }, - enumerable: true, - configurable: true - }); - return HexColorValue; -}(Node)); - -var _dot = '.'.charCodeAt(0), _0 = '0'.charCodeAt(0), _9 = '9'.charCodeAt(0); -var NumericValue = /** @class */ (function (_super) { - __extends(NumericValue, _super); - function NumericValue(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(NumericValue.prototype, "type", { - get: function () { - return NodeType.NumericValue; - }, - enumerable: true, - configurable: true - }); - NumericValue.prototype.getValue = function () { - var raw = this.getText(); - var unitIdx = 0; - var code; - for (var i = 0, len = raw.length; i < len; i++) { - code = raw.charCodeAt(i); - if (!(_0 <= code && code <= _9 || code === _dot)) { - break; - } - unitIdx += 1; - } - return { - value: raw.substring(0, unitIdx), - unit: unitIdx < raw.length ? raw.substring(unitIdx) : undefined - }; - }; - return NumericValue; -}(Node)); - -var VariableDeclaration = /** @class */ (function (_super) { - __extends(VariableDeclaration, _super); - function VariableDeclaration(offset, length) { - var _this = _super.call(this, offset, length) || this; - _this.needsSemicolon = true; - return _this; - } - Object.defineProperty(VariableDeclaration.prototype, "type", { - get: function () { - return NodeType.VariableDeclaration; - }, - enumerable: true, - configurable: true - }); - VariableDeclaration.prototype.setVariable = function (node) { - if (node) { - node.attachTo(this); - this.variable = node; - return true; - } - return false; - }; - VariableDeclaration.prototype.getVariable = function () { - return this.variable; - }; - VariableDeclaration.prototype.getName = function () { - return this.variable ? this.variable.getName() : ''; - }; - VariableDeclaration.prototype.setValue = function (node) { - if (node) { - node.attachTo(this); - this.value = node; - return true; - } - return false; - }; - VariableDeclaration.prototype.getValue = function () { - return this.value; - }; - return VariableDeclaration; -}(AbstractDeclaration)); - -var Interpolation = /** @class */ (function (_super) { - __extends(Interpolation, _super); - function Interpolation(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Interpolation.prototype, "type", { - get: function () { - return NodeType.Interpolation; - }, - enumerable: true, - configurable: true - }); - return Interpolation; -}(Node)); - -var Variable = /** @class */ (function (_super) { - __extends(Variable, _super); - function Variable(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(Variable.prototype, "type", { - get: function () { - return NodeType.VariableName; - }, - enumerable: true, - configurable: true - }); - Variable.prototype.getName = function () { - return this.getText(); - }; - return Variable; -}(Node)); - -var ExtendsReference = /** @class */ (function (_super) { - __extends(ExtendsReference, _super); - function ExtendsReference(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(ExtendsReference.prototype, "type", { - get: function () { - return NodeType.ExtendsReference; - }, - enumerable: true, - configurable: true - }); - ExtendsReference.prototype.getSelectors = function () { - if (!this.selectors) { - this.selectors = new Nodelist(this); - } - return this.selectors; - }; - return ExtendsReference; -}(Node)); - -var MixinReference = /** @class */ (function (_super) { - __extends(MixinReference, _super); - function MixinReference(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(MixinReference.prototype, "type", { - get: function () { - return NodeType.MixinReference; - }, - enumerable: true, - configurable: true - }); - MixinReference.prototype.getNamespaces = function () { - if (!this.namespaces) { - this.namespaces = new Nodelist(this); - } - return this.namespaces; - }; - MixinReference.prototype.setIdentifier = function (node) { - return this.setNode('identifier', node, 0); - }; - MixinReference.prototype.getIdentifier = function () { - return this.identifier; - }; - MixinReference.prototype.getName = function () { - return this.identifier ? this.identifier.getText() : ''; - }; - MixinReference.prototype.getArguments = function () { - if (!this.arguments) { - this.arguments = new Nodelist(this); - } - return this.arguments; - }; - MixinReference.prototype.setContent = function (node) { - return this.setNode('content', node); - }; - MixinReference.prototype.getContent = function () { - return this.content; - }; - return MixinReference; -}(Node)); - -var MixinDeclaration = /** @class */ (function (_super) { - __extends(MixinDeclaration, _super); - function MixinDeclaration(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(MixinDeclaration.prototype, "type", { - get: function () { - return NodeType.MixinDeclaration; - }, - enumerable: true, - configurable: true - }); - MixinDeclaration.prototype.setIdentifier = function (node) { - return this.setNode('identifier', node, 0); - }; - MixinDeclaration.prototype.getIdentifier = function () { - return this.identifier; - }; - MixinDeclaration.prototype.getName = function () { - return this.identifier ? this.identifier.getText() : ''; - }; - MixinDeclaration.prototype.getParameters = function () { - if (!this.parameters) { - this.parameters = new Nodelist(this); - } - return this.parameters; - }; - MixinDeclaration.prototype.setGuard = function (node) { - if (node) { - node.attachTo(this); - this.guard = node; - } - return false; - }; - return MixinDeclaration; -}(BodyDeclaration)); - -var UnknownAtRule = /** @class */ (function (_super) { - __extends(UnknownAtRule, _super); - function UnknownAtRule(offset, length) { - return _super.call(this, offset, length) || this; - } - Object.defineProperty(UnknownAtRule.prototype, "type", { - get: function () { - return NodeType.UnknownAtRule; - }, - enumerable: true, - configurable: true - }); - UnknownAtRule.prototype.setAtRuleName = function (atRuleName) { - this.atRuleName = atRuleName; - }; - UnknownAtRule.prototype.getAtRuleName = function (atRuleName) { - return this.atRuleName; - }; - return UnknownAtRule; -}(BodyDeclaration)); - -var ListEntry = /** @class */ (function (_super) { - __extends(ListEntry, _super); - function ListEntry() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ListEntry.prototype, "type", { - get: function () { - return NodeType.ListEntry; - }, - enumerable: true, - configurable: true - }); - ListEntry.prototype.setKey = function (node) { - return this.setNode('key', node, 0); - }; - ListEntry.prototype.setValue = function (node) { - return this.setNode('value', node, 1); - }; - return ListEntry; -}(Node)); - -var LessGuard = /** @class */ (function (_super) { - __extends(LessGuard, _super); - function LessGuard() { - return _super !== null && _super.apply(this, arguments) || this; - } - LessGuard.prototype.getConditions = function () { - if (!this.conditions) { - this.conditions = new Nodelist(this); - } - return this.conditions; - }; - return LessGuard; -}(Node)); - -var GuardCondition = /** @class */ (function (_super) { - __extends(GuardCondition, _super); - function GuardCondition() { - return _super !== null && _super.apply(this, arguments) || this; - } - GuardCondition.prototype.setVariable = function (node) { - return this.setNode('variable', node); - }; - return GuardCondition; -}(Node)); - -var Level; -(function (Level) { - Level[Level["Ignore"] = 1] = "Ignore"; - Level[Level["Warning"] = 2] = "Warning"; - Level[Level["Error"] = 4] = "Error"; -})(Level || (Level = {})); -var Marker = /** @class */ (function () { - function Marker(node, rule, level, message, offset, length) { - if (offset === void 0) { offset = node.offset; } - if (length === void 0) { length = node.length; } - this.node = node; - this.rule = rule; - this.level = level; - this.message = message || rule.message; - this.offset = offset; - this.length = length; - } - Marker.prototype.getRule = function () { - return this.rule; - }; - Marker.prototype.getLevel = function () { - return this.level; - }; - Marker.prototype.getOffset = function () { - return this.offset; - }; - Marker.prototype.getLength = function () { - return this.length; - }; - Marker.prototype.getNode = function () { - return this.node; - }; - Marker.prototype.getMessage = function () { - return this.message; - }; - return Marker; -}()); - -/* -export class DefaultVisitor implements IVisitor { - - public visitNode(node:Node):boolean { - switch (node.type) { - case NodeType.Stylesheet: - return this.visitStylesheet( node); - case NodeType.FontFace: - return this.visitFontFace( node); - case NodeType.Ruleset: - return this.visitRuleSet( node); - case NodeType.Selector: - return this.visitSelector( node); - case NodeType.SimpleSelector: - return this.visitSimpleSelector( node); - case NodeType.Declaration: - return this.visitDeclaration( node); - case NodeType.Function: - return this.visitFunction( node); - case NodeType.FunctionDeclaration: - return this.visitFunctionDeclaration( node); - case NodeType.FunctionParameter: - return this.visitFunctionParameter( node); - case NodeType.FunctionArgument: - return this.visitFunctionArgument( node); - case NodeType.Term: - return this.visitTerm( node); - case NodeType.Declaration: - return this.visitExpression( node); - case NodeType.NumericValue: - return this.visitNumericValue( node); - case NodeType.Page: - return this.visitPage( node); - case NodeType.PageBoxMarginBox: - return this.visitPageBoxMarginBox( node); - case NodeType.Property: - return this.visitProperty( node); - case NodeType.NumericValue: - return this.visitNodelist( node); - case NodeType.Import: - return this.visitImport( node); - case NodeType.Namespace: - return this.visitNamespace( node); - case NodeType.Keyframe: - return this.visitKeyframe( node); - case NodeType.KeyframeSelector: - return this.visitKeyframeSelector( node); - case NodeType.MixinDeclaration: - return this.visitMixinDeclaration( node); - case NodeType.MixinReference: - return this.visitMixinReference( node); - case NodeType.Variable: - return this.visitVariable( node); - case NodeType.VariableDeclaration: - return this.visitVariableDeclaration( node); - } - return this.visitUnknownNode(node); - } - - public visitFontFace(node:FontFace):boolean { - return true; - } - - public visitKeyframe(node:Keyframe):boolean { - return true; - } - - public visitKeyframeSelector(node:KeyframeSelector):boolean { - return true; - } - - public visitStylesheet(node:Stylesheet):boolean { - return true; - } - - public visitProperty(Node:Property):boolean { - return true; - } - - public visitRuleSet(node:RuleSet):boolean { - return true; - } - - public visitSelector(node:Selector):boolean { - return true; - } - - public visitSimpleSelector(node:SimpleSelector):boolean { - return true; - } - - public visitDeclaration(node:Declaration):boolean { - return true; - } - - public visitFunction(node:Function):boolean { - return true; - } - - public visitFunctionDeclaration(node:FunctionDeclaration):boolean { - return true; - } - - public visitInvocation(node:Invocation):boolean { - return true; - } - - public visitTerm(node:Term):boolean { - return true; - } - - public visitImport(node:Import):boolean { - return true; - } - - public visitNamespace(node:Namespace):boolean { - return true; - } - - public visitExpression(node:Expression):boolean { - return true; - } - - public visitNumericValue(node:NumericValue):boolean { - return true; - } - - public visitPage(node:Page):boolean { - return true; - } - - public visitPageBoxMarginBox(node:PageBoxMarginBox):boolean { - return true; - } - - public visitNodelist(node:Nodelist):boolean { - return true; - } - - public visitVariableDeclaration(node:VariableDeclaration):boolean { - return true; - } - - public visitVariable(node:Variable):boolean { - return true; - } - - public visitMixinDeclaration(node:MixinDeclaration):boolean { - return true; - } - - public visitMixinReference(node:MixinReference):boolean { - return true; - } - - public visitUnknownNode(node:Node):boolean { - return true; - } -} -*/ -var ParseErrorCollector = /** @class */ (function () { - function ParseErrorCollector() { - this.entries = []; - } - ParseErrorCollector.entries = function (node) { - var visitor = new ParseErrorCollector(); - node.acceptVisitor(visitor); - return visitor.entries; - }; - ParseErrorCollector.prototype.visitNode = function (node) { - if (node.isErroneous()) { - node.collectIssues(this.entries); - } - return true; - }; - return ParseErrorCollector; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssParser.js": -/*!*************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssParser.js ***! - \*************************************************************************************************************/ -/*! exports provided: Parser */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Parser", function() { return Parser; }); -/* harmony import */ var _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cssScanner.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssScanner.js"); -/* harmony import */ var _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cssNodes.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js"); -/* harmony import */ var _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cssErrors.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssErrors.js"); -/* harmony import */ var _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../languageFacts/facts.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/facts.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssParser.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -28520,22 +27743,22 @@ __webpack_require__.r(__webpack_exports__); /// https://www.w3.org/TR/CSS21/grammar.html /// http://www.w3.org/TR/CSS21/syndata.html#tokenization /// -var Parser = /** @class */ (function () { +var cssParser_Parser = /** @class */ (function () { function Parser(scnr) { - if (scnr === void 0) { scnr = new _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["Scanner"](); } + if (scnr === void 0) { scnr = new Scanner(); } this.keyframeRegex = /^@(\-(webkit|ms|moz|o)\-)?keyframes$/i; this.scanner = scnr; this.token = null; this.prevToken = null; } Parser.prototype.peekIdent = function (text) { - return _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Ident === this.token.type && text.length === this.token.text.length && text === this.token.text.toLowerCase(); + return TokenType.Ident === this.token.type && text.length === this.token.text.length && text === this.token.text.toLowerCase(); }; Parser.prototype.peekKeyword = function (text) { - return _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].AtKeyword === this.token.type && text.length === this.token.text.length && text === this.token.text.toLowerCase(); + return TokenType.AtKeyword === this.token.type && text.length === this.token.text.length && text === this.token.text.toLowerCase(); }; Parser.prototype.peekDelim = function (text) { - return _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Delim === this.token.type && text === this.token.text; + return TokenType.Delim === this.token.type && text === this.token.text; }; Parser.prototype.peek = function (type) { return type === this.token.type; @@ -28575,7 +27798,7 @@ var Parser = /** @class */ (function () { return node; }; Parser.prototype.acceptOneKeyword = function (keywords) { - if (_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].AtKeyword === this.token.type) { + if (TokenType.AtKeyword === this.token.type) { for (var _i = 0, keywords_1 = keywords; _i < keywords_1.length; _i++) { var keyword = keywords_1[_i]; if (keyword.length === this.token.text.length && keyword === this.token.text.toLowerCase()) { @@ -28636,7 +27859,7 @@ var Parser = /** @class */ (function () { return true; } else { - if (this.token.type === _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].EOF) { + if (this.token.type === TokenType.EOF) { return false; } this.token = this.scanner.scan(); @@ -28644,7 +27867,7 @@ var Parser = /** @class */ (function () { } }; Parser.prototype.createNode = function (nodeType) { - return new _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Node"](this.token.offset, this.token.len, nodeType); + return new cssNodes_Node(this.token.offset, this.token.len, nodeType); }; Parser.prototype.create = function (ctor) { return new ctor(this.token.offset, this.token.len); @@ -28652,7 +27875,7 @@ var Parser = /** @class */ (function () { Parser.prototype.finish = function (node, error, resyncTokens, resyncStopTokens) { // parseNumeric misuses error for boolean flagging (however the real error mustn't be a false) // + nodelist offsets mustn't be modified, because there is a offset hack in rulesets for smartselection - if (!(node instanceof _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Nodelist"])) { + if (!(node instanceof Nodelist)) { if (error) { this.markError(node, error, resyncTokens, resyncStopTokens); } @@ -28667,7 +27890,7 @@ var Parser = /** @class */ (function () { }; Parser.prototype.markError = function (node, error, resyncTokens, resyncStopTokens) { if (this.token !== this.lastErrorToken) { // do not report twice on the same token - node.addIssue(new _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Marker"](node, error, _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Level"].Error, null, this.token.offset, this.token.len)); + node.addIssue(new Marker(node, error, Level.Error, null, this.token.offset, this.token.len)); this.lastErrorToken = this.token; } if (resyncTokens || resyncStopTokens) { @@ -28699,7 +27922,7 @@ var Parser = /** @class */ (function () { return node; }; Parser.prototype._parseStylesheet = function () { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Stylesheet"]); + var node = this.create(Stylesheet); node.addChild(this._parseCharset()); var inRecovery = false; do { @@ -28711,35 +27934,35 @@ var Parser = /** @class */ (function () { node.addChild(statement); hasMatch = true; inRecovery = false; - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].EOF) && this._needsSemicolonAfter(statement) && !this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SemiColon)) { - this.markError(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].SemiColonExpected); + if (!this.peek(TokenType.EOF) && this._needsSemicolonAfter(statement) && !this.accept(TokenType.SemiColon)) { + this.markError(node, ParseError.SemiColonExpected); } } - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SemiColon) || this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CDO) || this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CDC)) { + while (this.accept(TokenType.SemiColon) || this.accept(TokenType.CDO) || this.accept(TokenType.CDC)) { // accept empty statements hasMatch = true; inRecovery = false; } } while (hasMatch); - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].EOF)) { + if (this.peek(TokenType.EOF)) { break; } if (!inRecovery) { - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].AtKeyword)) { - this.markError(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].UnknownAtRule); + if (this.peek(TokenType.AtKeyword)) { + this.markError(node, ParseError.UnknownAtRule); } else { - this.markError(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RuleOrSelectorExpected); + this.markError(node, ParseError.RuleOrSelectorExpected); } inRecovery = true; } this.consumeToken(); - } while (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].EOF)); + } while (!this.peek(TokenType.EOF)); return this.finish(node); }; Parser.prototype._parseStylesheetStatement = function (isNested) { if (isNested === void 0) { isNested = false; } - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].AtKeyword)) { + if (this.peek(TokenType.AtKeyword)) { return this._parseStylesheetAtStatement(isNested); } return this._parseRuleset(isNested); @@ -28760,10 +27983,10 @@ var Parser = /** @class */ (function () { Parser.prototype._tryParseRuleset = function (isNested) { var mark = this.mark(); if (this._parseSelector(isNested)) { - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Comma) && this._parseSelector(isNested)) { + while (this.accept(TokenType.Comma) && this._parseSelector(isNested)) { // loop } - if (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyL)) { + if (this.accept(TokenType.CurlyL)) { this.restoreAtMark(mark); return this._parseRuleset(isNested); } @@ -28773,14 +27996,14 @@ var Parser = /** @class */ (function () { }; Parser.prototype._parseRuleset = function (isNested) { if (isNested === void 0) { isNested = false; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["RuleSet"]); + var node = this.create(RuleSet); var selectors = node.getSelectors(); if (!selectors.addChild(this._parseSelector(isNested))) { return null; } - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Comma)) { + while (this.accept(TokenType.Comma)) { if (!selectors.addChild(this._parseSelector(isNested))) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].SelectorExpected); + return this.finish(node, ParseError.SelectorExpected); } } return this._parseBody(node, this._parseRuleSetDeclaration.bind(this)); @@ -28802,76 +28025,76 @@ var Parser = /** @class */ (function () { if (!this.peekKeyword('@apply')) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["AtApplyRule"]); + var node = this.create(AtApplyRule); this.consumeToken(); - if (!node.setIdentifier(this._parseIdent([_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["ReferenceType"].Variable]))) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].IdentifierExpected); + if (!node.setIdentifier(this._parseIdent([ReferenceType.Variable]))) { + return this.finish(node, ParseError.IdentifierExpected); } return this.finish(node); }; Parser.prototype._needsSemicolonAfter = function (node) { switch (node.type) { - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].Keyframe: - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].ViewPort: - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].Media: - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].Ruleset: - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].Namespace: - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].If: - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].For: - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].Each: - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].While: - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].MixinDeclaration: - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].FunctionDeclaration: + case NodeType.Keyframe: + case NodeType.ViewPort: + case NodeType.Media: + case NodeType.Ruleset: + case NodeType.Namespace: + case NodeType.If: + case NodeType.For: + case NodeType.Each: + case NodeType.While: + case NodeType.MixinDeclaration: + case NodeType.FunctionDeclaration: return false; - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].ExtendsReference: - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].MixinContent: - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].ReturnStatement: - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].MediaQuery: - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].Debug: - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].Import: - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].AtApplyRule: - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].CustomPropertyDeclaration: + case NodeType.ExtendsReference: + case NodeType.MixinContent: + case NodeType.ReturnStatement: + case NodeType.MediaQuery: + case NodeType.Debug: + case NodeType.Import: + case NodeType.AtApplyRule: + case NodeType.CustomPropertyDeclaration: return true; - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].VariableDeclaration: + case NodeType.VariableDeclaration: return node.needsSemicolon; - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].MixinReference: + case NodeType.MixinReference: return !node.getContent(); - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].Declaration: + case NodeType.Declaration: return !node.getNestedProperties(); } return false; }; Parser.prototype._parseDeclarations = function (parseDeclaration) { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Declarations"]); - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyL)) { + var node = this.create(Declarations); + if (!this.accept(TokenType.CurlyL)) { return null; } var decl = parseDeclaration(); while (node.addChild(decl)) { - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyR)) { + if (this.peek(TokenType.CurlyR)) { break; } - if (this._needsSemicolonAfter(decl) && !this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SemiColon)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].SemiColonExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SemiColon, _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyR]); + if (this._needsSemicolonAfter(decl) && !this.accept(TokenType.SemiColon)) { + return this.finish(node, ParseError.SemiColonExpected, [TokenType.SemiColon, TokenType.CurlyR]); } - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SemiColon)) { + while (this.accept(TokenType.SemiColon)) { // accept empty statements } decl = parseDeclaration(); } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RightCurlyExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyR, _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SemiColon]); + if (!this.accept(TokenType.CurlyR)) { + return this.finish(node, ParseError.RightCurlyExpected, [TokenType.CurlyR, TokenType.SemiColon]); } return this.finish(node); }; Parser.prototype._parseBody = function (node, parseDeclaration) { if (!node.setDeclarations(this._parseDeclarations(parseDeclaration))) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].LeftCurlyExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyR, _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SemiColon]); + return this.finish(node, ParseError.LeftCurlyExpected, [TokenType.CurlyR, TokenType.SemiColon]); } return this.finish(node); }; Parser.prototype._parseSelector = function (isNested) { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Selector"]); + var node = this.create(Selector); var hasContent = false; if (isNested) { // nested selectors can start with a combinator @@ -28884,43 +28107,43 @@ var Parser = /** @class */ (function () { return hasContent ? this.finish(node) : null; }; Parser.prototype._parseDeclaration = function (resyncStopTokens) { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Declaration"]); + var node = this.create(Declaration); if (!node.setProperty(this._parseProperty())) { return null; } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Colon)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].ColonExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Colon], resyncStopTokens); + if (!this.accept(TokenType.Colon)) { + return this.finish(node, ParseError.ColonExpected, [TokenType.Colon], resyncStopTokens); } node.colonPosition = this.prevToken.offset; if (!node.setValue(this._parseExpr())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].PropertyValueExpected); + return this.finish(node, ParseError.PropertyValueExpected); } node.addChild(this._parsePrio()); - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SemiColon)) { + if (this.peek(TokenType.SemiColon)) { node.semicolonPosition = this.token.offset; // not part of the declaration, but useful information for code assist } return this.finish(node); }; Parser.prototype._tryParseCustomPropertyDeclaration = function () { - if (!this.peekRegExp(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Ident, /^--/)) { + if (!this.peekRegExp(TokenType.Ident, /^--/)) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["CustomPropertyDeclaration"]); + var node = this.create(CustomPropertyDeclaration); if (!node.setProperty(this._parseProperty())) { return null; } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Colon)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].ColonExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Colon]); + if (!this.accept(TokenType.Colon)) { + return this.finish(node, ParseError.ColonExpected, [TokenType.Colon]); } node.colonPosition = this.prevToken.offset; var mark = this.mark(); - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyL)) { + if (this.peek(TokenType.CurlyL)) { // try to parse it as nested declaration - var propertySet = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["CustomPropertySet"]); + var propertySet = this.create(CustomPropertySet); var declarations = this._parseDeclarations(this._parseRuleSetDeclaration.bind(this)); if (propertySet.setDeclarations(declarations) && !declarations.isErroneous(true)) { propertySet.addChild(this._parsePrio()); - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SemiColon)) { + if (this.peek(TokenType.SemiColon)) { this.finish(propertySet); node.setPropertySet(propertySet); node.semicolonPosition = this.token.offset; // not part of the declaration, but useful information for code assist @@ -28933,7 +28156,7 @@ var Parser = /** @class */ (function () { var expression = this._parseExpr(); if (expression && !expression.isErroneous(true)) { this._parsePrio(); - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SemiColon)) { + if (this.peek(TokenType.SemiColon)) { node.setValue(expression); node.semicolonPosition = this.token.offset; // not part of the declaration, but useful information for code assist return this.finish(node); @@ -28943,7 +28166,7 @@ var Parser = /** @class */ (function () { node.addChild(this._parseCustomPropertyValue()); node.addChild(this._parsePrio()); if (this.token.offset === node.colonPosition + 1) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].PropertyValueExpected); + return this.finish(node, ParseError.PropertyValueExpected); } return this.finish(node); }; @@ -28959,29 +28182,29 @@ var Parser = /** @class */ (function () { * of delimitors). */ Parser.prototype._parseCustomPropertyValue = function () { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Node"]); + var node = this.create(cssNodes_Node); var isTopLevel = function () { return curlyDepth === 0 && parensDepth === 0 && bracketsDepth === 0; }; var curlyDepth = 0; var parensDepth = 0; var bracketsDepth = 0; done: while (true) { switch (this.token.type) { - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SemiColon: + case TokenType.SemiColon: // A semicolon only ends things if we're not inside a delimitor. if (isTopLevel()) { break done; } break; - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Exclamation: + case TokenType.Exclamation: // An exclamation ends the value if we're not inside delims. if (isTopLevel()) { break done; } break; - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyL: + case TokenType.CurlyL: curlyDepth++; break; - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyR: + case TokenType.CurlyR: curlyDepth--; if (curlyDepth < 0) { // The property value has been terminated without a semicolon, and @@ -28989,38 +28212,38 @@ var Parser = /** @class */ (function () { if (parensDepth === 0 && bracketsDepth === 0) { break done; } - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].LeftCurlyExpected); + return this.finish(node, ParseError.LeftCurlyExpected); } break; - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisL: + case TokenType.ParenthesisL: parensDepth++; break; - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisR: + case TokenType.ParenthesisR: parensDepth--; if (parensDepth < 0) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].LeftParenthesisExpected); + return this.finish(node, ParseError.LeftParenthesisExpected); } break; - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].BracketL: + case TokenType.BracketL: bracketsDepth++; break; - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].BracketR: + case TokenType.BracketR: bracketsDepth--; if (bracketsDepth < 0) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].LeftSquareBracketExpected); + return this.finish(node, ParseError.LeftSquareBracketExpected); } break; - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].BadString: // fall through + case TokenType.BadString: // fall through break done; - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].EOF: + case TokenType.EOF: // We shouldn't have reached the end of input, something is // unterminated. - var error = _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RightCurlyExpected; + var error = ParseError.RightCurlyExpected; if (bracketsDepth > 0) { - error = _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RightSquareBracketExpected; + error = ParseError.RightSquareBracketExpected; } else if (parensDepth > 0) { - error = _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RightParenthesisExpected; + error = ParseError.RightParenthesisExpected; } return this.finish(node, error); } @@ -29030,7 +28253,7 @@ var Parser = /** @class */ (function () { }; Parser.prototype._tryToParseDeclaration = function () { var mark = this.mark(); - if (this._parseProperty() && this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Colon)) { + if (this._parseProperty() && this.accept(TokenType.Colon)) { // looks like a declaration, go ahead this.restoreAtMark(mark); return this._parseDeclaration(); @@ -29039,7 +28262,7 @@ var Parser = /** @class */ (function () { return null; }; Parser.prototype._parseProperty = function () { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Property"]); + var node = this.create(Property); var mark = this.mark(); if (this.acceptDelim('*') || this.acceptDelim('_')) { // support for IE 5.x, 6 and 7 star hack: see http://en.wikipedia.org/wiki/CSS_filter#Star_hack @@ -29057,16 +28280,16 @@ var Parser = /** @class */ (function () { return this._parseIdent(); }; Parser.prototype._parseCharset = function () { - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Charset)) { + if (!this.peek(TokenType.Charset)) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Node"]); + var node = this.create(cssNodes_Node); this.consumeToken(); // charset - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].String)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].IdentifierExpected); + if (!this.accept(TokenType.String)) { + return this.finish(node, ParseError.IdentifierExpected); } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SemiColon)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].SemiColonExpected); + if (!this.accept(TokenType.SemiColon)) { + return this.finish(node, ParseError.SemiColonExpected); } return this.finish(node); }; @@ -29074,12 +28297,12 @@ var Parser = /** @class */ (function () { if (!this.peekKeyword('@import')) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Import"]); + var node = this.create(Import); this.consumeToken(); // @import if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].URIOrStringExpected); + return this.finish(node, ParseError.URIOrStringExpected); } - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SemiColon) && !this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].EOF)) { + if (!this.peek(TokenType.SemiColon) && !this.peek(TokenType.EOF)) { node.setMedialist(this._parseMediaQueryList()); } return this.finish(node); @@ -29090,16 +28313,16 @@ var Parser = /** @class */ (function () { if (!this.peekKeyword('@namespace')) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Namespace"]); + var node = this.create(Namespace); this.consumeToken(); // @namespace if (!node.addChild(this._parseURILiteral())) { // url literal also starts with ident node.addChild(this._parseIdent()); // optional prefix if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].URIExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SemiColon]); + return this.finish(node, ParseError.URIExpected, [TokenType.SemiColon]); } } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SemiColon)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].SemiColonExpected); + if (!this.accept(TokenType.SemiColon)) { + return this.finish(node, ParseError.SemiColonExpected); } return this.finish(node); }; @@ -29107,7 +28330,7 @@ var Parser = /** @class */ (function () { if (!this.peekKeyword('@font-face')) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["FontFace"]); + var node = this.create(FontFace); this.consumeToken(); // @font-face return this._parseBody(node, this._parseRuleSetDeclaration.bind(this)); }; @@ -29117,54 +28340,54 @@ var Parser = /** @class */ (function () { !this.peekKeyword('@viewport')) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["ViewPort"]); + var node = this.create(ViewPort); this.consumeToken(); // @-ms-viewport return this._parseBody(node, this._parseRuleSetDeclaration.bind(this)); }; Parser.prototype._parseKeyframe = function () { - if (!this.peekRegExp(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].AtKeyword, this.keyframeRegex)) { + if (!this.peekRegExp(TokenType.AtKeyword, this.keyframeRegex)) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Keyframe"]); - var atNode = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Node"]); + var node = this.create(Keyframe); + var atNode = this.create(cssNodes_Node); this.consumeToken(); // atkeyword node.setKeyword(this.finish(atNode)); if (atNode.getText() === '@-ms-keyframes') { // -ms-keyframes never existed - this.markError(atNode, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].UnknownKeyword); + this.markError(atNode, ParseError.UnknownKeyword); } if (!node.setIdentifier(this._parseKeyframeIdent())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].IdentifierExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyR]); + return this.finish(node, ParseError.IdentifierExpected, [TokenType.CurlyR]); } return this._parseBody(node, this._parseKeyframeSelector.bind(this)); }; Parser.prototype._parseKeyframeIdent = function () { - return this._parseIdent([_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["ReferenceType"].Keyframe]); + return this._parseIdent([ReferenceType.Keyframe]); }; Parser.prototype._parseKeyframeSelector = function () { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["KeyframeSelector"]); - if (!node.addChild(this._parseIdent()) && !this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Percentage)) { + var node = this.create(KeyframeSelector); + if (!node.addChild(this._parseIdent()) && !this.accept(TokenType.Percentage)) { return null; } - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Comma)) { - if (!node.addChild(this._parseIdent()) && !this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Percentage)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].PercentageExpected); + while (this.accept(TokenType.Comma)) { + if (!node.addChild(this._parseIdent()) && !this.accept(TokenType.Percentage)) { + return this.finish(node, ParseError.PercentageExpected); } } return this._parseBody(node, this._parseRuleSetDeclaration.bind(this)); }; Parser.prototype._tryParseKeyframeSelector = function () { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["KeyframeSelector"]); + var node = this.create(KeyframeSelector); var pos = this.mark(); - if (!node.addChild(this._parseIdent()) && !this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Percentage)) { + if (!node.addChild(this._parseIdent()) && !this.accept(TokenType.Percentage)) { return null; } - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Comma)) { - if (!node.addChild(this._parseIdent()) && !this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Percentage)) { + while (this.accept(TokenType.Comma)) { + if (!node.addChild(this._parseIdent()) && !this.accept(TokenType.Percentage)) { this.restoreAtMark(pos); return null; } } - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyL)) { + if (!this.peek(TokenType.CurlyL)) { this.restoreAtMark(pos); return null; } @@ -29176,7 +28399,7 @@ var Parser = /** @class */ (function () { if (!this.peekKeyword('@supports')) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Supports"]); + var node = this.create(Supports); this.consumeToken(); // @supports node.addChild(this._parseSupportsCondition()); return this._parseBody(node, this._parseSupportsDeclaration.bind(this, isNested)); @@ -29199,13 +28422,13 @@ var Parser = /** @class */ (function () { // supports_disjunction: supports_condition_in_parens ( S+ OR S+ supports_condition_in_parens )+; // supports_declaration_condition: '(' S* declaration ')'; // general_enclosed: ( FUNCTION | '(' ) ( any | unused )* ')' ; - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["SupportsCondition"]); + var node = this.create(SupportsCondition); if (this.acceptIdent('not')) { node.addChild(this._parseSupportsConditionInParens()); } else { node.addChild(this._parseSupportsConditionInParens()); - if (this.peekRegExp(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Ident, /^(and|or)$/i)) { + if (this.peekRegExp(TokenType.Ident, /^(and|or)$/i)) { var text = this.token.text.toLowerCase(); while (this.acceptIdent(text)) { node.addChild(this._parseSupportsConditionInParens()); @@ -29215,30 +28438,30 @@ var Parser = /** @class */ (function () { return this.finish(node); }; Parser.prototype._parseSupportsConditionInParens = function () { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["SupportsCondition"]); - if (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisL)) { + var node = this.create(SupportsCondition); + if (this.accept(TokenType.ParenthesisL)) { node.lParent = this.prevToken.offset; if (!node.addChild(this._tryToParseDeclaration())) { if (!this._parseSupportsCondition()) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].ConditionExpected); + return this.finish(node, ParseError.ConditionExpected); } } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RightParenthesisExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisR], []); + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [TokenType.ParenthesisR], []); } node.rParent = this.prevToken.offset; return this.finish(node); } - else if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Ident)) { + else if (this.peek(TokenType.Ident)) { var pos = this.mark(); this.consumeToken(); - if (!this.hasWhitespace() && this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisL)) { + if (!this.hasWhitespace() && this.accept(TokenType.ParenthesisL)) { var openParentCount = 1; - while (this.token.type !== _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].EOF && openParentCount !== 0) { - if (this.token.type === _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisL) { + while (this.token.type !== TokenType.EOF && openParentCount !== 0) { + if (this.token.type === TokenType.ParenthesisL) { openParentCount++; } - else if (this.token.type === _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisR) { + else if (this.token.type === TokenType.ParenthesisR) { openParentCount--; } this.consumeToken(); @@ -29249,7 +28472,7 @@ var Parser = /** @class */ (function () { this.restoreAtMark(pos); } } - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].LeftParenthesisExpected, [], [_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisL]); + return this.finish(node, ParseError.LeftParenthesisExpected, [], [TokenType.ParenthesisL]); }; Parser.prototype._parseMediaDeclaration = function (isNested) { if (isNested === void 0) { isNested = false; } @@ -29268,21 +28491,21 @@ var Parser = /** @class */ (function () { if (!this.peekKeyword('@media')) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Media"]); + var node = this.create(Media); this.consumeToken(); // @media if (!node.addChild(this._parseMediaQueryList())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].MediaQueryExpected); + return this.finish(node, ParseError.MediaQueryExpected); } return this._parseBody(node, this._parseMediaDeclaration.bind(this, isNested)); }; Parser.prototype._parseMediaQueryList = function () { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Medialist"]); - if (!node.addChild(this._parseMediaQuery([_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyL]))) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].MediaQueryExpected); + var node = this.create(Medialist); + if (!node.addChild(this._parseMediaQuery([TokenType.CurlyL]))) { + return this.finish(node, ParseError.MediaQueryExpected); } - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Comma)) { - if (!node.addChild(this._parseMediaQuery([_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyL]))) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].MediaQueryExpected); + while (this.accept(TokenType.Comma)) { + if (!node.addChild(this._parseMediaQuery([TokenType.CurlyL]))) { + return this.finish(node, ParseError.MediaQueryExpected); } } return this.finish(node); @@ -29291,10 +28514,10 @@ var Parser = /** @class */ (function () { // http://www.w3.org/TR/css3-mediaqueries/ // media_query : [ONLY | NOT]? S* IDENT S* [ AND S* expression ]* | expression [ AND S* expression ]* // expression : '(' S* IDENT S* [ ':' S* expr ]? ')' S* - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["MediaQuery"]); + var node = this.create(MediaQuery); var parseExpression = true; var hasContent = false; - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisL)) { + if (!this.peek(TokenType.ParenthesisL)) { if (this.acceptIdent('only') || this.acceptIdent('not')) { // optional } @@ -29305,22 +28528,22 @@ var Parser = /** @class */ (function () { parseExpression = this.acceptIdent('and'); } while (parseExpression) { - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisL)) { + if (!this.accept(TokenType.ParenthesisL)) { if (hasContent) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].LeftParenthesisExpected, [], resyncStopToken); + return this.finish(node, ParseError.LeftParenthesisExpected, [], resyncStopToken); } return null; } if (!node.addChild(this._parseMediaFeatureName())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].IdentifierExpected, [], resyncStopToken); + return this.finish(node, ParseError.IdentifierExpected, [], resyncStopToken); } - if (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Colon)) { + if (this.accept(TokenType.Colon)) { if (!node.addChild(this._parseExpr())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].TermExpected, [], resyncStopToken); + return this.finish(node, ParseError.TermExpected, [], resyncStopToken); } } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RightParenthesisExpected, [], resyncStopToken); + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [], resyncStopToken); } parseExpression = this.acceptIdent('and'); } @@ -29330,7 +28553,7 @@ var Parser = /** @class */ (function () { return this._parseIdent(); }; Parser.prototype._parseMedium = function () { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Node"]); + var node = this.create(cssNodes_Node); if (node.addChild(this._parseIdent())) { return this.finish(node); } @@ -29348,12 +28571,12 @@ var Parser = /** @class */ (function () { if (!this.peekKeyword('@page')) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Page"]); + var node = this.create(Page); this.consumeToken(); if (node.addChild(this._parsePageSelector())) { - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Comma)) { + while (this.accept(TokenType.Comma)) { if (!node.addChild(this._parsePageSelector())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].IdentifierExpected); + return this.finish(node, ParseError.IdentifierExpected); } } } @@ -29361,26 +28584,26 @@ var Parser = /** @class */ (function () { }; Parser.prototype._parsePageMarginBox = function () { // page_margin_box : margin_sym S* '{' S* declaration? [ ';' S* declaration? ]* '}' S* - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].AtKeyword)) { + if (!this.peek(TokenType.AtKeyword)) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["PageBoxMarginBox"]); - if (!this.acceptOneKeyword(_languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_3__["pageBoxDirectives"])) { - this.markError(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].UnknownAtRule, [], [_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyL]); + var node = this.create(PageBoxMarginBox); + if (!this.acceptOneKeyword(pageBoxDirectives)) { + this.markError(node, ParseError.UnknownAtRule, [], [TokenType.CurlyL]); } return this._parseBody(node, this._parseRuleSetDeclaration.bind(this)); }; Parser.prototype._parsePageSelector = function () { // page_selector : pseudo_page+ | IDENT pseudo_page* // pseudo_page : ':' [ "left" | "right" | "first" | "blank" ]; - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Ident) && !this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Colon)) { + if (!this.peek(TokenType.Ident) && !this.peek(TokenType.Colon)) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Node"]); + var node = this.create(cssNodes_Node); node.addChild(this._parseIdent()); // optional ident - if (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Colon)) { + if (this.accept(TokenType.Colon)) { if (!node.addChild(this._parseIdent())) { // optional ident - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].IdentifierExpected); + return this.finish(node, ParseError.IdentifierExpected); } } return this.finish(node); @@ -29390,17 +28613,17 @@ var Parser = /** @class */ (function () { if (!this.peekKeyword('@-moz-document')) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Document"]); + var node = this.create(Document); this.consumeToken(); // @-moz-document - this.resync([], [_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyL]); // ignore all the rules + this.resync([], [TokenType.CurlyL]); // ignore all the rules return this._parseBody(node, this._parseStylesheetStatement.bind(this)); }; // https://www.w3.org/TR/css-syntax-3/#consume-an-at-rule Parser.prototype._parseUnknownAtRule = function () { - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].AtKeyword)) { + if (!this.peek(TokenType.AtKeyword)) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["UnknownAtRule"]); + var node = this.create(UnknownAtRule); node.addChild(this._parseUnknownAtRuleName()); var isTopLevel = function () { return curlyDepth === 0 && parensDepth === 0 && bracketsDepth === 0; }; var curlyLCount = 0; @@ -29409,38 +28632,38 @@ var Parser = /** @class */ (function () { var bracketsDepth = 0; done: while (true) { switch (this.token.type) { - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SemiColon: + case TokenType.SemiColon: if (isTopLevel()) { break done; } break; - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].EOF: + case TokenType.EOF: if (curlyDepth > 0) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RightCurlyExpected); + return this.finish(node, ParseError.RightCurlyExpected); } else if (bracketsDepth > 0) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RightSquareBracketExpected); + return this.finish(node, ParseError.RightSquareBracketExpected); } else if (parensDepth > 0) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RightParenthesisExpected); + return this.finish(node, ParseError.RightParenthesisExpected); } else { return this.finish(node); } - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyL: + case TokenType.CurlyL: curlyLCount++; curlyDepth++; break; - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyR: + case TokenType.CurlyR: curlyDepth--; // End of at-rule, consume CurlyR and return node if (curlyLCount > 0 && curlyDepth === 0) { this.consumeToken(); if (bracketsDepth > 0) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RightSquareBracketExpected); + return this.finish(node, ParseError.RightSquareBracketExpected); } else if (parensDepth > 0) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RightParenthesisExpected); + return this.finish(node, ParseError.RightParenthesisExpected); } break done; } @@ -29450,25 +28673,25 @@ var Parser = /** @class */ (function () { if (parensDepth === 0 && bracketsDepth === 0) { break done; } - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].LeftCurlyExpected); + return this.finish(node, ParseError.LeftCurlyExpected); } break; - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisL: + case TokenType.ParenthesisL: parensDepth++; break; - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisR: + case TokenType.ParenthesisR: parensDepth--; if (parensDepth < 0) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].LeftParenthesisExpected); + return this.finish(node, ParseError.LeftParenthesisExpected); } break; - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].BracketL: + case TokenType.BracketL: bracketsDepth++; break; - case _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].BracketR: + case TokenType.BracketR: bracketsDepth--; if (bracketsDepth < 0) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].LeftSquareBracketExpected); + return this.finish(node, ParseError.LeftSquareBracketExpected); } break; } @@ -29477,8 +28700,8 @@ var Parser = /** @class */ (function () { return node; }; Parser.prototype._parseUnknownAtRuleName = function () { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Node"]); - if (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].AtKeyword)) { + var node = this.create(cssNodes_Node); + if (this.accept(TokenType.AtKeyword)) { return this.finish(node); } return node; @@ -29489,13 +28712,13 @@ var Parser = /** @class */ (function () { this.peekDelim('*') || this.peekDelim('+') || this.peekDelim('-') || - this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Dashmatch) || - this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Includes) || - this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SubstringOperator) || - this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].PrefixOperator) || - this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].SuffixOperator) || + this.peek(TokenType.Dashmatch) || + this.peek(TokenType.Includes) || + this.peek(TokenType.SubstringOperator) || + this.peek(TokenType.PrefixOperator) || + this.peek(TokenType.SuffixOperator) || this.peekDelim('=')) { // doesn't stick to the standard here - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].Operator); + var node = this.createNode(NodeType.Operator); this.consumeToken(); return this.finish(node); } @@ -29507,43 +28730,43 @@ var Parser = /** @class */ (function () { if (!this.peekDelim('+') && !this.peekDelim('-')) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Node"]); + var node = this.create(cssNodes_Node); this.consumeToken(); return this.finish(node); }; Parser.prototype._parseCombinator = function () { if (this.peekDelim('>')) { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Node"]); + var node = this.create(cssNodes_Node); this.consumeToken(); var mark = this.mark(); if (!this.hasWhitespace() && this.acceptDelim('>')) { if (!this.hasWhitespace() && this.acceptDelim('>')) { - node.type = _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].SelectorCombinatorShadowPiercingDescendant; + node.type = NodeType.SelectorCombinatorShadowPiercingDescendant; return this.finish(node); } this.restoreAtMark(mark); } - node.type = _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].SelectorCombinatorParent; + node.type = NodeType.SelectorCombinatorParent; return this.finish(node); } else if (this.peekDelim('+')) { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Node"]); + var node = this.create(cssNodes_Node); this.consumeToken(); - node.type = _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].SelectorCombinatorSibling; + node.type = NodeType.SelectorCombinatorSibling; return this.finish(node); } else if (this.peekDelim('~')) { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Node"]); + var node = this.create(cssNodes_Node); this.consumeToken(); - node.type = _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].SelectorCombinatorAllSiblings; + node.type = NodeType.SelectorCombinatorAllSiblings; return this.finish(node); } else if (this.peekDelim('/')) { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Node"]); + var node = this.create(cssNodes_Node); this.consumeToken(); var mark = this.mark(); if (!this.hasWhitespace() && this.acceptIdent('deep') && !this.hasWhitespace() && this.acceptDelim('/')) { - node.type = _cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].SelectorCombinatorShadowPiercingDescendant; + node.type = NodeType.SelectorCombinatorShadowPiercingDescendant; return this.finish(node); } this.restoreAtMark(mark); @@ -29555,7 +28778,7 @@ var Parser = /** @class */ (function () { Parser.prototype._parseSimpleSelector = function () { // simple_selector // : element_name [ HASH | class | attrib | pseudo ]* | [ HASH | class | attrib | pseudo ]+ ; - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["SimpleSelector"]); + var node = this.create(SimpleSelector); var c = 0; if (node.addChild(this._parseElementName())) { c++; @@ -29572,13 +28795,13 @@ var Parser = /** @class */ (function () { return this._parseIdent(); }; Parser.prototype._parseHash = function () { - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Hash) && !this.peekDelim('#')) { + if (!this.peek(TokenType.Hash) && !this.peekDelim('#')) { return null; } - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].IdentifierSelector); + var node = this.createNode(NodeType.IdentifierSelector); if (this.acceptDelim('#')) { if (this.hasWhitespace() || !node.addChild(this._parseSelectorIdent())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].IdentifierExpected); + return this.finish(node, ParseError.IdentifierExpected); } } else { @@ -29591,17 +28814,17 @@ var Parser = /** @class */ (function () { if (!this.peekDelim('.')) { return null; } - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].ClassSelector); + var node = this.createNode(NodeType.ClassSelector); this.consumeToken(); // '.' if (this.hasWhitespace() || !node.addChild(this._parseSelectorIdent())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].IdentifierExpected); + return this.finish(node, ParseError.IdentifierExpected); } return this.finish(node); }; Parser.prototype._parseElementName = function () { // element_name: (ns? '|')? IDENT | '*'; var pos = this.mark(); - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].ElementNameSelector); + var node = this.createNode(NodeType.ElementNameSelector); node.addChild(this._parseNamespacePrefix()); if (!node.addChild(this._parseSelectorIdent()) && !this.acceptDelim('*')) { this.restoreAtMark(pos); @@ -29611,7 +28834,7 @@ var Parser = /** @class */ (function () { }; Parser.prototype._parseNamespacePrefix = function () { var pos = this.mark(); - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].NamespacePrefix); + var node = this.createNode(NodeType.NamespacePrefix); if (!node.addChild(this._parseIdent()) && !this.acceptDelim('*')) { // ns is optional } @@ -29623,22 +28846,22 @@ var Parser = /** @class */ (function () { }; Parser.prototype._parseAttrib = function () { // attrib : '[' S* IDENT S* [ [ '=' | INCLUDES | DASHMATCH ] S* [ IDENT | STRING ] S* ]? ']' - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].BracketL)) { + if (!this.peek(TokenType.BracketL)) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["AttributeSelector"]); + var node = this.create(AttributeSelector); this.consumeToken(); // BracketL // Optional attrib namespace node.setNamespacePrefix(this._parseNamespacePrefix()); if (!node.setIdentifier(this._parseIdent())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].IdentifierExpected); + return this.finish(node, ParseError.IdentifierExpected); } if (node.setOperator(this._parseOperator())) { node.setValue(this._parseBinaryExpr()); this.acceptIdent('i'); // case insensitive matching } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].BracketR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RightSquareBracketExpected); + if (!this.accept(TokenType.BracketR)) { + return this.finish(node, ParseError.RightSquareBracketExpected); } return this.finish(node); }; @@ -29647,22 +28870,22 @@ var Parser = /** @class */ (function () { // pseudo: ':' [ IDENT | FUNCTION S* [IDENT S*]? ')' ] var node = this._tryParsePseudoIdentifier(); if (node) { - if (!this.hasWhitespace() && this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisL)) { + if (!this.hasWhitespace() && this.accept(TokenType.ParenthesisL)) { var tryAsSelector = function () { - var selectors = _this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Node"]); + var selectors = _this.create(cssNodes_Node); if (!selectors.addChild(_this._parseSelector(false))) { return null; } - while (_this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Comma) && selectors.addChild(_this._parseSelector(false))) { + while (_this.accept(TokenType.Comma) && selectors.addChild(_this._parseSelector(false))) { // loop } - if (_this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisR)) { + if (_this.peek(TokenType.ParenthesisR)) { return _this.finish(selectors); } }; node.addChild(this.try(tryAsSelector) || this._parseBinaryExpr()); - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RightParenthesisExpected); + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); } } return this.finish(node); @@ -29670,22 +28893,22 @@ var Parser = /** @class */ (function () { return null; }; Parser.prototype._tryParsePseudoIdentifier = function () { - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Colon)) { + if (!this.peek(TokenType.Colon)) { return null; } var pos = this.mark(); - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].PseudoSelector); + var node = this.createNode(NodeType.PseudoSelector); this.consumeToken(); // Colon if (this.hasWhitespace()) { this.restoreAtMark(pos); return null; } // optional, support :: - if (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Colon) && this.hasWhitespace()) { - this.markError(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].IdentifierExpected); + if (this.accept(TokenType.Colon) && this.hasWhitespace()) { + this.markError(node, ParseError.IdentifierExpected); } if (!node.addChild(this._parseIdent())) { - this.markError(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].IdentifierExpected); + this.markError(node, ParseError.IdentifierExpected); } return node; }; @@ -29699,23 +28922,23 @@ var Parser = /** @class */ (function () { return null; }; Parser.prototype._parsePrio = function () { - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Exclamation)) { + if (!this.peek(TokenType.Exclamation)) { return null; } - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].Prio); - if (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Exclamation) && this.acceptIdent('important')) { + var node = this.createNode(NodeType.Prio); + if (this.accept(TokenType.Exclamation) && this.acceptIdent('important')) { return this.finish(node); } return null; }; Parser.prototype._parseExpr = function (stopOnComma) { if (stopOnComma === void 0) { stopOnComma = false; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Expression"]); + var node = this.create(Expression); if (!node.addChild(this._parseBinaryExpr())) { return null; } while (true) { - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Comma)) { // optional + if (this.peek(TokenType.Comma)) { // optional if (stopOnComma) { return this.finish(node); } @@ -29729,21 +28952,21 @@ var Parser = /** @class */ (function () { }; Parser.prototype._parseNamedLine = function () { // https://www.w3.org/TR/css-grid-1/#named-lines - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].BracketL)) { + if (!this.peek(TokenType.BracketL)) { return null; } - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].GridLine); + var node = this.createNode(NodeType.GridLine); this.consumeToken(); while (node.addChild(this._parseIdent())) { // repeat } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].BracketR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RightSquareBracketExpected); + if (!this.accept(TokenType.BracketR)) { + return this.finish(node, ParseError.RightSquareBracketExpected); } return this.finish(node); }; Parser.prototype._parseBinaryExpr = function (preparsedLeft, preparsedOper) { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["BinaryExpression"]); + var node = this.create(BinaryExpression); if (!node.setLeft((preparsedLeft || this._parseTerm()))) { return null; } @@ -29751,7 +28974,7 @@ var Parser = /** @class */ (function () { return this.finish(node); } if (!node.setRight(this._parseTerm())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].TermExpected); + return this.finish(node, ParseError.TermExpected); } // things needed for multiple binary expressions node = this.finish(node); @@ -29762,7 +28985,7 @@ var Parser = /** @class */ (function () { return this.finish(node); }; Parser.prototype._parseTerm = function () { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Term"]); + var node = this.create(Term); node.setOperator(this._parseUnaryOperator()); // optional if (node.setExpression(this._parseURILiteral()) || // url before function node.setExpression(this._parseFunction()) || // function before ident @@ -29777,50 +29000,50 @@ var Parser = /** @class */ (function () { return null; }; Parser.prototype._parseOperation = function () { - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisL)) { + if (!this.peek(TokenType.ParenthesisL)) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Node"]); + var node = this.create(cssNodes_Node); this.consumeToken(); // ParenthesisL node.addChild(this._parseExpr()); - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RightParenthesisExpected); + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); } return this.finish(node); }; Parser.prototype._parseNumeric = function () { - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Num) || - this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Percentage) || - this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Resolution) || - this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Length) || - this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].EMS) || - this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].EXS) || - this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Angle) || - this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Time) || - this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Dimension) || - this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Freq)) { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NumericValue"]); + if (this.peek(TokenType.Num) || + this.peek(TokenType.Percentage) || + this.peek(TokenType.Resolution) || + this.peek(TokenType.Length) || + this.peek(TokenType.EMS) || + this.peek(TokenType.EXS) || + this.peek(TokenType.Angle) || + this.peek(TokenType.Time) || + this.peek(TokenType.Dimension) || + this.peek(TokenType.Freq)) { + var node = this.create(NumericValue); this.consumeToken(); return this.finish(node); } return null; }; Parser.prototype._parseStringLiteral = function () { - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].String) && !this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].BadString)) { + if (!this.peek(TokenType.String) && !this.peek(TokenType.BadString)) { return null; } - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].StringLiteral); + var node = this.createNode(NodeType.StringLiteral); this.consumeToken(); return this.finish(node); }; Parser.prototype._parseURILiteral = function () { - if (!this.peekRegExp(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Ident, /^url(-prefix)?$/i)) { + if (!this.peekRegExp(TokenType.Ident, /^url(-prefix)?$/i)) { return null; } var pos = this.mark(); - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].URILiteral); - this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Ident); - if (this.hasWhitespace() || !this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisL)) { + var node = this.createNode(NodeType.URILiteral); + this.accept(TokenType.Ident); + if (this.hasWhitespace() || !this.peek(TokenType.ParenthesisL)) { this.restoreAtMark(pos); return null; } @@ -29828,65 +29051,65 @@ var Parser = /** @class */ (function () { this.consumeToken(); // consume () node.addChild(this._parseURLArgument()); // argument is optional this.scanner.inURL = false; - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RightParenthesisExpected); + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); } return this.finish(node); }; Parser.prototype._parseURLArgument = function () { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Node"]); - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].String) && !this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].BadString) && !this.acceptUnquotedString()) { + var node = this.create(cssNodes_Node); + if (!this.accept(TokenType.String) && !this.accept(TokenType.BadString) && !this.acceptUnquotedString()) { return null; } return this.finish(node); }; Parser.prototype._parseIdent = function (referenceTypes) { - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Ident)) { + if (!this.peek(TokenType.Ident)) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Identifier"]); + var node = this.create(Identifier); if (referenceTypes) { node.referenceTypes = referenceTypes; } - node.isCustomProperty = this.peekRegExp(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Ident, /^--/); + node.isCustomProperty = this.peekRegExp(TokenType.Ident, /^--/); this.consumeToken(); return this.finish(node); }; Parser.prototype._parseFunction = function () { var pos = this.mark(); - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Function"]); + var node = this.create(Function); if (!node.setIdentifier(this._parseFunctionIdentifier())) { return null; } - if (this.hasWhitespace() || !this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisL)) { + if (this.hasWhitespace() || !this.accept(TokenType.ParenthesisL)) { this.restoreAtMark(pos); return null; } if (node.getArguments().addChild(this._parseFunctionArgument())) { - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Comma)) { - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisR)) { + while (this.accept(TokenType.Comma)) { + if (this.peek(TokenType.ParenthesisR)) { break; } if (!node.getArguments().addChild(this._parseFunctionArgument())) { - this.markError(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].ExpressionExpected); + this.markError(node, ParseError.ExpressionExpected); } } } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].ParenthesisR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_2__["ParseError"].RightParenthesisExpected); + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); } return this.finish(node); }; Parser.prototype._parseFunctionIdentifier = function () { - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Ident)) { + if (!this.peek(TokenType.Ident)) { return null; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["Identifier"]); - node.referenceTypes = [_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["ReferenceType"].Function]; + var node = this.create(Identifier); + node.referenceTypes = [ReferenceType.Function]; if (this.acceptIdent('progid')) { // support for IE7 specific filters: 'progid:DXImageTransform.Microsoft.MotionBlur(strength=13, direction=310)' - if (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Colon)) { - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Ident) && this.acceptDelim('.')) { + if (this.accept(TokenType.Colon)) { + while (this.accept(TokenType.Ident) && this.acceptDelim('.')) { // loop } } @@ -29896,15 +29119,15 @@ var Parser = /** @class */ (function () { return this.finish(node); }; Parser.prototype._parseFunctionArgument = function () { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["FunctionArgument"]); + var node = this.create(FunctionArgument); if (node.setValue(this._parseExpr(true))) { return this.finish(node); } return null; }; Parser.prototype._parseHexColor = function () { - if (this.peekRegExp(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Hash, /^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/g)) { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["HexColorValue"]); + if (this.peekRegExp(TokenType.Hash, /^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/g)) { + var node = this.create(HexColorValue); this.consumeToken(); return this.finish(node); } @@ -29916,6332 +29139,7 @@ var Parser = /** @class */ (function () { }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssScanner.js": -/*!**************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssScanner.js ***! - \**************************************************************************************************************/ -/*! exports provided: TokenType, MultiLineStream, Scanner */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenType", function() { return TokenType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiLineStream", function() { return MultiLineStream; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scanner", function() { return Scanner; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var TokenType; -(function (TokenType) { - TokenType[TokenType["Ident"] = 0] = "Ident"; - TokenType[TokenType["AtKeyword"] = 1] = "AtKeyword"; - TokenType[TokenType["String"] = 2] = "String"; - TokenType[TokenType["BadString"] = 3] = "BadString"; - TokenType[TokenType["UnquotedString"] = 4] = "UnquotedString"; - TokenType[TokenType["Hash"] = 5] = "Hash"; - TokenType[TokenType["Num"] = 6] = "Num"; - TokenType[TokenType["Percentage"] = 7] = "Percentage"; - TokenType[TokenType["Dimension"] = 8] = "Dimension"; - TokenType[TokenType["UnicodeRange"] = 9] = "UnicodeRange"; - TokenType[TokenType["CDO"] = 10] = "CDO"; - TokenType[TokenType["CDC"] = 11] = "CDC"; - TokenType[TokenType["Colon"] = 12] = "Colon"; - TokenType[TokenType["SemiColon"] = 13] = "SemiColon"; - TokenType[TokenType["CurlyL"] = 14] = "CurlyL"; - TokenType[TokenType["CurlyR"] = 15] = "CurlyR"; - TokenType[TokenType["ParenthesisL"] = 16] = "ParenthesisL"; - TokenType[TokenType["ParenthesisR"] = 17] = "ParenthesisR"; - TokenType[TokenType["BracketL"] = 18] = "BracketL"; - TokenType[TokenType["BracketR"] = 19] = "BracketR"; - TokenType[TokenType["Whitespace"] = 20] = "Whitespace"; - TokenType[TokenType["Includes"] = 21] = "Includes"; - TokenType[TokenType["Dashmatch"] = 22] = "Dashmatch"; - TokenType[TokenType["SubstringOperator"] = 23] = "SubstringOperator"; - TokenType[TokenType["PrefixOperator"] = 24] = "PrefixOperator"; - TokenType[TokenType["SuffixOperator"] = 25] = "SuffixOperator"; - TokenType[TokenType["Delim"] = 26] = "Delim"; - TokenType[TokenType["EMS"] = 27] = "EMS"; - TokenType[TokenType["EXS"] = 28] = "EXS"; - TokenType[TokenType["Length"] = 29] = "Length"; - TokenType[TokenType["Angle"] = 30] = "Angle"; - TokenType[TokenType["Time"] = 31] = "Time"; - TokenType[TokenType["Freq"] = 32] = "Freq"; - TokenType[TokenType["Exclamation"] = 33] = "Exclamation"; - TokenType[TokenType["Resolution"] = 34] = "Resolution"; - TokenType[TokenType["Comma"] = 35] = "Comma"; - TokenType[TokenType["Charset"] = 36] = "Charset"; - TokenType[TokenType["EscapedJavaScript"] = 37] = "EscapedJavaScript"; - TokenType[TokenType["BadEscapedJavaScript"] = 38] = "BadEscapedJavaScript"; - TokenType[TokenType["Comment"] = 39] = "Comment"; - TokenType[TokenType["SingleLineComment"] = 40] = "SingleLineComment"; - TokenType[TokenType["EOF"] = 41] = "EOF"; - TokenType[TokenType["CustomToken"] = 42] = "CustomToken"; -})(TokenType || (TokenType = {})); -var MultiLineStream = /** @class */ (function () { - function MultiLineStream(source) { - this.source = source; - this.len = source.length; - this.position = 0; - } - MultiLineStream.prototype.substring = function (from, to) { - if (to === void 0) { to = this.position; } - return this.source.substring(from, to); - }; - MultiLineStream.prototype.eos = function () { - return this.len <= this.position; - }; - MultiLineStream.prototype.pos = function () { - return this.position; - }; - MultiLineStream.prototype.goBackTo = function (pos) { - this.position = pos; - }; - MultiLineStream.prototype.goBack = function (n) { - this.position -= n; - }; - MultiLineStream.prototype.advance = function (n) { - this.position += n; - }; - MultiLineStream.prototype.nextChar = function () { - return this.source.charCodeAt(this.position++) || 0; - }; - MultiLineStream.prototype.peekChar = function (n) { - if (n === void 0) { n = 0; } - return this.source.charCodeAt(this.position + n) || 0; - }; - MultiLineStream.prototype.lookbackChar = function (n) { - if (n === void 0) { n = 0; } - return this.source.charCodeAt(this.position - n) || 0; - }; - MultiLineStream.prototype.advanceIfChar = function (ch) { - if (ch === this.source.charCodeAt(this.position)) { - this.position++; - return true; - } - return false; - }; - MultiLineStream.prototype.advanceIfChars = function (ch) { - if (this.position + ch.length > this.source.length) { - return false; - } - var i = 0; - for (; i < ch.length; i++) { - if (this.source.charCodeAt(this.position + i) !== ch[i]) { - return false; - } - } - this.advance(i); - return true; - }; - MultiLineStream.prototype.advanceWhileChar = function (condition) { - var posNow = this.position; - while (this.position < this.len && condition(this.source.charCodeAt(this.position))) { - this.position++; - } - return this.position - posNow; - }; - return MultiLineStream; -}()); - -var _a = 'a'.charCodeAt(0); -var _f = 'f'.charCodeAt(0); -var _z = 'z'.charCodeAt(0); -var _A = 'A'.charCodeAt(0); -var _F = 'F'.charCodeAt(0); -var _Z = 'Z'.charCodeAt(0); -var _0 = '0'.charCodeAt(0); -var _9 = '9'.charCodeAt(0); -var _TLD = '~'.charCodeAt(0); -var _HAT = '^'.charCodeAt(0); -var _EQS = '='.charCodeAt(0); -var _PIP = '|'.charCodeAt(0); -var _MIN = '-'.charCodeAt(0); -var _USC = '_'.charCodeAt(0); -var _PRC = '%'.charCodeAt(0); -var _MUL = '*'.charCodeAt(0); -var _LPA = '('.charCodeAt(0); -var _RPA = ')'.charCodeAt(0); -var _LAN = '<'.charCodeAt(0); -var _RAN = '>'.charCodeAt(0); -var _ATS = '@'.charCodeAt(0); -var _HSH = '#'.charCodeAt(0); -var _DLR = '$'.charCodeAt(0); -var _BSL = '\\'.charCodeAt(0); -var _FSL = '/'.charCodeAt(0); -var _NWL = '\n'.charCodeAt(0); -var _CAR = '\r'.charCodeAt(0); -var _LFD = '\f'.charCodeAt(0); -var _DQO = '"'.charCodeAt(0); -var _SQO = '\''.charCodeAt(0); -var _WSP = ' '.charCodeAt(0); -var _TAB = '\t'.charCodeAt(0); -var _SEM = ';'.charCodeAt(0); -var _COL = ':'.charCodeAt(0); -var _CUL = '{'.charCodeAt(0); -var _CUR = '}'.charCodeAt(0); -var _BRL = '['.charCodeAt(0); -var _BRR = ']'.charCodeAt(0); -var _CMA = ','.charCodeAt(0); -var _DOT = '.'.charCodeAt(0); -var _BNG = '!'.charCodeAt(0); -var staticTokenTable = {}; -staticTokenTable[_SEM] = TokenType.SemiColon; -staticTokenTable[_COL] = TokenType.Colon; -staticTokenTable[_CUL] = TokenType.CurlyL; -staticTokenTable[_CUR] = TokenType.CurlyR; -staticTokenTable[_BRR] = TokenType.BracketR; -staticTokenTable[_BRL] = TokenType.BracketL; -staticTokenTable[_LPA] = TokenType.ParenthesisL; -staticTokenTable[_RPA] = TokenType.ParenthesisR; -staticTokenTable[_CMA] = TokenType.Comma; -var staticUnitTable = {}; -staticUnitTable['em'] = TokenType.EMS; -staticUnitTable['ex'] = TokenType.EXS; -staticUnitTable['px'] = TokenType.Length; -staticUnitTable['cm'] = TokenType.Length; -staticUnitTable['mm'] = TokenType.Length; -staticUnitTable['in'] = TokenType.Length; -staticUnitTable['pt'] = TokenType.Length; -staticUnitTable['pc'] = TokenType.Length; -staticUnitTable['deg'] = TokenType.Angle; -staticUnitTable['rad'] = TokenType.Angle; -staticUnitTable['grad'] = TokenType.Angle; -staticUnitTable['ms'] = TokenType.Time; -staticUnitTable['s'] = TokenType.Time; -staticUnitTable['hz'] = TokenType.Freq; -staticUnitTable['khz'] = TokenType.Freq; -staticUnitTable['%'] = TokenType.Percentage; -staticUnitTable['fr'] = TokenType.Percentage; -staticUnitTable['dpi'] = TokenType.Resolution; -staticUnitTable['dpcm'] = TokenType.Resolution; -var Scanner = /** @class */ (function () { - function Scanner() { - this.stream = new MultiLineStream(''); - this.ignoreComment = true; - this.ignoreWhitespace = true; - this.inURL = false; - } - Scanner.prototype.setSource = function (input) { - this.stream = new MultiLineStream(input); - }; - Scanner.prototype.finishToken = function (offset, type, text) { - return { - offset: offset, - len: this.stream.pos() - offset, - type: type, - text: text || this.stream.substring(offset) - }; - }; - Scanner.prototype.substring = function (offset, len) { - return this.stream.substring(offset, offset + len); - }; - Scanner.prototype.pos = function () { - return this.stream.pos(); - }; - Scanner.prototype.goBackTo = function (pos) { - this.stream.goBackTo(pos); - }; - Scanner.prototype.scanUnquotedString = function () { - var offset = this.stream.pos(); - var content = []; - if (this._unquotedString(content)) { - return this.finishToken(offset, TokenType.UnquotedString, content.join('')); - } - return null; - }; - Scanner.prototype.scan = function () { - // processes all whitespaces and comments - var triviaToken = this.trivia(); - if (triviaToken !== null) { - return triviaToken; - } - var offset = this.stream.pos(); - // End of file/input - if (this.stream.eos()) { - return this.finishToken(offset, TokenType.EOF); - } - return this.scanNext(offset); - }; - Scanner.prototype.scanNext = function (offset) { - // CDO - if (this.stream.advanceIfChars([_MIN, _MIN, _RAN])) { - return this.finishToken(offset, TokenType.CDC); - } - var content = []; - if (this.ident(content)) { - return this.finishToken(offset, TokenType.Ident, content.join('')); - } - // at-keyword - if (this.stream.advanceIfChar(_ATS)) { - content = ['@']; - if (this._name(content)) { - var keywordText = content.join(''); - if (keywordText === '@charset') { - return this.finishToken(offset, TokenType.Charset, keywordText); - } - return this.finishToken(offset, TokenType.AtKeyword, keywordText); - } - else { - return this.finishToken(offset, TokenType.Delim); - } - } - // hash - if (this.stream.advanceIfChar(_HSH)) { - content = ['#']; - if (this._name(content)) { - return this.finishToken(offset, TokenType.Hash, content.join('')); - } - else { - return this.finishToken(offset, TokenType.Delim); - } - } - // Important - if (this.stream.advanceIfChar(_BNG)) { - return this.finishToken(offset, TokenType.Exclamation); - } - // Numbers - if (this._number()) { - var pos = this.stream.pos(); - content = [this.stream.substring(offset, pos)]; - if (this.stream.advanceIfChar(_PRC)) { - // Percentage 43% - return this.finishToken(offset, TokenType.Percentage); - } - else if (this.ident(content)) { - var dim = this.stream.substring(pos).toLowerCase(); - var tokenType_1 = staticUnitTable[dim]; - if (typeof tokenType_1 !== 'undefined') { - // Known dimension 43px - return this.finishToken(offset, tokenType_1, content.join('')); - } - else { - // Unknown dimension 43ft - return this.finishToken(offset, TokenType.Dimension, content.join('')); - } - } - return this.finishToken(offset, TokenType.Num); - } - // String, BadString - content = []; - var tokenType = this._string(content); - if (tokenType !== null) { - return this.finishToken(offset, tokenType, content.join('')); - } - // single character tokens - tokenType = staticTokenTable[this.stream.peekChar()]; - if (typeof tokenType !== 'undefined') { - this.stream.advance(1); - return this.finishToken(offset, tokenType); - } - // includes ~= - if (this.stream.peekChar(0) === _TLD && this.stream.peekChar(1) === _EQS) { - this.stream.advance(2); - return this.finishToken(offset, TokenType.Includes); - } - // DashMatch |= - if (this.stream.peekChar(0) === _PIP && this.stream.peekChar(1) === _EQS) { - this.stream.advance(2); - return this.finishToken(offset, TokenType.Dashmatch); - } - // Substring operator *= - if (this.stream.peekChar(0) === _MUL && this.stream.peekChar(1) === _EQS) { - this.stream.advance(2); - return this.finishToken(offset, TokenType.SubstringOperator); - } - // Substring operator ^= - if (this.stream.peekChar(0) === _HAT && this.stream.peekChar(1) === _EQS) { - this.stream.advance(2); - return this.finishToken(offset, TokenType.PrefixOperator); - } - // Substring operator $= - if (this.stream.peekChar(0) === _DLR && this.stream.peekChar(1) === _EQS) { - this.stream.advance(2); - return this.finishToken(offset, TokenType.SuffixOperator); - } - // Delim - this.stream.nextChar(); - return this.finishToken(offset, TokenType.Delim); - }; - Scanner.prototype._matchWordAnyCase = function (characters) { - var index = 0; - this.stream.advanceWhileChar(function (ch) { - var result = characters[index] === ch || characters[index + 1] === ch; - if (result) { - index += 2; - } - return result; - }); - if (index === characters.length) { - return true; - } - else { - this.stream.goBack(index / 2); - return false; - } - }; - Scanner.prototype.trivia = function () { - while (true) { - var offset = this.stream.pos(); - if (this._whitespace()) { - if (!this.ignoreWhitespace) { - return this.finishToken(offset, TokenType.Whitespace); - } - } - else if (this.comment()) { - if (!this.ignoreComment) { - return this.finishToken(offset, TokenType.Comment); - } - } - else { - return null; - } - } - }; - Scanner.prototype.comment = function () { - if (this.stream.advanceIfChars([_FSL, _MUL])) { - var success_1 = false, hot_1 = false; - this.stream.advanceWhileChar(function (ch) { - if (hot_1 && ch === _FSL) { - success_1 = true; - return false; - } - hot_1 = ch === _MUL; - return true; - }); - if (success_1) { - this.stream.advance(1); - } - return true; - } - return false; - }; - Scanner.prototype._number = function () { - var npeek = 0, ch; - if (this.stream.peekChar() === _DOT) { - npeek = 1; - } - ch = this.stream.peekChar(npeek); - if (ch >= _0 && ch <= _9) { - this.stream.advance(npeek + 1); - this.stream.advanceWhileChar(function (ch) { - return ch >= _0 && ch <= _9 || npeek === 0 && ch === _DOT; - }); - return true; - } - return false; - }; - Scanner.prototype._newline = function (result) { - var ch = this.stream.peekChar(); - switch (ch) { - case _CAR: - case _LFD: - case _NWL: - this.stream.advance(1); - result.push(String.fromCharCode(ch)); - if (ch === _CAR && this.stream.advanceIfChar(_NWL)) { - result.push('\n'); - } - return true; - } - return false; - }; - Scanner.prototype._escape = function (result, includeNewLines) { - var ch = this.stream.peekChar(); - if (ch === _BSL) { - this.stream.advance(1); - ch = this.stream.peekChar(); - var hexNumCount = 0; - while (hexNumCount < 6 && (ch >= _0 && ch <= _9 || ch >= _a && ch <= _f || ch >= _A && ch <= _F)) { - this.stream.advance(1); - ch = this.stream.peekChar(); - hexNumCount++; - } - if (hexNumCount > 0) { - try { - var hexVal = parseInt(this.stream.substring(this.stream.pos() - hexNumCount), 16); - if (hexVal) { - result.push(String.fromCharCode(hexVal)); - } - } - catch (e) { - // ignore - } - // optional whitespace or new line, not part of result text - if (ch === _WSP || ch === _TAB) { - this.stream.advance(1); - } - else { - this._newline([]); - } - return true; - } - if (ch !== _CAR && ch !== _LFD && ch !== _NWL) { - this.stream.advance(1); - result.push(String.fromCharCode(ch)); - return true; - } - else if (includeNewLines) { - return this._newline(result); - } - } - return false; - }; - Scanner.prototype._stringChar = function (closeQuote, result) { - // not closeQuote, not backslash, not newline - var ch = this.stream.peekChar(); - if (ch !== 0 && ch !== closeQuote && ch !== _BSL && ch !== _CAR && ch !== _LFD && ch !== _NWL) { - this.stream.advance(1); - result.push(String.fromCharCode(ch)); - return true; - } - return false; - }; - Scanner.prototype._string = function (result) { - if (this.stream.peekChar() === _SQO || this.stream.peekChar() === _DQO) { - var closeQuote = this.stream.nextChar(); - result.push(String.fromCharCode(closeQuote)); - while (this._stringChar(closeQuote, result) || this._escape(result, true)) { - // loop - } - if (this.stream.peekChar() === closeQuote) { - this.stream.nextChar(); - result.push(String.fromCharCode(closeQuote)); - return TokenType.String; - } - else { - return TokenType.BadString; - } - } - return null; - }; - Scanner.prototype._unquotedChar = function (result) { - // not closeQuote, not backslash, not newline - var ch = this.stream.peekChar(); - if (ch !== 0 && ch !== _BSL && ch !== _SQO && ch !== _DQO && ch !== _LPA && ch !== _RPA && ch !== _WSP && ch !== _TAB && ch !== _NWL && ch !== _LFD && ch !== _CAR) { - this.stream.advance(1); - result.push(String.fromCharCode(ch)); - return true; - } - return false; - }; - Scanner.prototype._unquotedString = function (result) { - var hasContent = false; - while (this._unquotedChar(result) || this._escape(result)) { - hasContent = true; - } - return hasContent; - }; - Scanner.prototype._whitespace = function () { - var n = this.stream.advanceWhileChar(function (ch) { - return ch === _WSP || ch === _TAB || ch === _NWL || ch === _LFD || ch === _CAR; - }); - return n > 0; - }; - Scanner.prototype._name = function (result) { - var matched = false; - while (this._identChar(result) || this._escape(result)) { - matched = true; - } - return matched; - }; - Scanner.prototype.ident = function (result) { - var pos = this.stream.pos(); - var hasMinus = this._minus(result); - if (hasMinus && this._minus(result) /* -- */) { - if (this._identFirstChar(result) || this._escape(result)) { - while (this._identChar(result) || this._escape(result)) { - // loop - } - return true; - } - } - else if (this._identFirstChar(result) || this._escape(result)) { - while (this._identChar(result) || this._escape(result)) { - // loop - } - return true; - } - this.stream.goBackTo(pos); - return false; - }; - Scanner.prototype._identFirstChar = function (result) { - var ch = this.stream.peekChar(); - if (ch === _USC || // _ - ch >= _a && ch <= _z || // a-z - ch >= _A && ch <= _Z || // A-Z - ch >= 0x80 && ch <= 0xFFFF) { // nonascii - this.stream.advance(1); - result.push(String.fromCharCode(ch)); - return true; - } - return false; - }; - Scanner.prototype._minus = function (result) { - var ch = this.stream.peekChar(); - if (ch === _MIN) { - this.stream.advance(1); - result.push(String.fromCharCode(ch)); - return true; - } - return false; - }; - Scanner.prototype._identChar = function (result) { - var ch = this.stream.peekChar(); - if (ch === _USC || // _ - ch === _MIN || // - - ch >= _a && ch <= _z || // a-z - ch >= _A && ch <= _Z || // A-Z - ch >= _0 && ch <= _9 || // 0/9 - ch >= 0x80 && ch <= 0xFFFF) { // nonascii - this.stream.advance(1); - result.push(String.fromCharCode(ch)); - return true; - } - return false; - }; - return Scanner; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssSymbolScope.js": -/*!******************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssSymbolScope.js ***! - \******************************************************************************************************************/ -/*! exports provided: Scope, GlobalScope, Symbol, ScopeBuilder, Symbols */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scope", function() { return Scope; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GlobalScope", function() { return GlobalScope; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Symbol", function() { return Symbol; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScopeBuilder", function() { return ScopeBuilder; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Symbols", function() { return Symbols; }); -/* harmony import */ var _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cssNodes.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js"); -/* harmony import */ var _utils_arrays_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/arrays.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/utils/arrays.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -var Scope = /** @class */ (function () { - function Scope(offset, length) { - this.offset = offset; - this.length = length; - this.symbols = []; - this.parent = null; - this.children = []; - } - Scope.prototype.addChild = function (scope) { - this.children.push(scope); - scope.setParent(this); - }; - Scope.prototype.setParent = function (scope) { - this.parent = scope; - }; - Scope.prototype.findScope = function (offset, length) { - if (length === void 0) { length = 0; } - if (this.offset <= offset && this.offset + this.length > offset + length || this.offset === offset && this.length === length) { - return this.findInScope(offset, length); - } - return null; - }; - Scope.prototype.findInScope = function (offset, length) { - if (length === void 0) { length = 0; } - // find the first scope child that has an offset larger than offset + length - var end = offset + length; - var idx = Object(_utils_arrays_js__WEBPACK_IMPORTED_MODULE_1__["findFirst"])(this.children, function (s) { return s.offset > end; }); - if (idx === 0) { - // all scopes have offsets larger than our end - return this; - } - var res = this.children[idx - 1]; - if (res.offset <= offset && res.offset + res.length >= offset + length) { - return res.findInScope(offset, length); - } - return this; - }; - Scope.prototype.addSymbol = function (symbol) { - this.symbols.push(symbol); - }; - Scope.prototype.getSymbol = function (name, type) { - for (var index = 0; index < this.symbols.length; index++) { - var symbol = this.symbols[index]; - if (symbol.name === name && symbol.type === type) { - return symbol; - } - } - return null; - }; - Scope.prototype.getSymbols = function () { - return this.symbols; - }; - return Scope; -}()); - -var GlobalScope = /** @class */ (function (_super) { - __extends(GlobalScope, _super); - function GlobalScope() { - return _super.call(this, 0, Number.MAX_VALUE) || this; - } - return GlobalScope; -}(Scope)); - -var Symbol = /** @class */ (function () { - function Symbol(name, value, node, type) { - this.name = name; - this.value = value; - this.node = node; - this.type = type; - } - return Symbol; -}()); - -var ScopeBuilder = /** @class */ (function () { - function ScopeBuilder(scope) { - this.scope = scope; - } - ScopeBuilder.prototype.addSymbol = function (node, name, value, type) { - if (node.offset !== -1) { - var current = this.scope.findScope(node.offset, node.length); - if (current) { - current.addSymbol(new Symbol(name, value, node, type)); - } - } - }; - ScopeBuilder.prototype.addScope = function (node) { - if (node.offset !== -1) { - var current = this.scope.findScope(node.offset, node.length); - if (current && (current.offset !== node.offset || current.length !== node.length)) { // scope already known? - var newScope = new Scope(node.offset, node.length); - current.addChild(newScope); - return newScope; - } - return current; - } - return null; - }; - ScopeBuilder.prototype.addSymbolToChildScope = function (scopeNode, node, name, value, type) { - if (scopeNode && scopeNode.offset !== -1) { - var current = this.addScope(scopeNode); // create the scope or gets the existing one - if (current) { - current.addSymbol(new Symbol(name, value, node, type)); - } - } - }; - ScopeBuilder.prototype.visitNode = function (node) { - switch (node.type) { - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Keyframe: - this.addSymbol(node, node.getName(), void 0, _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Keyframe); - return true; - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].CustomPropertyDeclaration: - return this.visitCustomPropertyDeclarationNode(node); - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].VariableDeclaration: - return this.visitVariableDeclarationNode(node); - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Ruleset: - return this.visitRuleSet(node); - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].MixinDeclaration: - this.addSymbol(node, node.getName(), void 0, _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Mixin); - return true; - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].FunctionDeclaration: - this.addSymbol(node, node.getName(), void 0, _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Function); - return true; - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].FunctionParameter: { - return this.visitFunctionParameterNode(node); - } - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Declarations: - this.addScope(node); - return true; - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].For: - var forNode = node; - var scopeNode = forNode.getDeclarations(); - if (scopeNode) { - this.addSymbolToChildScope(scopeNode, forNode.variable, forNode.variable.getName(), void 0, _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Variable); - } - return true; - case _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Each: { - var eachNode = node; - var scopeNode_1 = eachNode.getDeclarations(); - if (scopeNode_1) { - var variables = eachNode.getVariables().getChildren(); - for (var _i = 0, variables_1 = variables; _i < variables_1.length; _i++) { - var variable = variables_1[_i]; - this.addSymbolToChildScope(scopeNode_1, variable, variable.getName(), void 0, _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Variable); - } - } - return true; - } - } - return true; - }; - ScopeBuilder.prototype.visitRuleSet = function (node) { - var current = this.scope.findScope(node.offset, node.length); - if (current) { - for (var _i = 0, _a = node.getSelectors().getChildren(); _i < _a.length; _i++) { - var child = _a[_i]; - if (child instanceof _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Selector"]) { - if (child.getChildren().length === 1) { // only selectors with a single element can be extended - current.addSymbol(new Symbol(child.getChild(0).getText(), void 0, child, _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Rule)); - } - } - } - } - return true; - }; - ScopeBuilder.prototype.visitVariableDeclarationNode = function (node) { - var value = node.getValue() ? node.getValue().getText() : void 0; - this.addSymbol(node, node.getName(), value, _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Variable); - return true; - }; - ScopeBuilder.prototype.visitFunctionParameterNode = function (node) { - // parameters are part of the body scope - var scopeNode = node.getParent().getDeclarations(); - if (scopeNode) { - var valueNode = node.getDefaultValue(); - var value = valueNode ? valueNode.getText() : void 0; - this.addSymbolToChildScope(scopeNode, node, node.getName(), value, _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Variable); - } - return true; - }; - ScopeBuilder.prototype.visitCustomPropertyDeclarationNode = function (node) { - var value = node.getValue() ? node.getValue().getText() : ''; - this.addCSSVariable(node.getProperty(), node.getProperty().getName(), value, _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Variable); - return true; - }; - ScopeBuilder.prototype.addCSSVariable = function (node, name, value, type) { - if (node.offset !== -1) { - this.scope.addSymbol(new Symbol(name, value, node, type)); - } - }; - return ScopeBuilder; -}()); - -var Symbols = /** @class */ (function () { - function Symbols(node) { - this.global = new GlobalScope(); - node.acceptVisitor(new ScopeBuilder(this.global)); - } - Symbols.prototype.findSymbolsAtOffset = function (offset, referenceType) { - var scope = this.global.findScope(offset, 0); - var result = []; - var names = {}; - while (scope) { - var symbols = scope.getSymbols(); - for (var i = 0; i < symbols.length; i++) { - var symbol = symbols[i]; - if (symbol.type === referenceType && !names[symbol.name]) { - result.push(symbol); - names[symbol.name] = true; - } - } - scope = scope.parent; - } - return result; - }; - Symbols.prototype.internalFindSymbol = function (node, referenceTypes) { - var scopeNode = node; - if (node.parent instanceof _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["FunctionParameter"] && node.parent.getParent() instanceof _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["BodyDeclaration"]) { - scopeNode = node.parent.getParent().getDeclarations(); - } - if (node.parent instanceof _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["FunctionArgument"] && node.parent.getParent() instanceof _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Function"]) { - var funcId = node.parent.getParent().getIdentifier(); - if (funcId) { - var functionSymbol = this.internalFindSymbol(funcId, [_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Function]); - if (functionSymbol) { - scopeNode = functionSymbol.node.getDeclarations(); - } - } - } - if (!scopeNode) { - return null; - } - var name = node.getText(); - var scope = this.global.findScope(scopeNode.offset, scopeNode.length); - while (scope) { - for (var index = 0; index < referenceTypes.length; index++) { - var type = referenceTypes[index]; - var symbol = scope.getSymbol(name, type); - if (symbol) { - return symbol; - } - } - scope = scope.parent; - } - return null; - }; - Symbols.prototype.evaluateReferenceTypes = function (node) { - if (node instanceof _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Identifier"]) { - var referenceTypes = node.referenceTypes; - if (referenceTypes) { - return referenceTypes; - } - else { - if (node.isCustomProperty) { - return [_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Variable]; - } - // are a reference to a keyframe? - var decl = _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["getParentDeclaration"](node); - if (decl) { - var propertyName = decl.getNonPrefixedPropertyName(); - if ((propertyName === 'animation' || propertyName === 'animation-name') - && decl.getValue() && decl.getValue().offset === node.offset) { - return [_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Keyframe]; - } - } - } - } - else if (node instanceof _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Variable"]) { - return [_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Variable]; - } - var selector = node.findAParent(_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Selector, _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].ExtendsReference); - if (selector) { - return [_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Rule]; - } - return null; - }; - Symbols.prototype.findSymbolFromNode = function (node) { - if (!node) { - return null; - } - while (node.type === _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Interpolation) { - node = node.getParent(); - } - var referenceTypes = this.evaluateReferenceTypes(node); - if (referenceTypes) { - return this.internalFindSymbol(node, referenceTypes); - } - return null; - }; - Symbols.prototype.matchesSymbol = function (node, symbol) { - if (!node) { - return false; - } - while (node.type === _cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Interpolation) { - node = node.getParent(); - } - if (symbol.name.length !== node.length || symbol.name !== node.getText()) { - return false; - } - var referenceTypes = this.evaluateReferenceTypes(node); - if (!referenceTypes || referenceTypes.indexOf(symbol.type) === -1) { - return false; - } - var nodeSymbol = this.internalFindSymbol(node, referenceTypes); - return nodeSymbol === symbol; - }; - Symbols.prototype.findSymbol = function (name, type, offset) { - var scope = this.global.findScope(offset); - while (scope) { - var symbol = scope.getSymbol(name, type); - if (symbol) { - return symbol; - } - scope = scope.parent; - } - return null; - }; - return Symbols; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/lessParser.js": -/*!**************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/lessParser.js ***! - \**************************************************************************************************************/ -/*! exports provided: LESSParser */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LESSParser", function() { return LESSParser; }); -/* harmony import */ var _lessScanner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lessScanner.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/lessScanner.js"); -/* harmony import */ var _cssScanner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cssScanner.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssScanner.js"); -/* harmony import */ var _cssParser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cssParser.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssParser.js"); -/* harmony import */ var _cssNodes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cssNodes.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js"); -/* harmony import */ var _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cssErrors.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssErrors.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - - -/// -/// A parser for LESS -/// http://lesscss.org/ -/// -var LESSParser = /** @class */ (function (_super) { - __extends(LESSParser, _super); - function LESSParser() { - return _super.call(this, new _lessScanner_js__WEBPACK_IMPORTED_MODULE_0__["LESSScanner"]()) || this; - } - LESSParser.prototype._parseStylesheetStatement = function (isNested) { - if (isNested === void 0) { isNested = false; } - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].AtKeyword)) { - return this._parseVariableDeclaration() - || this._parsePlugin() - || _super.prototype._parseStylesheetAtStatement.call(this, isNested); - } - return this._tryParseMixinDeclaration() - || this._tryParseMixinReference() - || this._parseFunction() - || this._parseRuleset(true); - }; - LESSParser.prototype._parseImport = function () { - if (!this.peekKeyword('@import') && !this.peekKeyword('@import-once') /* deprecated in less 1.4.1 */) { - return null; - } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Import"]); - this.consumeToken(); - // less 1.4.1: @import (css) "lib" - if (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisL)) { - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Ident)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].IdentifierExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].SemiColon]); - } - do { - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Comma)) { - break; - } - } while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Ident)); - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].RightParenthesisExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].SemiColon]); - } - } - if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].URIOrStringExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].SemiColon]); - } - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].SemiColon) && !this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].EOF)) { - node.setMedialist(this._parseMediaQueryList()); - } - return this.finish(node); - }; - LESSParser.prototype._parsePlugin = function () { - if (!this.peekKeyword('@plugin')) { - return null; - } - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["NodeType"].Plugin); - this.consumeToken(); // @import - if (!node.addChild(this._parseStringLiteral())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].StringLiteralExpected); - } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].SemiColon)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].SemiColonExpected); - } - return this.finish(node); - }; - LESSParser.prototype._parseMediaQuery = function (resyncStopToken) { - var node = _super.prototype._parseMediaQuery.call(this, resyncStopToken); - if (!node) { - var node_1 = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["MediaQuery"]); - if (node_1.addChild(this._parseVariable())) { - return this.finish(node_1); - } - return null; - } - return node; - }; - LESSParser.prototype._parseMediaDeclaration = function (isNested) { - if (isNested === void 0) { isNested = false; } - return this._tryParseRuleset(isNested) - || this._tryToParseDeclaration() - || this._tryParseMixinDeclaration() - || this._tryParseMixinReference() - || this._parseDetachedRuleSetMixin() - || this._parseStylesheetStatement(isNested); - }; - LESSParser.prototype._parseMediaFeatureName = function () { - return this._parseIdent() || this._parseVariable(); - }; - LESSParser.prototype._parseVariableDeclaration = function (panic) { - if (panic === void 0) { panic = []; } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["VariableDeclaration"]); - var mark = this.mark(); - if (!this.peekDelim('@') && !this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].AtKeyword) || !node.setVariable(this._parseVariable())) { - return null; - } - if (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Colon)) { - node.colonPosition = this.prevToken.offset; - if (node.setValue(this._parseDetachedRuleSet())) { - node.needsSemicolon = false; - } - else if (!node.setValue(this._parseExpr())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].VariableValueExpected, [], panic); - } - node.addChild(this._parsePrio()); - } - else { - this.restoreAtMark(mark); - return null; // at keyword, but no ':', not a variable declaration but some at keyword - } - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].SemiColon)) { - node.semicolonPosition = this.token.offset; // not part of the declaration, but useful information for code assist - } - return this.finish(node); - }; - LESSParser.prototype._parseDetachedRuleSet = function () { - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyL)) { - return null; - } - var content = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["BodyDeclaration"]); - this._parseBody(content, this._parseDetachedRuleSetBody.bind(this)); - return this.finish(content); - }; - LESSParser.prototype._parseDetachedRuleSetBody = function () { - return this._tryParseKeyframeSelector() || this._parseRuleSetDeclaration(); - }; - LESSParser.prototype._parseVariable = function () { - if (!this.peekDelim('@') && !this.peekDelim('$') && !this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].AtKeyword)) { - return null; - } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Variable"]); - var mark = this.mark(); - while (this.acceptDelim('@') || this.acceptDelim('$')) { - if (this.hasWhitespace()) { - this.restoreAtMark(mark); - return null; - } - } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].AtKeyword) && !this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Ident)) { - this.restoreAtMark(mark); - return null; - } - return node; - }; - LESSParser.prototype._parseTerm = function () { - var term = _super.prototype._parseTerm.call(this); - if (term) { - return term; - } - term = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Term"]); - if (term.setExpression(this._parseVariable()) || - term.setExpression(this._parseEscaped()) || - term.setExpression(this._tryParseMixinReference())) { - return this.finish(term); - } - return null; - }; - LESSParser.prototype._parseEscaped = function () { - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].EscapedJavaScript) || - this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].BadEscapedJavaScript)) { - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["NodeType"].EscapedValue); - this.consumeToken(); - return this.finish(node); - } - if (this.peekDelim('~')) { - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["NodeType"].EscapedValue); - this.consumeToken(); - if (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].String) || this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].EscapedJavaScript)) { - return this.finish(node); - } - else { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].TermExpected); - } - } - return null; - }; - LESSParser.prototype._parseOperator = function () { - var node = this._parseGuardOperator(); - if (node) { - return node; - } - else { - return _super.prototype._parseOperator.call(this); - } - }; - LESSParser.prototype._parseGuardOperator = function () { - if (this.peekDelim('>')) { - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["NodeType"].Operator); - this.consumeToken(); - this.acceptDelim('='); - return node; - } - else if (this.peekDelim('=')) { - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["NodeType"].Operator); - this.consumeToken(); - this.acceptDelim('<'); - return node; - } - else if (this.peekDelim('<')) { - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["NodeType"].Operator); - this.consumeToken(); - this.acceptDelim('='); - return node; - } - return null; - }; - LESSParser.prototype._parseRuleSetDeclaration = function () { - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].AtKeyword)) { - return this._parseKeyframe() - || this._parseMedia(true) - || this._parseImport() - || this._parseSupports(true) // @supports - || this._parseDetachedRuleSetMixin() // less detached ruleset mixin - || this._parseVariableDeclaration() // Variable declarations - || this._parseUnknownAtRule(); - } - return this._tryParseMixinDeclaration() - || this._tryParseRuleset(true) // nested ruleset - || this._tryParseMixinReference() // less mixin reference - || this._parseFunction() - || this._parseExtend() // less extend declaration - || _super.prototype._parseRuleSetDeclaration.call(this); // try css ruleset declaration as the last option - }; - LESSParser.prototype._parseKeyframeIdent = function () { - return this._parseIdent([_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["ReferenceType"].Keyframe]) || this._parseVariable(); - }; - LESSParser.prototype._parseKeyframeSelector = function () { - return this._parseDetachedRuleSetMixin() // less detached ruleset mixin - || _super.prototype._parseKeyframeSelector.call(this); - }; - LESSParser.prototype._parseSimpleSelectorBody = function () { - return this._parseSelectorCombinator() || _super.prototype._parseSimpleSelectorBody.call(this); - }; - LESSParser.prototype._parseSelector = function (isNested) { - // CSS Guards - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Selector"]); - var hasContent = false; - if (isNested) { - // nested selectors can start with a combinator - hasContent = node.addChild(this._parseCombinator()); - } - while (node.addChild(this._parseSimpleSelector())) { - hasContent = true; - var mark = this.mark(); - if (node.addChild(this._parseGuard()) && this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyL)) { - break; - } - this.restoreAtMark(mark); - node.addChild(this._parseCombinator()); // optional - } - return hasContent ? this.finish(node) : null; - }; - LESSParser.prototype._parseSelectorCombinator = function () { - if (this.peekDelim('&')) { - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["NodeType"].SelectorCombinator); - this.consumeToken(); - while (!this.hasWhitespace() && (this.acceptDelim('-') || this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Num) || this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Dimension) || node.addChild(this._parseIdent()) || this.acceptDelim('&'))) { - // support &-foo - } - return this.finish(node); - } - return null; - }; - LESSParser.prototype._parseSelectorIdent = function () { - if (!this.peekInterpolatedIdent()) { - return null; - } - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["NodeType"].SelectorInterpolation); - var hasContent = this._acceptInterpolatedIdent(node); - return hasContent ? this.finish(node) : null; - }; - LESSParser.prototype._parsePropertyIdentifier = function () { - if (!this.peekInterpolatedIdent()) { - return null; - } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Identifier"]); - node.isCustomProperty = this.peekRegExp(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Ident, /^--/); - var hasContent = this._acceptInterpolatedIdent(node); - if (hasContent && !this.hasWhitespace()) { - this.acceptDelim('+'); - if (!this.hasWhitespace()) { - this.acceptIdent('_'); - } - } - return hasContent ? this.finish(node) : null; - }; - LESSParser.prototype.peekInterpolatedIdent = function () { - return this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Ident) || - this.peekDelim('@') || - this.peekDelim('$') || - this.peekDelim('-'); - }; - LESSParser.prototype._acceptInterpolatedIdent = function (node) { - var _this = this; - var hasContent = false; - var indentInterpolation = function () { - var pos = _this.mark(); - if (_this.acceptDelim('-')) { - if (!_this.hasWhitespace()) { - _this.acceptDelim('-'); - } - if (_this.hasWhitespace()) { - _this.restoreAtMark(pos); - return null; - } - } - return _this._parseInterpolation(); - }; - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Ident) || node.addChild(indentInterpolation()) || (hasContent && (this.acceptDelim('-') || this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Num)))) { - hasContent = true; - if (this.hasWhitespace()) { - break; - } - } - return hasContent; - }; - LESSParser.prototype._parseInterpolation = function () { - // @{name} Variable or - // ${name} Property - var mark = this.mark(); - if (this.peekDelim('@') || this.peekDelim('$')) { - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["NodeType"].Interpolation); - this.consumeToken(); - if (this.hasWhitespace() || !this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyL)) { - this.restoreAtMark(mark); - return null; - } - if (!node.addChild(this._parseIdent())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].IdentifierExpected); - } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].RightCurlyExpected); - } - return this.finish(node); - } - return null; - }; - LESSParser.prototype._tryParseMixinDeclaration = function () { - var mark = this.mark(); - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["MixinDeclaration"]); - if (!node.setIdentifier(this._parseMixinDeclarationIdentifier()) || !this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisL)) { - this.restoreAtMark(mark); - return null; - } - if (node.getParameters().addChild(this._parseMixinParameter())) { - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Comma) || this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].SemiColon)) { - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - break; - } - if (!node.getParameters().addChild(this._parseMixinParameter())) { - this.markError(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].IdentifierExpected, [], [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR]); - } - } - } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - this.restoreAtMark(mark); - return null; - } - node.setGuard(this._parseGuard()); - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyL)) { - this.restoreAtMark(mark); - return null; - } - return this._parseBody(node, this._parseMixInBodyDeclaration.bind(this)); - }; - LESSParser.prototype._parseMixInBodyDeclaration = function () { - return this._parseFontFace() || this._parseRuleSetDeclaration(); - }; - LESSParser.prototype._parseMixinDeclarationIdentifier = function () { - var identifier; - if (this.peekDelim('#') || this.peekDelim('.')) { - identifier = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Identifier"]); - this.consumeToken(); // # or . - if (this.hasWhitespace() || !identifier.addChild(this._parseIdent())) { - return null; - } - } - else if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Hash)) { - identifier = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Identifier"]); - this.consumeToken(); // TokenType.Hash - } - else { - return null; - } - identifier.referenceTypes = [_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["ReferenceType"].Mixin]; - return this.finish(identifier); - }; - LESSParser.prototype._parsePseudo = function () { - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Colon)) { - return null; - } - var mark = this.mark(); - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["ExtendsReference"]); - this.consumeToken(); // : - if (this.acceptIdent('extend')) { - return this._completeExtends(node); - } - this.restoreAtMark(mark); - return _super.prototype._parsePseudo.call(this); - }; - LESSParser.prototype._parseExtend = function () { - if (!this.peekDelim('&')) { - return null; - } - var mark = this.mark(); - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["ExtendsReference"]); - this.consumeToken(); // & - if (this.hasWhitespace() || !this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Colon) || !this.acceptIdent('extend')) { - this.restoreAtMark(mark); - return null; - } - return this._completeExtends(node); - }; - LESSParser.prototype._completeExtends = function (node) { - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisL)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].LeftParenthesisExpected); - } - var selectors = node.getSelectors(); - if (!selectors.addChild(this._parseSelector(true))) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].SelectorExpected); - } - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Comma)) { - if (!selectors.addChild(this._parseSelector(true))) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].SelectorExpected); - } - } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].RightParenthesisExpected); - } - return this.finish(node); - }; - LESSParser.prototype._parseDetachedRuleSetMixin = function () { - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].AtKeyword)) { - return null; - } - var mark = this.mark(); - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["MixinReference"]); - if (node.addChild(this._parseVariable()) && (this.hasWhitespace() || !this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisL))) { - this.restoreAtMark(mark); - return null; - } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].RightParenthesisExpected); - } - return this.finish(node); - }; - LESSParser.prototype._tryParseMixinReference = function () { - var mark = this.mark(); - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["MixinReference"]); - var identifier = this._parseMixinDeclarationIdentifier(); - while (identifier) { - this.acceptDelim('>'); - var nextId = this._parseMixinDeclarationIdentifier(); - if (nextId) { - node.getNamespaces().addChild(identifier); - identifier = nextId; - } - else { - break; - } - } - if (!node.setIdentifier(identifier)) { - this.restoreAtMark(mark); - return null; - } - var hasArguments = false; - if (!this.hasWhitespace() && this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisL)) { - hasArguments = true; - if (node.getArguments().addChild(this._parseMixinArgument())) { - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Comma) || this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].SemiColon)) { - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - break; - } - if (!node.getArguments().addChild(this._parseMixinArgument())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].ExpressionExpected); - } - } - } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].RightParenthesisExpected); - } - identifier.referenceTypes = [_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["ReferenceType"].Mixin]; - } - else { - identifier.referenceTypes = [_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["ReferenceType"].Mixin, _cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["ReferenceType"].Rule]; - } - node.addChild(this._parsePrio()); - if (!hasArguments && !this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].SemiColon) && !this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR) && !this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].EOF)) { - this.restoreAtMark(mark); - return null; - } - return this.finish(node); - }; - LESSParser.prototype._parseMixinArgument = function () { - // [variableName ':'] expression | variableName '...' - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["FunctionArgument"]); - var pos = this.mark(); - var argument = this._parseVariable(); - if (argument) { - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Colon)) { - this.restoreAtMark(pos); - } - else { - node.setIdentifier(argument); - } - } - if (node.setValue(this._parseDetachedRuleSet() || this._parseExpr(true))) { - return this.finish(node); - } - this.restoreAtMark(pos); - return null; - }; - LESSParser.prototype._parseMixinParameter = function () { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["FunctionParameter"]); - // special rest variable: @rest... - if (this.peekKeyword('@rest')) { - var restNode = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Node"]); - this.consumeToken(); - if (!this.accept(_lessScanner_js__WEBPACK_IMPORTED_MODULE_0__["Ellipsis"])) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].DotExpected, [], [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Comma, _cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR]); - } - node.setIdentifier(this.finish(restNode)); - return this.finish(node); - } - // special const args: ... - if (this.peek(_lessScanner_js__WEBPACK_IMPORTED_MODULE_0__["Ellipsis"])) { - var varargsNode = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Node"]); - this.consumeToken(); - node.setIdentifier(this.finish(varargsNode)); - return this.finish(node); - } - var hasContent = false; - // default variable declaration: @param: 12 or @name - if (node.setIdentifier(this._parseVariable())) { - this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Colon); - hasContent = true; - } - if (!node.setDefaultValue(this._parseDetachedRuleSet() || this._parseExpr(true)) && !hasContent) { - return null; - } - return this.finish(node); - }; - LESSParser.prototype._parseGuard = function () { - if (!this.peekIdent('when')) { - return null; - } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["LessGuard"]); - this.consumeToken(); // when - node.isNegated = this.acceptIdent('not'); - if (!node.getConditions().addChild(this._parseGuardCondition())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].ConditionExpected); - } - while (this.acceptIdent('and') || this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Comma)) { - if (!node.getConditions().addChild(this._parseGuardCondition())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].ConditionExpected); - } - } - return this.finish(node); - }; - LESSParser.prototype._parseGuardCondition = function () { - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisL)) { - return null; - } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["GuardCondition"]); - this.consumeToken(); // ParenthesisL - if (!node.addChild(this._parseExpr())) { - // empty (?) - } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].RightParenthesisExpected); - } - return this.finish(node); - }; - LESSParser.prototype._parseFunction = function () { - var pos = this.mark(); - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Function"]); - if (!node.setIdentifier(this._parseFunctionIdentifier())) { - return null; - } - if (this.hasWhitespace() || !this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisL)) { - this.restoreAtMark(pos); - return null; - } - if (node.getArguments().addChild(this._parseMixinArgument())) { - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Comma) || this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].SemiColon)) { - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - break; - } - if (!node.getArguments().addChild(this._parseMixinArgument())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].ExpressionExpected); - } - } - } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_4__["ParseError"].RightParenthesisExpected); - } - return this.finish(node); - }; - LESSParser.prototype._parseFunctionIdentifier = function () { - if (this.peekDelim('%')) { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Identifier"]); - node.referenceTypes = [_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["ReferenceType"].Function]; - this.consumeToken(); - return this.finish(node); - } - return _super.prototype._parseFunctionIdentifier.call(this); - }; - LESSParser.prototype._parseURLArgument = function () { - var pos = this.mark(); - var node = _super.prototype._parseURLArgument.call(this); - if (!node || !this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - this.restoreAtMark(pos); - var node_2 = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Node"]); - node_2.addChild(this._parseBinaryExpr()); - return this.finish(node_2); - } - return node; - }; - return LESSParser; -}(_cssParser_js__WEBPACK_IMPORTED_MODULE_2__["Parser"])); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/lessScanner.js": -/*!***************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/lessScanner.js ***! - \***************************************************************************************************************/ -/*! exports provided: Ellipsis, LESSScanner */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Ellipsis", function() { return Ellipsis; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LESSScanner", function() { return LESSScanner; }); -/* harmony import */ var _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cssScanner.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssScanner.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var _FSL = '/'.charCodeAt(0); -var _NWL = '\n'.charCodeAt(0); -var _CAR = '\r'.charCodeAt(0); -var _LFD = '\f'.charCodeAt(0); -var _TIC = '`'.charCodeAt(0); -var _DOT = '.'.charCodeAt(0); -var customTokenValue = _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CustomToken; -var Ellipsis = customTokenValue++; -var LESSScanner = /** @class */ (function (_super) { - __extends(LESSScanner, _super); - function LESSScanner() { - return _super !== null && _super.apply(this, arguments) || this; - } - LESSScanner.prototype.scanNext = function (offset) { - // LESS: escaped JavaScript code `const a = "dddd"` - var tokenType = this.escapedJavaScript(); - if (tokenType !== null) { - return this.finishToken(offset, tokenType); - } - if (this.stream.advanceIfChars([_DOT, _DOT, _DOT])) { - return this.finishToken(offset, Ellipsis); - } - return _super.prototype.scanNext.call(this, offset); - }; - LESSScanner.prototype.comment = function () { - if (_super.prototype.comment.call(this)) { - return true; - } - if (!this.inURL && this.stream.advanceIfChars([_FSL, _FSL])) { - this.stream.advanceWhileChar(function (ch) { - switch (ch) { - case _NWL: - case _CAR: - case _LFD: - return false; - default: - return true; - } - }); - return true; - } - else { - return false; - } - }; - LESSScanner.prototype.escapedJavaScript = function () { - var ch = this.stream.peekChar(); - if (ch === _TIC) { - this.stream.advance(1); - this.stream.advanceWhileChar(function (ch) { return ch !== _TIC; }); - return this.stream.advanceIfChar(_TIC) ? _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].EscapedJavaScript : _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].BadEscapedJavaScript; - } - return null; - }; - return LESSScanner; -}(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["Scanner"])); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/scssErrors.js": -/*!**************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/scssErrors.js ***! - \**************************************************************************************************************/ -/*! exports provided: SCSSIssueType, SCSSParseError */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SCSSIssueType", function() { return SCSSIssueType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SCSSParseError", function() { return SCSSParseError; }); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./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. - *--------------------------------------------------------------------------------------------*/ - - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_0__["loadMessageBundle"](); -var SCSSIssueType = /** @class */ (function () { - function SCSSIssueType(id, message) { - this.id = id; - this.message = message; - } - return SCSSIssueType; -}()); - -var SCSSParseError = { - FromExpected: new SCSSIssueType('scss-fromexpected', localize('expected.from', "'from' expected")), - ThroughOrToExpected: new SCSSIssueType('scss-throughexpected', localize('expected.through', "'through' or 'to' expected")), - InExpected: new SCSSIssueType('scss-fromexpected', localize('expected.in', "'in' expected")), -}; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/scssParser.js": -/*!**************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/scssParser.js ***! - \**************************************************************************************************************/ -/*! exports provided: SCSSParser */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SCSSParser", function() { return SCSSParser; }); -/* harmony import */ var _scssScanner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scssScanner.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/scssScanner.js"); -/* harmony import */ var _cssScanner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cssScanner.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssScanner.js"); -/* harmony import */ var _cssParser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cssParser.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssParser.js"); -/* harmony import */ var _cssNodes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cssNodes.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js"); -/* harmony import */ var _scssErrors_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./scssErrors.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/scssErrors.js"); -/* harmony import */ var _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./cssErrors.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssErrors.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - - - -/// -/// A parser for scss -/// http://sass-lang.com/documentation/file.SASS_REFERENCE.html -/// -var SCSSParser = /** @class */ (function (_super) { - __extends(SCSSParser, _super); - function SCSSParser() { - return _super.call(this, new _scssScanner_js__WEBPACK_IMPORTED_MODULE_0__["SCSSScanner"]()) || this; - } - SCSSParser.prototype._parseStylesheetStatement = function () { - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].AtKeyword)) { - return this._parseWarnAndDebug() - || this._parseControlStatement() - || this._parseMixinDeclaration() - || this._parseMixinContent() - || this._parseMixinReference() // @include - || this._parseFunctionDeclaration() - || _super.prototype._parseStylesheetAtStatement.call(this); - } - return this._parseRuleset(true) || this._parseVariableDeclaration(); - }; - SCSSParser.prototype._parseImport = function () { - if (!this.peekKeyword('@import')) { - return null; - } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Import"]); - this.consumeToken(); - if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].URIOrStringExpected); - } - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Comma)) { - if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].URIOrStringExpected); - } - } - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].SemiColon) && !this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].EOF)) { - node.setMedialist(this._parseMediaQueryList()); - } - return this.finish(node); - }; - // scss variables: $font-size: 12px; - SCSSParser.prototype._parseVariableDeclaration = function (panic) { - if (panic === void 0) { panic = []; } - if (!this.peek(_scssScanner_js__WEBPACK_IMPORTED_MODULE_0__["VariableName"])) { - return null; - } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["VariableDeclaration"]); - if (!node.setVariable(this._parseVariable())) { - return null; - } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Colon)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].ColonExpected); - } - node.colonPosition = this.prevToken.offset; - if (!node.setValue(this._parseExpr())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].VariableValueExpected, [], panic); - } - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Exclamation)) { - if (!this.peekRegExp(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Ident, /^(default|global)$/)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].UnknownKeyword); - } - this.consumeToken(); - } - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].SemiColon)) { - node.semicolonPosition = this.token.offset; // not part of the declaration, but useful information for code assist - } - return this.finish(node); - }; - SCSSParser.prototype._parseMediaFeatureName = function () { - return this._parseFunction() || this._parseIdent() || this._parseVariable(); // first function, the indent - }; - SCSSParser.prototype._parseKeyframeSelector = function () { - return this._tryParseKeyframeSelector() - || this._parseControlStatement(this._parseKeyframeSelector.bind(this)) - || this._parseVariableDeclaration() - || this._parseMixinContent(); - }; - SCSSParser.prototype._parseVariable = function () { - if (!this.peek(_scssScanner_js__WEBPACK_IMPORTED_MODULE_0__["VariableName"])) { - return null; - } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Variable"]); - this.consumeToken(); - return node; - }; - SCSSParser.prototype._parseIdent = function (referenceTypes) { - var _this = this; - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Ident) && !this.peek(_scssScanner_js__WEBPACK_IMPORTED_MODULE_0__["InterpolationFunction"]) && !this.peekDelim('-')) { - return null; - } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Identifier"]); - node.referenceTypes = referenceTypes; - node.isCustomProperty = this.peekRegExp(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Ident, /^--/); - var hasContent = false; - var indentInterpolation = function () { - var pos = _this.mark(); - if (_this.acceptDelim('-')) { - if (!_this.hasWhitespace()) { - _this.acceptDelim('-'); - } - if (_this.hasWhitespace()) { - _this.restoreAtMark(pos); - return null; - } - } - return _this._parseInterpolation(); - }; - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Ident) || node.addChild(indentInterpolation()) || (hasContent && (this.acceptDelim('-') || this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Num)))) { - hasContent = true; - if (this.hasWhitespace()) { - break; - } - } - return hasContent ? this.finish(node) : null; - }; - SCSSParser.prototype._parseTerm = function () { - var term = _super.prototype._parseTerm.call(this); - if (term) { - return term; - } - term = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Term"]); - if (term.setExpression(this._parseVariable()) - || term.setExpression(this._parseSelectorCombinator()) - || term.setExpression(this._tryParsePrio())) { - return this.finish(term); - } - return null; - }; - SCSSParser.prototype._parseInterpolation = function () { - if (this.peek(_scssScanner_js__WEBPACK_IMPORTED_MODULE_0__["InterpolationFunction"])) { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Interpolation"]); - this.consumeToken(); - if (!node.addChild(this._parseExpr()) && !this._parseSelectorCombinator()) { - if (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR)) { - return this.finish(node); - } - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].ExpressionExpected); - } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].RightCurlyExpected); - } - return this.finish(node); - } - return null; - }; - SCSSParser.prototype._parseOperator = function () { - if (this.peek(_scssScanner_js__WEBPACK_IMPORTED_MODULE_0__["EqualsOperator"]) || this.peek(_scssScanner_js__WEBPACK_IMPORTED_MODULE_0__["NotEqualsOperator"]) - || this.peek(_scssScanner_js__WEBPACK_IMPORTED_MODULE_0__["GreaterEqualsOperator"]) || this.peek(_scssScanner_js__WEBPACK_IMPORTED_MODULE_0__["SmallerEqualsOperator"]) - || this.peekDelim('>') || this.peekDelim('<') - || this.peekIdent('and') || this.peekIdent('or') - || this.peekDelim('%')) { - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["NodeType"].Operator); - this.consumeToken(); - return this.finish(node); - } - return _super.prototype._parseOperator.call(this); - }; - SCSSParser.prototype._parseUnaryOperator = function () { - if (this.peekIdent('not')) { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Node"]); - this.consumeToken(); - return this.finish(node); - } - return _super.prototype._parseUnaryOperator.call(this); - }; - SCSSParser.prototype._parseRuleSetDeclaration = function () { - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].AtKeyword)) { - return this._parseKeyframe() // nested @keyframe - || this._parseImport() // nested @import - || this._parseMedia(true) // nested @media - || this._parseFontFace() // nested @font-face - || this._parseWarnAndDebug() // @warn, @debug and @error statements - || this._parseControlStatement() // @if, @while, @for, @each - || this._parseFunctionDeclaration() // @function - || this._parseExtends() // @extends - || this._parseMixinReference() // @include - || this._parseMixinContent() // @content - || this._parseMixinDeclaration() // nested @mixin - || this._parseRuleset(true) // @at-rule - || this._parseSupports(true); // @supports - } - return this._parseVariableDeclaration() // variable declaration - || this._tryParseRuleset(true) // nested ruleset - || _super.prototype._parseRuleSetDeclaration.call(this); // try css ruleset declaration as last so in the error case, the ast will contain a declaration - }; - SCSSParser.prototype._parseDeclaration = function (resyncStopTokens) { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Declaration"]); - if (!node.setProperty(this._parseProperty())) { - return null; - } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Colon)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].ColonExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Colon], resyncStopTokens); - } - node.colonPosition = this.prevToken.offset; - var hasContent = false; - if (node.setValue(this._parseExpr())) { - hasContent = true; - node.addChild(this._parsePrio()); - } - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyL)) { - node.setNestedProperties(this._parseNestedProperties()); - } - else { - if (!hasContent) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].PropertyValueExpected); - } - } - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].SemiColon)) { - node.semicolonPosition = this.token.offset; // not part of the declaration, but useful information for code assist - } - return this.finish(node); - }; - SCSSParser.prototype._parseNestedProperties = function () { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["NestedProperties"]); - return this._parseBody(node, this._parseDeclaration.bind(this)); - }; - SCSSParser.prototype._parseExtends = function () { - if (this.peekKeyword('@extend')) { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["ExtendsReference"]); - this.consumeToken(); - if (!node.getSelectors().addChild(this._parseSimpleSelector())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].SelectorExpected); - } - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Comma)) { - node.getSelectors().addChild(this._parseSimpleSelector()); - } - if (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Exclamation)) { - if (!this.acceptIdent('optional')) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].UnknownKeyword); - } - } - return this.finish(node); - } - return null; - }; - SCSSParser.prototype._parseSimpleSelectorBody = function () { - return this._parseSelectorCombinator() || this._parseSelectorPlaceholder() || _super.prototype._parseSimpleSelectorBody.call(this); - }; - SCSSParser.prototype._parseSelectorCombinator = function () { - if (this.peekDelim('&')) { - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["NodeType"].SelectorCombinator); - this.consumeToken(); - while (!this.hasWhitespace() && (this.acceptDelim('-') || this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Num) || this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Dimension) || node.addChild(this._parseIdent()) || this.acceptDelim('&'))) { - // support &-foo-1 - } - return this.finish(node); - } - return null; - }; - SCSSParser.prototype._parseSelectorPlaceholder = function () { - if (this.peekDelim('%')) { - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["NodeType"].SelectorPlaceholder); - this.consumeToken(); - this._parseIdent(); - return this.finish(node); - } - else if (this.peekKeyword('@at-root')) { - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["NodeType"].SelectorPlaceholder); - this.consumeToken(); - return this.finish(node); - } - return null; - }; - SCSSParser.prototype._parseElementName = function () { - var pos = this.mark(); - var node = _super.prototype._parseElementName.call(this); - if (node && !this.hasWhitespace() && this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisL)) { // for #49589 - this.restoreAtMark(pos); - return null; - } - return node; - }; - SCSSParser.prototype._tryParsePseudoIdentifier = function () { - return this._parseInterpolation() || _super.prototype._tryParsePseudoIdentifier.call(this); // for #49589 - }; - SCSSParser.prototype._parseWarnAndDebug = function () { - if (!this.peekKeyword('@debug') - && !this.peekKeyword('@warn') - && !this.peekKeyword('@error')) { - return null; - } - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["NodeType"].Debug); - this.consumeToken(); // @debug, @warn or @error - node.addChild(this._parseExpr()); // optional - return this.finish(node); - }; - SCSSParser.prototype._parseControlStatement = function (parseStatement) { - if (parseStatement === void 0) { parseStatement = this._parseRuleSetDeclaration.bind(this); } - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].AtKeyword)) { - return null; - } - return this._parseIfStatement(parseStatement) || this._parseForStatement(parseStatement) - || this._parseEachStatement(parseStatement) || this._parseWhileStatement(parseStatement); - }; - SCSSParser.prototype._parseIfStatement = function (parseStatement) { - if (!this.peekKeyword('@if')) { - return null; - } - return this._internalParseIfStatement(parseStatement); - }; - SCSSParser.prototype._internalParseIfStatement = function (parseStatement) { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["IfStatement"]); - this.consumeToken(); // @if or if - if (!node.setExpression(this._parseExpr(true))) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].ExpressionExpected); - } - this._parseBody(node, parseStatement); - if (this.acceptKeyword('@else')) { - if (this.peekIdent('if')) { - node.setElseClause(this._internalParseIfStatement(parseStatement)); - } - else if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyL)) { - var elseNode = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["ElseStatement"]); - this._parseBody(elseNode, parseStatement); - node.setElseClause(elseNode); - } - } - return this.finish(node); - }; - SCSSParser.prototype._parseForStatement = function (parseStatement) { - if (!this.peekKeyword('@for')) { - return null; - } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["ForStatement"]); - this.consumeToken(); // @for - if (!node.setVariable(this._parseVariable())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].VariableNameExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR]); - } - if (!this.acceptIdent('from')) { - return this.finish(node, _scssErrors_js__WEBPACK_IMPORTED_MODULE_4__["SCSSParseError"].FromExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR]); - } - if (!node.addChild(this._parseBinaryExpr())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].ExpressionExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR]); - } - if (!this.acceptIdent('to') && !this.acceptIdent('through')) { - return this.finish(node, _scssErrors_js__WEBPACK_IMPORTED_MODULE_4__["SCSSParseError"].ThroughOrToExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR]); - } - if (!node.addChild(this._parseBinaryExpr())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].ExpressionExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR]); - } - return this._parseBody(node, parseStatement); - }; - SCSSParser.prototype._parseEachStatement = function (parseStatement) { - if (!this.peekKeyword('@each')) { - return null; - } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["EachStatement"]); - this.consumeToken(); // @each - var variables = node.getVariables(); - if (!variables.addChild(this._parseVariable())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].VariableNameExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR]); - } - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Comma)) { - if (!variables.addChild(this._parseVariable())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].VariableNameExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR]); - } - } - this.finish(variables); - if (!this.acceptIdent('in')) { - return this.finish(node, _scssErrors_js__WEBPACK_IMPORTED_MODULE_4__["SCSSParseError"].InExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR]); - } - if (!node.addChild(this._parseExpr())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].ExpressionExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR]); - } - return this._parseBody(node, parseStatement); - }; - SCSSParser.prototype._parseWhileStatement = function (parseStatement) { - if (!this.peekKeyword('@while')) { - return null; - } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["WhileStatement"]); - this.consumeToken(); // @while - if (!node.addChild(this._parseBinaryExpr())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].ExpressionExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR]); - } - return this._parseBody(node, parseStatement); - }; - SCSSParser.prototype._parseFunctionBodyDeclaration = function () { - return this._parseVariableDeclaration() || this._parseReturnStatement() || this._parseWarnAndDebug() - || this._parseControlStatement(this._parseFunctionBodyDeclaration.bind(this)); - }; - SCSSParser.prototype._parseFunctionDeclaration = function () { - if (!this.peekKeyword('@function')) { - return null; - } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["FunctionDeclaration"]); - this.consumeToken(); // @function - if (!node.setIdentifier(this._parseIdent([_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["ReferenceType"].Function]))) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].IdentifierExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR]); - } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisL)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].LeftParenthesisExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR]); - } - if (node.getParameters().addChild(this._parseParameterDeclaration())) { - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Comma)) { - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - break; - } - if (!node.getParameters().addChild(this._parseParameterDeclaration())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].VariableNameExpected); - } - } - } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].RightParenthesisExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR]); - } - return this._parseBody(node, this._parseFunctionBodyDeclaration.bind(this)); - }; - SCSSParser.prototype._parseReturnStatement = function () { - if (!this.peekKeyword('@return')) { - return null; - } - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["NodeType"].ReturnStatement); - this.consumeToken(); // @function - if (!node.addChild(this._parseExpr())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].ExpressionExpected); - } - return this.finish(node); - }; - SCSSParser.prototype._parseMixinDeclaration = function () { - if (!this.peekKeyword('@mixin')) { - return null; - } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["MixinDeclaration"]); - this.consumeToken(); - if (!node.setIdentifier(this._parseIdent([_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["ReferenceType"].Mixin]))) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].IdentifierExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR]); - } - if (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisL)) { - if (node.getParameters().addChild(this._parseParameterDeclaration())) { - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Comma)) { - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - break; - } - if (!node.getParameters().addChild(this._parseParameterDeclaration())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].VariableNameExpected); - } - } - } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].RightParenthesisExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR]); - } - } - return this._parseBody(node, this._parseRuleSetDeclaration.bind(this)); - }; - SCSSParser.prototype._parseParameterDeclaration = function () { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["FunctionParameter"]); - if (!node.setIdentifier(this._parseVariable())) { - return null; - } - if (this.accept(_scssScanner_js__WEBPACK_IMPORTED_MODULE_0__["Ellipsis"])) { - // ok - } - if (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Colon)) { - if (!node.setDefaultValue(this._parseExpr(true))) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].VariableValueExpected, [], [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Comma, _cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR]); - } - } - return this.finish(node); - }; - SCSSParser.prototype._parseMixinContent = function () { - if (!this.peekKeyword('@content')) { - return null; - } - var node = this.createNode(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["NodeType"].MixinContent); - this.consumeToken(); - return this.finish(node); - }; - SCSSParser.prototype._parseMixinReference = function () { - if (!this.peekKeyword('@include')) { - return null; - } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["MixinReference"]); - this.consumeToken(); - if (!node.setIdentifier(this._parseIdent([_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["ReferenceType"].Mixin]))) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].IdentifierExpected, [_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyR]); - } - if (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisL)) { - if (node.getArguments().addChild(this._parseFunctionArgument())) { - while (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Comma)) { - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - break; - } - if (!node.getArguments().addChild(this._parseFunctionArgument())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].ExpressionExpected); - } - } - } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].RightParenthesisExpected); - } - } - if (this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].CurlyL)) { - var content = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["BodyDeclaration"]); - this._parseBody(content, this._parseMixinReferenceBodyStatement.bind(this)); - node.setContent(content); - } - return this.finish(node); - }; - SCSSParser.prototype._parseMixinReferenceBodyStatement = function () { - return this._tryParseKeyframeSelector() || this._parseRuleSetDeclaration(); - }; - SCSSParser.prototype._parseFunctionArgument = function () { - // [variableName ':'] expression | variableName '...' - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["FunctionArgument"]); - var pos = this.mark(); - var argument = this._parseVariable(); - if (argument) { - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Colon)) { - if (this.accept(_scssScanner_js__WEBPACK_IMPORTED_MODULE_0__["Ellipsis"])) { // optional - node.setValue(argument); - return this.finish(node); - } - else { - this.restoreAtMark(pos); - } - } - else { - node.setIdentifier(argument); - } - } - if (node.setValue(this._parseExpr(true))) { - this.accept(_scssScanner_js__WEBPACK_IMPORTED_MODULE_0__["Ellipsis"]); // #43746 - node.addChild(this._parsePrio()); // #9859 - return this.finish(node); - } - return null; - }; - SCSSParser.prototype._parseURLArgument = function () { - var pos = this.mark(); - var node = _super.prototype._parseURLArgument.call(this); - if (!node || !this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - this.restoreAtMark(pos); - var node_1 = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Node"]); - node_1.addChild(this._parseBinaryExpr()); - return this.finish(node_1); - } - return node; - }; - SCSSParser.prototype._parseOperation = function () { - if (!this.peek(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisL)) { - return null; - } - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["Node"]); - this.consumeToken(); - while (node.addChild(this._parseListElement())) { - this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Comma); // optional - } - if (!this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].ParenthesisR)) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].RightParenthesisExpected); - } - return this.finish(node); - }; - SCSSParser.prototype._parseListElement = function () { - var node = this.create(_cssNodes_js__WEBPACK_IMPORTED_MODULE_3__["ListEntry"]); - var child = this._parseBinaryExpr(); - if (!child) { - return null; - } - if (this.accept(_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Colon)) { - node.setKey(child); - if (!node.setValue(this._parseBinaryExpr())) { - return this.finish(node, _cssErrors_js__WEBPACK_IMPORTED_MODULE_5__["ParseError"].ExpressionExpected); - } - } - else { - node.setValue(child); - } - return this.finish(node); - }; - return SCSSParser; -}(_cssParser_js__WEBPACK_IMPORTED_MODULE_2__["Parser"])); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/scssScanner.js": -/*!***************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/scssScanner.js ***! - \***************************************************************************************************************/ -/*! exports provided: VariableName, InterpolationFunction, Default, EqualsOperator, NotEqualsOperator, GreaterEqualsOperator, SmallerEqualsOperator, Ellipsis, SCSSScanner */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VariableName", function() { return VariableName; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InterpolationFunction", function() { return InterpolationFunction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Default", function() { return Default; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EqualsOperator", function() { return EqualsOperator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NotEqualsOperator", function() { return NotEqualsOperator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GreaterEqualsOperator", function() { return GreaterEqualsOperator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SmallerEqualsOperator", function() { return SmallerEqualsOperator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Ellipsis", function() { return Ellipsis; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SCSSScanner", function() { return SCSSScanner; }); -/* harmony import */ var _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cssScanner.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssScanner.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var _FSL = '/'.charCodeAt(0); -var _NWL = '\n'.charCodeAt(0); -var _CAR = '\r'.charCodeAt(0); -var _LFD = '\f'.charCodeAt(0); -var _DLR = '$'.charCodeAt(0); -var _HSH = '#'.charCodeAt(0); -var _CUL = '{'.charCodeAt(0); -var _EQS = '='.charCodeAt(0); -var _BNG = '!'.charCodeAt(0); -var _LAN = '<'.charCodeAt(0); -var _RAN = '>'.charCodeAt(0); -var _DOT = '.'.charCodeAt(0); -var customTokenValue = _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CustomToken; -var VariableName = customTokenValue++; -var InterpolationFunction = customTokenValue++; -var Default = customTokenValue++; -var EqualsOperator = customTokenValue++; -var NotEqualsOperator = customTokenValue++; -var GreaterEqualsOperator = customTokenValue++; -var SmallerEqualsOperator = customTokenValue++; -var Ellipsis = customTokenValue++; -var SCSSScanner = /** @class */ (function (_super) { - __extends(SCSSScanner, _super); - function SCSSScanner() { - return _super !== null && _super.apply(this, arguments) || this; - } - SCSSScanner.prototype.scanNext = function (offset) { - // scss variable - if (this.stream.advanceIfChar(_DLR)) { - var content = ['$']; - if (this.ident(content)) { - return this.finishToken(offset, VariableName, content.join('')); - } - else { - this.stream.goBackTo(offset); - } - } - // scss: interpolation function #{..}) - if (this.stream.advanceIfChars([_HSH, _CUL])) { - return this.finishToken(offset, InterpolationFunction); - } - // operator == - if (this.stream.advanceIfChars([_EQS, _EQS])) { - return this.finishToken(offset, EqualsOperator); - } - // operator != - if (this.stream.advanceIfChars([_BNG, _EQS])) { - return this.finishToken(offset, NotEqualsOperator); - } - // operators <, <= - if (this.stream.advanceIfChar(_LAN)) { - if (this.stream.advanceIfChar(_EQS)) { - return this.finishToken(offset, SmallerEqualsOperator); - } - return this.finishToken(offset, _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Delim); - } - // ooperators >, >= - if (this.stream.advanceIfChar(_RAN)) { - if (this.stream.advanceIfChar(_EQS)) { - return this.finishToken(offset, GreaterEqualsOperator); - } - return this.finishToken(offset, _cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Delim); - } - // ellipis - if (this.stream.advanceIfChars([_DOT, _DOT, _DOT])) { - return this.finishToken(offset, Ellipsis); - } - return _super.prototype.scanNext.call(this, offset); - }; - SCSSScanner.prototype.comment = function () { - if (_super.prototype.comment.call(this)) { - return true; - } - if (!this.inURL && this.stream.advanceIfChars([_FSL, _FSL])) { - this.stream.advanceWhileChar(function (ch) { - switch (ch) { - case _NWL: - case _CAR: - case _LFD: - return false; - default: - return true; - } - }); - return true; - } - else { - return false; - } - }; - return SCSSScanner; -}(_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["Scanner"])); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssCodeActions.js": -/*!********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssCodeActions.js ***! - \********************************************************************************************************************/ -/*! exports provided: CSSCodeActions */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CSSCodeActions", function() { return CSSCodeActions; }); -/* harmony import */ var _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/cssNodes.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js"); -/* harmony import */ var _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../languageFacts/facts.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/facts.js"); -/* harmony import */ var _utils_strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/strings.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/utils/strings.js"); -/* harmony import */ var _services_lintRules_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../services/lintRules.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lintRules.js"); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./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. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_5__["loadMessageBundle"](); -var CSSCodeActions = /** @class */ (function () { - function CSSCodeActions() { - } - CSSCodeActions.prototype.doCodeActions = function (document, range, context, stylesheet) { - return this.doCodeActions2(document, range, context, stylesheet).map(function (ca) { - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["Command"].create(ca.title, '_css.applyCodeAction', document.uri, document.version, ca.edit.documentChanges[0].edits); - }); - }; - CSSCodeActions.prototype.doCodeActions2 = function (document, range, context, stylesheet) { - var result = []; - if (context.diagnostics) { - for (var _i = 0, _a = context.diagnostics; _i < _a.length; _i++) { - var diagnostic = _a[_i]; - this.appendFixesForMarker(document, stylesheet, diagnostic, result); - } - } - return result; - }; - CSSCodeActions.prototype.getFixesForUnknownProperty = function (document, property, marker, result) { - var propertyName = property.getName(); - var candidates = []; - _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_1__["cssDataManager"].getProperties().forEach(function (p) { - var score = Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_2__["difference"])(propertyName, p.name); - if (score >= propertyName.length / 2 /*score_lim*/) { - candidates.push({ property: p.name, score: score }); - } - }); - // Sort in descending order. - candidates.sort(function (a, b) { - return b.score - a.score; - }); - var maxActions = 3; - for (var _i = 0, candidates_1 = candidates; _i < candidates_1.length; _i++) { - var candidate = candidates_1[_i]; - var propertyName_1 = candidate.property; - var title = localize('css.codeaction.rename', "Rename to '{0}'", propertyName_1); - var edit = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(marker.range, propertyName_1); - var documentIdentifier = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["VersionedTextDocumentIdentifier"].create(document.uri, document.version); - var workspaceEdit = { documentChanges: [_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextDocumentEdit"].create(documentIdentifier, [edit])] }; - var codeAction = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CodeAction"].create(title, workspaceEdit, _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CodeActionKind"].QuickFix); - codeAction.diagnostics = [marker]; - result.push(codeAction); - if (--maxActions <= 0) { - return; - } - } - }; - CSSCodeActions.prototype.appendFixesForMarker = function (document, stylesheet, marker, result) { - if (marker.code !== _services_lintRules_js__WEBPACK_IMPORTED_MODULE_3__["Rules"].UnknownProperty.id) { - return; - } - var offset = document.offsetAt(marker.range.start); - var end = document.offsetAt(marker.range.end); - var nodepath = _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["getNodePath"](stylesheet, offset); - for (var i = nodepath.length - 1; i >= 0; i--) { - var node = nodepath[i]; - if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Declaration"]) { - var property = node.getProperty(); - if (property && property.offset === offset && property.end === end) { - this.getFixesForUnknownProperty(document, property, marker, result); - return; - } - } - } - }; - return CSSCodeActions; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssCompletion.js": -/*!*******************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssCompletion.js ***! - \*******************************************************************************************************************/ -/*! exports provided: CSSCompletion */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CSSCompletion", function() { return CSSCompletion; }); -/* harmony import */ var _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/cssNodes.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js"); -/* harmony import */ var _parser_cssSymbolScope_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../parser/cssSymbolScope.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssSymbolScope.js"); -/* harmony import */ var _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../languageFacts/facts.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/facts.js"); -/* harmony import */ var _utils_strings_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/strings.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/utils/strings.js"); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./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. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_5__["loadMessageBundle"](); -var SnippetFormat = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["InsertTextFormat"].Snippet; -var CSSCompletion = /** @class */ (function () { - function CSSCompletion(variablePrefix) { - if (variablePrefix === void 0) { variablePrefix = null; } - this.completionParticipants = []; - this.valueTypes = [ - _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Identifier, _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Value, _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].StringLiteral, _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].URILiteral, _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].NumericValue, - _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].HexColorValue, _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].VariableName, _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Prio - ]; - this.variablePrefix = variablePrefix; - } - CSSCompletion.prototype.getSymbolContext = function () { - if (!this.symbolContext) { - this.symbolContext = new _parser_cssSymbolScope_js__WEBPACK_IMPORTED_MODULE_1__["Symbols"](this.styleSheet); - } - return this.symbolContext; - }; - CSSCompletion.prototype.setCompletionParticipants = function (registeredCompletionParticipants) { - this.completionParticipants = registeredCompletionParticipants || []; - }; - CSSCompletion.prototype.doComplete = function (document, position, styleSheet) { - this.offset = document.offsetAt(position); - this.position = position; - this.currentWord = getCurrentWord(document, this.offset); - this.defaultReplaceRange = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["Range"].create(_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["Position"].create(this.position.line, this.position.character - this.currentWord.length), this.position); - this.textDocument = document; - this.styleSheet = styleSheet; - try { - var result = { isIncomplete: false, items: [] }; - this.nodePath = _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["getNodePath"](this.styleSheet, this.offset); - for (var i = this.nodePath.length - 1; i >= 0; i--) { - var node = this.nodePath[i]; - if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Property"]) { - this.getCompletionsForDeclarationProperty(node.getParent(), result); - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Expression"]) { - if (node.parent instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Interpolation"]) { - this.getVariableProposals(null, result); - } - else { - this.getCompletionsForExpression(node, result); - } - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["SimpleSelector"]) { - var parentRef = node.findAParent(_parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].ExtendsReference, _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Ruleset); - if (parentRef) { - if (parentRef.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].ExtendsReference) { - this.getCompletionsForExtendsReference(parentRef, node, result); - } - else { - var parentRuleSet = parentRef; - this.getCompletionsForSelector(parentRuleSet, parentRuleSet && parentRuleSet.isNested(), result); - } - } - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["FunctionArgument"]) { - this.getCompletionsForFunctionArgument(node, node.getParent(), result); - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Declarations"]) { - this.getCompletionsForDeclarations(node, result); - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["VariableDeclaration"]) { - this.getCompletionsForVariableDeclaration(node, result); - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["RuleSet"]) { - this.getCompletionsForRuleSet(node, result); - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Interpolation"]) { - this.getCompletionsForInterpolation(node, result); - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["FunctionDeclaration"]) { - this.getCompletionsForFunctionDeclaration(node, result); - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["MixinReference"]) { - this.getCompletionsForMixinReference(node, result); - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Function"]) { - this.getCompletionsForFunctionArgument(null, node, result); - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Supports"]) { - this.getCompletionsForSupports(node, result); - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["SupportsCondition"]) { - this.getCompletionsForSupportsCondition(node, result); - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ExtendsReference"]) { - this.getCompletionsForExtendsReference(node, null, result); - } - else if (node.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].URILiteral) { - this.getCompletionForUriLiteralValue(node, result); - } - else if (node.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].StringLiteral && node.parent.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Import) { - this.getCompletionForImportPath(node, result); - } - else if (node.parent === null) { - this.getCompletionForTopLevel(result); - // } else if (node instanceof nodes.Variable) { - // this.getCompletionsForVariableDeclaration() - } - else { - continue; - } - if (result.items.length > 0 || this.offset > node.offset) { - return this.finalize(result); - } - } - this.getCompletionsForStylesheet(result); - if (result.items.length === 0) { - if (this.variablePrefix && this.currentWord.indexOf(this.variablePrefix) === 0) { - this.getVariableProposals(null, result); - } - } - return this.finalize(result); - } - finally { - // don't hold on any state, clear symbolContext - this.position = null; - this.currentWord = null; - this.textDocument = null; - this.styleSheet = null; - this.symbolContext = null; - this.defaultReplaceRange = null; - this.nodePath = null; - } - }; - CSSCompletion.prototype.finalize = function (result) { - var needsSortText = result.items.some(function (i) { return !!i.sortText; }); - if (needsSortText) { - for (var _i = 0, _a = result.items; _i < _a.length; _i++) { - var i = _a[_i]; - if (!i.sortText) { - i.sortText = 'd'; - } - } - } - return result; - }; - CSSCompletion.prototype.findInNodePath = function () { - var types = []; - for (var _i = 0; _i < arguments.length; _i++) { - types[_i] = arguments[_i]; - } - for (var i = this.nodePath.length - 1; i >= 0; i--) { - var node = this.nodePath[i]; - if (types.indexOf(node.type) !== -1) { - return node; - } - } - return null; - }; - CSSCompletion.prototype.getCompletionsForDeclarationProperty = function (declaration, result) { - return this.getPropertyProposals(declaration, result); - }; - CSSCompletion.prototype.getPropertyProposals = function (declaration, result) { - var _this = this; - var properties = _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["cssDataManager"].getProperties(); - properties.forEach(function (entry) { - var range; - var insertText; - var retrigger = false; - if (declaration) { - range = _this.getCompletionRange(declaration.getProperty()); - insertText = entry.name; - if (!isDefined(declaration.colonPosition)) { - insertText += ': '; - retrigger = true; - } - } - else { - range = _this.getCompletionRange(null); - insertText = entry.name + ': '; - retrigger = true; - } - var item = { - label: entry.name, - documentation: _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["getEntryDescription"](entry), - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(range, insertText), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Property - }; - if (!entry.restrictions) { - retrigger = false; - } - if (retrigger) { - item.command = { - title: 'Suggest', - command: 'editor.action.triggerSuggest' - }; - } - if (_utils_strings_js__WEBPACK_IMPORTED_MODULE_3__["startsWith"](entry.name, '-')) { - item.sortText = 'x'; - } - result.items.push(item); - }); - this.completionParticipants.forEach(function (participant) { - if (participant.onCssProperty) { - participant.onCssProperty({ - propertyName: _this.currentWord, - range: _this.defaultReplaceRange - }); - } - }); - return result; - }; - CSSCompletion.prototype.getCompletionsForDeclarationValue = function (node, result) { - var _this = this; - var propertyName = node.getFullPropertyName(); - var entry = _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["cssDataManager"].getProperty(propertyName); - var existingNode = node.getValue(); - while (existingNode && existingNode.hasChildren()) { - existingNode = existingNode.findChildAtOffset(this.offset, false); - } - this.completionParticipants.forEach(function (participant) { - if (participant.onCssPropertyValue) { - participant.onCssPropertyValue({ - propertyName: propertyName, - propertyValue: _this.currentWord, - range: _this.getCompletionRange(existingNode) - }); - } - }); - if (entry) { - if (entry.restrictions) { - for (var _i = 0, _a = entry.restrictions; _i < _a.length; _i++) { - var restriction = _a[_i]; - switch (restriction) { - case 'color': - this.getColorProposals(entry, existingNode, result); - break; - case 'position': - this.getPositionProposals(entry, existingNode, result); - break; - case 'repeat': - this.getRepeatStyleProposals(entry, existingNode, result); - break; - case 'line-style': - this.getLineStyleProposals(entry, existingNode, result); - break; - case 'line-width': - this.getLineWidthProposals(entry, existingNode, result); - break; - case 'geometry-box': - this.getGeometryBoxProposals(entry, existingNode, result); - break; - case 'box': - this.getBoxProposals(entry, existingNode, result); - break; - case 'image': - this.getImageProposals(entry, existingNode, result); - break; - case 'timing-function': - this.getTimingFunctionProposals(entry, existingNode, result); - break; - case 'shape': - this.getBasicShapeProposals(entry, existingNode, result); - break; - } - } - } - this.getValueEnumProposals(entry, existingNode, result); - this.getCSSWideKeywordProposals(entry, existingNode, result); - this.getUnitProposals(entry, existingNode, result); - } - else { - var existingValues = collectValues(this.styleSheet, node); - for (var _b = 0, _c = existingValues.getEntries(); _b < _c.length; _b++) { - var existingValue = _c[_b]; - result.items.push({ - label: existingValue, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), existingValue), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Value - }); - } - } - this.getVariableProposals(existingNode, result); - this.getTermProposals(entry, existingNode, result); - return result; - }; - CSSCompletion.prototype.getValueEnumProposals = function (entry, existingNode, result) { - if (entry.values) { - for (var _i = 0, _a = entry.values; _i < _a.length; _i++) { - var value = _a[_i]; - if (_languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["supportedInMoreThanOneBrowser"](value)) { - var insertString = value.name; - var insertTextFormat = void 0; - if (_utils_strings_js__WEBPACK_IMPORTED_MODULE_3__["endsWith"](insertString, ')')) { - var from = insertString.lastIndexOf('('); - if (from !== -1) { - insertString = insertString.substr(0, from) + '($1)'; - insertTextFormat = SnippetFormat; - } - } - var item = { - label: value.name, - documentation: _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["getEntryDescription"](value), - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), insertString), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Value, - insertTextFormat: insertTextFormat - }; - result.items.push(item); - } - } - } - return result; - }; - CSSCompletion.prototype.getCSSWideKeywordProposals = function (entry, existingNode, result) { - for (var keywords in _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["cssWideKeywords"]) { - result.items.push({ - label: keywords, - documentation: _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["cssWideKeywords"][keywords], - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), keywords), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Value - }); - } - return result; - }; - CSSCompletion.prototype.getCompletionsForInterpolation = function (node, result) { - if (this.offset >= node.offset + 2) { - this.getVariableProposals(null, result); - } - return result; - }; - CSSCompletion.prototype.getVariableProposals = function (existingNode, result) { - var symbols = this.getSymbolContext().findSymbolsAtOffset(this.offset, _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Variable); - for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) { - var symbol = symbols_1[_i]; - var insertText = _utils_strings_js__WEBPACK_IMPORTED_MODULE_3__["startsWith"](symbol.name, '--') ? "var(" + symbol.name + ")" : symbol.name; - var suggest = { - label: symbol.name, - documentation: symbol.value ? _utils_strings_js__WEBPACK_IMPORTED_MODULE_3__["getLimitedString"](symbol.value) : symbol.value, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), insertText), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Variable, - sortText: 'z' - }; - if (symbol.node.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].FunctionParameter) { - var mixinNode = (symbol.node.getParent()); - if (mixinNode.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].MixinDeclaration) { - suggest.detail = localize('completion.argument', 'argument from \'{0}\'', mixinNode.getName()); - } - } - result.items.push(suggest); - } - return result; - }; - CSSCompletion.prototype.getVariableProposalsForCSSVarFunction = function (result) { - var symbols = this.getSymbolContext().findSymbolsAtOffset(this.offset, _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Variable); - symbols = symbols.filter(function (symbol) { - return _utils_strings_js__WEBPACK_IMPORTED_MODULE_3__["startsWith"](symbol.name, '--'); - }); - for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) { - var symbol = symbols_2[_i]; - result.items.push({ - label: symbol.name, - documentation: symbol.value ? _utils_strings_js__WEBPACK_IMPORTED_MODULE_3__["getLimitedString"](symbol.value) : symbol.value, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(null), symbol.name), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Variable - }); - } - return result; - }; - CSSCompletion.prototype.getUnitProposals = function (entry, existingNode, result) { - var currentWord = '0'; - if (this.currentWord.length > 0) { - var numMatch = this.currentWord.match(/^-?\d[\.\d+]*/); - if (numMatch) { - currentWord = numMatch[0]; - result.isIncomplete = currentWord.length === this.currentWord.length; - } - } - else if (this.currentWord.length === 0) { - result.isIncomplete = true; - } - if (existingNode && existingNode.parent && existingNode.parent.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Term) { - existingNode = existingNode.getParent(); // include the unary operator - } - if (entry.restrictions) { - for (var _i = 0, _a = entry.restrictions; _i < _a.length; _i++) { - var restriction = _a[_i]; - var units = _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["units"][restriction]; - if (units) { - for (var _b = 0, units_1 = units; _b < units_1.length; _b++) { - var unit = units_1[_b]; - var insertText = currentWord + unit; - result.items.push({ - label: insertText, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), insertText), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Unit - }); - } - } - } - } - return result; - }; - CSSCompletion.prototype.getCompletionRange = function (existingNode) { - if (existingNode && existingNode.offset <= this.offset) { - var end = existingNode.end !== -1 ? this.textDocument.positionAt(existingNode.end) : this.position; - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["Range"].create(this.textDocument.positionAt(existingNode.offset), end); - } - return this.defaultReplaceRange; - }; - CSSCompletion.prototype.getColorProposals = function (entry, existingNode, result) { - for (var color in _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["colors"]) { - result.items.push({ - label: color, - documentation: _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["colors"][color], - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), color), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Color - }); - } - for (var color in _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["colorKeywords"]) { - result.items.push({ - label: color, - documentation: _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["colorKeywords"][color], - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), color), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Value - }); - } - var colorValues = new Set(); - this.styleSheet.acceptVisitor(new ColorValueCollector(colorValues, this.offset)); - for (var _i = 0, _a = colorValues.getEntries(); _i < _a.length; _i++) { - var color = _a[_i]; - result.items.push({ - label: color, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), color), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Color - }); - } - var _loop_1 = function (p) { - var tabStop = 1; - var replaceFunction = function (match, p1) { return '${' + tabStop++ + ':' + p1 + '}'; }; - var insertText = p.func.replace(/\[?\$(\w+)\]?/g, replaceFunction); - result.items.push({ - label: p.func.substr(0, p.func.indexOf('(')), - detail: p.func, - documentation: p.desc, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this_1.getCompletionRange(existingNode), insertText), - insertTextFormat: SnippetFormat, - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Function - }); - }; - var this_1 = this; - for (var _b = 0, _c = _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["colorFunctions"]; _b < _c.length; _b++) { - var p = _c[_b]; - _loop_1(p); - } - return result; - }; - CSSCompletion.prototype.getPositionProposals = function (entry, existingNode, result) { - for (var position in _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["positionKeywords"]) { - result.items.push({ - label: position, - documentation: _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["positionKeywords"][position], - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), position), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Value - }); - } - return result; - }; - CSSCompletion.prototype.getRepeatStyleProposals = function (entry, existingNode, result) { - for (var repeat in _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["repeatStyleKeywords"]) { - result.items.push({ - label: repeat, - documentation: _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["repeatStyleKeywords"][repeat], - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), repeat), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Value - }); - } - return result; - }; - CSSCompletion.prototype.getLineStyleProposals = function (entry, existingNode, result) { - for (var lineStyle in _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["lineStyleKeywords"]) { - result.items.push({ - label: lineStyle, - documentation: _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["lineStyleKeywords"][lineStyle], - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), lineStyle), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Value - }); - } - return result; - }; - CSSCompletion.prototype.getLineWidthProposals = function (entry, existingNode, result) { - for (var _i = 0, _a = _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["lineWidthKeywords"]; _i < _a.length; _i++) { - var lineWidth = _a[_i]; - result.items.push({ - label: lineWidth, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), lineWidth), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Value - }); - } - return result; - }; - CSSCompletion.prototype.getGeometryBoxProposals = function (entry, existingNode, result) { - for (var box in _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["geometryBoxKeywords"]) { - result.items.push({ - label: box, - documentation: _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["geometryBoxKeywords"][box], - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), box), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Value - }); - } - return result; - }; - CSSCompletion.prototype.getBoxProposals = function (entry, existingNode, result) { - for (var box in _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["boxKeywords"]) { - result.items.push({ - label: box, - documentation: _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["boxKeywords"][box], - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), box), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Value - }); - } - return result; - }; - CSSCompletion.prototype.getImageProposals = function (entry, existingNode, result) { - for (var image in _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["imageFunctions"]) { - var insertText = moveCursorInsideParenthesis(image); - result.items.push({ - label: image, - documentation: _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["imageFunctions"][image], - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), insertText), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Function, - insertTextFormat: image !== insertText ? SnippetFormat : void 0 - }); - } - return result; - }; - CSSCompletion.prototype.getTimingFunctionProposals = function (entry, existingNode, result) { - for (var timing in _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["transitionTimingFunctions"]) { - var insertText = moveCursorInsideParenthesis(timing); - result.items.push({ - label: timing, - documentation: _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["transitionTimingFunctions"][timing], - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), insertText), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Function, - insertTextFormat: timing !== insertText ? SnippetFormat : void 0 - }); - } - return result; - }; - CSSCompletion.prototype.getBasicShapeProposals = function (entry, existingNode, result) { - for (var shape in _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["basicShapeFunctions"]) { - var insertText = moveCursorInsideParenthesis(shape); - result.items.push({ - label: shape, - documentation: _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["basicShapeFunctions"][shape], - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), insertText), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Function, - insertTextFormat: shape !== insertText ? SnippetFormat : void 0 - }); - } - return result; - }; - CSSCompletion.prototype.getCompletionsForStylesheet = function (result) { - var node = this.styleSheet.findFirstChildBeforeOffset(this.offset); - if (!node) { - return this.getCompletionForTopLevel(result); - } - if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["RuleSet"]) { - return this.getCompletionsForRuleSet(node, result); - } - if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Supports"]) { - return this.getCompletionsForSupports(node, result); - } - return result; - }; - CSSCompletion.prototype.getCompletionForTopLevel = function (result) { - var _this = this; - _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["cssDataManager"].getAtDirectives().forEach(function (entry) { - result.items.push({ - label: entry.name, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(_this.getCompletionRange(null), entry.name), - documentation: _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["getEntryDescription"](entry), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Keyword - }); - }); - this.getCompletionsForSelector(null, false, result); - return result; - }; - CSSCompletion.prototype.getCompletionsForRuleSet = function (ruleSet, result) { - var declarations = ruleSet.getDeclarations(); - var isAfter = declarations && declarations.endsWith('}') && this.offset >= declarations.end; - if (isAfter) { - return this.getCompletionForTopLevel(result); - } - var isInSelectors = !declarations || this.offset <= declarations.offset; - if (isInSelectors) { - return this.getCompletionsForSelector(ruleSet, ruleSet.isNested(), result); - } - return this.getCompletionsForDeclarations(ruleSet.getDeclarations(), result); - }; - CSSCompletion.prototype.getCompletionsForSelector = function (ruleSet, isNested, result) { - var _this = this; - var existingNode = this.findInNodePath(_parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].PseudoSelector, _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].IdentifierSelector, _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].ClassSelector, _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].ElementNameSelector); - if (!existingNode && this.offset - this.currentWord.length > 0 && this.textDocument.getText()[this.offset - this.currentWord.length - 1] === ':') { - // after the ':' of a pseudo selector, no node generated for just ':' - this.currentWord = ':' + this.currentWord; - this.defaultReplaceRange = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["Range"].create(_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["Position"].create(this.position.line, this.position.character - this.currentWord.length), this.position); - } - var pseudoClasses = _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["cssDataManager"].getPseudoClasses(); - pseudoClasses.forEach(function (entry) { - var insertText = moveCursorInsideParenthesis(entry.name); - var item = { - label: entry.name, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(_this.getCompletionRange(existingNode), insertText), - documentation: _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["getEntryDescription"](entry), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Function, - insertTextFormat: entry.name !== insertText ? SnippetFormat : void 0 - }; - if (_utils_strings_js__WEBPACK_IMPORTED_MODULE_3__["startsWith"](entry.name, ':-')) { - item.sortText = 'x'; - } - result.items.push(item); - }); - var pseudoElements = _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["cssDataManager"].getPseudoElements(); - pseudoElements.forEach(function (entry) { - var insertText = moveCursorInsideParenthesis(entry.name); - var item = { - label: entry.name, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(_this.getCompletionRange(existingNode), insertText), - documentation: _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["getEntryDescription"](entry), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Function, - insertTextFormat: entry.name !== insertText ? SnippetFormat : void 0 - }; - if (_utils_strings_js__WEBPACK_IMPORTED_MODULE_3__["startsWith"](entry.name, '::-')) { - item.sortText = 'x'; - } - result.items.push(item); - }); - if (!isNested) { // show html tags only for top level - for (var _i = 0, _a = _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["html5Tags"]; _i < _a.length; _i++) { - var entry = _a[_i]; - result.items.push({ - label: entry, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), entry), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Keyword - }); - } - for (var _b = 0, _c = _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["svgElements"]; _b < _c.length; _b++) { - var entry = _c[_b]; - result.items.push({ - label: entry, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), entry), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Keyword - }); - } - } - var visited = {}; - visited[this.currentWord] = true; - var textProvider = this.styleSheet.getTextProvider(); - this.styleSheet.accept(function (n) { - if (n.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].SimpleSelector && n.length > 0) { - var selector = textProvider(n.offset, n.length); - if (selector.charAt(0) === '.' && !visited[selector]) { - visited[selector] = true; - result.items.push({ - label: selector, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(_this.getCompletionRange(existingNode), selector), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Keyword - }); - } - return false; - } - return true; - }); - if (ruleSet && ruleSet.isNested()) { - var selector = ruleSet.getSelectors().findFirstChildBeforeOffset(this.offset); - if (selector && ruleSet.getSelectors().getChildren().indexOf(selector) === 0) { - this.getPropertyProposals(null, result); - } - } - return result; - }; - CSSCompletion.prototype.getCompletionsForDeclarations = function (declarations, result) { - if (!declarations || this.offset === declarations.offset) { // incomplete nodes - return result; - } - var node = declarations.findFirstChildBeforeOffset(this.offset); - if (!node) { - return this.getCompletionsForDeclarationProperty(null, result); - } - if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["AbstractDeclaration"]) { - var declaration = node; - if (!isDefined(declaration.colonPosition) || this.offset <= declaration.colonPosition) { - // complete property - return this.getCompletionsForDeclarationProperty(declaration, result); - } - else if ((isDefined(declaration.semicolonPosition) && declaration.semicolonPosition < this.offset)) { - if (this.offset === declaration.semicolonPosition + 1) { - return result; // don't show new properties right after semicolon (see Bug 15421:[intellisense] [css] Be less aggressive when manually typing CSS) - } - // complete next property - return this.getCompletionsForDeclarationProperty(null, result); - } - if (declaration instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Declaration"]) { - // complete value - return this.getCompletionsForDeclarationValue(declaration, result); - } - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ExtendsReference"]) { - this.getCompletionsForExtendsReference(node, null, result); - } - else if (this.currentWord && this.currentWord[0] === '@') { - this.getCompletionsForDeclarationProperty(null, result); - } - return result; - }; - CSSCompletion.prototype.getCompletionsForVariableDeclaration = function (declaration, result) { - if (this.offset > declaration.colonPosition) { - this.getVariableProposals(declaration.getValue(), result); - } - return result; - }; - CSSCompletion.prototype.getCompletionsForExpression = function (expression, result) { - if (expression.getParent() instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["FunctionArgument"]) { - this.getCompletionsForFunctionArgument(expression.getParent(), expression.getParent().getParent(), result); - return result; - } - var declaration = expression.findParent(_parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Declaration); - if (!declaration) { - this.getTermProposals(null, null, result); - return result; - } - var node = expression.findChildAtOffset(this.offset, true); - if (!node) { - return this.getCompletionsForDeclarationValue(declaration, result); - } - if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NumericValue"] || node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Identifier"]) { - return this.getCompletionsForDeclarationValue(declaration, result); - } - return result; - }; - CSSCompletion.prototype.getCompletionsForFunctionArgument = function (arg, func, result) { - if (func.getIdentifier().getText() === 'var') { - if (!func.getArguments().hasChildren() || func.getArguments().getChild(0) === arg) { - this.getVariableProposalsForCSSVarFunction(result); - } - } - return result; - }; - CSSCompletion.prototype.getCompletionsForFunctionDeclaration = function (decl, result) { - var declarations = decl.getDeclarations(); - if (declarations && this.offset > declarations.offset && this.offset < declarations.end) { - this.getTermProposals(null, null, result); - } - return result; - }; - CSSCompletion.prototype.getCompletionsForMixinReference = function (ref, result) { - var allMixins = this.getSymbolContext().findSymbolsAtOffset(this.offset, _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Mixin); - for (var _i = 0, allMixins_1 = allMixins; _i < allMixins_1.length; _i++) { - var mixinSymbol = allMixins_1[_i]; - if (mixinSymbol.node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["MixinDeclaration"]) { - result.items.push(this.makeTermProposal(mixinSymbol, mixinSymbol.node.getParameters(), null)); - } - } - return result; - }; - CSSCompletion.prototype.getTermProposals = function (entry, existingNode, result) { - var allFunctions = this.getSymbolContext().findSymbolsAtOffset(this.offset, _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ReferenceType"].Function); - for (var _i = 0, allFunctions_1 = allFunctions; _i < allFunctions_1.length; _i++) { - var functionSymbol = allFunctions_1[_i]; - if (functionSymbol.node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["FunctionDeclaration"]) { - result.items.push(this.makeTermProposal(functionSymbol, functionSymbol.node.getParameters(), existingNode)); - } - } - return result; - }; - CSSCompletion.prototype.makeTermProposal = function (symbol, parameters, existingNode) { - var decl = symbol.node; - var params = parameters.getChildren().map(function (c) { - return (c instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["FunctionParameter"]) ? c.getName() : c.getText(); - }); - var insertText = symbol.name + '(' + params.map(function (p, index) { return '${' + (index + 1) + ':' + p + '}'; }).join(', ') + ')'; - return { - label: symbol.name, - detail: symbol.name + '(' + params.join(', ') + ')', - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["TextEdit"].replace(this.getCompletionRange(existingNode), insertText), - insertTextFormat: SnippetFormat, - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["CompletionItemKind"].Function, - sortText: 'z' - }; - }; - CSSCompletion.prototype.getCompletionsForSupportsCondition = function (supportsCondition, result) { - var child = supportsCondition.findFirstChildBeforeOffset(this.offset); - if (child) { - if (child instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Declaration"]) { - if (!isDefined(child.colonPosition || this.offset <= child.colonPosition)) { - return this.getCompletionsForDeclarationProperty(child, result); - } - else { - return this.getCompletionsForDeclarationValue(child, result); - } - } - else if (child instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["SupportsCondition"]) { - return this.getCompletionsForSupportsCondition(child, result); - } - } - if (isDefined(supportsCondition.lParent) && this.offset > supportsCondition.lParent && (!isDefined(supportsCondition.rParent) || this.offset <= supportsCondition.rParent)) { - return this.getCompletionsForDeclarationProperty(null, result); - } - return result; - }; - CSSCompletion.prototype.getCompletionsForSupports = function (supports, result) { - var declarations = supports.getDeclarations(); - var inInCondition = !declarations || this.offset <= declarations.offset; - if (inInCondition) { - var child = supports.findFirstChildBeforeOffset(this.offset); - if (child instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["SupportsCondition"]) { - return this.getCompletionsForSupportsCondition(child, result); - } - return result; - } - return this.getCompletionForTopLevel(result); - }; - CSSCompletion.prototype.getCompletionsForExtendsReference = function (extendsRef, existingNode, result) { - return result; - }; - CSSCompletion.prototype.getCompletionForUriLiteralValue = function (uriLiteralNode, result) { - var uriValue; - var position; - var range; - // No children, empty value - if (uriLiteralNode.getChildren().length === 0) { - uriValue = ''; - position = this.position; - var emptyURIValuePosition = this.textDocument.positionAt(uriLiteralNode.offset + 'url('.length); - range = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_4__["Range"].create(emptyURIValuePosition, emptyURIValuePosition); - } - else { - var uriValueNode = uriLiteralNode.getChild(0); - uriValue = uriValueNode.getText(); - position = this.position; - range = this.getCompletionRange(uriValueNode); - } - this.completionParticipants.forEach(function (participant) { - if (participant.onCssURILiteralValue) { - participant.onCssURILiteralValue({ - uriValue: uriValue, - position: position, - range: range - }); - } - }); - return result; - }; - CSSCompletion.prototype.getCompletionForImportPath = function (importPathNode, result) { - var _this = this; - this.completionParticipants.forEach(function (participant) { - if (participant.onCssImportPath) { - participant.onCssImportPath({ - pathValue: importPathNode.getText(), - position: _this.position, - range: _this.getCompletionRange(importPathNode) - }); - } - }); - return result; - }; - return CSSCompletion; -}()); - -var Set = /** @class */ (function () { - function Set() { - this.entries = {}; - } - Set.prototype.add = function (entry) { - this.entries[entry] = true; - }; - Set.prototype.getEntries = function () { - return Object.keys(this.entries); - }; - return Set; -}()); -function moveCursorInsideParenthesis(text) { - return text.replace(/\(\)$/, "($1)"); -} -function collectValues(styleSheet, declaration) { - var fullPropertyName = declaration.getFullPropertyName(); - var entries = new Set(); - function visitValue(node) { - if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Identifier"] || node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NumericValue"] || node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["HexColorValue"]) { - entries.add(node.getText()); - } - return true; - } - function matchesProperty(decl) { - var propertyName = decl.getFullPropertyName(); - return fullPropertyName === propertyName; - } - function vistNode(node) { - if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Declaration"] && node !== declaration) { - if (matchesProperty(node)) { - var value = node.getValue(); - if (value) { - value.accept(visitValue); - } - } - } - return true; - } - styleSheet.accept(vistNode); - return entries; -} -var ColorValueCollector = /** @class */ (function () { - function ColorValueCollector(entries, currentOffset) { - this.entries = entries; - this.currentOffset = currentOffset; - // nothing to do - } - ColorValueCollector.prototype.visitNode = function (node) { - if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["HexColorValue"] || (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Function"] && _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_2__["isColorConstructor"](node))) { - if (this.currentOffset < node.offset || node.end < this.currentOffset) { - this.entries.add(node.getText()); - } - } - return true; - }; - return ColorValueCollector; -}()); -function isDefined(obj) { - return typeof obj !== 'undefined'; -} -function getCurrentWord(document, offset) { - var i = offset - 1; - var text = document.getText(); - while (i >= 0 && ' \t\n\r":{[()]},*>+'.indexOf(text.charAt(i)) === -1) { - i--; - } - return text.substring(i + 1, offset); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssFolding.js": -/*!****************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssFolding.js ***! - \****************************************************************************************************************/ -/*! exports provided: getFoldingRanges */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFoldingRanges", function() { return getFoldingRanges; }); -/* harmony import */ var _parser_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/cssScanner.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssScanner.js"); -/* harmony import */ var _parser_scssScanner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../parser/scssScanner.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/scssScanner.js"); -/* harmony import */ var _parser_lessScanner_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../parser/lessScanner.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/lessScanner.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -function getFoldingRanges(document, context) { - var ranges = computeFoldingRanges(document); - return limitFoldingRanges(ranges, context); -} -function computeFoldingRanges(document) { - function getStartLine(t) { - return document.positionAt(t.offset).line; - } - function getEndLine(t) { - return document.positionAt(t.offset + t.len).line; - } - function getScanner() { - switch (document.languageId) { - case 'scss': - return new _parser_scssScanner_js__WEBPACK_IMPORTED_MODULE_1__["SCSSScanner"](); - case 'less': - return new _parser_lessScanner_js__WEBPACK_IMPORTED_MODULE_2__["LESSScanner"](); - default: - return new _parser_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["Scanner"](); - } - } - function tokenToRange(t, kind) { - var startLine = getStartLine(t); - var endLine = getEndLine(t); - if (startLine !== endLine) { - return { - startLine: startLine, - endLine: endLine, - kind: kind - }; - } - else { - return null; - } - } - var ranges = []; - var delimiterStack = []; - var scanner = getScanner(); - scanner.ignoreComment = false; - scanner.setSource(document.getText()); - var token = scanner.scan(); - var prevToken; - var _loop_1 = function () { - switch (token.type) { - case _parser_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyL: - case _parser_scssScanner_js__WEBPACK_IMPORTED_MODULE_1__["InterpolationFunction"]: - { - delimiterStack.push({ line: getStartLine(token), type: 'brace', isStart: true }); - break; - } - case _parser_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].CurlyR: { - if (delimiterStack.length !== 0) { - var prevDelimiter = popPrevStartDelimiterOfType(delimiterStack, 'brace'); - if (!prevDelimiter) { - break; - } - var endLine = getEndLine(token); - if (prevDelimiter.type === 'brace') { - /** - * Other than the case when curly brace is not on a new line by itself, for example - * .foo { - * color: red; } - * Use endLine minus one to show ending curly brace - */ - if (getEndLine(prevToken) !== endLine) { - endLine--; - } - if (prevDelimiter.line !== endLine) { - ranges.push({ - startLine: prevDelimiter.line, - endLine: endLine, - kind: undefined - }); - } - } - } - break; - } - /** - * In CSS, there is no single line comment prefixed with // - * All comments are marked as `Comment` - */ - case _parser_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].Comment: { - var commentRegionMarkerToDelimiter_1 = function (marker) { - if (marker === '#region') { - return { line: getStartLine(token), type: 'comment', isStart: true }; - } - else { - return { line: getEndLine(token), type: 'comment', isStart: false }; - } - }; - var getCurrDelimiter = function (token) { - var matches = token.text.match(/^\s*\/\*\s*(#region|#endregion)\b\s*(.*?)\s*\*\//); - if (matches) { - return commentRegionMarkerToDelimiter_1(matches[1]); - } - else if (document.languageId === 'scss' || document.languageId === 'less') { - var matches_1 = token.text.match(/^\s*\/\/\s*(#region|#endregion)\b\s*(.*?)\s*/); - if (matches_1) { - return commentRegionMarkerToDelimiter_1(matches_1[1]); - } - } - return null; - }; - var currDelimiter = getCurrDelimiter(token); - // /* */ comment region folding - // All #region and #endregion cases - if (currDelimiter) { - if (currDelimiter.isStart) { - delimiterStack.push(currDelimiter); - } - else { - var prevDelimiter = popPrevStartDelimiterOfType(delimiterStack, 'comment'); - if (!prevDelimiter) { - break; - } - if (prevDelimiter.type === 'comment') { - if (prevDelimiter.line !== currDelimiter.line) { - ranges.push({ - startLine: prevDelimiter.line, - endLine: currDelimiter.line, - kind: 'region' - }); - } - } - } - } - // Multiline comment case - else { - var range = tokenToRange(token, 'comment'); - if (range) { - ranges.push(range); - } - } - break; - } - } - prevToken = token; - token = scanner.scan(); - }; - while (token.type !== _parser_cssScanner_js__WEBPACK_IMPORTED_MODULE_0__["TokenType"].EOF) { - _loop_1(); - } - return ranges; -} -function popPrevStartDelimiterOfType(stack, type) { - if (stack.length === 0) { - return null; - } - for (var i = stack.length - 1; i >= 0; i--) { - if (stack[i].type === type && stack[i].isStart) { - return stack.splice(i, 1)[0]; - } - } - return null; -} -/** - * - Sort regions - * - Remove invalid regions (intersections) - * - If limit exceeds, only return `rangeLimit` amount of ranges - */ -function limitFoldingRanges(ranges, context) { - var maxRanges = context && context.rangeLimit || Number.MAX_VALUE; - var sortedRanges = ranges.sort(function (r1, r2) { - var diff = r1.startLine - r2.startLine; - if (diff === 0) { - diff = r1.endLine - r2.endLine; - } - return diff; - }); - var validRanges = []; - var prevEndLine = -1; - sortedRanges.forEach(function (r) { - if (!(r.startLine < prevEndLine && prevEndLine < r.endLine)) { - validRanges.push(r); - prevEndLine = r.endLine; - } - }); - if (validRanges.length < maxRanges) { - return validRanges; - } - else { - return validRanges.slice(0, maxRanges); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssHover.js": -/*!**************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssHover.js ***! - \**************************************************************************************************************/ -/*! exports provided: CSSHover */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CSSHover", function() { return CSSHover; }); -/* harmony import */ var _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/cssNodes.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js"); -/* harmony import */ var _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../languageFacts/facts.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/facts.js"); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _selectorPrinting_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./selectorPrinting.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/selectorPrinting.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -var CSSHover = /** @class */ (function () { - function CSSHover() { - } - CSSHover.prototype.doHover = function (document, position, stylesheet) { - function getRange(node) { - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["Range"].create(document.positionAt(node.offset), document.positionAt(node.end)); - } - var offset = document.offsetAt(position); - var nodepath = _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["getNodePath"](stylesheet, offset); - for (var i = 0; i < nodepath.length; i++) { - var node = nodepath[i]; - if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Selector"]) { - return { - contents: Object(_selectorPrinting_js__WEBPACK_IMPORTED_MODULE_3__["selectorToMarkedString"])(node), - range: getRange(node) - }; - } - if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["SimpleSelector"]) { - return { - contents: Object(_selectorPrinting_js__WEBPACK_IMPORTED_MODULE_3__["simpleSelectorToMarkedString"])(node), - range: getRange(node) - }; - } - if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Declaration"]) { - var propertyName = node.getFullPropertyName(); - var entry = _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_1__["cssDataManager"].getProperty(propertyName); - if (entry) { - var contents = []; - if (entry.description) { - contents.push(_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["MarkedString"].fromPlainText(entry.description)); - } - var browserLabel = _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_1__["getBrowserLabel"](entry.browsers); - if (browserLabel) { - contents.push(_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["MarkedString"].fromPlainText(browserLabel)); - } - if (contents.length) { - return { - contents: contents, - range: getRange(node) - }; - } - } - } - } - return null; - }; - return CSSHover; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssNavigation.js": -/*!*******************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssNavigation.js ***! - \*******************************************************************************************************************/ -/*! exports provided: CSSNavigation */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CSSNavigation", function() { return CSSNavigation; }); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./node_modules/monaco-editor/esm/vs/language/css/fillers/vscode-nls.js"); -/* harmony import */ var _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../parser/cssNodes.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js"); -/* harmony import */ var _parser_cssSymbolScope_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../parser/cssSymbolScope.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssSymbolScope.js"); -/* harmony import */ var _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../languageFacts/facts.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/facts.js"); -/* harmony import */ var _utils_strings_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/strings.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/utils/strings.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_1__["loadMessageBundle"](); -var CSSNavigation = /** @class */ (function () { - function CSSNavigation() { - } - CSSNavigation.prototype.findDefinition = function (document, position, stylesheet) { - var symbols = new _parser_cssSymbolScope_js__WEBPACK_IMPORTED_MODULE_3__["Symbols"](stylesheet); - var offset = document.offsetAt(position); - var node = _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["getNodeAtOffset"](stylesheet, offset); - if (!node) { - return null; - } - var symbol = symbols.findSymbolFromNode(node); - if (!symbol) { - return null; - } - return { - uri: document.uri, - range: getRange(symbol.node, document) - }; - }; - CSSNavigation.prototype.findReferences = function (document, position, stylesheet) { - var highlights = this.findDocumentHighlights(document, position, stylesheet); - return highlights.map(function (h) { - return { - uri: document.uri, - range: h.range - }; - }); - }; - CSSNavigation.prototype.findDocumentHighlights = function (document, position, stylesheet) { - var result = []; - var offset = document.offsetAt(position); - var node = _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["getNodeAtOffset"](stylesheet, offset); - if (!node || node.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].Stylesheet || node.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].Declarations) { - return result; - } - if (node.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].Identifier && node.parent && node.parent.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].ClassSelector) { - node = node.parent; - } - var symbols = new _parser_cssSymbolScope_js__WEBPACK_IMPORTED_MODULE_3__["Symbols"](stylesheet); - var symbol = symbols.findSymbolFromNode(node); - var name = node.getText(); - stylesheet.accept(function (candidate) { - if (symbol) { - if (symbols.matchesSymbol(candidate, symbol)) { - result.push({ - kind: getHighlightKind(candidate), - range: getRange(candidate, document) - }); - return false; - } - } - else if (node.type === candidate.type && node.length === candidate.length && name === candidate.getText()) { - // Same node type and data - result.push({ - kind: getHighlightKind(candidate), - range: getRange(candidate, document) - }); - } - return true; - }); - return result; - }; - CSSNavigation.prototype.findDocumentLinks = function (document, stylesheet, documentContext) { - var result = []; - stylesheet.accept(function (candidate) { - if (candidate.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].URILiteral) { - var link = uriLiteralNodeToDocumentLink(document, candidate, documentContext); - if (link) { - result.push(link); - } - return false; - } - /** - * In @import, it is possible to include links that do not use `url()` - * For example, `@import 'foo.css';` - */ - if (candidate.parent && candidate.parent.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].Import) { - var rawText = candidate.getText(); - if (Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_5__["startsWith"])(rawText, "'") || Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_5__["startsWith"])(rawText, "\"")) { - result.push(uriStringNodeToDocumentLink(document, candidate, documentContext)); - } - return false; - } - return true; - }); - return result; - }; - CSSNavigation.prototype.findDocumentSymbols = function (document, stylesheet) { - var result = []; - stylesheet.accept(function (node) { - var entry = { - name: null, - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["SymbolKind"].Class, - location: null - }; - var locationNode = node; - if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["Selector"]) { - entry.name = node.getText(); - locationNode = node.findAParent(_parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].Ruleset, _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].ExtendsReference); - if (locationNode) { - entry.location = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Location"].create(document.uri, getRange(locationNode, document)); - result.push(entry); - } - return false; - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["VariableDeclaration"]) { - entry.name = node.getName(); - entry.kind = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["SymbolKind"].Variable; - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["MixinDeclaration"]) { - entry.name = node.getName(); - entry.kind = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["SymbolKind"].Method; - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["FunctionDeclaration"]) { - entry.name = node.getName(); - entry.kind = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["SymbolKind"].Function; - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["Keyframe"]) { - entry.name = localize('literal.keyframes', "@keyframes {0}", node.getName()); - } - else if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["FontFace"]) { - entry.name = localize('literal.fontface', "@font-face"); - } - if (entry.name) { - entry.location = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Location"].create(document.uri, getRange(locationNode, document)); - result.push(entry); - } - return true; - }); - return result; - }; - CSSNavigation.prototype.findDocumentColors = function (document, stylesheet) { - var result = []; - stylesheet.accept(function (node) { - var colorInfo = getColorInformation(node, document); - if (colorInfo) { - result.push(colorInfo); - } - return true; - }); - return result; - }; - CSSNavigation.prototype.getColorPresentations = function (document, stylesheet, color, range) { - var result = []; - var red256 = Math.round(color.red * 255), green256 = Math.round(color.green * 255), blue256 = Math.round(color.blue * 255); - var label; - if (color.alpha === 1) { - label = "rgb(" + red256 + ", " + green256 + ", " + blue256 + ")"; - } - else { - label = "rgba(" + red256 + ", " + green256 + ", " + blue256 + ", " + color.alpha + ")"; - } - result.push({ label: label, textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextEdit"].replace(range, label) }); - if (color.alpha === 1) { - label = "#" + toTwoDigitHex(red256) + toTwoDigitHex(green256) + toTwoDigitHex(blue256); - } - else { - label = "#" + toTwoDigitHex(red256) + toTwoDigitHex(green256) + toTwoDigitHex(blue256) + toTwoDigitHex(Math.round(color.alpha * 255)); - } - result.push({ label: label, textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextEdit"].replace(range, label) }); - var hsl = Object(_languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_4__["hslFromColor"])(color); - if (hsl.a === 1) { - label = "hsl(" + hsl.h + ", " + Math.round(hsl.s * 100) + "%, " + Math.round(hsl.l * 100) + "%)"; - } - else { - label = "hsla(" + hsl.h + ", " + Math.round(hsl.s * 100) + "%, " + Math.round(hsl.l * 100) + "%, " + hsl.a + ")"; - } - result.push({ label: label, textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextEdit"].replace(range, label) }); - return result; - }; - CSSNavigation.prototype.doRename = function (document, position, newName, stylesheet) { - var _a; - var highlights = this.findDocumentHighlights(document, position, stylesheet); - var edits = highlights.map(function (h) { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextEdit"].replace(h.range, newName); }); - return { - changes: (_a = {}, _a[document.uri] = edits, _a) - }; - }; - return CSSNavigation; -}()); - -function getColorInformation(node, document) { - var color = Object(_languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_4__["getColorValue"])(node); - if (color) { - var range = getRange(node, document); - return { color: color, range: range }; - } - return null; -} -function uriLiteralNodeToDocumentLink(document, uriLiteralNode, documentContext) { - if (uriLiteralNode.getChildren().length === 0) { - return null; - } - var uriStringNode = uriLiteralNode.getChild(0); - return uriStringNodeToDocumentLink(document, uriStringNode, documentContext); -} -function uriStringNodeToDocumentLink(document, uriStringNode, documentContext) { - var rawUri = uriStringNode.getText(); - var range = getRange(uriStringNode, document); - // Make sure the range is not empty - if (range.start.line === range.end.line && range.start.character === range.end.character) { - return null; - } - if (Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_5__["startsWith"])(rawUri, "'") || Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_5__["startsWith"])(rawUri, "\"")) { - rawUri = rawUri.slice(1, -1); - } - var target; - if (Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_5__["startsWith"])(rawUri, 'http://') || Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_5__["startsWith"])(rawUri, 'https://')) { - target = rawUri; - } - else if (/^\w+:\/\//g.test(rawUri)) { - target = rawUri; - } - else { - /** - * In SCSS, @import 'foo' could be referring to `_foo.scss`, if none of the following is true: - * - The file's extension is .css. - * - The filename begins with http://. - * - The filename is a url(). - * - The @import has any media queries. - */ - if (document.languageId === 'scss') { - if (!Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_5__["endsWith"])(rawUri, '.css') && - !Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_5__["startsWith"])(rawUri, 'http://') && !Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_5__["startsWith"])(rawUri, 'https://') && - !(uriStringNode.parent && uriStringNode.parent.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].URILiteral) && - uriStringNode.parent.getChildren().length === 1) { - target = toScssPartialUri(documentContext.resolveReference(rawUri, document.uri)); - } - else { - target = documentContext.resolveReference(rawUri, document.uri); - } - } - else { - target = documentContext.resolveReference(rawUri, document.uri); - } - } - return { - range: range, - target: target - }; -} -function toScssPartialUri(uri) { - return uri.replace(/\/(\w+)(.scss)?$/gm, function (match, fileName) { - return '/_' + fileName + '.scss'; - }); -} -function getRange(node, document) { - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Range"].create(document.positionAt(node.offset), document.positionAt(node.end)); -} -function getHighlightKind(node) { - if (node.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].Selector) { - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["DocumentHighlightKind"].Write; - } - if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["Identifier"]) { - if (node.parent && node.parent instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["Property"]) { - if (node.isCustomProperty) { - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["DocumentHighlightKind"].Write; - } - } - } - if (node.parent) { - switch (node.parent.type) { - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].FunctionDeclaration: - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].MixinDeclaration: - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].Keyframe: - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].VariableDeclaration: - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].FunctionParameter: - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["DocumentHighlightKind"].Write; - } - } - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["DocumentHighlightKind"].Read; -} -function toTwoDigitHex(n) { - var r = n.toString(16); - return r.length !== 2 ? '0' + r : r; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssSelectionRange.js": -/*!***********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssSelectionRange.js ***! - \***********************************************************************************************************************/ -/*! exports provided: getSelectionRanges */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectionRanges", function() { return getSelectionRanges; }); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../parser/cssNodes.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js"); -/* harmony import */ var _cssLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../cssLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/cssLanguageTypes.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -function getSelectionRanges(document, positions, stylesheet) { - function getSelectionRange(position) { - var applicableRanges = getApplicableRanges(position); - var ranges = applicableRanges.map(function (pair) { - return { - range: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Range"].create(document.positionAt(pair[0]), document.positionAt(pair[1])), - kind: _cssLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["SelectionRangeKind"].Statement - }; - }); - return ranges; - } - return positions.map(getSelectionRange); - function getApplicableRanges(position) { - var currNode = stylesheet.findChildAtOffset(document.offsetAt(position), true); - if (!currNode) { - return []; - } - var result = []; - while (currNode) { - if (currNode.parent && - currNode.offset === currNode.parent.offset && - currNode.end === currNode.parent.end) { - currNode = currNode.parent; - continue; - } - if (currNode.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["NodeType"].Declarations) { - result.push([currNode.offset + 1, currNode.end - 1]); - } - else { - result.push([currNode.offset, currNode.end]); - } - currNode = currNode.parent; - } - return result; - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssValidation.js": -/*!*******************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssValidation.js ***! - \*******************************************************************************************************************/ -/*! exports provided: CSSValidation */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CSSValidation", function() { return CSSValidation; }); -/* harmony import */ var _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/cssNodes.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js"); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _lintRules_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lintRules.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lintRules.js"); -/* harmony import */ var _lint_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lint.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lint.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -var CSSValidation = /** @class */ (function () { - function CSSValidation() { - } - CSSValidation.prototype.configure = function (settings) { - this.settings = settings; - }; - CSSValidation.prototype.doValidation = function (document, stylesheet, settings) { - if (settings === void 0) { settings = this.settings; } - if (settings && settings.validate === false) { - return []; - } - var entries = []; - entries.push.apply(entries, _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["ParseErrorCollector"].entries(stylesheet)); - entries.push.apply(entries, _lint_js__WEBPACK_IMPORTED_MODULE_3__["LintVisitor"].entries(stylesheet, document, new _lintRules_js__WEBPACK_IMPORTED_MODULE_2__["LintConfigurationSettings"](settings && settings.lint))); - var ruleIds = []; - for (var r in _lintRules_js__WEBPACK_IMPORTED_MODULE_2__["Rules"]) { - ruleIds.push(_lintRules_js__WEBPACK_IMPORTED_MODULE_2__["Rules"][r].id); - } - function toDiagnostic(marker) { - var range = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["Range"].create(document.positionAt(marker.getOffset()), document.positionAt(marker.getOffset() + marker.getLength())); - var source = document.languageId; - return { - code: marker.getRule().id, - source: source, - message: marker.getMessage(), - severity: marker.getLevel() === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Level"].Warning ? _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["DiagnosticSeverity"].Warning : _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["DiagnosticSeverity"].Error, - range: range - }; - } - return entries.filter(function (entry) { return entry.getLevel() !== _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Level"].Ignore; }).map(toDiagnostic); - }; - return CSSValidation; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lessCompletion.js": -/*!********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lessCompletion.js ***! - \********************************************************************************************************************/ -/*! exports provided: LESSCompletion */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LESSCompletion", function() { return LESSCompletion; }); -/* harmony import */ var _cssCompletion_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cssCompletion.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssCompletion.js"); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./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. - *--------------------------------------------------------------------------------------------*/ - -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_2__["loadMessageBundle"](); -var LESSCompletion = /** @class */ (function (_super) { - __extends(LESSCompletion, _super); - function LESSCompletion() { - return _super.call(this, '@') || this; - } - LESSCompletion.prototype.createFunctionProposals = function (proposals, existingNode, sortToEnd, result) { - for (var _i = 0, proposals_1 = proposals; _i < proposals_1.length; _i++) { - var p = proposals_1[_i]; - var item = { - label: p.name, - detail: p.example, - documentation: p.description, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["TextEdit"].replace(this.getCompletionRange(existingNode), p.name + '($0)'), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["InsertTextFormat"].Snippet, - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["CompletionItemKind"].Function - }; - if (sortToEnd) { - item.sortText = 'z'; - } - result.items.push(item); - } - return result; - }; - LESSCompletion.prototype.getTermProposals = function (entry, existingNode, result) { - var functions = LESSCompletion.builtInProposals; - if (entry) { - functions = functions.filter(function (f) { return !f.type || entry.restrictions.indexOf(f.type) !== -1; }); - } - this.createFunctionProposals(functions, existingNode, true, result); - return _super.prototype.getTermProposals.call(this, entry, existingNode, result); - }; - LESSCompletion.prototype.getColorProposals = function (entry, existingNode, result) { - this.createFunctionProposals(LESSCompletion.colorProposals, existingNode, false, result); - return _super.prototype.getColorProposals.call(this, entry, existingNode, result); - }; - LESSCompletion.prototype.getCompletionsForDeclarationProperty = function (declaration, result) { - this.getCompletionsForSelector(null, true, result); - return _super.prototype.getCompletionsForDeclarationProperty.call(this, declaration, result); - }; - LESSCompletion.builtInProposals = [ - // Boolean functions - { - 'name': 'if', - 'example': 'if(condition, trueValue [, falseValue]);', - 'description': localize('less.builtin.if', 'returns one of two values depending on a condition.') - }, - { - 'name': 'boolean', - 'example': 'boolean(condition);', - 'description': localize('less.builtin.boolean', '"store" a boolean test for later evaluation in a guard or if().') - }, - // List functions - { - 'name': 'length', - 'example': 'length(@list);', - 'description': localize('less.builtin.length', 'returns the number of elements in a value list') - }, - { - 'name': 'extract', - 'example': 'extract(@list, index);', - 'description': localize('less.builtin.extract', 'returns a value at the specified position in the list') - }, - { - 'name': 'range', - 'example': 'range([start, ] end [, step]);', - 'description': localize('less.builtin.range', 'generate a list spanning a range of values') - }, - { - 'name': 'each', - 'example': 'each(@list, ruleset);', - 'description': localize('less.builtin.each', 'bind the evaluation of a ruleset to each member of a list.') - }, - // Other built-ins - { - 'name': 'escape', - 'example': 'escape(@string);', - 'description': localize('less.builtin.escape', 'URL encodes a string') - }, - { - 'name': 'e', - 'example': 'e(@string);', - 'description': localize('less.builtin.e', 'escape string content') - }, - { - 'name': 'replace', - 'example': 'replace(@string, @pattern, @replacement[, @flags]);', - 'description': localize('less.builtin.replace', 'string replace') - }, - { - 'name': 'unit', - 'example': 'unit(@dimension, [@unit: \'\']);', - 'description': localize('less.builtin.unit', 'remove or change the unit of a dimension') - }, - { - 'name': 'color', - 'example': 'color(@string);', - 'description': localize('less.builtin.color', 'parses a string to a color'), - 'type': 'color' - }, - { - 'name': 'convert', - 'example': 'convert(@value, unit);', - 'description': localize('less.builtin.convert', 'converts numbers from one type into another') - }, - { - 'name': 'data-uri', - 'example': 'data-uri([mimetype,] url);', - 'description': localize('less.builtin.data-uri', 'inlines a resource and falls back to `url()`'), - 'type': 'url' - }, - { - 'name': 'abs', - 'description': localize('less.builtin.abs', 'absolute value of a number'), - 'example': 'abs(number);' - }, - { - 'name': 'acos', - 'description': localize('less.builtin.acos', 'arccosine - inverse of cosine function'), - 'example': 'acos(number);' - }, - { - 'name': 'asin', - 'description': localize('less.builtin.asin', 'arcsine - inverse of sine function'), - 'example': 'asin(number);' - }, - { - 'name': 'ceil', - 'example': 'ceil(@number);', - 'description': localize('less.builtin.ceil', 'rounds up to an integer') - }, - { - 'name': 'cos', - 'description': localize('less.builtin.cos', 'cosine function'), - 'example': 'cos(number);' - }, - { - 'name': 'floor', - 'description': localize('less.builtin.floor', 'rounds down to an integer'), - 'example': 'floor(@number);' - }, - { - 'name': 'percentage', - 'description': localize('less.builtin.percentage', 'converts to a %, e.g. 0.5 > 50%'), - 'example': 'percentage(@number);', - 'type': 'percentage' - }, - { - 'name': 'round', - 'description': localize('less.builtin.round', 'rounds a number to a number of places'), - 'example': 'round(number, [places: 0]);' - }, - { - 'name': 'sqrt', - 'description': localize('less.builtin.sqrt', 'calculates square root of a number'), - 'example': 'sqrt(number);' - }, - { - 'name': 'sin', - 'description': localize('less.builtin.sin', 'sine function'), - 'example': 'sin(number);' - }, - { - 'name': 'tan', - 'description': localize('less.builtin.tan', 'tangent function'), - 'example': 'tan(number);' - }, - { - 'name': 'atan', - 'description': localize('less.builtin.atan', 'arctangent - inverse of tangent function'), - 'example': 'atan(number);' - }, - { - 'name': 'pi', - 'description': localize('less.builtin.pi', 'returns pi'), - 'example': 'pi();' - }, - { - 'name': 'pow', - 'description': localize('less.builtin.pow', 'first argument raised to the power of the second argument'), - 'example': 'pow(@base, @exponent);' - }, - { - 'name': 'mod', - 'description': localize('less.builtin.mod', 'first argument modulus second argument'), - 'example': 'mod(number, number);' - }, - { - 'name': 'min', - 'description': localize('less.builtin.min', 'returns the lowest of one or more values'), - 'example': 'min(@x, @y);' - }, - { - 'name': 'max', - 'description': localize('less.builtin.max', 'returns the lowest of one or more values'), - 'example': 'max(@x, @y);' - } - ]; - LESSCompletion.colorProposals = [ - { - 'name': 'argb', - 'example': 'argb(@color);', - 'description': localize('less.builtin.argb', 'creates a #AARRGGBB') - }, - { - 'name': 'hsl', - 'example': 'hsl(@hue, @saturation, @lightness);', - 'description': localize('less.builtin.hsl', 'creates a color') - }, - { - 'name': 'hsla', - 'example': 'hsla(@hue, @saturation, @lightness, @alpha);', - 'description': localize('less.builtin.hsla', 'creates a color') - }, - { - 'name': 'hsv', - 'example': 'hsv(@hue, @saturation, @value);', - 'description': localize('less.builtin.hsv', 'creates a color') - }, - { - 'name': 'hsva', - 'example': 'hsva(@hue, @saturation, @value, @alpha);', - 'description': localize('less.builtin.hsva', 'creates a color') - }, - { - 'name': 'hue', - 'example': 'hue(@color);', - 'description': localize('less.builtin.hue', 'returns the `hue` channel of `@color` in the HSL space') - }, - { - 'name': 'saturation', - 'example': 'saturation(@color);', - 'description': localize('less.builtin.saturation', 'returns the `saturation` channel of `@color` in the HSL space') - }, - { - 'name': 'lightness', - 'example': 'lightness(@color);', - 'description': localize('less.builtin.lightness', 'returns the `lightness` channel of `@color` in the HSL space') - }, - { - 'name': 'hsvhue', - 'example': 'hsvhue(@color);', - 'description': localize('less.builtin.hsvhue', 'returns the `hue` channel of `@color` in the HSV space') - }, - { - 'name': 'hsvsaturation', - 'example': 'hsvsaturation(@color);', - 'description': localize('less.builtin.hsvsaturation', 'returns the `saturation` channel of `@color` in the HSV space') - }, - { - 'name': 'hsvvalue', - 'example': 'hsvvalue(@color);', - 'description': localize('less.builtin.hsvvalue', 'returns the `value` channel of `@color` in the HSV space') - }, - { - 'name': 'red', - 'example': 'red(@color);', - 'description': localize('less.builtin.red', 'returns the `red` channel of `@color`') - }, - { - 'name': 'green', - 'example': 'green(@color);', - 'description': localize('less.builtin.green', 'returns the `green` channel of `@color`') - }, - { - 'name': 'blue', - 'example': 'blue(@color);', - 'description': localize('less.builtin.blue', 'returns the `blue` channel of `@color`') - }, - { - 'name': 'alpha', - 'example': 'alpha(@color);', - 'description': localize('less.builtin.alpha', 'returns the `alpha` channel of `@color`') - }, - { - 'name': 'luma', - 'example': 'luma(@color);', - 'description': localize('less.builtin.luma', 'returns the `luma` value (perceptual brightness) of `@color`') - }, - { - 'name': 'saturate', - 'example': 'saturate(@color, 10%);', - 'description': localize('less.builtin.saturate', 'return `@color` 10% points more saturated') - }, - { - 'name': 'desaturate', - 'example': 'desaturate(@color, 10%);', - 'description': localize('less.builtin.desaturate', 'return `@color` 10% points less saturated') - }, - { - 'name': 'lighten', - 'example': 'lighten(@color, 10%);', - 'description': localize('less.builtin.lighten', 'return `@color` 10% points lighter') - }, - { - 'name': 'darken', - 'example': 'darken(@color, 10%);', - 'description': localize('less.builtin.darken', 'return `@color` 10% points darker') - }, - { - 'name': 'fadein', - 'example': 'fadein(@color, 10%);', - 'description': localize('less.builtin.fadein', 'return `@color` 10% points less transparent') - }, - { - 'name': 'fadeout', - 'example': 'fadeout(@color, 10%);', - 'description': localize('less.builtin.fadeout', 'return `@color` 10% points more transparent') - }, - { - 'name': 'fade', - 'example': 'fade(@color, 50%);', - 'description': localize('less.builtin.fade', 'return `@color` with 50% transparency') - }, - { - 'name': 'spin', - 'example': 'spin(@color, 10);', - 'description': localize('less.builtin.spin', 'return `@color` with a 10 degree larger in hue') - }, - { - 'name': 'mix', - 'example': 'mix(@color1, @color2, [@weight: 50%]);', - 'description': localize('less.builtin.mix', 'return a mix of `@color1` and `@color2`') - }, - { - 'name': 'greyscale', - 'example': 'greyscale(@color);', - 'description': localize('less.builtin.greyscale', 'returns a grey, 100% desaturated color'), - }, - { - 'name': 'contrast', - 'example': 'contrast(@color1, [@darkcolor: black], [@lightcolor: white], [@threshold: 43%]);', - 'description': localize('less.builtin.contrast', 'return `@darkcolor` if `@color1 is> 43% luma` otherwise return `@lightcolor`, see notes') - }, - { - 'name': 'multiply', - 'example': 'multiply(@color1, @color2);' - }, - { - 'name': 'screen', - 'example': 'screen(@color1, @color2);' - }, - { - 'name': 'overlay', - 'example': 'overlay(@color1, @color2);' - }, - { - 'name': 'softlight', - 'example': 'softlight(@color1, @color2);' - }, - { - 'name': 'hardlight', - 'example': 'hardlight(@color1, @color2);' - }, - { - 'name': 'difference', - 'example': 'difference(@color1, @color2);' - }, - { - 'name': 'exclusion', - 'example': 'exclusion(@color1, @color2);' - }, - { - 'name': 'average', - 'example': 'average(@color1, @color2);' - }, - { - 'name': 'negation', - 'example': 'negation(@color1, @color2);' - } - ]; - return LESSCompletion; -}(_cssCompletion_js__WEBPACK_IMPORTED_MODULE_0__["CSSCompletion"])); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lint.js": -/*!**********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lint.js ***! - \**********************************************************************************************************/ -/*! exports provided: LintVisitor */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LintVisitor", function() { return LintVisitor; }); -/* harmony import */ var _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../languageFacts/facts.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/languageFacts/facts.js"); -/* harmony import */ var _lintRules_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lintRules.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lintRules.js"); -/* harmony import */ var _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../parser/cssNodes.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js"); -/* harmony import */ var _lintUtil_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lintUtil.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lintUtil.js"); -/* harmony import */ var _utils_arrays_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/arrays.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/utils/arrays.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./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. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_5__["loadMessageBundle"](); -var NodesByRootMap = /** @class */ (function () { - function NodesByRootMap() { - this.data = {}; - } - NodesByRootMap.prototype.add = function (root, name, node) { - var entry = this.data[root]; - if (!entry) { - entry = { nodes: [], names: [] }; - this.data[root] = entry; - } - entry.names.push(name); - if (node) { - entry.nodes.push(node); - } - }; - return NodesByRootMap; -}()); -var LintVisitor = /** @class */ (function () { - function LintVisitor(document, settings) { - var _this = this; - this.warnings = []; - this.settings = settings; - this.documentText = document.getText(); - this.keyframes = new NodesByRootMap(); - this.validProperties = {}; - var properties = settings.getSetting(_lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Settings"].ValidProperties); - if (Array.isArray(properties)) { - properties.forEach(function (p) { - if (typeof p === 'string') { - var name = p.trim().toLowerCase(); - if (name.length) { - _this.validProperties[name] = true; - } - } - }); - } - } - LintVisitor.entries = function (node, document, settings, entryFilter) { - var visitor = new LintVisitor(document, settings); - node.acceptVisitor(visitor); - visitor.completeValidations(); - return visitor.getEntries(entryFilter); - }; - LintVisitor.prototype.isValidPropertyDeclaration = function (decl) { - var propertyName = decl.getFullPropertyName().toLowerCase(); - return this.validProperties[propertyName]; - }; - LintVisitor.prototype.fetch = function (input, s) { - var elements = []; - for (var _i = 0, input_1 = input; _i < input_1.length; _i++) { - var curr = input_1[_i]; - if (curr.name === s) { - elements.push(curr); - } - } - return elements; - }; - LintVisitor.prototype.fetchWithValue = function (input, s, v) { - var elements = []; - for (var _i = 0, input_2 = input; _i < input_2.length; _i++) { - var inputElement = input_2[_i]; - if (inputElement.name === s) { - var expression = inputElement.node.getValue(); - if (expression && this.findValueInExpression(expression, v)) { - elements.push(inputElement); - } - } - } - return elements; - }; - LintVisitor.prototype.findValueInExpression = function (expression, v) { - var found = false; - expression.accept(function (node) { - if (node.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].Identifier && node.getText() === v) { - found = true; - } - return !found; - }); - return found; - }; - LintVisitor.prototype.getEntries = function (filter) { - if (filter === void 0) { filter = (_parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["Level"].Warning | _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["Level"].Error); } - return this.warnings.filter(function (entry) { - return (entry.getLevel() & filter) !== 0; - }); - }; - LintVisitor.prototype.addEntry = function (node, rule, details) { - var entry = new _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["Marker"](node, rule, this.settings.getRule(rule), details); - this.warnings.push(entry); - }; - LintVisitor.prototype.getMissingNames = function (expected, actual) { - expected = expected.slice(0); // clone - for (var i = 0; i < actual.length; i++) { - var k = expected.indexOf(actual[i]); - if (k !== -1) { - expected[k] = null; - } - } - var result = null; - for (var i = 0; i < expected.length; i++) { - var curr = expected[i]; - if (curr) { - if (result === null) { - result = localize('namelist.single', "'{0}'", curr); - } - else { - result = localize('namelist.concatenated', "{0}, '{1}'", result, curr); - } - } - } - return result; - }; - LintVisitor.prototype.visitNode = function (node) { - switch (node.type) { - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].UnknownAtRule: - return this.visitUnknownAtRule(node); - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].Keyframe: - return this.visitKeyframe(node); - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].FontFace: - return this.visitFontFace(node); - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].Ruleset: - return this.visitRuleSet(node); - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].SimpleSelector: - return this.visitSimpleSelector(node); - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].Function: - return this.visitFunction(node); - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].NumericValue: - return this.visitNumericValue(node); - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].Import: - return this.visitImport(node); - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].HexColorValue: - return this.visitHexColorValue(node); - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].Prio: - return this.visitPrio(node); - } - return true; - }; - LintVisitor.prototype.completeValidations = function () { - this.validateKeyframes(); - }; - LintVisitor.prototype.visitUnknownAtRule = function (node) { - var atRuleName = node.getChild(0); - if (!atRuleName) { - return false; - } - this.addEntry(atRuleName, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].UnknownAtRules, "Unknown at rule " + atRuleName.getText()); - return true; - }; - LintVisitor.prototype.visitKeyframe = function (node) { - var keyword = node.getKeyword(); - var text = keyword.getText(); - this.keyframes.add(node.getName(), text, (text !== '@keyframes') ? keyword : null); - return true; - }; - LintVisitor.prototype.validateKeyframes = function () { - // @keyframe and it's vendor specific alternatives - // @keyframe should be included - var expected = ['@-webkit-keyframes', '@-moz-keyframes', '@-o-keyframes']; - for (var name in this.keyframes.data) { - var actual = this.keyframes.data[name].names; - var needsStandard = (actual.indexOf('@keyframes') === -1); - if (!needsStandard && actual.length === 1) { - continue; // only the non-vendor specific keyword is used, that's fine, no warning - } - var missingVendorSpecific = this.getMissingNames(expected, actual); - if (missingVendorSpecific || needsStandard) { - for (var _i = 0, _a = this.keyframes.data[name].nodes; _i < _a.length; _i++) { - var node = _a[_i]; - if (needsStandard) { - var message = localize('keyframes.standardrule.missing', "Always define standard rule '@keyframes' when defining keyframes."); - this.addEntry(node, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].IncludeStandardPropertyWhenUsingVendorPrefix, message); - } - if (missingVendorSpecific) { - var message = localize('keyframes.vendorspecific.missing', "Always include all vendor specific rules: Missing: {0}", missingVendorSpecific); - this.addEntry(node, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].AllVendorPrefixes, message); - } - } - } - } - return true; - }; - LintVisitor.prototype.visitSimpleSelector = function (node) { - var firstChar = this.documentText.charAt(node.offset); - ///////////////////////////////////////////////////////////// - // Lint - The universal selector (*) is known to be slow. - ///////////////////////////////////////////////////////////// - if (node.length === 1 && firstChar === '*') { - this.addEntry(node, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].UniversalSelector); - } - ///////////////////////////////////////////////////////////// - // Lint - Avoid id selectors - ///////////////////////////////////////////////////////////// - if (firstChar === '#') { - this.addEntry(node, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].AvoidIdSelector); - } - return true; - }; - LintVisitor.prototype.visitImport = function (node) { - ///////////////////////////////////////////////////////////// - // Lint - Import statements shouldn't be used, because they aren't offering parallel downloads. - ///////////////////////////////////////////////////////////// - this.addEntry(node, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].ImportStatemement); - return true; - }; - LintVisitor.prototype.visitRuleSet = function (node) { - ///////////////////////////////////////////////////////////// - // Lint - Don't use empty rulesets. - ///////////////////////////////////////////////////////////// - var declarations = node.getDeclarations(); - if (!declarations) { - // syntax error - return false; - } - if (!declarations.hasChildren()) { - this.addEntry(node.getSelectors(), _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].EmptyRuleSet); - } - var propertyTable = []; - for (var _i = 0, _a = declarations.getChildren(); _i < _a.length; _i++) { - var element = _a[_i]; - if (element instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["Declaration"]) { - var decl = element; - propertyTable.push(new _lintUtil_js__WEBPACK_IMPORTED_MODULE_3__["Element"](decl.getFullPropertyName().toLowerCase(), decl)); - } - } - ///////////////////////////////////////////////////////////// - // the rule warns when it finds: - // width being used with border, border-left, border-right, padding, padding-left, or padding-right - // height being used with border, border-top, border-bottom, padding, padding-top, or padding-bottom - // No error when box-sizing property is specified, as it assumes the user knows what he's doing. - // see https://github.com/CSSLint/csslint/wiki/Beware-of-box-model-size - ///////////////////////////////////////////////////////////// - var boxModel = Object(_lintUtil_js__WEBPACK_IMPORTED_MODULE_3__["default"])(propertyTable); - if (boxModel.width) { - var properties = []; - if (boxModel.right.value) { - properties = Object(_utils_arrays_js__WEBPACK_IMPORTED_MODULE_4__["union"])(properties, boxModel.right.properties); - } - if (boxModel.left.value) { - properties = Object(_utils_arrays_js__WEBPACK_IMPORTED_MODULE_4__["union"])(properties, boxModel.left.properties); - } - if (properties.length !== 0) { - for (var _b = 0, properties_1 = properties; _b < properties_1.length; _b++) { - var item = properties_1[_b]; - this.addEntry(item.node, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].BewareOfBoxModelSize); - } - this.addEntry(boxModel.width.node, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].BewareOfBoxModelSize); - } - } - if (boxModel.height) { - var properties = []; - if (boxModel.top.value) { - properties = Object(_utils_arrays_js__WEBPACK_IMPORTED_MODULE_4__["union"])(properties, boxModel.top.properties); - } - if (boxModel.bottom.value) { - properties = Object(_utils_arrays_js__WEBPACK_IMPORTED_MODULE_4__["union"])(properties, boxModel.bottom.properties); - } - if (properties.length !== 0) { - for (var _c = 0, properties_2 = properties; _c < properties_2.length; _c++) { - var item = properties_2[_c]; - this.addEntry(item.node, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].BewareOfBoxModelSize); - } - this.addEntry(boxModel.height.node, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].BewareOfBoxModelSize); - } - } - ///////////////////////////////////////////////////////////// - // Properties ignored due to display - ///////////////////////////////////////////////////////////// - // With 'display: inline', the width, height, margin-top, margin-bottom, and float properties have no effect - var displayElems = this.fetchWithValue(propertyTable, 'display', 'inline'); - if (displayElems.length > 0) { - for (var _d = 0, _e = ['width', 'height', 'margin-top', 'margin-bottom', 'float']; _d < _e.length; _d++) { - var prop = _e[_d]; - var elem = this.fetch(propertyTable, prop); - for (var index = 0; index < elem.length; index++) { - var node_1 = elem[index].node; - var value = node_1.getValue(); - if (prop === 'float' && (!value || value.matches('none'))) { - continue; - } - this.addEntry(node_1, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].PropertyIgnoredDueToDisplay, localize('rule.propertyIgnoredDueToDisplayInline', "Property is ignored due to the display. With 'display: inline', the width, height, margin-top, margin-bottom, and float properties have no effect.")); - } - } - } - // With 'display: inline-block', 'float' has no effect - displayElems = this.fetchWithValue(propertyTable, 'display', 'inline-block'); - if (displayElems.length > 0) { - var elem = this.fetch(propertyTable, 'float'); - for (var index = 0; index < elem.length; index++) { - var node_2 = elem[index].node; - var value = node_2.getValue(); - if (value && !value.matches('none')) { - this.addEntry(node_2, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].PropertyIgnoredDueToDisplay, localize('rule.propertyIgnoredDueToDisplayInlineBlock', "inline-block is ignored due to the float. If 'float' has a value other than 'none', the box is floated and 'display' is treated as 'block'")); - } - } - } - // With 'display: block', 'vertical-align' has no effect - displayElems = this.fetchWithValue(propertyTable, 'display', 'block'); - if (displayElems.length > 0) { - var elem = this.fetch(propertyTable, 'vertical-align'); - for (var index = 0; index < elem.length; index++) { - this.addEntry(elem[index].node, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].PropertyIgnoredDueToDisplay, localize('rule.propertyIgnoredDueToDisplayBlock', "Property is ignored due to the display. With 'display: block', vertical-align should not be used.")); - } - } - ///////////////////////////////////////////////////////////// - // Avoid 'float' - ///////////////////////////////////////////////////////////// - var elements = this.fetch(propertyTable, 'float'); - for (var index = 0; index < elements.length; index++) { - var decl = elements[index].node; - if (!this.isValidPropertyDeclaration(decl)) { - this.addEntry(decl, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].AvoidFloat); - } - } - ///////////////////////////////////////////////////////////// - // Don't use duplicate declarations. - ///////////////////////////////////////////////////////////// - for (var i = 0; i < propertyTable.length; i++) { - var element = propertyTable[i]; - if (element.name !== 'background' && !this.validProperties[element.name]) { - var value = element.node.getValue(); - if (value && this.documentText.charAt(value.offset) !== '-') { - var elements_1 = this.fetch(propertyTable, element.name); - if (elements_1.length > 1) { - for (var k = 0; k < elements_1.length; k++) { - var value_1 = elements_1[k].node.getValue(); - if (value_1 && this.documentText.charAt(value_1.offset) !== '-' && elements_1[k] !== element) { - this.addEntry(element.node, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].DuplicateDeclarations); - } - } - } - } - } - } - ///////////////////////////////////////////////////////////// - // Unknown propery & When using a vendor-prefixed gradient, make sure to use them all. - ///////////////////////////////////////////////////////////// - var isExportBlock = node.getSelectors().getText() === ":export"; - if (!isExportBlock) { - var propertiesBySuffix = new NodesByRootMap(); - var containsUnknowns = false; - for (var _f = 0, _g = declarations.getChildren(); _f < _g.length; _f++) { - var node_3 = _g[_f]; - if (this.isCSSDeclaration(node_3)) { - var decl = node_3; - var name = decl.getFullPropertyName().toLowerCase(); - var firstChar = name.charAt(0); - if (firstChar === '-') { - if (name.charAt(1) !== '-') { // avoid css variables - if (!_languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_0__["cssDataManager"].isKnownProperty(name) && !this.validProperties[name]) { - this.addEntry(decl.getProperty(), _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].UnknownVendorSpecificProperty); - } - var nonPrefixedName = decl.getNonPrefixedPropertyName(); - propertiesBySuffix.add(nonPrefixedName, name, decl.getProperty()); - } - } - else { - var fullName = name; - if (firstChar === '*' || firstChar === '_') { - this.addEntry(decl.getProperty(), _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].IEStarHack); - name = name.substr(1); - } - // _property and *property might be contributed via custom data - if (!_languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_0__["cssDataManager"].isKnownProperty(fullName) && !_languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_0__["cssDataManager"].isKnownProperty(name)) { - if (!this.validProperties[name]) { - this.addEntry(decl.getProperty(), _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].UnknownProperty, localize('property.unknownproperty.detailed', "Unknown property: '{0}'", name)); - } - } - propertiesBySuffix.add(name, name, null); // don't pass the node as we don't show errors on the standard - } - } - else { - containsUnknowns = true; - } - } - if (!containsUnknowns) { // don't perform this test if there are - for (var suffix in propertiesBySuffix.data) { - var entry = propertiesBySuffix.data[suffix]; - var actual = entry.names; - var needsStandard = _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_0__["cssDataManager"].isStandardProperty(suffix) && (actual.indexOf(suffix) === -1); - if (!needsStandard && actual.length === 1) { - continue; // only the non-vendor specific rule is used, that's fine, no warning - } - var expected = []; - for (var i = 0, len = LintVisitor.prefixes.length; i < len; i++) { - var prefix = LintVisitor.prefixes[i]; - if (_languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_0__["cssDataManager"].isStandardProperty(prefix + suffix)) { - expected.push(prefix + suffix); - } - } - var missingVendorSpecific = this.getMissingNames(expected, actual); - if (missingVendorSpecific || needsStandard) { - for (var _h = 0, _j = entry.nodes; _h < _j.length; _h++) { - var node_4 = _j[_h]; - if (needsStandard) { - var message = localize('property.standard.missing', "Also define the standard property '{0}' for compatibility", suffix); - this.addEntry(node_4, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].IncludeStandardPropertyWhenUsingVendorPrefix, message); - } - if (missingVendorSpecific) { - var message = localize('property.vendorspecific.missing', "Always include all vendor specific properties: Missing: {0}", missingVendorSpecific); - this.addEntry(node_4, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].AllVendorPrefixes, message); - } - } - } - } - } - } - return true; - }; - LintVisitor.prototype.visitPrio = function (node) { - ///////////////////////////////////////////////////////////// - // Don't use !important - ///////////////////////////////////////////////////////////// - this.addEntry(node, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].AvoidImportant); - return true; - }; - LintVisitor.prototype.visitNumericValue = function (node) { - ///////////////////////////////////////////////////////////// - // 0 has no following unit - ///////////////////////////////////////////////////////////// - var funcDecl = node.findParent(_parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].Function); - if (funcDecl && funcDecl.getName() === 'calc') { - return true; - } - var decl = node.findParent(_parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["NodeType"].Declaration); - if (decl) { - var declValue = decl.getValue(); - if (declValue) { - var value = node.getValue(); - if (!value.unit || _languageFacts_facts_js__WEBPACK_IMPORTED_MODULE_0__["units"].length.indexOf(value.unit.toLowerCase()) === -1) { - return true; - } - if (parseFloat(value.value) === 0.0 && !!value.unit && !this.validProperties[decl.getFullPropertyName()]) { - this.addEntry(node, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].ZeroWithUnit); - } - } - } - return true; - }; - LintVisitor.prototype.visitFontFace = function (node) { - var declarations = node.getDeclarations(); - if (!declarations) { - // syntax error - return; - } - var definesSrc = false, definesFontFamily = false; - var containsUnknowns = false; - for (var _i = 0, _a = declarations.getChildren(); _i < _a.length; _i++) { - var node_5 = _a[_i]; - if (this.isCSSDeclaration(node_5)) { - var name = (node_5.getProperty().getName().toLowerCase()); - if (name === 'src') { - definesSrc = true; - } - if (name === 'font-family') { - definesFontFamily = true; - } - } - else { - containsUnknowns = true; - } - } - if (!containsUnknowns && (!definesSrc || !definesFontFamily)) { - this.addEntry(node, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].RequiredPropertiesForFontFace); - } - return true; - }; - LintVisitor.prototype.isCSSDeclaration = function (node) { - if (node instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["Declaration"]) { - if (!node.getValue()) { - return false; - } - var property = node.getProperty(); - if (!property || property.getIdentifier().containsInterpolation()) { - return false; - } - return true; - } - return false; - }; - LintVisitor.prototype.visitHexColorValue = function (node) { - // Rule: #eeff0011 or #eeff00 or #ef01 or #ef0 - var length = node.length; - if (length !== 9 && length !== 7 && length !== 5 && length !== 4) { - this.addEntry(node, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].HexColorLength); - } - return false; - }; - LintVisitor.prototype.visitFunction = function (node) { - var fnName = node.getName().toLowerCase(); - var expectedAttrCount = -1; - var actualAttrCount = 0; - switch (fnName) { - case 'rgb(': - case 'hsl(': - expectedAttrCount = 3; - break; - case 'rgba(': - case 'hsla(': - expectedAttrCount = 4; - break; - } - if (expectedAttrCount !== -1) { - node.getArguments().accept(function (n) { - if (n instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_2__["BinaryExpression"]) { - actualAttrCount += 1; - return false; - } - return true; - }); - if (actualAttrCount !== expectedAttrCount) { - this.addEntry(node, _lintRules_js__WEBPACK_IMPORTED_MODULE_1__["Rules"].ArgsInColorFunction); - } - } - return true; - }; - LintVisitor.prefixes = [ - '-ms-', '-moz-', '-o-', '-webkit-', - ]; - return LintVisitor; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lintRules.js": -/*!***************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lintRules.js ***! - \***************************************************************************************************************/ -/*! exports provided: Rule, Setting, Rules, Settings, LintConfigurationSettings */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rule", function() { return Rule; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Setting", function() { return Setting; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rules", function() { return Rules; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Settings", function() { return Settings; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LintConfigurationSettings", function() { return LintConfigurationSettings; }); -/* harmony import */ var _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/cssNodes.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./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. - *--------------------------------------------------------------------------------------------*/ - - - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_1__["loadMessageBundle"](); -var Warning = _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Level"].Warning; -var Error = _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Level"].Error; -var Ignore = _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Level"].Ignore; -var Rule = /** @class */ (function () { - function Rule(id, message, defaultValue) { - this.id = id; - this.message = message; - this.defaultValue = defaultValue; - // nothing to do - } - return Rule; -}()); - -var Setting = /** @class */ (function () { - function Setting(id, message, defaultValue) { - this.id = id; - this.message = message; - this.defaultValue = defaultValue; - // nothing to do - } - return Setting; -}()); - -var Rules = { - AllVendorPrefixes: new Rule('compatibleVendorPrefixes', localize('rule.vendorprefixes.all', "When using a vendor-specific prefix make sure to also include all other vendor-specific properties"), Ignore), - IncludeStandardPropertyWhenUsingVendorPrefix: new Rule('vendorPrefix', localize('rule.standardvendorprefix.all', "When using a vendor-specific prefix also include the standard property"), Warning), - DuplicateDeclarations: new Rule('duplicateProperties', localize('rule.duplicateDeclarations', "Do not use duplicate style definitions"), Ignore), - EmptyRuleSet: new Rule('emptyRules', localize('rule.emptyRuleSets', "Do not use empty rulesets"), Warning), - ImportStatemement: new Rule('importStatement', localize('rule.importDirective', "Import statements do not load in parallel"), Ignore), - BewareOfBoxModelSize: new Rule('boxModel', localize('rule.bewareOfBoxModelSize', "Do not use width or height when using padding or border"), Ignore), - UniversalSelector: new Rule('universalSelector', localize('rule.universalSelector', "The universal selector (*) is known to be slow"), Ignore), - ZeroWithUnit: new Rule('zeroUnits', localize('rule.zeroWidthUnit', "No unit for zero needed"), Ignore), - RequiredPropertiesForFontFace: new Rule('fontFaceProperties', localize('rule.fontFaceProperties', "@font-face rule must define 'src' and 'font-family' properties"), Warning), - HexColorLength: new Rule('hexColorLength', localize('rule.hexColor', "Hex colors must consist of three, four, six or eight hex numbers"), Error), - ArgsInColorFunction: new Rule('argumentsInColorFunction', localize('rule.colorFunction', "Invalid number of parameters"), Error), - UnknownProperty: new Rule('unknownProperties', localize('rule.unknownProperty', "Unknown property."), Warning), - UnknownAtRules: new Rule('unknownAtRules', localize('rule.unknownAtRules', "Unknown at-rule."), Warning), - IEStarHack: new Rule('ieHack', localize('rule.ieHack', "IE hacks are only necessary when supporting IE7 and older"), Ignore), - UnknownVendorSpecificProperty: new Rule('unknownVendorSpecificProperties', localize('rule.unknownVendorSpecificProperty', "Unknown vendor specific property."), Ignore), - PropertyIgnoredDueToDisplay: new Rule('propertyIgnoredDueToDisplay', localize('rule.propertyIgnoredDueToDisplay', "Property is ignored due to the display."), Warning), - AvoidImportant: new Rule('important', localize('rule.avoidImportant', "Avoid using !important. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored."), Ignore), - AvoidFloat: new Rule('float', localize('rule.avoidFloat', "Avoid using 'float'. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes."), Ignore), - AvoidIdSelector: new Rule('idSelector', localize('rule.avoidIdSelector', "Selectors should not contain IDs because these rules are too tightly coupled with the HTML."), Ignore), -}; -var Settings = { - ValidProperties: new Setting('validProperties', localize('rule.validProperties', "A list of properties that are not validated against the `unknownProperties` rule."), []) -}; -var LintConfigurationSettings = /** @class */ (function () { - function LintConfigurationSettings(conf) { - if (conf === void 0) { conf = {}; } - this.conf = conf; - } - LintConfigurationSettings.prototype.getRule = function (rule) { - if (this.conf.hasOwnProperty(rule.id)) { - var level = toLevel(this.conf[rule.id]); - if (level) { - return level; - } - } - return rule.defaultValue; - }; - LintConfigurationSettings.prototype.getSetting = function (setting) { - return this.conf[setting.id]; - }; - return LintConfigurationSettings; -}()); - -function toLevel(level) { - switch (level) { - case 'ignore': return _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Level"].Ignore; - case 'warning': return _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Level"].Warning; - case 'error': return _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["Level"].Error; - } - return null; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lintUtil.js": -/*!**************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lintUtil.js ***! - \**************************************************************************************************************/ -/*! exports provided: Element, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Element", function() { return Element; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return calculateBoxModel; }); -/* harmony import */ var _utils_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/arrays.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/utils/arrays.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -var Element = /** @class */ (function () { - function Element(text, data) { - this.name = text; - this.node = data; - } - return Element; -}()); - -function setSide(model, side, value, property) { - var state = model[side]; - state.value = value; - if (value) { - if (!Object(_utils_arrays_js__WEBPACK_IMPORTED_MODULE_0__["includes"])(state.properties, property)) { - state.properties.push(property); - } - } -} -function setAllSides(model, value, property) { - setSide(model, 'top', value, property); - setSide(model, 'right', value, property); - setSide(model, 'bottom', value, property); - setSide(model, 'left', value, property); -} -function updateModelWithValue(model, side, value, property) { - if (side === 'top' || side === 'right' || - side === 'bottom' || side === 'left') { - setSide(model, side, value, property); - } - else { - setAllSides(model, value, property); - } -} -function updateModelWithList(model, values, property) { - switch (values.length) { - case 1: - updateModelWithValue(model, undefined, values[0], property); - break; - case 2: - updateModelWithValue(model, 'top', values[0], property); - updateModelWithValue(model, 'bottom', values[0], property); - updateModelWithValue(model, 'right', values[1], property); - updateModelWithValue(model, 'left', values[1], property); - break; - case 3: - updateModelWithValue(model, 'top', values[0], property); - updateModelWithValue(model, 'right', values[1], property); - updateModelWithValue(model, 'left', values[1], property); - updateModelWithValue(model, 'bottom', values[2], property); - break; - case 4: - updateModelWithValue(model, 'top', values[0], property); - updateModelWithValue(model, 'right', values[1], property); - updateModelWithValue(model, 'bottom', values[2], property); - updateModelWithValue(model, 'left', values[3], property); - break; - } -} -/** - * @param allowsKeywords whether the initial value of property is zero, so keywords `initial` and `unset` count as zero - * @return `true` if this node represents a non-zero border; otherwise, `false` - */ -function checkLineWidth(value, allowsKeywords) { - if (allowsKeywords === void 0) { allowsKeywords = true; } - if (allowsKeywords && Object(_utils_arrays_js__WEBPACK_IMPORTED_MODULE_0__["includes"])(['initial', 'unset'], value)) { - return false; - } - // a is a value and a unit - // so use `parseFloat` to strip the unit - return parseFloat(value) !== 0; -} -function checkLineWidthList(nodes, allowsKeywords) { - if (allowsKeywords === void 0) { allowsKeywords = true; } - return nodes.map(function (node) { return checkLineWidth(node.getText(), allowsKeywords); }); -} -/** - * @param allowsKeywords whether keywords `initial` and `unset` count as zero - * @return `true` if this node represents a non-zero border; otherwise, `false` - */ -function checkLineStyle(value, allowsKeywords) { - if (allowsKeywords === void 0) { allowsKeywords = true; } - if (Object(_utils_arrays_js__WEBPACK_IMPORTED_MODULE_0__["includes"])(['none', 'hidden'], value)) { - return false; - } - if (allowsKeywords && Object(_utils_arrays_js__WEBPACK_IMPORTED_MODULE_0__["includes"])(['initial', 'unset'], value)) { - return false; - } - return true; -} -function checkLineStyleList(nodes, allowsKeywords) { - if (allowsKeywords === void 0) { allowsKeywords = true; } - return nodes.map(function (node) { return checkLineStyle(node.getText(), allowsKeywords); }); -} -function checkBorderShorthand(node) { - var children = node.getChildren(); - // the only child can be a keyword, a , or a - // if either check returns false, the result is no border - if (children.length === 1) { - var value = children[0].getText(); - return checkLineWidth(value) && checkLineStyle(value); - } - // multiple children can't contain keywords - // if any child means no border, the result is no border - for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { - var child = children_1[_i]; - var value = child.getText(); - if (!checkLineWidth(value, /* allowsKeywords: */ false) || - !checkLineStyle(value, /* allowsKeywords: */ false)) { - return false; - } - } - return true; -} -function calculateBoxModel(propertyTable) { - var model = { - top: { value: false, properties: [] }, - right: { value: false, properties: [] }, - bottom: { value: false, properties: [] }, - left: { value: false, properties: [] }, - }; - for (var _i = 0, propertyTable_1 = propertyTable; _i < propertyTable_1.length; _i++) { - var property = propertyTable_1[_i]; - var value = property.node.value; - if (typeof value === 'undefined') { - continue; - } - switch (property.name) { - case 'box-sizing': - // has `box-sizing`, bail out - return { - top: { value: false, properties: [] }, - right: { value: false, properties: [] }, - bottom: { value: false, properties: [] }, - left: { value: false, properties: [] }, - }; - case 'width': - model.width = property; - break; - case 'height': - model.height = property; - break; - default: - var segments = property.name.split('-'); - switch (segments[0]) { - case 'border': - switch (segments[1]) { - case undefined: - case 'top': - case 'right': - case 'bottom': - case 'left': - switch (segments[2]) { - case undefined: - updateModelWithValue(model, segments[1], checkBorderShorthand(value), property); - break; - case 'width': - // the initial value of `border-width` is `medium`, not zero - updateModelWithValue(model, segments[1], checkLineWidth(value.getText(), false), property); - break; - case 'style': - // the initial value of `border-style` is `none` - updateModelWithValue(model, segments[1], checkLineStyle(value.getText(), true), property); - break; - } - break; - case 'width': - // the initial value of `border-width` is `medium`, not zero - updateModelWithList(model, checkLineWidthList(value.getChildren(), false), property); - break; - case 'style': - // the initial value of `border-style` is `none` - updateModelWithList(model, checkLineStyleList(value.getChildren(), true), property); - break; - } - break; - case 'padding': - if (segments.length === 1) { - // the initial value of `padding` is zero - updateModelWithList(model, checkLineWidthList(value.getChildren(), true), property); - } - else { - // the initial value of `padding` is zero - updateModelWithValue(model, segments[1], checkLineWidth(value.getText(), true), property); - } - break; - } - break; - } - } - return model; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/scssCompletion.js": -/*!********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/scssCompletion.js ***! - \********************************************************************************************************************/ -/*! exports provided: SCSSCompletion */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SCSSCompletion", function() { return SCSSCompletion; }); -/* harmony import */ var _cssCompletion_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cssCompletion.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssCompletion.js"); -/* harmony import */ var _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../parser/cssNodes.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js"); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./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. - *--------------------------------------------------------------------------------------------*/ - -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_3__["loadMessageBundle"](); -var SCSSCompletion = /** @class */ (function (_super) { - __extends(SCSSCompletion, _super); - function SCSSCompletion() { - return _super.call(this, '$') || this; - } - SCSSCompletion.prototype.createReplaceFunction = function () { - var tabStopCounter = 1; - return function (_match, p1) { - return '\\' + p1 + ': ${' + tabStopCounter++ + ':' + (SCSSCompletion.variableDefaults[p1] || '') + '}'; - }; - }; - SCSSCompletion.prototype.createFunctionProposals = function (proposals, existingNode, sortToEnd, result) { - for (var _i = 0, proposals_1 = proposals; _i < proposals_1.length; _i++) { - var p = proposals_1[_i]; - var insertText = p.func.replace(/\[?(\$\w+)\]?/g, this.createReplaceFunction()); - var label = p.func.substr(0, p.func.indexOf('(')); - var item = { - label: label, - detail: p.func, - documentation: p.desc, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["TextEdit"].replace(this.getCompletionRange(existingNode), insertText), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["InsertTextFormat"].Snippet, - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["CompletionItemKind"].Function - }; - if (sortToEnd) { - item.sortText = 'z'; - } - result.items.push(item); - } - return result; - }; - SCSSCompletion.prototype.getCompletionsForSelector = function (ruleSet, isNested, result) { - this.createFunctionProposals(SCSSCompletion.selectorFuncs, void 0, true, result); - return _super.prototype.getCompletionsForSelector.call(this, ruleSet, isNested, result); - }; - SCSSCompletion.prototype.getTermProposals = function (entry, existingNode, result) { - var functions = SCSSCompletion.builtInFuncs; - if (entry) { - functions = functions.filter(function (f) { return !f.type || entry.restrictions.indexOf(f.type) !== -1; }); - } - this.createFunctionProposals(functions, existingNode, true, result); - return _super.prototype.getTermProposals.call(this, entry, existingNode, result); - }; - SCSSCompletion.prototype.getColorProposals = function (entry, existingNode, result) { - this.createFunctionProposals(SCSSCompletion.colorProposals, existingNode, false, result); - return _super.prototype.getColorProposals.call(this, entry, existingNode, result); - }; - SCSSCompletion.prototype.getCompletionsForDeclarationProperty = function (declaration, result) { - this.getCompletionForAtDirectives(result); - this.getCompletionsForSelector(null, true, result); - return _super.prototype.getCompletionsForDeclarationProperty.call(this, declaration, result); - }; - SCSSCompletion.prototype.getCompletionsForExtendsReference = function (_extendsRef, existingNode, result) { - var symbols = this.getSymbolContext().findSymbolsAtOffset(this.offset, _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_1__["ReferenceType"].Rule); - for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) { - var symbol = symbols_1[_i]; - var suggest = { - label: symbol.name, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["TextEdit"].replace(this.getCompletionRange(existingNode), symbol.name), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["CompletionItemKind"].Function, - }; - result.items.push(suggest); - } - return result; - }; - SCSSCompletion.prototype.getCompletionForAtDirectives = function (result) { - var _a; - (_a = result.items).push.apply(_a, SCSSCompletion.scssAtDirectives); - return result; - }; - SCSSCompletion.prototype.getCompletionForTopLevel = function (result) { - this.getCompletionForAtDirectives(result); - _super.prototype.getCompletionForTopLevel.call(this, result); - return result; - }; - SCSSCompletion.variableDefaults = { - '$red': '1', - '$green': '2', - '$blue': '3', - '$alpha': '1.0', - '$color': '#000000', - '$weight': '0.5', - '$hue': '0', - '$saturation': '0%', - '$lightness': '0%', - '$degrees': '0', - '$amount': '0', - '$string': '""', - '$substring': '"s"', - '$number': '0', - '$limit': '1' - }; - SCSSCompletion.colorProposals = [ - { func: 'red($color)', desc: localize('scss.builtin.red', 'Gets the red component of a color.') }, - { func: 'green($color)', desc: localize('scss.builtin.green', 'Gets the green component of a color.') }, - { func: 'blue($color)', desc: localize('scss.builtin.blue', 'Gets the blue component of a color.') }, - { func: 'mix($color, $color, [$weight])', desc: localize('scss.builtin.mix', 'Mixes two colors together.') }, - { func: 'hue($color)', desc: localize('scss.builtin.hue', 'Gets the hue component of a color.') }, - { func: 'saturation($color)', desc: localize('scss.builtin.saturation', 'Gets the saturation component of a color.') }, - { func: 'lightness($color)', desc: localize('scss.builtin.lightness', 'Gets the lightness component of a color.') }, - { func: 'adjust-hue($color, $degrees)', desc: localize('scss.builtin.adjust-hue', 'Changes the hue of a color.') }, - { func: 'lighten($color, $amount)', desc: localize('scss.builtin.lighten', 'Makes a color lighter.') }, - { func: 'darken($color, $amount)', desc: localize('scss.builtin.darken', 'Makes a color darker.') }, - { func: 'saturate($color, $amount)', desc: localize('scss.builtin.saturate', 'Makes a color more saturated.') }, - { func: 'desaturate($color, $amount)', desc: localize('scss.builtin.desaturate', 'Makes a color less saturated.') }, - { func: 'grayscale($color)', desc: localize('scss.builtin.grayscale', 'Converts a color to grayscale.') }, - { func: 'complement($color)', desc: localize('scss.builtin.complement', 'Returns the complement of a color.') }, - { func: 'invert($color)', desc: localize('scss.builtin.invert', 'Returns the inverse of a color.') }, - { func: 'alpha($color)', desc: localize('scss.builtin.alpha', 'Gets the opacity component of a color.') }, - { func: 'opacity($color)', desc: 'Gets the alpha component (opacity) of a color.' }, - { func: 'rgba($color, $alpha)', desc: localize('scss.builtin.rgba', 'Changes the alpha component for a color.') }, - { func: 'opacify($color, $amount)', desc: localize('scss.builtin.opacify', 'Makes a color more opaque.') }, - { func: 'fade-in($color, $amount)', desc: localize('scss.builtin.fade-in', 'Makes a color more opaque.') }, - { func: 'transparentize($color, $amount)', desc: localize('scss.builtin.transparentize', 'Makes a color more transparent.') }, - { func: 'fade-out($color, $amount)', desc: localize('scss.builtin.fade-out', 'Makes a color more transparent.') }, - { func: 'adjust-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])', desc: localize('scss.builtin.adjust-color', 'Increases or decreases one or more components of a color.') }, - { func: 'scale-color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha])', desc: localize('scss.builtin.scale-color', 'Fluidly scales one or more properties of a color.') }, - { func: 'change-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])', desc: localize('scss.builtin.change-color', 'Changes one or more properties of a color.') }, - { func: 'ie-hex-str($color)', desc: localize('scss.builtin.ie-hex-str', 'Converts a color into the format understood by IE filters.') } - ]; - SCSSCompletion.selectorFuncs = [ - { func: 'selector-nest($selectors…)', desc: localize('scss.builtin.selector-nest', 'Nests selector beneath one another like they would be nested in the stylesheet.') }, - { func: 'selector-append($selectors…)', desc: localize('scss.builtin.selector-append', 'Appends selectors to one another without spaces in between.') }, - { func: 'selector-extend($selector, $extendee, $extender)', desc: localize('scss.builtin.selector-extend', 'Extends $extendee with $extender within $selector.') }, - { func: 'selector-replace($selector, $original, $replacement)', desc: localize('scss.builtin.selector-replace', 'Replaces $original with $replacement within $selector.') }, - { func: 'selector-unify($selector1, $selector2)', desc: localize('scss.builtin.selector-unify', 'Unifies two selectors to produce a selector that matches elements matched by both.') }, - { func: 'is-superselector($super, $sub)', desc: localize('scss.builtin.is-superselector', 'Returns whether $super matches all the elements $sub does, and possibly more.') }, - { func: 'simple-selectors($selector)', desc: localize('scss.builtin.simple-selectors', 'Returns the simple selectors that comprise a compound selector.') }, - { func: 'selector-parse($selector)', desc: localize('scss.builtin.selector-parse', 'Parses a selector into the format returned by &.') } - ]; - SCSSCompletion.builtInFuncs = [ - { func: 'unquote($string)', desc: localize('scss.builtin.unquote', 'Removes quotes from a string.') }, - { func: 'quote($string)', desc: localize('scss.builtin.quote', 'Adds quotes to a string.') }, - { func: 'str-length($string)', desc: localize('scss.builtin.str-length', 'Returns the number of characters in a string.') }, - { func: 'str-insert($string, $insert, $index)', desc: localize('scss.builtin.str-insert', 'Inserts $insert into $string at $index.') }, - { func: 'str-index($string, $substring)', desc: localize('scss.builtin.str-index', 'Returns the index of the first occurance of $substring in $string.') }, - { func: 'str-slice($string, $start-at, [$end-at])', desc: localize('scss.builtin.str-slice', 'Extracts a substring from $string.') }, - { func: 'to-upper-case($string)', desc: localize('scss.builtin.to-upper-case', 'Converts a string to upper case.') }, - { func: 'to-lower-case($string)', desc: localize('scss.builtin.to-lower-case', 'Converts a string to lower case.') }, - { func: 'percentage($number)', desc: localize('scss.builtin.percentage', 'Converts a unitless number to a percentage.'), type: 'percentage' }, - { func: 'round($number)', desc: localize('scss.builtin.round', 'Rounds a number to the nearest whole number.') }, - { func: 'ceil($number)', desc: localize('scss.builtin.ceil', 'Rounds a number up to the next whole number.') }, - { func: 'floor($number)', desc: localize('scss.builtin.floor', 'Rounds a number down to the previous whole number.') }, - { func: 'abs($number)', desc: localize('scss.builtin.abs', 'Returns the absolute value of a number.') }, - { func: 'min($numbers)', desc: localize('scss.builtin.min', 'Finds the minimum of several numbers.') }, - { func: 'max($numbers)', desc: localize('scss.builtin.max', 'Finds the maximum of several numbers.') }, - { func: 'random([$limit])', desc: localize('scss.builtin.random', 'Returns a random number.') }, - { func: 'length($list)', desc: localize('scss.builtin.length', 'Returns the length of a list.') }, - { func: 'nth($list, $n)', desc: localize('scss.builtin.nth', 'Returns a specific item in a list.') }, - { func: 'set-nth($list, $n, $value)', desc: localize('scss.builtin.set-nth', 'Replaces the nth item in a list.') }, - { func: 'join($list1, $list2, [$separator])', desc: localize('scss.builtin.join', 'Joins together two lists into one.') }, - { func: 'append($list1, $val, [$separator])', desc: localize('scss.builtin.append', 'Appends a single value onto the end of a list.') }, - { func: 'zip($lists)', desc: localize('scss.builtin.zip', 'Combines several lists into a single multidimensional list.') }, - { func: 'index($list, $value)', desc: localize('scss.builtin.index', 'Returns the position of a value within a list.') }, - { func: 'list-separator(#list)', desc: localize('scss.builtin.list-separator', 'Returns the separator of a list.') }, - { func: 'map-get($map, $key)', desc: localize('scss.builtin.map-get', 'Returns the value in a map associated with a given key.') }, - { func: 'map-merge($map1, $map2)', desc: localize('scss.builtin.map-merge', 'Merges two maps together into a new map.') }, - { func: 'map-remove($map, $keys)', desc: localize('scss.builtin.map-remove', 'Returns a new map with keys removed.') }, - { func: 'map-keys($map)', desc: localize('scss.builtin.map-keys', 'Returns a list of all keys in a map.') }, - { func: 'map-values($map)', desc: localize('scss.builtin.map-values', 'Returns a list of all values in a map.') }, - { func: 'map-has-key($map, $key)', desc: localize('scss.builtin.map-has-key', 'Returns whether a map has a value associated with a given key.') }, - { func: 'keywords($args)', desc: localize('scss.builtin.keywords', 'Returns the keywords passed to a function that takes variable arguments.') }, - { func: 'feature-exists($feature)', desc: localize('scss.builtin.feature-exists', 'Returns whether a feature exists in the current Sass runtime.') }, - { func: 'variable-exists($name)', desc: localize('scss.builtin.variable-exists', 'Returns whether a variable with the given name exists in the current scope.') }, - { func: 'global-variable-exists($name)', desc: localize('scss.builtin.global-variable-exists', 'Returns whether a variable with the given name exists in the global scope.') }, - { func: 'function-exists($name)', desc: localize('scss.builtin.function-exists', 'Returns whether a function with the given name exists.') }, - { func: 'mixin-exists($name)', desc: localize('scss.builtin.mixin-exists', 'Returns whether a mixin with the given name exists.') }, - { func: 'inspect($value)', desc: localize('scss.builtin.inspect', 'Returns the string representation of a value as it would be represented in Sass.') }, - { func: 'type-of($value)', desc: localize('scss.builtin.type-of', 'Returns the type of a value.') }, - { func: 'unit($number)', desc: localize('scss.builtin.unit', 'Returns the unit(s) associated with a number.') }, - { func: 'unitless($number)', desc: localize('scss.builtin.unitless', 'Returns whether a number has units.') }, - { func: 'comparable($number1, $number2)', desc: localize('scss.builtin.comparable', 'Returns whether two numbers can be added, subtracted, or compared.') }, - { func: 'call($name, $args…)', desc: localize('scss.builtin.call', 'Dynamically calls a Sass function.') } - ]; - SCSSCompletion.scssAtDirectives = [ - { - label: "@extend", - documentation: localize("scss.builtin.@extend", "Inherits the styles of another selector."), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["CompletionItemKind"].Keyword - }, - { - label: "@at-root", - documentation: localize("scss.builtin.@at-root", "Causes one or more rules to be emitted at the root of the document."), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["CompletionItemKind"].Keyword - }, - { - label: "@debug", - documentation: localize("scss.builtin.@debug", "Prints the value of an expression to the standard error output stream. Useful for debugging complicated Sass files."), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["CompletionItemKind"].Keyword - }, - { - label: "@warn", - documentation: localize("scss.builtin.@warn", "Prints the value of an expression to the standard error output stream. Useful for libraries that need to warn users of deprecations or recovering from minor mixin usage mistakes. Warnings can be turned off with the `--quiet` command-line option or the `:quiet` Sass option."), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["CompletionItemKind"].Keyword - }, - { - label: "@error", - documentation: localize("scss.builtin.@error", "Throws the value of an expression as a fatal error with stack trace. Useful for validating arguments to mixins and functions."), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["CompletionItemKind"].Keyword - }, - { - label: "@if", - documentation: localize("scss.builtin.@if", "Includes the body if the expression does not evaluate to `false` or `null`."), - insertText: "@if ${1:expr} {\n\t$0\n}", - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["InsertTextFormat"].Snippet, - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["CompletionItemKind"].Keyword - }, - { - label: "@for", - documentation: localize("scss.builtin.@for", "For loop that repeatedly outputs a set of styles for each `$var` in the `from/through` or `from/to` clause."), - insertText: "@for \\$${1:var} from ${2:start} ${3|to,through|} ${4:end} {\n\t$0\n}", - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["InsertTextFormat"].Snippet, - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["CompletionItemKind"].Keyword - }, - { - label: "@each", - documentation: localize("scss.builtin.@each", "Each loop that sets `$var` to each item in the list or map, then outputs the styles it contains using that value of `$var`."), - insertText: "@each \\$${1:var} in ${2:list} {\n\t$0\n}", - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["InsertTextFormat"].Snippet, - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["CompletionItemKind"].Keyword - }, - { - label: "@while", - documentation: localize("scss.builtin.@while", "While loop that takes an expression and repeatedly outputs the nested styles until the statement evaluates to `false`."), - insertText: "@while ${1:condition} {\n\t$0\n}", - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["InsertTextFormat"].Snippet, - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["CompletionItemKind"].Keyword - }, - { - label: "@mixin", - documentation: localize("scss.builtin.@mixin", "Defines styles that can be re-used throughout the stylesheet with `@include`."), - insertText: "@mixin ${1:name} {\n\t$0\n}", - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["InsertTextFormat"].Snippet, - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["CompletionItemKind"].Keyword - }, - { - label: "@include", - documentation: localize("scss.builtin.@include", "Includes the styles defined by another mixin into the current rule."), - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_2__["CompletionItemKind"].Keyword - }, - ]; - return SCSSCompletion; -}(_cssCompletion_js__WEBPACK_IMPORTED_MODULE_0__["CSSCompletion"])); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/selectorPrinting.js": -/*!**********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/selectorPrinting.js ***! - \**********************************************************************************************************************/ -/*! exports provided: Element, RootElement, LabelElement, toElement, selectorToMarkedString, simpleSelectorToMarkedString, selectorToElement */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Element", function() { return Element; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RootElement", function() { return RootElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LabelElement", function() { return LabelElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toElement", function() { return toElement; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectorToMarkedString", function() { return selectorToMarkedString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "simpleSelectorToMarkedString", function() { return simpleSelectorToMarkedString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectorToElement", function() { return selectorToElement; }); -/* harmony import */ var _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/cssNodes.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssNodes.js"); -/* harmony import */ var _parser_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../parser/cssScanner.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssScanner.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./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. - *--------------------------------------------------------------------------------------------*/ - -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_2__["loadMessageBundle"](); -var Element = /** @class */ (function () { - function Element() { - } - Element.prototype.findAttribute = function (name) { - if (this.attributes) { - for (var _i = 0, _a = this.attributes; _i < _a.length; _i++) { - var attribute = _a[_i]; - if (attribute.name === name) { - return attribute.value; - } - } - } - return null; - }; - Element.prototype.addChild = function (child) { - if (child instanceof Element) { - child.parent = this; - } - if (!this.children) { - this.children = []; - } - this.children.push(child); - }; - Element.prototype.append = function (text) { - if (this.attributes) { - var last = this.attributes[this.attributes.length - 1]; - last.value = last.value + text; - } - }; - Element.prototype.prepend = function (text) { - if (this.attributes) { - var first = this.attributes[0]; - first.value = text + first.value; - } - }; - Element.prototype.findRoot = function () { - var curr = this; - while (curr.parent && !(curr.parent instanceof RootElement)) { - curr = curr.parent; - } - return curr; - }; - Element.prototype.removeChild = function (child) { - if (this.children) { - var index = this.children.indexOf(child); - if (index !== -1) { - this.children.splice(index, 1); - return true; - } - } - return false; - }; - Element.prototype.addAttr = function (name, value) { - if (!this.attributes) { - this.attributes = []; - } - for (var _i = 0, _a = this.attributes; _i < _a.length; _i++) { - var attribute = _a[_i]; - if (attribute.name === name) { - attribute.value += ' ' + value; - return; - } - } - this.attributes.push({ name: name, value: value }); - }; - Element.prototype.clone = function (cloneChildren) { - if (cloneChildren === void 0) { cloneChildren = true; } - var elem = new Element(); - if (this.attributes) { - elem.attributes = []; - for (var _i = 0, _a = this.attributes; _i < _a.length; _i++) { - var attribute = _a[_i]; - elem.addAttr(attribute.name, attribute.value); - } - } - if (cloneChildren && this.children) { - elem.children = []; - for (var index = 0; index < this.children.length; index++) { - elem.addChild(this.children[index].clone()); - } - } - return elem; - }; - Element.prototype.cloneWithParent = function () { - var clone = this.clone(false); - if (this.parent && !(this.parent instanceof RootElement)) { - var parentClone = this.parent.cloneWithParent(); - parentClone.addChild(clone); - } - return clone; - }; - return Element; -}()); - -var RootElement = /** @class */ (function (_super) { - __extends(RootElement, _super); - function RootElement() { - return _super !== null && _super.apply(this, arguments) || this; - } - return RootElement; -}(Element)); - -var LabelElement = /** @class */ (function (_super) { - __extends(LabelElement, _super); - function LabelElement(label) { - var _this = _super.call(this) || this; - _this.addAttr('name', label); - return _this; - } - return LabelElement; -}(Element)); - -var MarkedStringPrinter = /** @class */ (function () { - function MarkedStringPrinter(quote) { - this.quote = quote; - // empty - } - MarkedStringPrinter.prototype.print = function (element) { - this.result = []; - if (element instanceof RootElement) { - this.doPrint(element.children, 0); - } - else { - this.doPrint([element], 0); - } - var value = this.result.join('\n'); - return [{ language: 'html', value: value }]; - }; - MarkedStringPrinter.prototype.doPrint = function (elements, indent) { - for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { - var element = elements_1[_i]; - this.doPrintElement(element, indent); - if (element.children) { - this.doPrint(element.children, indent + 1); - } - } - }; - MarkedStringPrinter.prototype.writeLine = function (level, content) { - var indent = new Array(level + 1).join(' '); - this.result.push(indent + content); - }; - MarkedStringPrinter.prototype.doPrintElement = function (element, indent) { - var name = element.findAttribute('name'); - // special case: a simple label - if (element instanceof LabelElement || name === '\u2026') { - this.writeLine(indent, name); - return; - } - // the real deal - var content = ['<']; - // element name - if (name) { - content.push(name); - } - else { - content.push('element'); - } - // attributes - if (element.attributes) { - for (var _i = 0, _a = element.attributes; _i < _a.length; _i++) { - var attr = _a[_i]; - if (attr.name !== 'name') { - content.push(' '); - content.push(attr.name); - var value = attr.value; - if (value) { - content.push('='); - content.push(quotes.ensure(value, this.quote)); - } - } - } - } - content.push('>'); - this.writeLine(indent, content.join('')); - }; - return MarkedStringPrinter; -}()); -var quotes; -(function (quotes) { - function ensure(value, which) { - return which + remove(value) + which; - } - quotes.ensure = ensure; - function remove(value) { - var match = value.match(/^['"](.*)["']$/); - if (match) { - return match[1]; - } - return value; - } - quotes.remove = remove; -})(quotes || (quotes = {})); -function toElement(node, parentElement) { - var result = new Element(); - for (var _i = 0, _a = node.getChildren(); _i < _a.length; _i++) { - var child = _a[_i]; - switch (child.type) { - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].SelectorCombinator: - if (parentElement) { - var segments = child.getText().split('&'); - if (segments.length === 1) { - // should not happen - result.addAttr('name', segments[0]); - break; - } - result = parentElement.cloneWithParent(); - if (segments[0]) { - var root = result.findRoot(); - root.prepend(segments[0]); - } - for (var i = 1; i < segments.length; i++) { - if (i > 1) { - var clone = parentElement.cloneWithParent(); - result.addChild(clone.findRoot()); - result = clone; - } - result.append(segments[i]); - } - } - break; - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].SelectorPlaceholder: - if (child.getText() === '@at-root') { - return result; - } - // fall through - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].ElementNameSelector: - var text = child.getText(); - result.addAttr('name', text === '*' ? 'element' : unescape(text)); - break; - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].ClassSelector: - result.addAttr('class', unescape(child.getText().substring(1))); - break; - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].IdentifierSelector: - result.addAttr('id', unescape(child.getText().substring(1))); - break; - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].MixinDeclaration: - result.addAttr('class', child.getName()); - break; - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].PseudoSelector: - result.addAttr(unescape(child.getText()), ''); - break; - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].AttributeSelector: - var selector = child; - var identifuer = selector.getIdentifier(); - if (identifuer) { - var expression = selector.getValue(); - var operator = selector.getOperator(); - var value = void 0; - if (expression) { - switch (unescape(operator.getText())) { - case '|=': - // excatly or followed by -words - value = quotes.remove(unescape(expression.getText())) + "-\u2026"; - break; - case '^=': - // prefix - value = quotes.remove(unescape(expression.getText())) + "\u2026"; - break; - case '$=': - // suffix - value = "\u2026" + quotes.remove(unescape(expression.getText())); - break; - case '~=': - // one of a list of words - value = " \u2026 " + quotes.remove(unescape(expression.getText())) + " \u2026 "; - break; - case '*=': - // substring - value = "\u2026" + quotes.remove(unescape(expression.getText())) + "\u2026"; - break; - default: - value = quotes.remove(unescape(expression.getText())); - break; - } - } - result.addAttr(unescape(identifuer.getText()), value); - } - break; - } - } - return result; -} -function unescape(content) { - var scanner = new _parser_cssScanner_js__WEBPACK_IMPORTED_MODULE_1__["Scanner"](); - scanner.setSource(content); - var token = scanner.scanUnquotedString(); - if (token) { - return token.text; - } - return content; -} -function selectorToSpecificityMarkedString(node) { - //https://www.w3.org/TR/selectors-3/#specificity - function calculateScore(node) { - node.getChildren().forEach(function (element) { - switch (element.type) { - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].IdentifierSelector: - specificity[0] += 1; //a - break; - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].ClassSelector: - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].AttributeSelector: - specificity[1] += 1; //b - break; - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].ElementNameSelector: - //ignore universal selector - if (element.getText() === "*") { - break; - } - specificity[2] += 1; //c - break; - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].PseudoSelector: - if (element.getText().match(/^::/)) { - specificity[2] += 1; //c (pseudo element) - } - else { - //ignore psuedo class NOT - if (element.getText().match(/^:not/i)) { - break; - } - specificity[1] += 1; //b (pseudo class) - } - break; - } - if (element.getChildren().length > 0) { - calculateScore(element); - } - }); - } - var specificity = [0, 0, 0]; //a,b,c - calculateScore(node); - return localize.apply(void 0, ['specificity', "[Selector Specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity): ({0}, {1}, {2})"].concat(specificity)); -} -function selectorToMarkedString(node) { - var root = selectorToElement(node); - var markedStrings = new MarkedStringPrinter('"').print(root); - markedStrings.push(selectorToSpecificityMarkedString(node)); - return markedStrings; -} -function simpleSelectorToMarkedString(node) { - var element = toElement(node); - var markedStrings = new MarkedStringPrinter('"').print(element); - markedStrings.push(selectorToSpecificityMarkedString(node)); - return markedStrings; -} -var SelectorElementBuilder = /** @class */ (function () { - function SelectorElementBuilder(element) { - this.prev = null; - this.element = element; - } - SelectorElementBuilder.prototype.processSelector = function (selector) { - var parentElement = null; - if (!(this.element instanceof RootElement)) { - if (selector.getChildren().some(function (c) { return c.hasChildren() && c.getChild(0).type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].SelectorCombinator; })) { - var curr = this.element.findRoot(); - if (curr.parent instanceof RootElement) { - parentElement = this.element; - this.element = curr.parent; - this.element.removeChild(curr); - this.prev = null; - } - } - } - for (var _i = 0, _a = selector.getChildren(); _i < _a.length; _i++) { - var selectorChild = _a[_i]; - if (selectorChild instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["SimpleSelector"]) { - if (this.prev instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["SimpleSelector"]) { - var labelElement = new LabelElement('\u2026'); - this.element.addChild(labelElement); - this.element = labelElement; - } - else if (this.prev && (this.prev.matches('+') || this.prev.matches('~')) && this.element.parent) { - this.element = this.element.parent; - } - if (this.prev && this.prev.matches('~')) { - this.element.addChild(toElement(selectorChild)); - this.element.addChild(new LabelElement('\u22EE')); - } - var thisElement = toElement(selectorChild, parentElement); - var root = thisElement.findRoot(); - this.element.addChild(root); - this.element = thisElement; - } - if (selectorChild instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["SimpleSelector"] || - selectorChild.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].SelectorCombinatorParent || - selectorChild.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].SelectorCombinatorShadowPiercingDescendant || - selectorChild.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].SelectorCombinatorSibling || - selectorChild.type === _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].SelectorCombinatorAllSiblings) { - this.prev = selectorChild; - } - } - }; - return SelectorElementBuilder; -}()); -function isNewSelectorContext(node) { - switch (node.type) { - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].MixinDeclaration: - case _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["NodeType"].Stylesheet: - return true; - } - return false; -} -function selectorToElement(node) { - if (node.matches('@at-root')) { - return null; - } - var root = new RootElement(); - var parentRuleSets = []; - if (node.getParent() instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["RuleSet"]) { - var parent = node.getParent().getParent(); // parent of the selector's ruleset - while (parent && !isNewSelectorContext(parent)) { - if (parent instanceof _parser_cssNodes_js__WEBPACK_IMPORTED_MODULE_0__["RuleSet"]) { - if (parent.getSelectors().matches('@at-root')) { - break; - } - parentRuleSets.push(parent); - } - parent = parent.getParent(); - } - } - var builder = new SelectorElementBuilder(root); - for (var i = parentRuleSets.length - 1; i >= 0; i--) { - var selector = parentRuleSets[i].getSelectors().getChild(0); - if (selector) { - builder.processSelector(selector); - } - } - builder.processSelector(node); - return root; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/utils/arrays.js": -/*!*********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/utils/arrays.js ***! - \*********************************************************************************************************/ -/*! exports provided: findFirst, includes, union */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findFirst", function() { return findFirst; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return includes; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "union", function() { return union; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/utils/arrays.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -36289,50 +29187,354 @@ function union() { return result; } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/utils/objects.js": -/*!**********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/utils/objects.js ***! - \**********************************************************************************************************/ -/*! exports provided: values */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "values", function() { return values; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/cssSymbolScope.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -function values(obj) { - return Object.keys(obj).map(function (k) { return obj[k]; }); -} +var cssSymbolScope_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); -/***/ }), +var cssSymbolScope_Scope = /** @class */ (function () { + function Scope(offset, length) { + this.offset = offset; + this.length = length; + this.symbols = []; + this.parent = null; + this.children = []; + } + Scope.prototype.addChild = function (scope) { + this.children.push(scope); + scope.setParent(this); + }; + Scope.prototype.setParent = function (scope) { + this.parent = scope; + }; + Scope.prototype.findScope = function (offset, length) { + if (length === void 0) { length = 0; } + if (this.offset <= offset && this.offset + this.length > offset + length || this.offset === offset && this.length === length) { + return this.findInScope(offset, length); + } + return null; + }; + Scope.prototype.findInScope = function (offset, length) { + if (length === void 0) { length = 0; } + // find the first scope child that has an offset larger than offset + length + var end = offset + length; + var idx = findFirst(this.children, function (s) { return s.offset > end; }); + if (idx === 0) { + // all scopes have offsets larger than our end + return this; + } + var res = this.children[idx - 1]; + if (res.offset <= offset && res.offset + res.length >= offset + length) { + return res.findInScope(offset, length); + } + return this; + }; + Scope.prototype.addSymbol = function (symbol) { + this.symbols.push(symbol); + }; + Scope.prototype.getSymbol = function (name, type) { + for (var index = 0; index < this.symbols.length; index++) { + var symbol = this.symbols[index]; + if (symbol.name === name && symbol.type === type) { + return symbol; + } + } + return null; + }; + Scope.prototype.getSymbols = function () { + return this.symbols; + }; + return Scope; +}()); -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/utils/strings.js": -/*!**********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/utils/strings.js ***! - \**********************************************************************************************************/ -/*! exports provided: startsWith, endsWith, difference, getLimitedString */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +var GlobalScope = /** @class */ (function (_super) { + cssSymbolScope_extends(GlobalScope, _super); + function GlobalScope() { + return _super.call(this, 0, Number.MAX_VALUE) || this; + } + return GlobalScope; +}(cssSymbolScope_Scope)); -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return startsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return endsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return difference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLimitedString", function() { return getLimitedString; }); +var Symbol = /** @class */ (function () { + function Symbol(name, value, node, type) { + this.name = name; + this.value = value; + this.node = node; + this.type = type; + } + return Symbol; +}()); + +var cssSymbolScope_ScopeBuilder = /** @class */ (function () { + function ScopeBuilder(scope) { + this.scope = scope; + } + ScopeBuilder.prototype.addSymbol = function (node, name, value, type) { + if (node.offset !== -1) { + var current = this.scope.findScope(node.offset, node.length); + if (current) { + current.addSymbol(new Symbol(name, value, node, type)); + } + } + }; + ScopeBuilder.prototype.addScope = function (node) { + if (node.offset !== -1) { + var current = this.scope.findScope(node.offset, node.length); + if (current && (current.offset !== node.offset || current.length !== node.length)) { // scope already known? + var newScope = new cssSymbolScope_Scope(node.offset, node.length); + current.addChild(newScope); + return newScope; + } + return current; + } + return null; + }; + ScopeBuilder.prototype.addSymbolToChildScope = function (scopeNode, node, name, value, type) { + if (scopeNode && scopeNode.offset !== -1) { + var current = this.addScope(scopeNode); // create the scope or gets the existing one + if (current) { + current.addSymbol(new Symbol(name, value, node, type)); + } + } + }; + ScopeBuilder.prototype.visitNode = function (node) { + switch (node.type) { + case NodeType.Keyframe: + this.addSymbol(node, node.getName(), void 0, ReferenceType.Keyframe); + return true; + case NodeType.CustomPropertyDeclaration: + return this.visitCustomPropertyDeclarationNode(node); + case NodeType.VariableDeclaration: + return this.visitVariableDeclarationNode(node); + case NodeType.Ruleset: + return this.visitRuleSet(node); + case NodeType.MixinDeclaration: + this.addSymbol(node, node.getName(), void 0, ReferenceType.Mixin); + return true; + case NodeType.FunctionDeclaration: + this.addSymbol(node, node.getName(), void 0, ReferenceType.Function); + return true; + case NodeType.FunctionParameter: { + return this.visitFunctionParameterNode(node); + } + case NodeType.Declarations: + this.addScope(node); + return true; + case NodeType.For: + var forNode = node; + var scopeNode = forNode.getDeclarations(); + if (scopeNode) { + this.addSymbolToChildScope(scopeNode, forNode.variable, forNode.variable.getName(), void 0, ReferenceType.Variable); + } + return true; + case NodeType.Each: { + var eachNode = node; + var scopeNode_1 = eachNode.getDeclarations(); + if (scopeNode_1) { + var variables = eachNode.getVariables().getChildren(); + for (var _i = 0, variables_1 = variables; _i < variables_1.length; _i++) { + var variable = variables_1[_i]; + this.addSymbolToChildScope(scopeNode_1, variable, variable.getName(), void 0, ReferenceType.Variable); + } + } + return true; + } + } + return true; + }; + ScopeBuilder.prototype.visitRuleSet = function (node) { + var current = this.scope.findScope(node.offset, node.length); + if (current) { + for (var _i = 0, _a = node.getSelectors().getChildren(); _i < _a.length; _i++) { + var child = _a[_i]; + if (child instanceof Selector) { + if (child.getChildren().length === 1) { // only selectors with a single element can be extended + current.addSymbol(new Symbol(child.getChild(0).getText(), void 0, child, ReferenceType.Rule)); + } + } + } + } + return true; + }; + ScopeBuilder.prototype.visitVariableDeclarationNode = function (node) { + var value = node.getValue() ? node.getValue().getText() : void 0; + this.addSymbol(node, node.getName(), value, ReferenceType.Variable); + return true; + }; + ScopeBuilder.prototype.visitFunctionParameterNode = function (node) { + // parameters are part of the body scope + var scopeNode = node.getParent().getDeclarations(); + if (scopeNode) { + var valueNode = node.getDefaultValue(); + var value = valueNode ? valueNode.getText() : void 0; + this.addSymbolToChildScope(scopeNode, node, node.getName(), value, ReferenceType.Variable); + } + return true; + }; + ScopeBuilder.prototype.visitCustomPropertyDeclarationNode = function (node) { + var value = node.getValue() ? node.getValue().getText() : ''; + this.addCSSVariable(node.getProperty(), node.getProperty().getName(), value, ReferenceType.Variable); + return true; + }; + ScopeBuilder.prototype.addCSSVariable = function (node, name, value, type) { + if (node.offset !== -1) { + this.scope.addSymbol(new Symbol(name, value, node, type)); + } + }; + return ScopeBuilder; +}()); + +var cssSymbolScope_Symbols = /** @class */ (function () { + function Symbols(node) { + this.global = new GlobalScope(); + node.acceptVisitor(new cssSymbolScope_ScopeBuilder(this.global)); + } + Symbols.prototype.findSymbolsAtOffset = function (offset, referenceType) { + var scope = this.global.findScope(offset, 0); + var result = []; + var names = {}; + while (scope) { + var symbols = scope.getSymbols(); + for (var i = 0; i < symbols.length; i++) { + var symbol = symbols[i]; + if (symbol.type === referenceType && !names[symbol.name]) { + result.push(symbol); + names[symbol.name] = true; + } + } + scope = scope.parent; + } + return result; + }; + Symbols.prototype.internalFindSymbol = function (node, referenceTypes) { + var scopeNode = node; + if (node.parent instanceof FunctionParameter && node.parent.getParent() instanceof BodyDeclaration) { + scopeNode = node.parent.getParent().getDeclarations(); + } + if (node.parent instanceof FunctionArgument && node.parent.getParent() instanceof Function) { + var funcId = node.parent.getParent().getIdentifier(); + if (funcId) { + var functionSymbol = this.internalFindSymbol(funcId, [ReferenceType.Function]); + if (functionSymbol) { + scopeNode = functionSymbol.node.getDeclarations(); + } + } + } + if (!scopeNode) { + return null; + } + var name = node.getText(); + var scope = this.global.findScope(scopeNode.offset, scopeNode.length); + while (scope) { + for (var index = 0; index < referenceTypes.length; index++) { + var type = referenceTypes[index]; + var symbol = scope.getSymbol(name, type); + if (symbol) { + return symbol; + } + } + scope = scope.parent; + } + return null; + }; + Symbols.prototype.evaluateReferenceTypes = function (node) { + if (node instanceof Identifier) { + var referenceTypes = node.referenceTypes; + if (referenceTypes) { + return referenceTypes; + } + else { + if (node.isCustomProperty) { + return [ReferenceType.Variable]; + } + // are a reference to a keyframe? + var decl = getParentDeclaration(node); + if (decl) { + var propertyName = decl.getNonPrefixedPropertyName(); + if ((propertyName === 'animation' || propertyName === 'animation-name') + && decl.getValue() && decl.getValue().offset === node.offset) { + return [ReferenceType.Keyframe]; + } + } + } + } + else if (node instanceof Variable) { + return [ReferenceType.Variable]; + } + var selector = node.findAParent(NodeType.Selector, NodeType.ExtendsReference); + if (selector) { + return [ReferenceType.Rule]; + } + return null; + }; + Symbols.prototype.findSymbolFromNode = function (node) { + if (!node) { + return null; + } + while (node.type === NodeType.Interpolation) { + node = node.getParent(); + } + var referenceTypes = this.evaluateReferenceTypes(node); + if (referenceTypes) { + return this.internalFindSymbol(node, referenceTypes); + } + return null; + }; + Symbols.prototype.matchesSymbol = function (node, symbol) { + if (!node) { + return false; + } + while (node.type === NodeType.Interpolation) { + node = node.getParent(); + } + if (symbol.name.length !== node.length || symbol.name !== node.getText()) { + return false; + } + var referenceTypes = this.evaluateReferenceTypes(node); + if (!referenceTypes || referenceTypes.indexOf(symbol.type) === -1) { + return false; + } + var nodeSymbol = this.internalFindSymbol(node, referenceTypes); + return nodeSymbol === symbol; + }; + Symbols.prototype.findSymbol = function (name, type, offset) { + var scope = this.global.findScope(offset); + while (scope) { + var symbol = scope.getSymbol(name, type); + if (symbol) { + return symbol; + } + scope = scope.parent; + } + return null; + }; + return Symbols; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/utils/strings.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -function startsWith(haystack, needle) { +function strings_startsWith(haystack, needle) { if (haystack.length < needle.length) { return false; } @@ -36346,7 +29548,7 @@ function startsWith(haystack, needle) { /** * Determines if haystack ends with needle. */ -function endsWith(haystack, needle) { +function strings_endsWith(haystack, needle) { var diff = haystack.length - needle.length; if (diff > 0) { return haystack.lastIndexOf(needle) === diff; @@ -36411,65 +29613,7 @@ function getLimitedString(str, ellipsis) { return str.slice(0, 140) + (ellipsis ? '\u2026' : ''); } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-languageserver-types/main.js": -/*!**************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-languageserver-types/main.js ***! - \**************************************************************************************************/ -/*! exports provided: Position, Range, Location, LocationLink, Color, ColorInformation, ColorPresentation, FoldingRangeKind, FoldingRange, DiagnosticRelatedInformation, DiagnosticSeverity, Diagnostic, Command, TextEdit, TextDocumentEdit, CreateFile, RenameFile, DeleteFile, WorkspaceEdit, WorkspaceChange, TextDocumentIdentifier, VersionedTextDocumentIdentifier, TextDocumentItem, MarkupKind, MarkupContent, CompletionItemKind, InsertTextFormat, CompletionItem, CompletionList, MarkedString, Hover, ParameterInformation, SignatureInformation, DocumentHighlightKind, DocumentHighlight, SymbolKind, SymbolInformation, DocumentSymbol, CodeActionKind, CodeActionContext, CodeAction, CodeLens, FormattingOptions, DocumentLink, EOL, TextDocument, TextDocumentSaveReason */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Location", function() { return Location; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocationLink", function() { return LocationLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorInformation", function() { return ColorInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPresentation", function() { return ColorPresentation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRangeKind", function() { return FoldingRangeKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRange", function() { return FoldingRange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticRelatedInformation", function() { return DiagnosticRelatedInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticSeverity", function() { return DiagnosticSeverity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Diagnostic", function() { return Diagnostic; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEdit", function() { return TextEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentEdit", function() { return TextDocumentEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CreateFile", function() { return CreateFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenameFile", function() { return RenameFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteFile", function() { return DeleteFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceEdit", function() { return WorkspaceEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceChange", function() { return WorkspaceChange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentIdentifier", function() { return TextDocumentIdentifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VersionedTextDocumentIdentifier", function() { return VersionedTextDocumentIdentifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentItem", function() { return TextDocumentItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupKind", function() { return MarkupKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupContent", function() { return MarkupContent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InsertTextFormat", function() { return InsertTextFormat; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItem", function() { return CompletionItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionList", function() { return CompletionList; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkedString", function() { return MarkedString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hover", function() { return Hover; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParameterInformation", function() { return ParameterInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureInformation", function() { return SignatureInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlight", function() { return DocumentHighlight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolInformation", function() { return SymbolInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentSymbol", function() { return DocumentSymbol; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionKind", function() { return CodeActionKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionContext", function() { return CodeActionContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeAction", function() { return CodeAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeLens", function() { return CodeLens; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattingOptions", function() { return FormattingOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentLink", function() { return DocumentLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EOL", function() { return EOL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocument", function() { return TextDocument; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentSaveReason", function() { return TextDocumentSaveReason; }); +// 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. @@ -36479,7 +29623,7 @@ __webpack_require__.r(__webpack_exports__); * The Position namespace provides helper functions to work with * [Position](#Position) literals. */ -var Position; +var main_Position; (function (Position) { /** * Creates a new Position literal from the given line and character. @@ -36498,18 +29642,18 @@ var Position; return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character); } Position.is = is; -})(Position || (Position = {})); +})(main_Position || (main_Position = {})); /** * The Range namespace provides helper functions to work with * [Range](#Range) literals. */ -var Range; +var main_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) }; + return { start: main_Position.create(one, two), end: main_Position.create(three, four) }; } - else if (Position.is(one) && Position.is(two)) { + else if (main_Position.is(one) && main_Position.is(two)) { return { start: one, end: two }; } else { @@ -36522,10 +29666,10 @@ var Range; */ function is(value) { var candidate = value; - return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); + return Is.objectLiteral(candidate) && main_Position.is(candidate.start) && main_Position.is(candidate.end); } Range.is = is; -})(Range || (Range = {})); +})(main_Range || (main_Range = {})); /** * The Location namespace provides helper functions to work with * [Location](#Location) literals. @@ -36546,7 +29690,7 @@ var Location; */ function is(value) { var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); + return Is.defined(candidate) && main_Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); } Location.is = is; })(Location || (Location = {})); @@ -36572,9 +29716,9 @@ var LocationLink; */ 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)); + return Is.defined(candidate) && main_Range.is(candidate.targetRange) && Is.string(candidate.targetUri) + && (main_Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) + && (main_Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); } LocationLink.is = is; })(LocationLink || (LocationLink = {})); @@ -36629,7 +29773,7 @@ var ColorInformation; */ function is(value) { var candidate = value; - return Range.is(candidate.range) && Color.is(candidate.color); + return main_Range.is(candidate.range) && Color.is(candidate.color); } ColorInformation.is = is; })(ColorInformation || (ColorInformation = {})); @@ -36796,7 +29940,7 @@ var Diagnostic; function is(value) { var candidate = value; return Is.defined(candidate) - && Range.is(candidate.range) + && main_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)) @@ -36871,7 +30015,7 @@ var TextEdit; var candidate = value; return Is.objectLiteral(candidate) && Is.string(candidate.newText) - && Range.is(candidate.range); + && main_Range.is(candidate.range); } TextEdit.is = is; })(TextEdit || (TextEdit = {})); @@ -37215,7 +30359,7 @@ var MarkupContent; /** * The kind of a completion entry. */ -var CompletionItemKind; +var main_CompletionItemKind; (function (CompletionItemKind) { CompletionItemKind.Text = 1; CompletionItemKind.Method = 2; @@ -37242,7 +30386,7 @@ var CompletionItemKind; CompletionItemKind.Event = 23; CompletionItemKind.Operator = 24; CompletionItemKind.TypeParameter = 25; -})(CompletionItemKind || (CompletionItemKind = {})); +})(main_CompletionItemKind || (main_CompletionItemKind = {})); /** * Defines whether the insert text in a completion item should be interpreted as * plain text or a snippet. @@ -37326,7 +30470,7 @@ var Hover; 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)); + Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || main_Range.is(value.range)); } Hover.is = is; })(Hover || (Hover = {})); @@ -37376,7 +30520,7 @@ var SignatureInformation; /** * A document highlight kind. */ -var DocumentHighlightKind; +var main_DocumentHighlightKind; (function (DocumentHighlightKind) { /** * A textual occurrence. @@ -37390,7 +30534,7 @@ var DocumentHighlightKind; * Write-access of a symbol, like writing to a variable. */ DocumentHighlightKind.Write = 3; -})(DocumentHighlightKind || (DocumentHighlightKind = {})); +})(main_DocumentHighlightKind || (main_DocumentHighlightKind = {})); /** * DocumentHighlight namespace to provide helper functions to work with * [DocumentHighlight](#DocumentHighlight) literals. @@ -37413,7 +30557,7 @@ var DocumentHighlight; /** * A symbol kind. */ -var SymbolKind; +var main_SymbolKind; (function (SymbolKind) { SymbolKind.File = 1; SymbolKind.Module = 2; @@ -37441,7 +30585,7 @@ var SymbolKind; SymbolKind.Event = 24; SymbolKind.Operator = 25; SymbolKind.TypeParameter = 26; -})(SymbolKind || (SymbolKind = {})); +})(main_SymbolKind || (main_SymbolKind = {})); var SymbolInformation; (function (SymbolInformation) { /** @@ -37510,7 +30654,7 @@ var DocumentSymbol = /** @class */ (function () { var candidate = value; return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && - Range.is(candidate.range) && Range.is(candidate.selectionRange) && + main_Range.is(candidate.range) && main_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)); @@ -37651,7 +30795,7 @@ var CodeLens; */ function is(value) { var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); + return Is.defined(candidate) && main_Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); } CodeLens.is = is; })(CodeLens || (CodeLens = {})); @@ -37704,7 +30848,7 @@ var DocumentLink = /** @class */ (function () { */ function is(value) { var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); + return Is.defined(candidate) && main_Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); } DocumentLink.is = is; })(DocumentLink || (DocumentLink = {})); @@ -37877,7 +31021,7 @@ var FullTextDocument = /** @class */ (function () { var lineOffsets = this.getLineOffsets(); var low = 0, high = lineOffsets.length; if (high === 0) { - return Position.create(0, offset); + return main_Position.create(0, offset); } while (low < high) { var mid = Math.floor((low + high) / 2); @@ -37891,7 +31035,7 @@ var FullTextDocument = /** @class */ (function () { // 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]); + return main_Position.create(line, offset - lineOffsets[line]); }; FullTextDocument.prototype.offsetAt = function (position) { var lineOffsets = this.getLineOffsets(); @@ -37954,20 +31098,7 @@ var Is; Is.typedArray = typedArray; })(Is || (Is = {})); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/css.worker.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/css.worker.js ***! - \**********************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _editor_editor_worker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editor/editor.worker.js */ "./node_modules/monaco-editor/esm/vs/editor/editor.worker.js"); -/* harmony import */ var _cssWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cssWorker.js */ "./node_modules/monaco-editor/esm/vs/language/css/cssWorker.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssCompletion.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -37975,29 +31106,4812 @@ __webpack_require__.r(__webpack_exports__); -self.onmessage = function () { - // ignore the first message - _editor_editor_worker_js__WEBPACK_IMPORTED_MODULE_0__["initialize"](function (ctx, createData) { - return new _cssWorker_js__WEBPACK_IMPORTED_MODULE_1__["CSSWorker"](ctx, createData); + + + + +var cssCompletion_localize = loadMessageBundle(); +var SnippetFormat = InsertTextFormat.Snippet; +var cssCompletion_CSSCompletion = /** @class */ (function () { + function CSSCompletion(variablePrefix) { + if (variablePrefix === void 0) { variablePrefix = null; } + this.completionParticipants = []; + this.valueTypes = [ + NodeType.Identifier, NodeType.Value, NodeType.StringLiteral, NodeType.URILiteral, NodeType.NumericValue, + NodeType.HexColorValue, NodeType.VariableName, NodeType.Prio + ]; + this.variablePrefix = variablePrefix; + } + CSSCompletion.prototype.getSymbolContext = function () { + if (!this.symbolContext) { + this.symbolContext = new cssSymbolScope_Symbols(this.styleSheet); + } + return this.symbolContext; + }; + CSSCompletion.prototype.setCompletionParticipants = function (registeredCompletionParticipants) { + this.completionParticipants = registeredCompletionParticipants || []; + }; + CSSCompletion.prototype.doComplete = function (document, position, styleSheet) { + this.offset = document.offsetAt(position); + this.position = position; + this.currentWord = getCurrentWord(document, this.offset); + this.defaultReplaceRange = main_Range.create(main_Position.create(this.position.line, this.position.character - this.currentWord.length), this.position); + this.textDocument = document; + this.styleSheet = styleSheet; + try { + var result = { isIncomplete: false, items: [] }; + this.nodePath = getNodePath(this.styleSheet, this.offset); + for (var i = this.nodePath.length - 1; i >= 0; i--) { + var node = this.nodePath[i]; + if (node instanceof Property) { + this.getCompletionsForDeclarationProperty(node.getParent(), result); + } + else if (node instanceof Expression) { + if (node.parent instanceof Interpolation) { + this.getVariableProposals(null, result); + } + else { + this.getCompletionsForExpression(node, result); + } + } + else if (node instanceof SimpleSelector) { + var parentRef = node.findAParent(NodeType.ExtendsReference, NodeType.Ruleset); + if (parentRef) { + if (parentRef.type === NodeType.ExtendsReference) { + this.getCompletionsForExtendsReference(parentRef, node, result); + } + else { + var parentRuleSet = parentRef; + this.getCompletionsForSelector(parentRuleSet, parentRuleSet && parentRuleSet.isNested(), result); + } + } + } + else if (node instanceof FunctionArgument) { + this.getCompletionsForFunctionArgument(node, node.getParent(), result); + } + else if (node instanceof Declarations) { + this.getCompletionsForDeclarations(node, result); + } + else if (node instanceof VariableDeclaration) { + this.getCompletionsForVariableDeclaration(node, result); + } + else if (node instanceof RuleSet) { + this.getCompletionsForRuleSet(node, result); + } + else if (node instanceof Interpolation) { + this.getCompletionsForInterpolation(node, result); + } + else if (node instanceof FunctionDeclaration) { + this.getCompletionsForFunctionDeclaration(node, result); + } + else if (node instanceof MixinReference) { + this.getCompletionsForMixinReference(node, result); + } + else if (node instanceof Function) { + this.getCompletionsForFunctionArgument(null, node, result); + } + else if (node instanceof Supports) { + this.getCompletionsForSupports(node, result); + } + else if (node instanceof SupportsCondition) { + this.getCompletionsForSupportsCondition(node, result); + } + else if (node instanceof ExtendsReference) { + this.getCompletionsForExtendsReference(node, null, result); + } + else if (node.type === NodeType.URILiteral) { + this.getCompletionForUriLiteralValue(node, result); + } + else if (node.type === NodeType.StringLiteral && node.parent.type === NodeType.Import) { + this.getCompletionForImportPath(node, result); + } + else if (node.parent === null) { + this.getCompletionForTopLevel(result); + // } else if (node instanceof nodes.Variable) { + // this.getCompletionsForVariableDeclaration() + } + else { + continue; + } + if (result.items.length > 0 || this.offset > node.offset) { + return this.finalize(result); + } + } + this.getCompletionsForStylesheet(result); + if (result.items.length === 0) { + if (this.variablePrefix && this.currentWord.indexOf(this.variablePrefix) === 0) { + this.getVariableProposals(null, result); + } + } + return this.finalize(result); + } + finally { + // don't hold on any state, clear symbolContext + this.position = null; + this.currentWord = null; + this.textDocument = null; + this.styleSheet = null; + this.symbolContext = null; + this.defaultReplaceRange = null; + this.nodePath = null; + } + }; + CSSCompletion.prototype.finalize = function (result) { + var needsSortText = result.items.some(function (i) { return !!i.sortText; }); + if (needsSortText) { + for (var _i = 0, _a = result.items; _i < _a.length; _i++) { + var i = _a[_i]; + if (!i.sortText) { + i.sortText = 'd'; + } + } + } + return result; + }; + CSSCompletion.prototype.findInNodePath = function () { + var types = []; + for (var _i = 0; _i < arguments.length; _i++) { + types[_i] = arguments[_i]; + } + for (var i = this.nodePath.length - 1; i >= 0; i--) { + var node = this.nodePath[i]; + if (types.indexOf(node.type) !== -1) { + return node; + } + } + return null; + }; + CSSCompletion.prototype.getCompletionsForDeclarationProperty = function (declaration, result) { + return this.getPropertyProposals(declaration, result); + }; + CSSCompletion.prototype.getPropertyProposals = function (declaration, result) { + var _this = this; + var properties = cssDataManager.getProperties(); + properties.forEach(function (entry) { + var range; + var insertText; + var retrigger = false; + if (declaration) { + range = _this.getCompletionRange(declaration.getProperty()); + insertText = entry.name; + if (!isDefined(declaration.colonPosition)) { + insertText += ': '; + retrigger = true; + } + } + else { + range = _this.getCompletionRange(null); + insertText = entry.name + ': '; + retrigger = true; + } + var item = { + label: entry.name, + documentation: getEntryDescription(entry), + textEdit: TextEdit.replace(range, insertText), + kind: main_CompletionItemKind.Property + }; + if (!entry.restrictions) { + retrigger = false; + } + if (retrigger) { + item.command = { + title: 'Suggest', + command: 'editor.action.triggerSuggest' + }; + } + if (strings_startsWith(entry.name, '-')) { + item.sortText = 'x'; + } + result.items.push(item); + }); + this.completionParticipants.forEach(function (participant) { + if (participant.onCssProperty) { + participant.onCssProperty({ + propertyName: _this.currentWord, + range: _this.defaultReplaceRange + }); + } + }); + return result; + }; + CSSCompletion.prototype.getCompletionsForDeclarationValue = function (node, result) { + var _this = this; + var propertyName = node.getFullPropertyName(); + var entry = cssDataManager.getProperty(propertyName); + var existingNode = node.getValue(); + while (existingNode && existingNode.hasChildren()) { + existingNode = existingNode.findChildAtOffset(this.offset, false); + } + this.completionParticipants.forEach(function (participant) { + if (participant.onCssPropertyValue) { + participant.onCssPropertyValue({ + propertyName: propertyName, + propertyValue: _this.currentWord, + range: _this.getCompletionRange(existingNode) + }); + } + }); + if (entry) { + if (entry.restrictions) { + for (var _i = 0, _a = entry.restrictions; _i < _a.length; _i++) { + var restriction = _a[_i]; + switch (restriction) { + case 'color': + this.getColorProposals(entry, existingNode, result); + break; + case 'position': + this.getPositionProposals(entry, existingNode, result); + break; + case 'repeat': + this.getRepeatStyleProposals(entry, existingNode, result); + break; + case 'line-style': + this.getLineStyleProposals(entry, existingNode, result); + break; + case 'line-width': + this.getLineWidthProposals(entry, existingNode, result); + break; + case 'geometry-box': + this.getGeometryBoxProposals(entry, existingNode, result); + break; + case 'box': + this.getBoxProposals(entry, existingNode, result); + break; + case 'image': + this.getImageProposals(entry, existingNode, result); + break; + case 'timing-function': + this.getTimingFunctionProposals(entry, existingNode, result); + break; + case 'shape': + this.getBasicShapeProposals(entry, existingNode, result); + break; + } + } + } + this.getValueEnumProposals(entry, existingNode, result); + this.getCSSWideKeywordProposals(entry, existingNode, result); + this.getUnitProposals(entry, existingNode, result); + } + else { + var existingValues = collectValues(this.styleSheet, node); + for (var _b = 0, _c = existingValues.getEntries(); _b < _c.length; _b++) { + var existingValue = _c[_b]; + result.items.push({ + label: existingValue, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), existingValue), + kind: main_CompletionItemKind.Value + }); + } + } + this.getVariableProposals(existingNode, result); + this.getTermProposals(entry, existingNode, result); + return result; + }; + CSSCompletion.prototype.getValueEnumProposals = function (entry, existingNode, result) { + if (entry.values) { + for (var _i = 0, _a = entry.values; _i < _a.length; _i++) { + var value = _a[_i]; + if (supportedInMoreThanOneBrowser(value)) { + var insertString = value.name; + var insertTextFormat = void 0; + if (strings_endsWith(insertString, ')')) { + var from = insertString.lastIndexOf('('); + if (from !== -1) { + insertString = insertString.substr(0, from) + '($1)'; + insertTextFormat = SnippetFormat; + } + } + var item = { + label: value.name, + documentation: getEntryDescription(value), + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertString), + kind: main_CompletionItemKind.Value, + insertTextFormat: insertTextFormat + }; + result.items.push(item); + } + } + } + return result; + }; + CSSCompletion.prototype.getCSSWideKeywordProposals = function (entry, existingNode, result) { + for (var keywords in cssWideKeywords) { + result.items.push({ + label: keywords, + documentation: cssWideKeywords[keywords], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), keywords), + kind: main_CompletionItemKind.Value + }); + } + return result; + }; + CSSCompletion.prototype.getCompletionsForInterpolation = function (node, result) { + if (this.offset >= node.offset + 2) { + this.getVariableProposals(null, result); + } + return result; + }; + CSSCompletion.prototype.getVariableProposals = function (existingNode, result) { + var symbols = this.getSymbolContext().findSymbolsAtOffset(this.offset, ReferenceType.Variable); + for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) { + var symbol = symbols_1[_i]; + var insertText = strings_startsWith(symbol.name, '--') ? "var(" + symbol.name + ")" : symbol.name; + var suggest = { + label: symbol.name, + documentation: symbol.value ? getLimitedString(symbol.value) : symbol.value, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertText), + kind: main_CompletionItemKind.Variable, + sortText: 'z' + }; + if (symbol.node.type === NodeType.FunctionParameter) { + var mixinNode = (symbol.node.getParent()); + if (mixinNode.type === NodeType.MixinDeclaration) { + suggest.detail = cssCompletion_localize('completion.argument', 'argument from \'{0}\'', mixinNode.getName()); + } + } + result.items.push(suggest); + } + return result; + }; + CSSCompletion.prototype.getVariableProposalsForCSSVarFunction = function (result) { + var symbols = this.getSymbolContext().findSymbolsAtOffset(this.offset, ReferenceType.Variable); + symbols = symbols.filter(function (symbol) { + return strings_startsWith(symbol.name, '--'); + }); + for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) { + var symbol = symbols_2[_i]; + result.items.push({ + label: symbol.name, + documentation: symbol.value ? getLimitedString(symbol.value) : symbol.value, + textEdit: TextEdit.replace(this.getCompletionRange(null), symbol.name), + kind: main_CompletionItemKind.Variable + }); + } + return result; + }; + CSSCompletion.prototype.getUnitProposals = function (entry, existingNode, result) { + var currentWord = '0'; + if (this.currentWord.length > 0) { + var numMatch = this.currentWord.match(/^-?\d[\.\d+]*/); + if (numMatch) { + currentWord = numMatch[0]; + result.isIncomplete = currentWord.length === this.currentWord.length; + } + } + else if (this.currentWord.length === 0) { + result.isIncomplete = true; + } + if (existingNode && existingNode.parent && existingNode.parent.type === NodeType.Term) { + existingNode = existingNode.getParent(); // include the unary operator + } + if (entry.restrictions) { + for (var _i = 0, _a = entry.restrictions; _i < _a.length; _i++) { + var restriction = _a[_i]; + var units = builtinData_units[restriction]; + if (units) { + for (var _b = 0, units_1 = units; _b < units_1.length; _b++) { + var unit = units_1[_b]; + var insertText = currentWord + unit; + result.items.push({ + label: insertText, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertText), + kind: main_CompletionItemKind.Unit + }); + } + } + } + } + return result; + }; + CSSCompletion.prototype.getCompletionRange = function (existingNode) { + if (existingNode && existingNode.offset <= this.offset) { + var end = existingNode.end !== -1 ? this.textDocument.positionAt(existingNode.end) : this.position; + return main_Range.create(this.textDocument.positionAt(existingNode.offset), end); + } + return this.defaultReplaceRange; + }; + CSSCompletion.prototype.getColorProposals = function (entry, existingNode, result) { + for (var color in colors) { + result.items.push({ + label: color, + documentation: colors[color], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), color), + kind: main_CompletionItemKind.Color + }); + } + for (var color in colorKeywords) { + result.items.push({ + label: color, + documentation: colorKeywords[color], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), color), + kind: main_CompletionItemKind.Value + }); + } + var colorValues = new cssCompletion_Set(); + this.styleSheet.acceptVisitor(new cssCompletion_ColorValueCollector(colorValues, this.offset)); + for (var _i = 0, _a = colorValues.getEntries(); _i < _a.length; _i++) { + var color = _a[_i]; + result.items.push({ + label: color, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), color), + kind: main_CompletionItemKind.Color + }); + } + var _loop_1 = function (p) { + var tabStop = 1; + var replaceFunction = function (match, p1) { return '${' + tabStop++ + ':' + p1 + '}'; }; + var insertText = p.func.replace(/\[?\$(\w+)\]?/g, replaceFunction); + result.items.push({ + label: p.func.substr(0, p.func.indexOf('(')), + detail: p.func, + documentation: p.desc, + textEdit: TextEdit.replace(this_1.getCompletionRange(existingNode), insertText), + insertTextFormat: SnippetFormat, + kind: main_CompletionItemKind.Function + }); + }; + var this_1 = this; + for (var _b = 0, _c = colorFunctions; _b < _c.length; _b++) { + var p = _c[_b]; + _loop_1(p); + } + return result; + }; + CSSCompletion.prototype.getPositionProposals = function (entry, existingNode, result) { + for (var position in positionKeywords) { + result.items.push({ + label: position, + documentation: positionKeywords[position], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), position), + kind: main_CompletionItemKind.Value + }); + } + return result; + }; + CSSCompletion.prototype.getRepeatStyleProposals = function (entry, existingNode, result) { + for (var repeat in repeatStyleKeywords) { + result.items.push({ + label: repeat, + documentation: repeatStyleKeywords[repeat], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), repeat), + kind: main_CompletionItemKind.Value + }); + } + return result; + }; + CSSCompletion.prototype.getLineStyleProposals = function (entry, existingNode, result) { + for (var lineStyle in lineStyleKeywords) { + result.items.push({ + label: lineStyle, + documentation: lineStyleKeywords[lineStyle], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), lineStyle), + kind: main_CompletionItemKind.Value + }); + } + return result; + }; + CSSCompletion.prototype.getLineWidthProposals = function (entry, existingNode, result) { + for (var _i = 0, _a = lineWidthKeywords; _i < _a.length; _i++) { + var lineWidth = _a[_i]; + result.items.push({ + label: lineWidth, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), lineWidth), + kind: main_CompletionItemKind.Value + }); + } + return result; + }; + CSSCompletion.prototype.getGeometryBoxProposals = function (entry, existingNode, result) { + for (var box in geometryBoxKeywords) { + result.items.push({ + label: box, + documentation: geometryBoxKeywords[box], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), box), + kind: main_CompletionItemKind.Value + }); + } + return result; + }; + CSSCompletion.prototype.getBoxProposals = function (entry, existingNode, result) { + for (var box in boxKeywords) { + result.items.push({ + label: box, + documentation: boxKeywords[box], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), box), + kind: main_CompletionItemKind.Value + }); + } + return result; + }; + CSSCompletion.prototype.getImageProposals = function (entry, existingNode, result) { + for (var image in imageFunctions) { + var insertText = moveCursorInsideParenthesis(image); + result.items.push({ + label: image, + documentation: imageFunctions[image], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertText), + kind: main_CompletionItemKind.Function, + insertTextFormat: image !== insertText ? SnippetFormat : void 0 + }); + } + return result; + }; + CSSCompletion.prototype.getTimingFunctionProposals = function (entry, existingNode, result) { + for (var timing in transitionTimingFunctions) { + var insertText = moveCursorInsideParenthesis(timing); + result.items.push({ + label: timing, + documentation: transitionTimingFunctions[timing], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertText), + kind: main_CompletionItemKind.Function, + insertTextFormat: timing !== insertText ? SnippetFormat : void 0 + }); + } + return result; + }; + CSSCompletion.prototype.getBasicShapeProposals = function (entry, existingNode, result) { + for (var shape in basicShapeFunctions) { + var insertText = moveCursorInsideParenthesis(shape); + result.items.push({ + label: shape, + documentation: basicShapeFunctions[shape], + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertText), + kind: main_CompletionItemKind.Function, + insertTextFormat: shape !== insertText ? SnippetFormat : void 0 + }); + } + return result; + }; + CSSCompletion.prototype.getCompletionsForStylesheet = function (result) { + var node = this.styleSheet.findFirstChildBeforeOffset(this.offset); + if (!node) { + return this.getCompletionForTopLevel(result); + } + if (node instanceof RuleSet) { + return this.getCompletionsForRuleSet(node, result); + } + if (node instanceof Supports) { + return this.getCompletionsForSupports(node, result); + } + return result; + }; + CSSCompletion.prototype.getCompletionForTopLevel = function (result) { + var _this = this; + cssDataManager.getAtDirectives().forEach(function (entry) { + result.items.push({ + label: entry.name, + textEdit: TextEdit.replace(_this.getCompletionRange(null), entry.name), + documentation: getEntryDescription(entry), + kind: main_CompletionItemKind.Keyword + }); + }); + this.getCompletionsForSelector(null, false, result); + return result; + }; + CSSCompletion.prototype.getCompletionsForRuleSet = function (ruleSet, result) { + var declarations = ruleSet.getDeclarations(); + var isAfter = declarations && declarations.endsWith('}') && this.offset >= declarations.end; + if (isAfter) { + return this.getCompletionForTopLevel(result); + } + var isInSelectors = !declarations || this.offset <= declarations.offset; + if (isInSelectors) { + return this.getCompletionsForSelector(ruleSet, ruleSet.isNested(), result); + } + return this.getCompletionsForDeclarations(ruleSet.getDeclarations(), result); + }; + CSSCompletion.prototype.getCompletionsForSelector = function (ruleSet, isNested, result) { + var _this = this; + var existingNode = this.findInNodePath(NodeType.PseudoSelector, NodeType.IdentifierSelector, NodeType.ClassSelector, NodeType.ElementNameSelector); + if (!existingNode && this.offset - this.currentWord.length > 0 && this.textDocument.getText()[this.offset - this.currentWord.length - 1] === ':') { + // after the ':' of a pseudo selector, no node generated for just ':' + this.currentWord = ':' + this.currentWord; + this.defaultReplaceRange = main_Range.create(main_Position.create(this.position.line, this.position.character - this.currentWord.length), this.position); + } + var pseudoClasses = cssDataManager.getPseudoClasses(); + pseudoClasses.forEach(function (entry) { + var insertText = moveCursorInsideParenthesis(entry.name); + var item = { + label: entry.name, + textEdit: TextEdit.replace(_this.getCompletionRange(existingNode), insertText), + documentation: getEntryDescription(entry), + kind: main_CompletionItemKind.Function, + insertTextFormat: entry.name !== insertText ? SnippetFormat : void 0 + }; + if (strings_startsWith(entry.name, ':-')) { + item.sortText = 'x'; + } + result.items.push(item); + }); + var pseudoElements = cssDataManager.getPseudoElements(); + pseudoElements.forEach(function (entry) { + var insertText = moveCursorInsideParenthesis(entry.name); + var item = { + label: entry.name, + textEdit: TextEdit.replace(_this.getCompletionRange(existingNode), insertText), + documentation: getEntryDescription(entry), + kind: main_CompletionItemKind.Function, + insertTextFormat: entry.name !== insertText ? SnippetFormat : void 0 + }; + if (strings_startsWith(entry.name, '::-')) { + item.sortText = 'x'; + } + result.items.push(item); + }); + if (!isNested) { // show html tags only for top level + for (var _i = 0, _a = html5Tags; _i < _a.length; _i++) { + var entry = _a[_i]; + result.items.push({ + label: entry, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), entry), + kind: main_CompletionItemKind.Keyword + }); + } + for (var _b = 0, _c = svgElements; _b < _c.length; _b++) { + var entry = _c[_b]; + result.items.push({ + label: entry, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), entry), + kind: main_CompletionItemKind.Keyword + }); + } + } + var visited = {}; + visited[this.currentWord] = true; + var textProvider = this.styleSheet.getTextProvider(); + this.styleSheet.accept(function (n) { + if (n.type === NodeType.SimpleSelector && n.length > 0) { + var selector = textProvider(n.offset, n.length); + if (selector.charAt(0) === '.' && !visited[selector]) { + visited[selector] = true; + result.items.push({ + label: selector, + textEdit: TextEdit.replace(_this.getCompletionRange(existingNode), selector), + kind: main_CompletionItemKind.Keyword + }); + } + return false; + } + return true; + }); + if (ruleSet && ruleSet.isNested()) { + var selector = ruleSet.getSelectors().findFirstChildBeforeOffset(this.offset); + if (selector && ruleSet.getSelectors().getChildren().indexOf(selector) === 0) { + this.getPropertyProposals(null, result); + } + } + return result; + }; + CSSCompletion.prototype.getCompletionsForDeclarations = function (declarations, result) { + if (!declarations || this.offset === declarations.offset) { // incomplete nodes + return result; + } + var node = declarations.findFirstChildBeforeOffset(this.offset); + if (!node) { + return this.getCompletionsForDeclarationProperty(null, result); + } + if (node instanceof AbstractDeclaration) { + var declaration = node; + if (!isDefined(declaration.colonPosition) || this.offset <= declaration.colonPosition) { + // complete property + return this.getCompletionsForDeclarationProperty(declaration, result); + } + else if ((isDefined(declaration.semicolonPosition) && declaration.semicolonPosition < this.offset)) { + if (this.offset === declaration.semicolonPosition + 1) { + return result; // don't show new properties right after semicolon (see Bug 15421:[intellisense] [css] Be less aggressive when manually typing CSS) + } + // complete next property + return this.getCompletionsForDeclarationProperty(null, result); + } + if (declaration instanceof Declaration) { + // complete value + return this.getCompletionsForDeclarationValue(declaration, result); + } + } + else if (node instanceof ExtendsReference) { + this.getCompletionsForExtendsReference(node, null, result); + } + else if (this.currentWord && this.currentWord[0] === '@') { + this.getCompletionsForDeclarationProperty(null, result); + } + return result; + }; + CSSCompletion.prototype.getCompletionsForVariableDeclaration = function (declaration, result) { + if (this.offset > declaration.colonPosition) { + this.getVariableProposals(declaration.getValue(), result); + } + return result; + }; + CSSCompletion.prototype.getCompletionsForExpression = function (expression, result) { + if (expression.getParent() instanceof FunctionArgument) { + this.getCompletionsForFunctionArgument(expression.getParent(), expression.getParent().getParent(), result); + return result; + } + var declaration = expression.findParent(NodeType.Declaration); + if (!declaration) { + this.getTermProposals(null, null, result); + return result; + } + var node = expression.findChildAtOffset(this.offset, true); + if (!node) { + return this.getCompletionsForDeclarationValue(declaration, result); + } + if (node instanceof NumericValue || node instanceof Identifier) { + return this.getCompletionsForDeclarationValue(declaration, result); + } + return result; + }; + CSSCompletion.prototype.getCompletionsForFunctionArgument = function (arg, func, result) { + if (func.getIdentifier().getText() === 'var') { + if (!func.getArguments().hasChildren() || func.getArguments().getChild(0) === arg) { + this.getVariableProposalsForCSSVarFunction(result); + } + } + return result; + }; + CSSCompletion.prototype.getCompletionsForFunctionDeclaration = function (decl, result) { + var declarations = decl.getDeclarations(); + if (declarations && this.offset > declarations.offset && this.offset < declarations.end) { + this.getTermProposals(null, null, result); + } + return result; + }; + CSSCompletion.prototype.getCompletionsForMixinReference = function (ref, result) { + var allMixins = this.getSymbolContext().findSymbolsAtOffset(this.offset, ReferenceType.Mixin); + for (var _i = 0, allMixins_1 = allMixins; _i < allMixins_1.length; _i++) { + var mixinSymbol = allMixins_1[_i]; + if (mixinSymbol.node instanceof MixinDeclaration) { + result.items.push(this.makeTermProposal(mixinSymbol, mixinSymbol.node.getParameters(), null)); + } + } + return result; + }; + CSSCompletion.prototype.getTermProposals = function (entry, existingNode, result) { + var allFunctions = this.getSymbolContext().findSymbolsAtOffset(this.offset, ReferenceType.Function); + for (var _i = 0, allFunctions_1 = allFunctions; _i < allFunctions_1.length; _i++) { + var functionSymbol = allFunctions_1[_i]; + if (functionSymbol.node instanceof FunctionDeclaration) { + result.items.push(this.makeTermProposal(functionSymbol, functionSymbol.node.getParameters(), existingNode)); + } + } + return result; + }; + CSSCompletion.prototype.makeTermProposal = function (symbol, parameters, existingNode) { + var decl = symbol.node; + var params = parameters.getChildren().map(function (c) { + return (c instanceof FunctionParameter) ? c.getName() : c.getText(); + }); + var insertText = symbol.name + '(' + params.map(function (p, index) { return '${' + (index + 1) + ':' + p + '}'; }).join(', ') + ')'; + return { + label: symbol.name, + detail: symbol.name + '(' + params.join(', ') + ')', + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertText), + insertTextFormat: SnippetFormat, + kind: main_CompletionItemKind.Function, + sortText: 'z' + }; + }; + CSSCompletion.prototype.getCompletionsForSupportsCondition = function (supportsCondition, result) { + var child = supportsCondition.findFirstChildBeforeOffset(this.offset); + if (child) { + if (child instanceof Declaration) { + if (!isDefined(child.colonPosition || this.offset <= child.colonPosition)) { + return this.getCompletionsForDeclarationProperty(child, result); + } + else { + return this.getCompletionsForDeclarationValue(child, result); + } + } + else if (child instanceof SupportsCondition) { + return this.getCompletionsForSupportsCondition(child, result); + } + } + if (isDefined(supportsCondition.lParent) && this.offset > supportsCondition.lParent && (!isDefined(supportsCondition.rParent) || this.offset <= supportsCondition.rParent)) { + return this.getCompletionsForDeclarationProperty(null, result); + } + return result; + }; + CSSCompletion.prototype.getCompletionsForSupports = function (supports, result) { + var declarations = supports.getDeclarations(); + var inInCondition = !declarations || this.offset <= declarations.offset; + if (inInCondition) { + var child = supports.findFirstChildBeforeOffset(this.offset); + if (child instanceof SupportsCondition) { + return this.getCompletionsForSupportsCondition(child, result); + } + return result; + } + return this.getCompletionForTopLevel(result); + }; + CSSCompletion.prototype.getCompletionsForExtendsReference = function (extendsRef, existingNode, result) { + return result; + }; + CSSCompletion.prototype.getCompletionForUriLiteralValue = function (uriLiteralNode, result) { + var uriValue; + var position; + var range; + // No children, empty value + if (uriLiteralNode.getChildren().length === 0) { + uriValue = ''; + position = this.position; + var emptyURIValuePosition = this.textDocument.positionAt(uriLiteralNode.offset + 'url('.length); + range = main_Range.create(emptyURIValuePosition, emptyURIValuePosition); + } + else { + var uriValueNode = uriLiteralNode.getChild(0); + uriValue = uriValueNode.getText(); + position = this.position; + range = this.getCompletionRange(uriValueNode); + } + this.completionParticipants.forEach(function (participant) { + if (participant.onCssURILiteralValue) { + participant.onCssURILiteralValue({ + uriValue: uriValue, + position: position, + range: range + }); + } + }); + return result; + }; + CSSCompletion.prototype.getCompletionForImportPath = function (importPathNode, result) { + var _this = this; + this.completionParticipants.forEach(function (participant) { + if (participant.onCssImportPath) { + participant.onCssImportPath({ + pathValue: importPathNode.getText(), + position: _this.position, + range: _this.getCompletionRange(importPathNode) + }); + } + }); + return result; + }; + return CSSCompletion; +}()); + +var cssCompletion_Set = /** @class */ (function () { + function Set() { + this.entries = {}; + } + Set.prototype.add = function (entry) { + this.entries[entry] = true; + }; + Set.prototype.getEntries = function () { + return Object.keys(this.entries); + }; + return Set; +}()); +function moveCursorInsideParenthesis(text) { + return text.replace(/\(\)$/, "($1)"); +} +function collectValues(styleSheet, declaration) { + var fullPropertyName = declaration.getFullPropertyName(); + var entries = new cssCompletion_Set(); + function visitValue(node) { + if (node instanceof Identifier || node instanceof NumericValue || node instanceof HexColorValue) { + entries.add(node.getText()); + } + return true; + } + function matchesProperty(decl) { + var propertyName = decl.getFullPropertyName(); + return fullPropertyName === propertyName; + } + function vistNode(node) { + if (node instanceof Declaration && node !== declaration) { + if (matchesProperty(node)) { + var value = node.getValue(); + if (value) { + value.accept(visitValue); + } + } + } + return true; + } + styleSheet.accept(vistNode); + return entries; +} +var cssCompletion_ColorValueCollector = /** @class */ (function () { + function ColorValueCollector(entries, currentOffset) { + this.entries = entries; + this.currentOffset = currentOffset; + // nothing to do + } + ColorValueCollector.prototype.visitNode = function (node) { + if (node instanceof HexColorValue || (node instanceof Function && isColorConstructor(node))) { + if (this.currentOffset < node.offset || node.end < this.currentOffset) { + this.entries.add(node.getText()); + } + } + return true; + }; + return ColorValueCollector; +}()); +function isDefined(obj) { + return typeof obj !== 'undefined'; +} +function getCurrentWord(document, offset) { + var i = offset - 1; + var text = document.getText(); + while (i >= 0 && ' \t\n\r":{[()]},*>+'.indexOf(text.charAt(i)) === -1) { + i--; + } + return text.substring(i + 1, offset); +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/selectorPrinting.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var selectorPrinting_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + +var selectorPrinting_localize = loadMessageBundle(); +var Element = /** @class */ (function () { + function Element() { + } + Element.prototype.findAttribute = function (name) { + if (this.attributes) { + for (var _i = 0, _a = this.attributes; _i < _a.length; _i++) { + var attribute = _a[_i]; + if (attribute.name === name) { + return attribute.value; + } + } + } + return null; + }; + Element.prototype.addChild = function (child) { + if (child instanceof Element) { + child.parent = this; + } + if (!this.children) { + this.children = []; + } + this.children.push(child); + }; + Element.prototype.append = function (text) { + if (this.attributes) { + var last = this.attributes[this.attributes.length - 1]; + last.value = last.value + text; + } + }; + Element.prototype.prepend = function (text) { + if (this.attributes) { + var first = this.attributes[0]; + first.value = text + first.value; + } + }; + Element.prototype.findRoot = function () { + var curr = this; + while (curr.parent && !(curr.parent instanceof RootElement)) { + curr = curr.parent; + } + return curr; + }; + Element.prototype.removeChild = function (child) { + if (this.children) { + var index = this.children.indexOf(child); + if (index !== -1) { + this.children.splice(index, 1); + return true; + } + } + return false; + }; + Element.prototype.addAttr = function (name, value) { + if (!this.attributes) { + this.attributes = []; + } + for (var _i = 0, _a = this.attributes; _i < _a.length; _i++) { + var attribute = _a[_i]; + if (attribute.name === name) { + attribute.value += ' ' + value; + return; + } + } + this.attributes.push({ name: name, value: value }); + }; + Element.prototype.clone = function (cloneChildren) { + if (cloneChildren === void 0) { cloneChildren = true; } + var elem = new Element(); + if (this.attributes) { + elem.attributes = []; + for (var _i = 0, _a = this.attributes; _i < _a.length; _i++) { + var attribute = _a[_i]; + elem.addAttr(attribute.name, attribute.value); + } + } + if (cloneChildren && this.children) { + elem.children = []; + for (var index = 0; index < this.children.length; index++) { + elem.addChild(this.children[index].clone()); + } + } + return elem; + }; + Element.prototype.cloneWithParent = function () { + var clone = this.clone(false); + if (this.parent && !(this.parent instanceof RootElement)) { + var parentClone = this.parent.cloneWithParent(); + parentClone.addChild(clone); + } + return clone; + }; + return Element; +}()); + +var RootElement = /** @class */ (function (_super) { + selectorPrinting_extends(RootElement, _super); + function RootElement() { + return _super !== null && _super.apply(this, arguments) || this; + } + return RootElement; +}(Element)); + +var LabelElement = /** @class */ (function (_super) { + selectorPrinting_extends(LabelElement, _super); + function LabelElement(label) { + var _this = _super.call(this) || this; + _this.addAttr('name', label); + return _this; + } + return LabelElement; +}(Element)); + +var MarkedStringPrinter = /** @class */ (function () { + function MarkedStringPrinter(quote) { + this.quote = quote; + // empty + } + MarkedStringPrinter.prototype.print = function (element) { + this.result = []; + if (element instanceof RootElement) { + this.doPrint(element.children, 0); + } + else { + this.doPrint([element], 0); + } + var value = this.result.join('\n'); + return [{ language: 'html', value: value }]; + }; + MarkedStringPrinter.prototype.doPrint = function (elements, indent) { + for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) { + var element = elements_1[_i]; + this.doPrintElement(element, indent); + if (element.children) { + this.doPrint(element.children, indent + 1); + } + } + }; + MarkedStringPrinter.prototype.writeLine = function (level, content) { + var indent = new Array(level + 1).join(' '); + this.result.push(indent + content); + }; + MarkedStringPrinter.prototype.doPrintElement = function (element, indent) { + var name = element.findAttribute('name'); + // special case: a simple label + if (element instanceof LabelElement || name === '\u2026') { + this.writeLine(indent, name); + return; + } + // the real deal + var content = ['<']; + // element name + if (name) { + content.push(name); + } + else { + content.push('element'); + } + // attributes + if (element.attributes) { + for (var _i = 0, _a = element.attributes; _i < _a.length; _i++) { + var attr = _a[_i]; + if (attr.name !== 'name') { + content.push(' '); + content.push(attr.name); + var value = attr.value; + if (value) { + content.push('='); + content.push(quotes.ensure(value, this.quote)); + } + } + } + } + content.push('>'); + this.writeLine(indent, content.join('')); + }; + return MarkedStringPrinter; +}()); +var quotes; +(function (quotes) { + function ensure(value, which) { + return which + remove(value) + which; + } + quotes.ensure = ensure; + function remove(value) { + var match = value.match(/^['"](.*)["']$/); + if (match) { + return match[1]; + } + return value; + } + quotes.remove = remove; +})(quotes || (quotes = {})); +function toElement(node, parentElement) { + var result = new Element(); + for (var _i = 0, _a = node.getChildren(); _i < _a.length; _i++) { + var child = _a[_i]; + switch (child.type) { + case NodeType.SelectorCombinator: + if (parentElement) { + var segments = child.getText().split('&'); + if (segments.length === 1) { + // should not happen + result.addAttr('name', segments[0]); + break; + } + result = parentElement.cloneWithParent(); + if (segments[0]) { + var root = result.findRoot(); + root.prepend(segments[0]); + } + for (var i = 1; i < segments.length; i++) { + if (i > 1) { + var clone = parentElement.cloneWithParent(); + result.addChild(clone.findRoot()); + result = clone; + } + result.append(segments[i]); + } + } + break; + case NodeType.SelectorPlaceholder: + if (child.getText() === '@at-root') { + return result; + } + // fall through + case NodeType.ElementNameSelector: + var text = child.getText(); + result.addAttr('name', text === '*' ? 'element' : selectorPrinting_unescape(text)); + break; + case NodeType.ClassSelector: + result.addAttr('class', selectorPrinting_unescape(child.getText().substring(1))); + break; + case NodeType.IdentifierSelector: + result.addAttr('id', selectorPrinting_unescape(child.getText().substring(1))); + break; + case NodeType.MixinDeclaration: + result.addAttr('class', child.getName()); + break; + case NodeType.PseudoSelector: + result.addAttr(selectorPrinting_unescape(child.getText()), ''); + break; + case NodeType.AttributeSelector: + var selector = child; + var identifuer = selector.getIdentifier(); + if (identifuer) { + var expression = selector.getValue(); + var operator = selector.getOperator(); + var value = void 0; + if (expression) { + switch (selectorPrinting_unescape(operator.getText())) { + case '|=': + // excatly or followed by -words + value = quotes.remove(selectorPrinting_unescape(expression.getText())) + "-\u2026"; + break; + case '^=': + // prefix + value = quotes.remove(selectorPrinting_unescape(expression.getText())) + "\u2026"; + break; + case '$=': + // suffix + value = "\u2026" + quotes.remove(selectorPrinting_unescape(expression.getText())); + break; + case '~=': + // one of a list of words + value = " \u2026 " + quotes.remove(selectorPrinting_unescape(expression.getText())) + " \u2026 "; + break; + case '*=': + // substring + value = "\u2026" + quotes.remove(selectorPrinting_unescape(expression.getText())) + "\u2026"; + break; + default: + value = quotes.remove(selectorPrinting_unescape(expression.getText())); + break; + } + } + result.addAttr(selectorPrinting_unescape(identifuer.getText()), value); + } + break; + } + } + return result; +} +function selectorPrinting_unescape(content) { + var scanner = new Scanner(); + scanner.setSource(content); + var token = scanner.scanUnquotedString(); + if (token) { + return token.text; + } + return content; +} +function selectorToSpecificityMarkedString(node) { + //https://www.w3.org/TR/selectors-3/#specificity + function calculateScore(node) { + node.getChildren().forEach(function (element) { + switch (element.type) { + case NodeType.IdentifierSelector: + specificity[0] += 1; //a + break; + case NodeType.ClassSelector: + case NodeType.AttributeSelector: + specificity[1] += 1; //b + break; + case NodeType.ElementNameSelector: + //ignore universal selector + if (element.getText() === "*") { + break; + } + specificity[2] += 1; //c + break; + case NodeType.PseudoSelector: + if (element.getText().match(/^::/)) { + specificity[2] += 1; //c (pseudo element) + } + else { + //ignore psuedo class NOT + if (element.getText().match(/^:not/i)) { + break; + } + specificity[1] += 1; //b (pseudo class) + } + break; + } + if (element.getChildren().length > 0) { + calculateScore(element); + } + }); + } + var specificity = [0, 0, 0]; //a,b,c + calculateScore(node); + return selectorPrinting_localize.apply(void 0, ['specificity', "[Selector Specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity): ({0}, {1}, {2})"].concat(specificity)); +} +function selectorToMarkedString(node) { + var root = selectorToElement(node); + var markedStrings = new MarkedStringPrinter('"').print(root); + markedStrings.push(selectorToSpecificityMarkedString(node)); + return markedStrings; +} +function simpleSelectorToMarkedString(node) { + var element = toElement(node); + var markedStrings = new MarkedStringPrinter('"').print(element); + markedStrings.push(selectorToSpecificityMarkedString(node)); + return markedStrings; +} +var selectorPrinting_SelectorElementBuilder = /** @class */ (function () { + function SelectorElementBuilder(element) { + this.prev = null; + this.element = element; + } + SelectorElementBuilder.prototype.processSelector = function (selector) { + var parentElement = null; + if (!(this.element instanceof RootElement)) { + if (selector.getChildren().some(function (c) { return c.hasChildren() && c.getChild(0).type === NodeType.SelectorCombinator; })) { + var curr = this.element.findRoot(); + if (curr.parent instanceof RootElement) { + parentElement = this.element; + this.element = curr.parent; + this.element.removeChild(curr); + this.prev = null; + } + } + } + for (var _i = 0, _a = selector.getChildren(); _i < _a.length; _i++) { + var selectorChild = _a[_i]; + if (selectorChild instanceof SimpleSelector) { + if (this.prev instanceof SimpleSelector) { + var labelElement = new LabelElement('\u2026'); + this.element.addChild(labelElement); + this.element = labelElement; + } + else if (this.prev && (this.prev.matches('+') || this.prev.matches('~')) && this.element.parent) { + this.element = this.element.parent; + } + if (this.prev && this.prev.matches('~')) { + this.element.addChild(toElement(selectorChild)); + this.element.addChild(new LabelElement('\u22EE')); + } + var thisElement = toElement(selectorChild, parentElement); + var root = thisElement.findRoot(); + this.element.addChild(root); + this.element = thisElement; + } + if (selectorChild instanceof SimpleSelector || + selectorChild.type === NodeType.SelectorCombinatorParent || + selectorChild.type === NodeType.SelectorCombinatorShadowPiercingDescendant || + selectorChild.type === NodeType.SelectorCombinatorSibling || + selectorChild.type === NodeType.SelectorCombinatorAllSiblings) { + this.prev = selectorChild; + } + } + }; + return SelectorElementBuilder; +}()); +function isNewSelectorContext(node) { + switch (node.type) { + case NodeType.MixinDeclaration: + case NodeType.Stylesheet: + return true; + } + return false; +} +function selectorToElement(node) { + if (node.matches('@at-root')) { + return null; + } + var root = new RootElement(); + var parentRuleSets = []; + if (node.getParent() instanceof RuleSet) { + var parent = node.getParent().getParent(); // parent of the selector's ruleset + while (parent && !isNewSelectorContext(parent)) { + if (parent instanceof RuleSet) { + if (parent.getSelectors().matches('@at-root')) { + break; + } + parentRuleSets.push(parent); + } + parent = parent.getParent(); + } + } + var builder = new selectorPrinting_SelectorElementBuilder(root); + for (var i = parentRuleSets.length - 1; i >= 0; i--) { + var selector = parentRuleSets[i].getSelectors().getChild(0); + if (selector) { + builder.processSelector(selector); + } + } + builder.processSelector(node); + return root; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssHover.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + + + +var cssHover_CSSHover = /** @class */ (function () { + function CSSHover() { + } + CSSHover.prototype.doHover = function (document, position, stylesheet) { + function getRange(node) { + return main_Range.create(document.positionAt(node.offset), document.positionAt(node.end)); + } + var offset = document.offsetAt(position); + var nodepath = getNodePath(stylesheet, offset); + for (var i = 0; i < nodepath.length; i++) { + var node = nodepath[i]; + if (node instanceof Selector) { + return { + contents: selectorToMarkedString(node), + range: getRange(node) + }; + } + if (node instanceof SimpleSelector) { + return { + contents: simpleSelectorToMarkedString(node), + range: getRange(node) + }; + } + if (node instanceof Declaration) { + var propertyName = node.getFullPropertyName(); + var entry = cssDataManager.getProperty(propertyName); + if (entry) { + var contents = []; + if (entry.description) { + contents.push(MarkedString.fromPlainText(entry.description)); + } + var browserLabel = getBrowserLabel(entry.browsers); + if (browserLabel) { + contents.push(MarkedString.fromPlainText(browserLabel)); + } + if (contents.length) { + return { + contents: contents, + range: getRange(node) + }; + } + } + } + } + return null; + }; + return CSSHover; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssNavigation.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + + + + + +var cssNavigation_localize = loadMessageBundle(); +var cssNavigation_CSSNavigation = /** @class */ (function () { + function CSSNavigation() { + } + CSSNavigation.prototype.findDefinition = function (document, position, stylesheet) { + var symbols = new cssSymbolScope_Symbols(stylesheet); + var offset = document.offsetAt(position); + var node = getNodeAtOffset(stylesheet, offset); + if (!node) { + return null; + } + var symbol = symbols.findSymbolFromNode(node); + if (!symbol) { + return null; + } + return { + uri: document.uri, + range: cssNavigation_getRange(symbol.node, document) + }; + }; + CSSNavigation.prototype.findReferences = function (document, position, stylesheet) { + var highlights = this.findDocumentHighlights(document, position, stylesheet); + return highlights.map(function (h) { + return { + uri: document.uri, + range: h.range + }; + }); + }; + CSSNavigation.prototype.findDocumentHighlights = function (document, position, stylesheet) { + var result = []; + var offset = document.offsetAt(position); + var node = getNodeAtOffset(stylesheet, offset); + if (!node || node.type === NodeType.Stylesheet || node.type === NodeType.Declarations) { + return result; + } + if (node.type === NodeType.Identifier && node.parent && node.parent.type === NodeType.ClassSelector) { + node = node.parent; + } + var symbols = new cssSymbolScope_Symbols(stylesheet); + var symbol = symbols.findSymbolFromNode(node); + var name = node.getText(); + stylesheet.accept(function (candidate) { + if (symbol) { + if (symbols.matchesSymbol(candidate, symbol)) { + result.push({ + kind: getHighlightKind(candidate), + range: cssNavigation_getRange(candidate, document) + }); + return false; + } + } + else if (node.type === candidate.type && node.length === candidate.length && name === candidate.getText()) { + // Same node type and data + result.push({ + kind: getHighlightKind(candidate), + range: cssNavigation_getRange(candidate, document) + }); + } + return true; + }); + return result; + }; + CSSNavigation.prototype.findDocumentLinks = function (document, stylesheet, documentContext) { + var result = []; + stylesheet.accept(function (candidate) { + if (candidate.type === NodeType.URILiteral) { + var link = uriLiteralNodeToDocumentLink(document, candidate, documentContext); + if (link) { + result.push(link); + } + return false; + } + /** + * In @import, it is possible to include links that do not use `url()` + * For example, `@import 'foo.css';` + */ + if (candidate.parent && candidate.parent.type === NodeType.Import) { + var rawText = candidate.getText(); + if (strings_startsWith(rawText, "'") || strings_startsWith(rawText, "\"")) { + result.push(uriStringNodeToDocumentLink(document, candidate, documentContext)); + } + return false; + } + return true; + }); + return result; + }; + CSSNavigation.prototype.findDocumentSymbols = function (document, stylesheet) { + var result = []; + stylesheet.accept(function (node) { + var entry = { + name: null, + kind: main_SymbolKind.Class, + location: null + }; + var locationNode = node; + if (node instanceof Selector) { + entry.name = node.getText(); + locationNode = node.findAParent(NodeType.Ruleset, NodeType.ExtendsReference); + if (locationNode) { + entry.location = Location.create(document.uri, cssNavigation_getRange(locationNode, document)); + result.push(entry); + } + return false; + } + else if (node instanceof VariableDeclaration) { + entry.name = node.getName(); + entry.kind = main_SymbolKind.Variable; + } + else if (node instanceof MixinDeclaration) { + entry.name = node.getName(); + entry.kind = main_SymbolKind.Method; + } + else if (node instanceof FunctionDeclaration) { + entry.name = node.getName(); + entry.kind = main_SymbolKind.Function; + } + else if (node instanceof Keyframe) { + entry.name = cssNavigation_localize('literal.keyframes', "@keyframes {0}", node.getName()); + } + else if (node instanceof FontFace) { + entry.name = cssNavigation_localize('literal.fontface', "@font-face"); + } + if (entry.name) { + entry.location = Location.create(document.uri, cssNavigation_getRange(locationNode, document)); + result.push(entry); + } + return true; + }); + return result; + }; + CSSNavigation.prototype.findDocumentColors = function (document, stylesheet) { + var result = []; + stylesheet.accept(function (node) { + var colorInfo = getColorInformation(node, document); + if (colorInfo) { + result.push(colorInfo); + } + return true; + }); + return result; + }; + CSSNavigation.prototype.getColorPresentations = function (document, stylesheet, color, range) { + var result = []; + var red256 = Math.round(color.red * 255), green256 = Math.round(color.green * 255), blue256 = Math.round(color.blue * 255); + var label; + if (color.alpha === 1) { + label = "rgb(" + red256 + ", " + green256 + ", " + blue256 + ")"; + } + else { + label = "rgba(" + red256 + ", " + green256 + ", " + blue256 + ", " + color.alpha + ")"; + } + result.push({ label: label, textEdit: TextEdit.replace(range, label) }); + if (color.alpha === 1) { + label = "#" + toTwoDigitHex(red256) + toTwoDigitHex(green256) + toTwoDigitHex(blue256); + } + else { + label = "#" + toTwoDigitHex(red256) + toTwoDigitHex(green256) + toTwoDigitHex(blue256) + toTwoDigitHex(Math.round(color.alpha * 255)); + } + result.push({ label: label, textEdit: TextEdit.replace(range, label) }); + var hsl = hslFromColor(color); + if (hsl.a === 1) { + label = "hsl(" + hsl.h + ", " + Math.round(hsl.s * 100) + "%, " + Math.round(hsl.l * 100) + "%)"; + } + else { + label = "hsla(" + hsl.h + ", " + Math.round(hsl.s * 100) + "%, " + Math.round(hsl.l * 100) + "%, " + hsl.a + ")"; + } + result.push({ label: label, textEdit: TextEdit.replace(range, label) }); + return result; + }; + CSSNavigation.prototype.doRename = function (document, position, newName, stylesheet) { + var _a; + var highlights = this.findDocumentHighlights(document, position, stylesheet); + var edits = highlights.map(function (h) { return TextEdit.replace(h.range, newName); }); + return { + changes: (_a = {}, _a[document.uri] = edits, _a) + }; + }; + return CSSNavigation; +}()); + +function getColorInformation(node, document) { + var color = getColorValue(node); + if (color) { + var range = cssNavigation_getRange(node, document); + return { color: color, range: range }; + } + return null; +} +function uriLiteralNodeToDocumentLink(document, uriLiteralNode, documentContext) { + if (uriLiteralNode.getChildren().length === 0) { + return null; + } + var uriStringNode = uriLiteralNode.getChild(0); + return uriStringNodeToDocumentLink(document, uriStringNode, documentContext); +} +function uriStringNodeToDocumentLink(document, uriStringNode, documentContext) { + var rawUri = uriStringNode.getText(); + var range = cssNavigation_getRange(uriStringNode, document); + // Make sure the range is not empty + if (range.start.line === range.end.line && range.start.character === range.end.character) { + return null; + } + if (strings_startsWith(rawUri, "'") || strings_startsWith(rawUri, "\"")) { + rawUri = rawUri.slice(1, -1); + } + var target; + if (strings_startsWith(rawUri, 'http://') || strings_startsWith(rawUri, 'https://')) { + target = rawUri; + } + else if (/^\w+:\/\//g.test(rawUri)) { + target = rawUri; + } + else { + /** + * In SCSS, @import 'foo' could be referring to `_foo.scss`, if none of the following is true: + * - The file's extension is .css. + * - The filename begins with http://. + * - The filename is a url(). + * - The @import has any media queries. + */ + if (document.languageId === 'scss') { + if (!strings_endsWith(rawUri, '.css') && + !strings_startsWith(rawUri, 'http://') && !strings_startsWith(rawUri, 'https://') && + !(uriStringNode.parent && uriStringNode.parent.type === NodeType.URILiteral) && + uriStringNode.parent.getChildren().length === 1) { + target = toScssPartialUri(documentContext.resolveReference(rawUri, document.uri)); + } + else { + target = documentContext.resolveReference(rawUri, document.uri); + } + } + else { + target = documentContext.resolveReference(rawUri, document.uri); + } + } + return { + range: range, + target: target + }; +} +function toScssPartialUri(uri) { + return uri.replace(/\/(\w+)(.scss)?$/gm, function (match, fileName) { + return '/_' + fileName + '.scss'; }); +} +function cssNavigation_getRange(node, document) { + return main_Range.create(document.positionAt(node.offset), document.positionAt(node.end)); +} +function getHighlightKind(node) { + if (node.type === NodeType.Selector) { + return main_DocumentHighlightKind.Write; + } + if (node instanceof Identifier) { + if (node.parent && node.parent instanceof Property) { + if (node.isCustomProperty) { + return main_DocumentHighlightKind.Write; + } + } + } + if (node.parent) { + switch (node.parent.type) { + case NodeType.FunctionDeclaration: + case NodeType.MixinDeclaration: + case NodeType.Keyframe: + case NodeType.VariableDeclaration: + case NodeType.FunctionParameter: + return main_DocumentHighlightKind.Write; + } + } + return main_DocumentHighlightKind.Read; +} +function toTwoDigitHex(n) { + var r = n.toString(16); + return r.length !== 2 ? '0' + r : r; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lintRules.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + +var lintRules_localize = loadMessageBundle(); +var Warning = Level.Warning; +var lintRules_Error = Level.Error; +var Ignore = Level.Ignore; +var Rule = /** @class */ (function () { + function Rule(id, message, defaultValue) { + this.id = id; + this.message = message; + this.defaultValue = defaultValue; + // nothing to do + } + return Rule; +}()); + +var Setting = /** @class */ (function () { + function Setting(id, message, defaultValue) { + this.id = id; + this.message = message; + this.defaultValue = defaultValue; + // nothing to do + } + return Setting; +}()); + +var Rules = { + AllVendorPrefixes: new Rule('compatibleVendorPrefixes', lintRules_localize('rule.vendorprefixes.all', "When using a vendor-specific prefix make sure to also include all other vendor-specific properties"), Ignore), + IncludeStandardPropertyWhenUsingVendorPrefix: new Rule('vendorPrefix', lintRules_localize('rule.standardvendorprefix.all', "When using a vendor-specific prefix also include the standard property"), Warning), + DuplicateDeclarations: new Rule('duplicateProperties', lintRules_localize('rule.duplicateDeclarations', "Do not use duplicate style definitions"), Ignore), + EmptyRuleSet: new Rule('emptyRules', lintRules_localize('rule.emptyRuleSets', "Do not use empty rulesets"), Warning), + ImportStatemement: new Rule('importStatement', lintRules_localize('rule.importDirective', "Import statements do not load in parallel"), Ignore), + BewareOfBoxModelSize: new Rule('boxModel', lintRules_localize('rule.bewareOfBoxModelSize', "Do not use width or height when using padding or border"), Ignore), + UniversalSelector: new Rule('universalSelector', lintRules_localize('rule.universalSelector', "The universal selector (*) is known to be slow"), Ignore), + ZeroWithUnit: new Rule('zeroUnits', lintRules_localize('rule.zeroWidthUnit', "No unit for zero needed"), Ignore), + RequiredPropertiesForFontFace: new Rule('fontFaceProperties', lintRules_localize('rule.fontFaceProperties', "@font-face rule must define 'src' and 'font-family' properties"), Warning), + HexColorLength: new Rule('hexColorLength', lintRules_localize('rule.hexColor', "Hex colors must consist of three, four, six or eight hex numbers"), lintRules_Error), + ArgsInColorFunction: new Rule('argumentsInColorFunction', lintRules_localize('rule.colorFunction', "Invalid number of parameters"), lintRules_Error), + UnknownProperty: new Rule('unknownProperties', lintRules_localize('rule.unknownProperty', "Unknown property."), Warning), + UnknownAtRules: new Rule('unknownAtRules', lintRules_localize('rule.unknownAtRules', "Unknown at-rule."), Warning), + IEStarHack: new Rule('ieHack', lintRules_localize('rule.ieHack', "IE hacks are only necessary when supporting IE7 and older"), Ignore), + UnknownVendorSpecificProperty: new Rule('unknownVendorSpecificProperties', lintRules_localize('rule.unknownVendorSpecificProperty', "Unknown vendor specific property."), Ignore), + PropertyIgnoredDueToDisplay: new Rule('propertyIgnoredDueToDisplay', lintRules_localize('rule.propertyIgnoredDueToDisplay', "Property is ignored due to the display."), Warning), + AvoidImportant: new Rule('important', lintRules_localize('rule.avoidImportant', "Avoid using !important. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored."), Ignore), + AvoidFloat: new Rule('float', lintRules_localize('rule.avoidFloat', "Avoid using 'float'. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes."), Ignore), + AvoidIdSelector: new Rule('idSelector', lintRules_localize('rule.avoidIdSelector', "Selectors should not contain IDs because these rules are too tightly coupled with the HTML."), Ignore), +}; +var Settings = { + ValidProperties: new Setting('validProperties', lintRules_localize('rule.validProperties', "A list of properties that are not validated against the `unknownProperties` rule."), []) +}; +var LintConfigurationSettings = /** @class */ (function () { + function LintConfigurationSettings(conf) { + if (conf === void 0) { conf = {}; } + this.conf = conf; + } + LintConfigurationSettings.prototype.getRule = function (rule) { + if (this.conf.hasOwnProperty(rule.id)) { + var level = toLevel(this.conf[rule.id]); + if (level) { + return level; + } + } + return rule.defaultValue; + }; + LintConfigurationSettings.prototype.getSetting = function (setting) { + return this.conf[setting.id]; + }; + return LintConfigurationSettings; +}()); + +function toLevel(level) { + switch (level) { + case 'ignore': return Level.Ignore; + case 'warning': return Level.Warning; + case 'error': return Level.Error; + } + return null; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssCodeActions.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + + + + + +var cssCodeActions_localize = loadMessageBundle(); +var cssCodeActions_CSSCodeActions = /** @class */ (function () { + function CSSCodeActions() { + } + CSSCodeActions.prototype.doCodeActions = function (document, range, context, stylesheet) { + return this.doCodeActions2(document, range, context, stylesheet).map(function (ca) { + return Command.create(ca.title, '_css.applyCodeAction', document.uri, document.version, ca.edit.documentChanges[0].edits); + }); + }; + CSSCodeActions.prototype.doCodeActions2 = function (document, range, context, stylesheet) { + var result = []; + if (context.diagnostics) { + for (var _i = 0, _a = context.diagnostics; _i < _a.length; _i++) { + var diagnostic = _a[_i]; + this.appendFixesForMarker(document, stylesheet, diagnostic, result); + } + } + return result; + }; + CSSCodeActions.prototype.getFixesForUnknownProperty = function (document, property, marker, result) { + var propertyName = property.getName(); + var candidates = []; + cssDataManager.getProperties().forEach(function (p) { + var score = difference(propertyName, p.name); + if (score >= propertyName.length / 2 /*score_lim*/) { + candidates.push({ property: p.name, score: score }); + } + }); + // Sort in descending order. + candidates.sort(function (a, b) { + return b.score - a.score; + }); + var maxActions = 3; + for (var _i = 0, candidates_1 = candidates; _i < candidates_1.length; _i++) { + var candidate = candidates_1[_i]; + var propertyName_1 = candidate.property; + var title = cssCodeActions_localize('css.codeaction.rename', "Rename to '{0}'", propertyName_1); + var edit = TextEdit.replace(marker.range, propertyName_1); + var documentIdentifier = VersionedTextDocumentIdentifier.create(document.uri, document.version); + var workspaceEdit = { documentChanges: [TextDocumentEdit.create(documentIdentifier, [edit])] }; + var codeAction = CodeAction.create(title, workspaceEdit, CodeActionKind.QuickFix); + codeAction.diagnostics = [marker]; + result.push(codeAction); + if (--maxActions <= 0) { + return; + } + } + }; + CSSCodeActions.prototype.appendFixesForMarker = function (document, stylesheet, marker, result) { + if (marker.code !== Rules.UnknownProperty.id) { + return; + } + var offset = document.offsetAt(marker.range.start); + var end = document.offsetAt(marker.range.end); + var nodepath = getNodePath(stylesheet, offset); + for (var i = nodepath.length - 1; i >= 0; i--) { + var node = nodepath[i]; + if (node instanceof Declaration) { + var property = node.getProperty(); + if (property && property.offset === offset && property.end === end) { + this.getFixesForUnknownProperty(document, property, marker, result); + return; + } + } + } + }; + return CSSCodeActions; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lintUtil.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + +var lintUtil_Element = /** @class */ (function () { + function Element(text, data) { + this.name = text; + this.node = data; + } + return Element; +}()); + +function setSide(model, side, value, property) { + var state = model[side]; + state.value = value; + if (value) { + if (!includes(state.properties, property)) { + state.properties.push(property); + } + } +} +function setAllSides(model, value, property) { + setSide(model, 'top', value, property); + setSide(model, 'right', value, property); + setSide(model, 'bottom', value, property); + setSide(model, 'left', value, property); +} +function updateModelWithValue(model, side, value, property) { + if (side === 'top' || side === 'right' || + side === 'bottom' || side === 'left') { + setSide(model, side, value, property); + } + else { + setAllSides(model, value, property); + } +} +function updateModelWithList(model, values, property) { + switch (values.length) { + case 1: + updateModelWithValue(model, undefined, values[0], property); + break; + case 2: + updateModelWithValue(model, 'top', values[0], property); + updateModelWithValue(model, 'bottom', values[0], property); + updateModelWithValue(model, 'right', values[1], property); + updateModelWithValue(model, 'left', values[1], property); + break; + case 3: + updateModelWithValue(model, 'top', values[0], property); + updateModelWithValue(model, 'right', values[1], property); + updateModelWithValue(model, 'left', values[1], property); + updateModelWithValue(model, 'bottom', values[2], property); + break; + case 4: + updateModelWithValue(model, 'top', values[0], property); + updateModelWithValue(model, 'right', values[1], property); + updateModelWithValue(model, 'bottom', values[2], property); + updateModelWithValue(model, 'left', values[3], property); + break; + } +} +/** + * @param allowsKeywords whether the initial value of property is zero, so keywords `initial` and `unset` count as zero + * @return `true` if this node represents a non-zero border; otherwise, `false` + */ +function checkLineWidth(value, allowsKeywords) { + if (allowsKeywords === void 0) { allowsKeywords = true; } + if (allowsKeywords && includes(['initial', 'unset'], value)) { + return false; + } + // a is a value and a unit + // so use `parseFloat` to strip the unit + return parseFloat(value) !== 0; +} +function checkLineWidthList(nodes, allowsKeywords) { + if (allowsKeywords === void 0) { allowsKeywords = true; } + return nodes.map(function (node) { return checkLineWidth(node.getText(), allowsKeywords); }); +} +/** + * @param allowsKeywords whether keywords `initial` and `unset` count as zero + * @return `true` if this node represents a non-zero border; otherwise, `false` + */ +function checkLineStyle(value, allowsKeywords) { + if (allowsKeywords === void 0) { allowsKeywords = true; } + if (includes(['none', 'hidden'], value)) { + return false; + } + if (allowsKeywords && includes(['initial', 'unset'], value)) { + return false; + } + return true; +} +function checkLineStyleList(nodes, allowsKeywords) { + if (allowsKeywords === void 0) { allowsKeywords = true; } + return nodes.map(function (node) { return checkLineStyle(node.getText(), allowsKeywords); }); +} +function checkBorderShorthand(node) { + var children = node.getChildren(); + // the only child can be a keyword, a , or a + // if either check returns false, the result is no border + if (children.length === 1) { + var value = children[0].getText(); + return checkLineWidth(value) && checkLineStyle(value); + } + // multiple children can't contain keywords + // if any child means no border, the result is no border + for (var _i = 0, children_1 = children; _i < children_1.length; _i++) { + var child = children_1[_i]; + var value = child.getText(); + if (!checkLineWidth(value, /* allowsKeywords: */ false) || + !checkLineStyle(value, /* allowsKeywords: */ false)) { + return false; + } + } + return true; +} +function calculateBoxModel(propertyTable) { + var model = { + top: { value: false, properties: [] }, + right: { value: false, properties: [] }, + bottom: { value: false, properties: [] }, + left: { value: false, properties: [] }, + }; + for (var _i = 0, propertyTable_1 = propertyTable; _i < propertyTable_1.length; _i++) { + var property = propertyTable_1[_i]; + var value = property.node.value; + if (typeof value === 'undefined') { + continue; + } + switch (property.name) { + case 'box-sizing': + // has `box-sizing`, bail out + return { + top: { value: false, properties: [] }, + right: { value: false, properties: [] }, + bottom: { value: false, properties: [] }, + left: { value: false, properties: [] }, + }; + case 'width': + model.width = property; + break; + case 'height': + model.height = property; + break; + default: + var segments = property.name.split('-'); + switch (segments[0]) { + case 'border': + switch (segments[1]) { + case undefined: + case 'top': + case 'right': + case 'bottom': + case 'left': + switch (segments[2]) { + case undefined: + updateModelWithValue(model, segments[1], checkBorderShorthand(value), property); + break; + case 'width': + // the initial value of `border-width` is `medium`, not zero + updateModelWithValue(model, segments[1], checkLineWidth(value.getText(), false), property); + break; + case 'style': + // the initial value of `border-style` is `none` + updateModelWithValue(model, segments[1], checkLineStyle(value.getText(), true), property); + break; + } + break; + case 'width': + // the initial value of `border-width` is `medium`, not zero + updateModelWithList(model, checkLineWidthList(value.getChildren(), false), property); + break; + case 'style': + // the initial value of `border-style` is `none` + updateModelWithList(model, checkLineStyleList(value.getChildren(), true), property); + break; + } + break; + case 'padding': + if (segments.length === 1) { + // the initial value of `padding` is zero + updateModelWithList(model, checkLineWidthList(value.getChildren(), true), property); + } + else { + // the initial value of `padding` is zero + updateModelWithValue(model, segments[1], checkLineWidth(value.getText(), true), property); + } + break; + } + break; + } + } + return model; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lint.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + + + + + +var lint_localize = loadMessageBundle(); +var NodesByRootMap = /** @class */ (function () { + function NodesByRootMap() { + this.data = {}; + } + NodesByRootMap.prototype.add = function (root, name, node) { + var entry = this.data[root]; + if (!entry) { + entry = { nodes: [], names: [] }; + this.data[root] = entry; + } + entry.names.push(name); + if (node) { + entry.nodes.push(node); + } + }; + return NodesByRootMap; +}()); +var lint_LintVisitor = /** @class */ (function () { + function LintVisitor(document, settings) { + var _this = this; + this.warnings = []; + this.settings = settings; + this.documentText = document.getText(); + this.keyframes = new NodesByRootMap(); + this.validProperties = {}; + var properties = settings.getSetting(Settings.ValidProperties); + if (Array.isArray(properties)) { + properties.forEach(function (p) { + if (typeof p === 'string') { + var name = p.trim().toLowerCase(); + if (name.length) { + _this.validProperties[name] = true; + } + } + }); + } + } + LintVisitor.entries = function (node, document, settings, entryFilter) { + var visitor = new LintVisitor(document, settings); + node.acceptVisitor(visitor); + visitor.completeValidations(); + return visitor.getEntries(entryFilter); + }; + LintVisitor.prototype.isValidPropertyDeclaration = function (decl) { + var propertyName = decl.getFullPropertyName().toLowerCase(); + return this.validProperties[propertyName]; + }; + LintVisitor.prototype.fetch = function (input, s) { + var elements = []; + for (var _i = 0, input_1 = input; _i < input_1.length; _i++) { + var curr = input_1[_i]; + if (curr.name === s) { + elements.push(curr); + } + } + return elements; + }; + LintVisitor.prototype.fetchWithValue = function (input, s, v) { + var elements = []; + for (var _i = 0, input_2 = input; _i < input_2.length; _i++) { + var inputElement = input_2[_i]; + if (inputElement.name === s) { + var expression = inputElement.node.getValue(); + if (expression && this.findValueInExpression(expression, v)) { + elements.push(inputElement); + } + } + } + return elements; + }; + LintVisitor.prototype.findValueInExpression = function (expression, v) { + var found = false; + expression.accept(function (node) { + if (node.type === NodeType.Identifier && node.getText() === v) { + found = true; + } + return !found; + }); + return found; + }; + LintVisitor.prototype.getEntries = function (filter) { + if (filter === void 0) { filter = (Level.Warning | Level.Error); } + return this.warnings.filter(function (entry) { + return (entry.getLevel() & filter) !== 0; + }); + }; + LintVisitor.prototype.addEntry = function (node, rule, details) { + var entry = new Marker(node, rule, this.settings.getRule(rule), details); + this.warnings.push(entry); + }; + LintVisitor.prototype.getMissingNames = function (expected, actual) { + expected = expected.slice(0); // clone + for (var i = 0; i < actual.length; i++) { + var k = expected.indexOf(actual[i]); + if (k !== -1) { + expected[k] = null; + } + } + var result = null; + for (var i = 0; i < expected.length; i++) { + var curr = expected[i]; + if (curr) { + if (result === null) { + result = lint_localize('namelist.single', "'{0}'", curr); + } + else { + result = lint_localize('namelist.concatenated', "{0}, '{1}'", result, curr); + } + } + } + return result; + }; + LintVisitor.prototype.visitNode = function (node) { + switch (node.type) { + case NodeType.UnknownAtRule: + return this.visitUnknownAtRule(node); + case NodeType.Keyframe: + return this.visitKeyframe(node); + case NodeType.FontFace: + return this.visitFontFace(node); + case NodeType.Ruleset: + return this.visitRuleSet(node); + case NodeType.SimpleSelector: + return this.visitSimpleSelector(node); + case NodeType.Function: + return this.visitFunction(node); + case NodeType.NumericValue: + return this.visitNumericValue(node); + case NodeType.Import: + return this.visitImport(node); + case NodeType.HexColorValue: + return this.visitHexColorValue(node); + case NodeType.Prio: + return this.visitPrio(node); + } + return true; + }; + LintVisitor.prototype.completeValidations = function () { + this.validateKeyframes(); + }; + LintVisitor.prototype.visitUnknownAtRule = function (node) { + var atRuleName = node.getChild(0); + if (!atRuleName) { + return false; + } + this.addEntry(atRuleName, Rules.UnknownAtRules, "Unknown at rule " + atRuleName.getText()); + return true; + }; + LintVisitor.prototype.visitKeyframe = function (node) { + var keyword = node.getKeyword(); + var text = keyword.getText(); + this.keyframes.add(node.getName(), text, (text !== '@keyframes') ? keyword : null); + return true; + }; + LintVisitor.prototype.validateKeyframes = function () { + // @keyframe and it's vendor specific alternatives + // @keyframe should be included + var expected = ['@-webkit-keyframes', '@-moz-keyframes', '@-o-keyframes']; + for (var name in this.keyframes.data) { + var actual = this.keyframes.data[name].names; + var needsStandard = (actual.indexOf('@keyframes') === -1); + if (!needsStandard && actual.length === 1) { + continue; // only the non-vendor specific keyword is used, that's fine, no warning + } + var missingVendorSpecific = this.getMissingNames(expected, actual); + if (missingVendorSpecific || needsStandard) { + for (var _i = 0, _a = this.keyframes.data[name].nodes; _i < _a.length; _i++) { + var node = _a[_i]; + if (needsStandard) { + var message = lint_localize('keyframes.standardrule.missing', "Always define standard rule '@keyframes' when defining keyframes."); + this.addEntry(node, Rules.IncludeStandardPropertyWhenUsingVendorPrefix, message); + } + if (missingVendorSpecific) { + var message = lint_localize('keyframes.vendorspecific.missing', "Always include all vendor specific rules: Missing: {0}", missingVendorSpecific); + this.addEntry(node, Rules.AllVendorPrefixes, message); + } + } + } + } + return true; + }; + LintVisitor.prototype.visitSimpleSelector = function (node) { + var firstChar = this.documentText.charAt(node.offset); + ///////////////////////////////////////////////////////////// + // Lint - The universal selector (*) is known to be slow. + ///////////////////////////////////////////////////////////// + if (node.length === 1 && firstChar === '*') { + this.addEntry(node, Rules.UniversalSelector); + } + ///////////////////////////////////////////////////////////// + // Lint - Avoid id selectors + ///////////////////////////////////////////////////////////// + if (firstChar === '#') { + this.addEntry(node, Rules.AvoidIdSelector); + } + return true; + }; + LintVisitor.prototype.visitImport = function (node) { + ///////////////////////////////////////////////////////////// + // Lint - Import statements shouldn't be used, because they aren't offering parallel downloads. + ///////////////////////////////////////////////////////////// + this.addEntry(node, Rules.ImportStatemement); + return true; + }; + LintVisitor.prototype.visitRuleSet = function (node) { + ///////////////////////////////////////////////////////////// + // Lint - Don't use empty rulesets. + ///////////////////////////////////////////////////////////// + var declarations = node.getDeclarations(); + if (!declarations) { + // syntax error + return false; + } + if (!declarations.hasChildren()) { + this.addEntry(node.getSelectors(), Rules.EmptyRuleSet); + } + var propertyTable = []; + for (var _i = 0, _a = declarations.getChildren(); _i < _a.length; _i++) { + var element = _a[_i]; + if (element instanceof Declaration) { + var decl = element; + propertyTable.push(new lintUtil_Element(decl.getFullPropertyName().toLowerCase(), decl)); + } + } + ///////////////////////////////////////////////////////////// + // the rule warns when it finds: + // width being used with border, border-left, border-right, padding, padding-left, or padding-right + // height being used with border, border-top, border-bottom, padding, padding-top, or padding-bottom + // No error when box-sizing property is specified, as it assumes the user knows what he's doing. + // see https://github.com/CSSLint/csslint/wiki/Beware-of-box-model-size + ///////////////////////////////////////////////////////////// + var boxModel = calculateBoxModel(propertyTable); + if (boxModel.width) { + var properties = []; + if (boxModel.right.value) { + properties = union(properties, boxModel.right.properties); + } + if (boxModel.left.value) { + properties = union(properties, boxModel.left.properties); + } + if (properties.length !== 0) { + for (var _b = 0, properties_1 = properties; _b < properties_1.length; _b++) { + var item = properties_1[_b]; + this.addEntry(item.node, Rules.BewareOfBoxModelSize); + } + this.addEntry(boxModel.width.node, Rules.BewareOfBoxModelSize); + } + } + if (boxModel.height) { + var properties = []; + if (boxModel.top.value) { + properties = union(properties, boxModel.top.properties); + } + if (boxModel.bottom.value) { + properties = union(properties, boxModel.bottom.properties); + } + if (properties.length !== 0) { + for (var _c = 0, properties_2 = properties; _c < properties_2.length; _c++) { + var item = properties_2[_c]; + this.addEntry(item.node, Rules.BewareOfBoxModelSize); + } + this.addEntry(boxModel.height.node, Rules.BewareOfBoxModelSize); + } + } + ///////////////////////////////////////////////////////////// + // Properties ignored due to display + ///////////////////////////////////////////////////////////// + // With 'display: inline', the width, height, margin-top, margin-bottom, and float properties have no effect + var displayElems = this.fetchWithValue(propertyTable, 'display', 'inline'); + if (displayElems.length > 0) { + for (var _d = 0, _e = ['width', 'height', 'margin-top', 'margin-bottom', 'float']; _d < _e.length; _d++) { + var prop = _e[_d]; + var elem = this.fetch(propertyTable, prop); + for (var index = 0; index < elem.length; index++) { + var node_1 = elem[index].node; + var value = node_1.getValue(); + if (prop === 'float' && (!value || value.matches('none'))) { + continue; + } + this.addEntry(node_1, Rules.PropertyIgnoredDueToDisplay, lint_localize('rule.propertyIgnoredDueToDisplayInline', "Property is ignored due to the display. With 'display: inline', the width, height, margin-top, margin-bottom, and float properties have no effect.")); + } + } + } + // With 'display: inline-block', 'float' has no effect + displayElems = this.fetchWithValue(propertyTable, 'display', 'inline-block'); + if (displayElems.length > 0) { + var elem = this.fetch(propertyTable, 'float'); + for (var index = 0; index < elem.length; index++) { + var node_2 = elem[index].node; + var value = node_2.getValue(); + if (value && !value.matches('none')) { + this.addEntry(node_2, Rules.PropertyIgnoredDueToDisplay, lint_localize('rule.propertyIgnoredDueToDisplayInlineBlock', "inline-block is ignored due to the float. If 'float' has a value other than 'none', the box is floated and 'display' is treated as 'block'")); + } + } + } + // With 'display: block', 'vertical-align' has no effect + displayElems = this.fetchWithValue(propertyTable, 'display', 'block'); + if (displayElems.length > 0) { + var elem = this.fetch(propertyTable, 'vertical-align'); + for (var index = 0; index < elem.length; index++) { + this.addEntry(elem[index].node, Rules.PropertyIgnoredDueToDisplay, lint_localize('rule.propertyIgnoredDueToDisplayBlock', "Property is ignored due to the display. With 'display: block', vertical-align should not be used.")); + } + } + ///////////////////////////////////////////////////////////// + // Avoid 'float' + ///////////////////////////////////////////////////////////// + var elements = this.fetch(propertyTable, 'float'); + for (var index = 0; index < elements.length; index++) { + var decl = elements[index].node; + if (!this.isValidPropertyDeclaration(decl)) { + this.addEntry(decl, Rules.AvoidFloat); + } + } + ///////////////////////////////////////////////////////////// + // Don't use duplicate declarations. + ///////////////////////////////////////////////////////////// + for (var i = 0; i < propertyTable.length; i++) { + var element = propertyTable[i]; + if (element.name !== 'background' && !this.validProperties[element.name]) { + var value = element.node.getValue(); + if (value && this.documentText.charAt(value.offset) !== '-') { + var elements_1 = this.fetch(propertyTable, element.name); + if (elements_1.length > 1) { + for (var k = 0; k < elements_1.length; k++) { + var value_1 = elements_1[k].node.getValue(); + if (value_1 && this.documentText.charAt(value_1.offset) !== '-' && elements_1[k] !== element) { + this.addEntry(element.node, Rules.DuplicateDeclarations); + } + } + } + } + } + } + ///////////////////////////////////////////////////////////// + // Unknown propery & When using a vendor-prefixed gradient, make sure to use them all. + ///////////////////////////////////////////////////////////// + var isExportBlock = node.getSelectors().getText() === ":export"; + if (!isExportBlock) { + var propertiesBySuffix = new NodesByRootMap(); + var containsUnknowns = false; + for (var _f = 0, _g = declarations.getChildren(); _f < _g.length; _f++) { + var node_3 = _g[_f]; + if (this.isCSSDeclaration(node_3)) { + var decl = node_3; + var name = decl.getFullPropertyName().toLowerCase(); + var firstChar = name.charAt(0); + if (firstChar === '-') { + if (name.charAt(1) !== '-') { // avoid css variables + if (!cssDataManager.isKnownProperty(name) && !this.validProperties[name]) { + this.addEntry(decl.getProperty(), Rules.UnknownVendorSpecificProperty); + } + var nonPrefixedName = decl.getNonPrefixedPropertyName(); + propertiesBySuffix.add(nonPrefixedName, name, decl.getProperty()); + } + } + else { + var fullName = name; + if (firstChar === '*' || firstChar === '_') { + this.addEntry(decl.getProperty(), Rules.IEStarHack); + name = name.substr(1); + } + // _property and *property might be contributed via custom data + if (!cssDataManager.isKnownProperty(fullName) && !cssDataManager.isKnownProperty(name)) { + if (!this.validProperties[name]) { + this.addEntry(decl.getProperty(), Rules.UnknownProperty, lint_localize('property.unknownproperty.detailed', "Unknown property: '{0}'", name)); + } + } + propertiesBySuffix.add(name, name, null); // don't pass the node as we don't show errors on the standard + } + } + else { + containsUnknowns = true; + } + } + if (!containsUnknowns) { // don't perform this test if there are + for (var suffix in propertiesBySuffix.data) { + var entry = propertiesBySuffix.data[suffix]; + var actual = entry.names; + var needsStandard = cssDataManager.isStandardProperty(suffix) && (actual.indexOf(suffix) === -1); + if (!needsStandard && actual.length === 1) { + continue; // only the non-vendor specific rule is used, that's fine, no warning + } + var expected = []; + for (var i = 0, len = LintVisitor.prefixes.length; i < len; i++) { + var prefix = LintVisitor.prefixes[i]; + if (cssDataManager.isStandardProperty(prefix + suffix)) { + expected.push(prefix + suffix); + } + } + var missingVendorSpecific = this.getMissingNames(expected, actual); + if (missingVendorSpecific || needsStandard) { + for (var _h = 0, _j = entry.nodes; _h < _j.length; _h++) { + var node_4 = _j[_h]; + if (needsStandard) { + var message = lint_localize('property.standard.missing', "Also define the standard property '{0}' for compatibility", suffix); + this.addEntry(node_4, Rules.IncludeStandardPropertyWhenUsingVendorPrefix, message); + } + if (missingVendorSpecific) { + var message = lint_localize('property.vendorspecific.missing', "Always include all vendor specific properties: Missing: {0}", missingVendorSpecific); + this.addEntry(node_4, Rules.AllVendorPrefixes, message); + } + } + } + } + } + } + return true; + }; + LintVisitor.prototype.visitPrio = function (node) { + ///////////////////////////////////////////////////////////// + // Don't use !important + ///////////////////////////////////////////////////////////// + this.addEntry(node, Rules.AvoidImportant); + return true; + }; + LintVisitor.prototype.visitNumericValue = function (node) { + ///////////////////////////////////////////////////////////// + // 0 has no following unit + ///////////////////////////////////////////////////////////// + var funcDecl = node.findParent(NodeType.Function); + if (funcDecl && funcDecl.getName() === 'calc') { + return true; + } + var decl = node.findParent(NodeType.Declaration); + if (decl) { + var declValue = decl.getValue(); + if (declValue) { + var value = node.getValue(); + if (!value.unit || builtinData_units.length.indexOf(value.unit.toLowerCase()) === -1) { + return true; + } + if (parseFloat(value.value) === 0.0 && !!value.unit && !this.validProperties[decl.getFullPropertyName()]) { + this.addEntry(node, Rules.ZeroWithUnit); + } + } + } + return true; + }; + LintVisitor.prototype.visitFontFace = function (node) { + var declarations = node.getDeclarations(); + if (!declarations) { + // syntax error + return; + } + var definesSrc = false, definesFontFamily = false; + var containsUnknowns = false; + for (var _i = 0, _a = declarations.getChildren(); _i < _a.length; _i++) { + var node_5 = _a[_i]; + if (this.isCSSDeclaration(node_5)) { + var name = (node_5.getProperty().getName().toLowerCase()); + if (name === 'src') { + definesSrc = true; + } + if (name === 'font-family') { + definesFontFamily = true; + } + } + else { + containsUnknowns = true; + } + } + if (!containsUnknowns && (!definesSrc || !definesFontFamily)) { + this.addEntry(node, Rules.RequiredPropertiesForFontFace); + } + return true; + }; + LintVisitor.prototype.isCSSDeclaration = function (node) { + if (node instanceof Declaration) { + if (!node.getValue()) { + return false; + } + var property = node.getProperty(); + if (!property || property.getIdentifier().containsInterpolation()) { + return false; + } + return true; + } + return false; + }; + LintVisitor.prototype.visitHexColorValue = function (node) { + // Rule: #eeff0011 or #eeff00 or #ef01 or #ef0 + var length = node.length; + if (length !== 9 && length !== 7 && length !== 5 && length !== 4) { + this.addEntry(node, Rules.HexColorLength); + } + return false; + }; + LintVisitor.prototype.visitFunction = function (node) { + var fnName = node.getName().toLowerCase(); + var expectedAttrCount = -1; + var actualAttrCount = 0; + switch (fnName) { + case 'rgb(': + case 'hsl(': + expectedAttrCount = 3; + break; + case 'rgba(': + case 'hsla(': + expectedAttrCount = 4; + break; + } + if (expectedAttrCount !== -1) { + node.getArguments().accept(function (n) { + if (n instanceof BinaryExpression) { + actualAttrCount += 1; + return false; + } + return true; + }); + if (actualAttrCount !== expectedAttrCount) { + this.addEntry(node, Rules.ArgsInColorFunction); + } + } + return true; + }; + LintVisitor.prefixes = [ + '-ms-', '-moz-', '-o-', '-webkit-', + ]; + return LintVisitor; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssValidation.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + + + +var cssValidation_CSSValidation = /** @class */ (function () { + function CSSValidation() { + } + CSSValidation.prototype.configure = function (settings) { + this.settings = settings; + }; + CSSValidation.prototype.doValidation = function (document, stylesheet, settings) { + if (settings === void 0) { settings = this.settings; } + if (settings && settings.validate === false) { + return []; + } + var entries = []; + entries.push.apply(entries, ParseErrorCollector.entries(stylesheet)); + entries.push.apply(entries, lint_LintVisitor.entries(stylesheet, document, new LintConfigurationSettings(settings && settings.lint))); + var ruleIds = []; + for (var r in Rules) { + ruleIds.push(Rules[r].id); + } + function toDiagnostic(marker) { + var range = main_Range.create(document.positionAt(marker.getOffset()), document.positionAt(marker.getOffset() + marker.getLength())); + var source = document.languageId; + return { + code: marker.getRule().id, + source: source, + message: marker.getMessage(), + severity: marker.getLevel() === Level.Warning ? DiagnosticSeverity.Warning : DiagnosticSeverity.Error, + range: range + }; + } + return entries.filter(function (entry) { return entry.getLevel() !== Level.Ignore; }).map(toDiagnostic); + }; + return CSSValidation; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/scssScanner.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var scssScanner_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + +var scssScanner_FSL = '/'.charCodeAt(0); +var scssScanner_NWL = '\n'.charCodeAt(0); +var scssScanner_CAR = '\r'.charCodeAt(0); +var scssScanner_LFD = '\f'.charCodeAt(0); +var scssScanner_DLR = '$'.charCodeAt(0); +var scssScanner_HSH = '#'.charCodeAt(0); +var scssScanner_CUL = '{'.charCodeAt(0); +var scssScanner_EQS = '='.charCodeAt(0); +var scssScanner_BNG = '!'.charCodeAt(0); +var scssScanner_LAN = '<'.charCodeAt(0); +var scssScanner_RAN = '>'.charCodeAt(0); +var scssScanner_DOT = '.'.charCodeAt(0); +var customTokenValue = TokenType.CustomToken; +var VariableName = customTokenValue++; +var InterpolationFunction = customTokenValue++; +var Default = customTokenValue++; +var EqualsOperator = customTokenValue++; +var NotEqualsOperator = customTokenValue++; +var GreaterEqualsOperator = customTokenValue++; +var SmallerEqualsOperator = customTokenValue++; +var Ellipsis = customTokenValue++; +var scssScanner_SCSSScanner = /** @class */ (function (_super) { + scssScanner_extends(SCSSScanner, _super); + function SCSSScanner() { + return _super !== null && _super.apply(this, arguments) || this; + } + SCSSScanner.prototype.scanNext = function (offset) { + // scss variable + if (this.stream.advanceIfChar(scssScanner_DLR)) { + var content = ['$']; + if (this.ident(content)) { + return this.finishToken(offset, VariableName, content.join('')); + } + else { + this.stream.goBackTo(offset); + } + } + // scss: interpolation function #{..}) + if (this.stream.advanceIfChars([scssScanner_HSH, scssScanner_CUL])) { + return this.finishToken(offset, InterpolationFunction); + } + // operator == + if (this.stream.advanceIfChars([scssScanner_EQS, scssScanner_EQS])) { + return this.finishToken(offset, EqualsOperator); + } + // operator != + if (this.stream.advanceIfChars([scssScanner_BNG, scssScanner_EQS])) { + return this.finishToken(offset, NotEqualsOperator); + } + // operators <, <= + if (this.stream.advanceIfChar(scssScanner_LAN)) { + if (this.stream.advanceIfChar(scssScanner_EQS)) { + return this.finishToken(offset, SmallerEqualsOperator); + } + return this.finishToken(offset, TokenType.Delim); + } + // ooperators >, >= + if (this.stream.advanceIfChar(scssScanner_RAN)) { + if (this.stream.advanceIfChar(scssScanner_EQS)) { + return this.finishToken(offset, GreaterEqualsOperator); + } + return this.finishToken(offset, TokenType.Delim); + } + // ellipis + if (this.stream.advanceIfChars([scssScanner_DOT, scssScanner_DOT, scssScanner_DOT])) { + return this.finishToken(offset, Ellipsis); + } + return _super.prototype.scanNext.call(this, offset); + }; + SCSSScanner.prototype.comment = function () { + if (_super.prototype.comment.call(this)) { + return true; + } + if (!this.inURL && this.stream.advanceIfChars([scssScanner_FSL, scssScanner_FSL])) { + this.stream.advanceWhileChar(function (ch) { + switch (ch) { + case scssScanner_NWL: + case scssScanner_CAR: + case scssScanner_LFD: + return false; + default: + return true; + } + }); + return true; + } + else { + return false; + } + }; + return SCSSScanner; +}(Scanner)); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/scssErrors.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + +var scssErrors_localize = loadMessageBundle(); +var SCSSIssueType = /** @class */ (function () { + function SCSSIssueType(id, message) { + this.id = id; + this.message = message; + } + return SCSSIssueType; +}()); + +var SCSSParseError = { + FromExpected: new SCSSIssueType('scss-fromexpected', scssErrors_localize('expected.from', "'from' expected")), + ThroughOrToExpected: new SCSSIssueType('scss-throughexpected', scssErrors_localize('expected.through', "'through' or 'to' expected")), + InExpected: new SCSSIssueType('scss-fromexpected', scssErrors_localize('expected.in', "'in' expected")), }; +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/scssParser.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ -/***/ }), +var scssParser_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); -/***/ "./node_modules/monaco-editor/esm/vs/language/css/cssWorker.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/cssWorker.js ***! - \*********************************************************************/ -/*! exports provided: CSSWorker, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CSSWorker", function() { return CSSWorker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _deps_vscode_css_languageservice_cssLanguageService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_deps/vscode-css-languageservice/cssLanguageService.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/cssLanguageService.js"); -/* harmony import */ var _deps_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_deps/vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-languageserver-types/main.js"); + + + + +/// +/// A parser for scss +/// http://sass-lang.com/documentation/file.SASS_REFERENCE.html +/// +var scssParser_SCSSParser = /** @class */ (function (_super) { + scssParser_extends(SCSSParser, _super); + function SCSSParser() { + return _super.call(this, new scssScanner_SCSSScanner()) || this; + } + SCSSParser.prototype._parseStylesheetStatement = function () { + if (this.peek(TokenType.AtKeyword)) { + return this._parseWarnAndDebug() + || this._parseControlStatement() + || this._parseMixinDeclaration() + || this._parseMixinContent() + || this._parseMixinReference() // @include + || this._parseFunctionDeclaration() + || _super.prototype._parseStylesheetAtStatement.call(this); + } + return this._parseRuleset(true) || this._parseVariableDeclaration(); + }; + SCSSParser.prototype._parseImport = function () { + if (!this.peekKeyword('@import')) { + return null; + } + var node = this.create(Import); + this.consumeToken(); + if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { + return this.finish(node, ParseError.URIOrStringExpected); + } + while (this.accept(TokenType.Comma)) { + if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { + return this.finish(node, ParseError.URIOrStringExpected); + } + } + if (!this.peek(TokenType.SemiColon) && !this.peek(TokenType.EOF)) { + node.setMedialist(this._parseMediaQueryList()); + } + return this.finish(node); + }; + // scss variables: $font-size: 12px; + SCSSParser.prototype._parseVariableDeclaration = function (panic) { + if (panic === void 0) { panic = []; } + if (!this.peek(VariableName)) { + return null; + } + var node = this.create(VariableDeclaration); + if (!node.setVariable(this._parseVariable())) { + return null; + } + if (!this.accept(TokenType.Colon)) { + return this.finish(node, ParseError.ColonExpected); + } + node.colonPosition = this.prevToken.offset; + if (!node.setValue(this._parseExpr())) { + return this.finish(node, ParseError.VariableValueExpected, [], panic); + } + while (this.accept(TokenType.Exclamation)) { + if (!this.peekRegExp(TokenType.Ident, /^(default|global)$/)) { + return this.finish(node, ParseError.UnknownKeyword); + } + this.consumeToken(); + } + if (this.peek(TokenType.SemiColon)) { + node.semicolonPosition = this.token.offset; // not part of the declaration, but useful information for code assist + } + return this.finish(node); + }; + SCSSParser.prototype._parseMediaFeatureName = function () { + return this._parseFunction() || this._parseIdent() || this._parseVariable(); // first function, the indent + }; + SCSSParser.prototype._parseKeyframeSelector = function () { + return this._tryParseKeyframeSelector() + || this._parseControlStatement(this._parseKeyframeSelector.bind(this)) + || this._parseVariableDeclaration() + || this._parseMixinContent(); + }; + SCSSParser.prototype._parseVariable = function () { + if (!this.peek(VariableName)) { + return null; + } + var node = this.create(Variable); + this.consumeToken(); + return node; + }; + SCSSParser.prototype._parseIdent = function (referenceTypes) { + var _this = this; + if (!this.peek(TokenType.Ident) && !this.peek(InterpolationFunction) && !this.peekDelim('-')) { + return null; + } + var node = this.create(Identifier); + node.referenceTypes = referenceTypes; + node.isCustomProperty = this.peekRegExp(TokenType.Ident, /^--/); + var hasContent = false; + var indentInterpolation = function () { + var pos = _this.mark(); + if (_this.acceptDelim('-')) { + if (!_this.hasWhitespace()) { + _this.acceptDelim('-'); + } + if (_this.hasWhitespace()) { + _this.restoreAtMark(pos); + return null; + } + } + return _this._parseInterpolation(); + }; + while (this.accept(TokenType.Ident) || node.addChild(indentInterpolation()) || (hasContent && (this.acceptDelim('-') || this.accept(TokenType.Num)))) { + hasContent = true; + if (this.hasWhitespace()) { + break; + } + } + return hasContent ? this.finish(node) : null; + }; + SCSSParser.prototype._parseTerm = function () { + var term = _super.prototype._parseTerm.call(this); + if (term) { + return term; + } + term = this.create(Term); + if (term.setExpression(this._parseVariable()) + || term.setExpression(this._parseSelectorCombinator()) + || term.setExpression(this._tryParsePrio())) { + return this.finish(term); + } + return null; + }; + SCSSParser.prototype._parseInterpolation = function () { + if (this.peek(InterpolationFunction)) { + var node = this.create(Interpolation); + this.consumeToken(); + if (!node.addChild(this._parseExpr()) && !this._parseSelectorCombinator()) { + if (this.accept(TokenType.CurlyR)) { + return this.finish(node); + } + return this.finish(node, ParseError.ExpressionExpected); + } + if (!this.accept(TokenType.CurlyR)) { + return this.finish(node, ParseError.RightCurlyExpected); + } + return this.finish(node); + } + return null; + }; + SCSSParser.prototype._parseOperator = function () { + if (this.peek(EqualsOperator) || this.peek(NotEqualsOperator) + || this.peek(GreaterEqualsOperator) || this.peek(SmallerEqualsOperator) + || this.peekDelim('>') || this.peekDelim('<') + || this.peekIdent('and') || this.peekIdent('or') + || this.peekDelim('%')) { + var node = this.createNode(NodeType.Operator); + this.consumeToken(); + return this.finish(node); + } + return _super.prototype._parseOperator.call(this); + }; + SCSSParser.prototype._parseUnaryOperator = function () { + if (this.peekIdent('not')) { + var node = this.create(cssNodes_Node); + this.consumeToken(); + return this.finish(node); + } + return _super.prototype._parseUnaryOperator.call(this); + }; + SCSSParser.prototype._parseRuleSetDeclaration = function () { + if (this.peek(TokenType.AtKeyword)) { + return this._parseKeyframe() // nested @keyframe + || this._parseImport() // nested @import + || this._parseMedia(true) // nested @media + || this._parseFontFace() // nested @font-face + || this._parseWarnAndDebug() // @warn, @debug and @error statements + || this._parseControlStatement() // @if, @while, @for, @each + || this._parseFunctionDeclaration() // @function + || this._parseExtends() // @extends + || this._parseMixinReference() // @include + || this._parseMixinContent() // @content + || this._parseMixinDeclaration() // nested @mixin + || this._parseRuleset(true) // @at-rule + || this._parseSupports(true); // @supports + } + return this._parseVariableDeclaration() // variable declaration + || this._tryParseRuleset(true) // nested ruleset + || _super.prototype._parseRuleSetDeclaration.call(this); // try css ruleset declaration as last so in the error case, the ast will contain a declaration + }; + SCSSParser.prototype._parseDeclaration = function (resyncStopTokens) { + var node = this.create(Declaration); + if (!node.setProperty(this._parseProperty())) { + return null; + } + if (!this.accept(TokenType.Colon)) { + return this.finish(node, ParseError.ColonExpected, [TokenType.Colon], resyncStopTokens); + } + node.colonPosition = this.prevToken.offset; + var hasContent = false; + if (node.setValue(this._parseExpr())) { + hasContent = true; + node.addChild(this._parsePrio()); + } + if (this.peek(TokenType.CurlyL)) { + node.setNestedProperties(this._parseNestedProperties()); + } + else { + if (!hasContent) { + return this.finish(node, ParseError.PropertyValueExpected); + } + } + if (this.peek(TokenType.SemiColon)) { + node.semicolonPosition = this.token.offset; // not part of the declaration, but useful information for code assist + } + return this.finish(node); + }; + SCSSParser.prototype._parseNestedProperties = function () { + var node = this.create(NestedProperties); + return this._parseBody(node, this._parseDeclaration.bind(this)); + }; + SCSSParser.prototype._parseExtends = function () { + if (this.peekKeyword('@extend')) { + var node = this.create(ExtendsReference); + this.consumeToken(); + if (!node.getSelectors().addChild(this._parseSimpleSelector())) { + return this.finish(node, ParseError.SelectorExpected); + } + while (this.accept(TokenType.Comma)) { + node.getSelectors().addChild(this._parseSimpleSelector()); + } + if (this.accept(TokenType.Exclamation)) { + if (!this.acceptIdent('optional')) { + return this.finish(node, ParseError.UnknownKeyword); + } + } + return this.finish(node); + } + return null; + }; + SCSSParser.prototype._parseSimpleSelectorBody = function () { + return this._parseSelectorCombinator() || this._parseSelectorPlaceholder() || _super.prototype._parseSimpleSelectorBody.call(this); + }; + SCSSParser.prototype._parseSelectorCombinator = function () { + if (this.peekDelim('&')) { + var node = this.createNode(NodeType.SelectorCombinator); + this.consumeToken(); + while (!this.hasWhitespace() && (this.acceptDelim('-') || this.accept(TokenType.Num) || this.accept(TokenType.Dimension) || node.addChild(this._parseIdent()) || this.acceptDelim('&'))) { + // support &-foo-1 + } + return this.finish(node); + } + return null; + }; + SCSSParser.prototype._parseSelectorPlaceholder = function () { + if (this.peekDelim('%')) { + var node = this.createNode(NodeType.SelectorPlaceholder); + this.consumeToken(); + this._parseIdent(); + return this.finish(node); + } + else if (this.peekKeyword('@at-root')) { + var node = this.createNode(NodeType.SelectorPlaceholder); + this.consumeToken(); + return this.finish(node); + } + return null; + }; + SCSSParser.prototype._parseElementName = function () { + var pos = this.mark(); + var node = _super.prototype._parseElementName.call(this); + if (node && !this.hasWhitespace() && this.peek(TokenType.ParenthesisL)) { // for #49589 + this.restoreAtMark(pos); + return null; + } + return node; + }; + SCSSParser.prototype._tryParsePseudoIdentifier = function () { + return this._parseInterpolation() || _super.prototype._tryParsePseudoIdentifier.call(this); // for #49589 + }; + SCSSParser.prototype._parseWarnAndDebug = function () { + if (!this.peekKeyword('@debug') + && !this.peekKeyword('@warn') + && !this.peekKeyword('@error')) { + return null; + } + var node = this.createNode(NodeType.Debug); + this.consumeToken(); // @debug, @warn or @error + node.addChild(this._parseExpr()); // optional + return this.finish(node); + }; + SCSSParser.prototype._parseControlStatement = function (parseStatement) { + if (parseStatement === void 0) { parseStatement = this._parseRuleSetDeclaration.bind(this); } + if (!this.peek(TokenType.AtKeyword)) { + return null; + } + return this._parseIfStatement(parseStatement) || this._parseForStatement(parseStatement) + || this._parseEachStatement(parseStatement) || this._parseWhileStatement(parseStatement); + }; + SCSSParser.prototype._parseIfStatement = function (parseStatement) { + if (!this.peekKeyword('@if')) { + return null; + } + return this._internalParseIfStatement(parseStatement); + }; + SCSSParser.prototype._internalParseIfStatement = function (parseStatement) { + var node = this.create(IfStatement); + this.consumeToken(); // @if or if + if (!node.setExpression(this._parseExpr(true))) { + return this.finish(node, ParseError.ExpressionExpected); + } + this._parseBody(node, parseStatement); + if (this.acceptKeyword('@else')) { + if (this.peekIdent('if')) { + node.setElseClause(this._internalParseIfStatement(parseStatement)); + } + else if (this.peek(TokenType.CurlyL)) { + var elseNode = this.create(ElseStatement); + this._parseBody(elseNode, parseStatement); + node.setElseClause(elseNode); + } + } + return this.finish(node); + }; + SCSSParser.prototype._parseForStatement = function (parseStatement) { + if (!this.peekKeyword('@for')) { + return null; + } + var node = this.create(ForStatement); + this.consumeToken(); // @for + if (!node.setVariable(this._parseVariable())) { + return this.finish(node, ParseError.VariableNameExpected, [TokenType.CurlyR]); + } + if (!this.acceptIdent('from')) { + return this.finish(node, SCSSParseError.FromExpected, [TokenType.CurlyR]); + } + if (!node.addChild(this._parseBinaryExpr())) { + return this.finish(node, ParseError.ExpressionExpected, [TokenType.CurlyR]); + } + if (!this.acceptIdent('to') && !this.acceptIdent('through')) { + return this.finish(node, SCSSParseError.ThroughOrToExpected, [TokenType.CurlyR]); + } + if (!node.addChild(this._parseBinaryExpr())) { + return this.finish(node, ParseError.ExpressionExpected, [TokenType.CurlyR]); + } + return this._parseBody(node, parseStatement); + }; + SCSSParser.prototype._parseEachStatement = function (parseStatement) { + if (!this.peekKeyword('@each')) { + return null; + } + var node = this.create(EachStatement); + this.consumeToken(); // @each + var variables = node.getVariables(); + if (!variables.addChild(this._parseVariable())) { + return this.finish(node, ParseError.VariableNameExpected, [TokenType.CurlyR]); + } + while (this.accept(TokenType.Comma)) { + if (!variables.addChild(this._parseVariable())) { + return this.finish(node, ParseError.VariableNameExpected, [TokenType.CurlyR]); + } + } + this.finish(variables); + if (!this.acceptIdent('in')) { + return this.finish(node, SCSSParseError.InExpected, [TokenType.CurlyR]); + } + if (!node.addChild(this._parseExpr())) { + return this.finish(node, ParseError.ExpressionExpected, [TokenType.CurlyR]); + } + return this._parseBody(node, parseStatement); + }; + SCSSParser.prototype._parseWhileStatement = function (parseStatement) { + if (!this.peekKeyword('@while')) { + return null; + } + var node = this.create(WhileStatement); + this.consumeToken(); // @while + if (!node.addChild(this._parseBinaryExpr())) { + return this.finish(node, ParseError.ExpressionExpected, [TokenType.CurlyR]); + } + return this._parseBody(node, parseStatement); + }; + SCSSParser.prototype._parseFunctionBodyDeclaration = function () { + return this._parseVariableDeclaration() || this._parseReturnStatement() || this._parseWarnAndDebug() + || this._parseControlStatement(this._parseFunctionBodyDeclaration.bind(this)); + }; + SCSSParser.prototype._parseFunctionDeclaration = function () { + if (!this.peekKeyword('@function')) { + return null; + } + var node = this.create(FunctionDeclaration); + this.consumeToken(); // @function + if (!node.setIdentifier(this._parseIdent([ReferenceType.Function]))) { + return this.finish(node, ParseError.IdentifierExpected, [TokenType.CurlyR]); + } + if (!this.accept(TokenType.ParenthesisL)) { + return this.finish(node, ParseError.LeftParenthesisExpected, [TokenType.CurlyR]); + } + if (node.getParameters().addChild(this._parseParameterDeclaration())) { + while (this.accept(TokenType.Comma)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.getParameters().addChild(this._parseParameterDeclaration())) { + return this.finish(node, ParseError.VariableNameExpected); + } + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [TokenType.CurlyR]); + } + return this._parseBody(node, this._parseFunctionBodyDeclaration.bind(this)); + }; + SCSSParser.prototype._parseReturnStatement = function () { + if (!this.peekKeyword('@return')) { + return null; + } + var node = this.createNode(NodeType.ReturnStatement); + this.consumeToken(); // @function + if (!node.addChild(this._parseExpr())) { + return this.finish(node, ParseError.ExpressionExpected); + } + return this.finish(node); + }; + SCSSParser.prototype._parseMixinDeclaration = function () { + if (!this.peekKeyword('@mixin')) { + return null; + } + var node = this.create(MixinDeclaration); + this.consumeToken(); + if (!node.setIdentifier(this._parseIdent([ReferenceType.Mixin]))) { + return this.finish(node, ParseError.IdentifierExpected, [TokenType.CurlyR]); + } + if (this.accept(TokenType.ParenthesisL)) { + if (node.getParameters().addChild(this._parseParameterDeclaration())) { + while (this.accept(TokenType.Comma)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.getParameters().addChild(this._parseParameterDeclaration())) { + return this.finish(node, ParseError.VariableNameExpected); + } + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [TokenType.CurlyR]); + } + } + return this._parseBody(node, this._parseRuleSetDeclaration.bind(this)); + }; + SCSSParser.prototype._parseParameterDeclaration = function () { + var node = this.create(FunctionParameter); + if (!node.setIdentifier(this._parseVariable())) { + return null; + } + if (this.accept(Ellipsis)) { + // ok + } + if (this.accept(TokenType.Colon)) { + if (!node.setDefaultValue(this._parseExpr(true))) { + return this.finish(node, ParseError.VariableValueExpected, [], [TokenType.Comma, TokenType.ParenthesisR]); + } + } + return this.finish(node); + }; + SCSSParser.prototype._parseMixinContent = function () { + if (!this.peekKeyword('@content')) { + return null; + } + var node = this.createNode(NodeType.MixinContent); + this.consumeToken(); + return this.finish(node); + }; + SCSSParser.prototype._parseMixinReference = function () { + if (!this.peekKeyword('@include')) { + return null; + } + var node = this.create(MixinReference); + this.consumeToken(); + if (!node.setIdentifier(this._parseIdent([ReferenceType.Mixin]))) { + return this.finish(node, ParseError.IdentifierExpected, [TokenType.CurlyR]); + } + if (this.accept(TokenType.ParenthesisL)) { + if (node.getArguments().addChild(this._parseFunctionArgument())) { + while (this.accept(TokenType.Comma)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.getArguments().addChild(this._parseFunctionArgument())) { + return this.finish(node, ParseError.ExpressionExpected); + } + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + } + if (this.peek(TokenType.CurlyL)) { + var content = this.create(BodyDeclaration); + this._parseBody(content, this._parseMixinReferenceBodyStatement.bind(this)); + node.setContent(content); + } + return this.finish(node); + }; + SCSSParser.prototype._parseMixinReferenceBodyStatement = function () { + return this._tryParseKeyframeSelector() || this._parseRuleSetDeclaration(); + }; + SCSSParser.prototype._parseFunctionArgument = function () { + // [variableName ':'] expression | variableName '...' + var node = this.create(FunctionArgument); + var pos = this.mark(); + var argument = this._parseVariable(); + if (argument) { + if (!this.accept(TokenType.Colon)) { + if (this.accept(Ellipsis)) { // optional + node.setValue(argument); + return this.finish(node); + } + else { + this.restoreAtMark(pos); + } + } + else { + node.setIdentifier(argument); + } + } + if (node.setValue(this._parseExpr(true))) { + this.accept(Ellipsis); // #43746 + node.addChild(this._parsePrio()); // #9859 + return this.finish(node); + } + return null; + }; + SCSSParser.prototype._parseURLArgument = function () { + var pos = this.mark(); + var node = _super.prototype._parseURLArgument.call(this); + if (!node || !this.peek(TokenType.ParenthesisR)) { + this.restoreAtMark(pos); + var node_1 = this.create(cssNodes_Node); + node_1.addChild(this._parseBinaryExpr()); + return this.finish(node_1); + } + return node; + }; + SCSSParser.prototype._parseOperation = function () { + if (!this.peek(TokenType.ParenthesisL)) { + return null; + } + var node = this.create(cssNodes_Node); + this.consumeToken(); + while (node.addChild(this._parseListElement())) { + this.accept(TokenType.Comma); // optional + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + return this.finish(node); + }; + SCSSParser.prototype._parseListElement = function () { + var node = this.create(ListEntry); + var child = this._parseBinaryExpr(); + if (!child) { + return null; + } + if (this.accept(TokenType.Colon)) { + node.setKey(child); + if (!node.setValue(this._parseBinaryExpr())) { + return this.finish(node, ParseError.ExpressionExpected); + } + } + else { + node.setValue(child); + } + return this.finish(node); + }; + return SCSSParser; +}(cssParser_Parser)); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/scssCompletion.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var scssCompletion_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + +var scssCompletion_localize = loadMessageBundle(); +var scssCompletion_SCSSCompletion = /** @class */ (function (_super) { + scssCompletion_extends(SCSSCompletion, _super); + function SCSSCompletion() { + return _super.call(this, '$') || this; + } + SCSSCompletion.prototype.createReplaceFunction = function () { + var tabStopCounter = 1; + return function (_match, p1) { + return '\\' + p1 + ': ${' + tabStopCounter++ + ':' + (SCSSCompletion.variableDefaults[p1] || '') + '}'; + }; + }; + SCSSCompletion.prototype.createFunctionProposals = function (proposals, existingNode, sortToEnd, result) { + for (var _i = 0, proposals_1 = proposals; _i < proposals_1.length; _i++) { + var p = proposals_1[_i]; + var insertText = p.func.replace(/\[?(\$\w+)\]?/g, this.createReplaceFunction()); + var label = p.func.substr(0, p.func.indexOf('(')); + var item = { + label: label, + detail: p.func, + documentation: p.desc, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertText), + insertTextFormat: InsertTextFormat.Snippet, + kind: main_CompletionItemKind.Function + }; + if (sortToEnd) { + item.sortText = 'z'; + } + result.items.push(item); + } + return result; + }; + SCSSCompletion.prototype.getCompletionsForSelector = function (ruleSet, isNested, result) { + this.createFunctionProposals(SCSSCompletion.selectorFuncs, void 0, true, result); + return _super.prototype.getCompletionsForSelector.call(this, ruleSet, isNested, result); + }; + SCSSCompletion.prototype.getTermProposals = function (entry, existingNode, result) { + var functions = SCSSCompletion.builtInFuncs; + if (entry) { + functions = functions.filter(function (f) { return !f.type || entry.restrictions.indexOf(f.type) !== -1; }); + } + this.createFunctionProposals(functions, existingNode, true, result); + return _super.prototype.getTermProposals.call(this, entry, existingNode, result); + }; + SCSSCompletion.prototype.getColorProposals = function (entry, existingNode, result) { + this.createFunctionProposals(SCSSCompletion.colorProposals, existingNode, false, result); + return _super.prototype.getColorProposals.call(this, entry, existingNode, result); + }; + SCSSCompletion.prototype.getCompletionsForDeclarationProperty = function (declaration, result) { + this.getCompletionForAtDirectives(result); + this.getCompletionsForSelector(null, true, result); + return _super.prototype.getCompletionsForDeclarationProperty.call(this, declaration, result); + }; + SCSSCompletion.prototype.getCompletionsForExtendsReference = function (_extendsRef, existingNode, result) { + var symbols = this.getSymbolContext().findSymbolsAtOffset(this.offset, ReferenceType.Rule); + for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) { + var symbol = symbols_1[_i]; + var suggest = { + label: symbol.name, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), symbol.name), + kind: main_CompletionItemKind.Function, + }; + result.items.push(suggest); + } + return result; + }; + SCSSCompletion.prototype.getCompletionForAtDirectives = function (result) { + var _a; + (_a = result.items).push.apply(_a, SCSSCompletion.scssAtDirectives); + return result; + }; + SCSSCompletion.prototype.getCompletionForTopLevel = function (result) { + this.getCompletionForAtDirectives(result); + _super.prototype.getCompletionForTopLevel.call(this, result); + return result; + }; + SCSSCompletion.variableDefaults = { + '$red': '1', + '$green': '2', + '$blue': '3', + '$alpha': '1.0', + '$color': '#000000', + '$weight': '0.5', + '$hue': '0', + '$saturation': '0%', + '$lightness': '0%', + '$degrees': '0', + '$amount': '0', + '$string': '""', + '$substring': '"s"', + '$number': '0', + '$limit': '1' + }; + SCSSCompletion.colorProposals = [ + { func: 'red($color)', desc: scssCompletion_localize('scss.builtin.red', 'Gets the red component of a color.') }, + { func: 'green($color)', desc: scssCompletion_localize('scss.builtin.green', 'Gets the green component of a color.') }, + { func: 'blue($color)', desc: scssCompletion_localize('scss.builtin.blue', 'Gets the blue component of a color.') }, + { func: 'mix($color, $color, [$weight])', desc: scssCompletion_localize('scss.builtin.mix', 'Mixes two colors together.') }, + { func: 'hue($color)', desc: scssCompletion_localize('scss.builtin.hue', 'Gets the hue component of a color.') }, + { func: 'saturation($color)', desc: scssCompletion_localize('scss.builtin.saturation', 'Gets the saturation component of a color.') }, + { func: 'lightness($color)', desc: scssCompletion_localize('scss.builtin.lightness', 'Gets the lightness component of a color.') }, + { func: 'adjust-hue($color, $degrees)', desc: scssCompletion_localize('scss.builtin.adjust-hue', 'Changes the hue of a color.') }, + { func: 'lighten($color, $amount)', desc: scssCompletion_localize('scss.builtin.lighten', 'Makes a color lighter.') }, + { func: 'darken($color, $amount)', desc: scssCompletion_localize('scss.builtin.darken', 'Makes a color darker.') }, + { func: 'saturate($color, $amount)', desc: scssCompletion_localize('scss.builtin.saturate', 'Makes a color more saturated.') }, + { func: 'desaturate($color, $amount)', desc: scssCompletion_localize('scss.builtin.desaturate', 'Makes a color less saturated.') }, + { func: 'grayscale($color)', desc: scssCompletion_localize('scss.builtin.grayscale', 'Converts a color to grayscale.') }, + { func: 'complement($color)', desc: scssCompletion_localize('scss.builtin.complement', 'Returns the complement of a color.') }, + { func: 'invert($color)', desc: scssCompletion_localize('scss.builtin.invert', 'Returns the inverse of a color.') }, + { func: 'alpha($color)', desc: scssCompletion_localize('scss.builtin.alpha', 'Gets the opacity component of a color.') }, + { func: 'opacity($color)', desc: 'Gets the alpha component (opacity) of a color.' }, + { func: 'rgba($color, $alpha)', desc: scssCompletion_localize('scss.builtin.rgba', 'Changes the alpha component for a color.') }, + { func: 'opacify($color, $amount)', desc: scssCompletion_localize('scss.builtin.opacify', 'Makes a color more opaque.') }, + { func: 'fade-in($color, $amount)', desc: scssCompletion_localize('scss.builtin.fade-in', 'Makes a color more opaque.') }, + { func: 'transparentize($color, $amount)', desc: scssCompletion_localize('scss.builtin.transparentize', 'Makes a color more transparent.') }, + { func: 'fade-out($color, $amount)', desc: scssCompletion_localize('scss.builtin.fade-out', 'Makes a color more transparent.') }, + { func: 'adjust-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])', desc: scssCompletion_localize('scss.builtin.adjust-color', 'Increases or decreases one or more components of a color.') }, + { func: 'scale-color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha])', desc: scssCompletion_localize('scss.builtin.scale-color', 'Fluidly scales one or more properties of a color.') }, + { func: 'change-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])', desc: scssCompletion_localize('scss.builtin.change-color', 'Changes one or more properties of a color.') }, + { func: 'ie-hex-str($color)', desc: scssCompletion_localize('scss.builtin.ie-hex-str', 'Converts a color into the format understood by IE filters.') } + ]; + SCSSCompletion.selectorFuncs = [ + { func: 'selector-nest($selectors…)', desc: scssCompletion_localize('scss.builtin.selector-nest', 'Nests selector beneath one another like they would be nested in the stylesheet.') }, + { func: 'selector-append($selectors…)', desc: scssCompletion_localize('scss.builtin.selector-append', 'Appends selectors to one another without spaces in between.') }, + { func: 'selector-extend($selector, $extendee, $extender)', desc: scssCompletion_localize('scss.builtin.selector-extend', 'Extends $extendee with $extender within $selector.') }, + { func: 'selector-replace($selector, $original, $replacement)', desc: scssCompletion_localize('scss.builtin.selector-replace', 'Replaces $original with $replacement within $selector.') }, + { func: 'selector-unify($selector1, $selector2)', desc: scssCompletion_localize('scss.builtin.selector-unify', 'Unifies two selectors to produce a selector that matches elements matched by both.') }, + { func: 'is-superselector($super, $sub)', desc: scssCompletion_localize('scss.builtin.is-superselector', 'Returns whether $super matches all the elements $sub does, and possibly more.') }, + { func: 'simple-selectors($selector)', desc: scssCompletion_localize('scss.builtin.simple-selectors', 'Returns the simple selectors that comprise a compound selector.') }, + { func: 'selector-parse($selector)', desc: scssCompletion_localize('scss.builtin.selector-parse', 'Parses a selector into the format returned by &.') } + ]; + SCSSCompletion.builtInFuncs = [ + { func: 'unquote($string)', desc: scssCompletion_localize('scss.builtin.unquote', 'Removes quotes from a string.') }, + { func: 'quote($string)', desc: scssCompletion_localize('scss.builtin.quote', 'Adds quotes to a string.') }, + { func: 'str-length($string)', desc: scssCompletion_localize('scss.builtin.str-length', 'Returns the number of characters in a string.') }, + { func: 'str-insert($string, $insert, $index)', desc: scssCompletion_localize('scss.builtin.str-insert', 'Inserts $insert into $string at $index.') }, + { func: 'str-index($string, $substring)', desc: scssCompletion_localize('scss.builtin.str-index', 'Returns the index of the first occurance of $substring in $string.') }, + { func: 'str-slice($string, $start-at, [$end-at])', desc: scssCompletion_localize('scss.builtin.str-slice', 'Extracts a substring from $string.') }, + { func: 'to-upper-case($string)', desc: scssCompletion_localize('scss.builtin.to-upper-case', 'Converts a string to upper case.') }, + { func: 'to-lower-case($string)', desc: scssCompletion_localize('scss.builtin.to-lower-case', 'Converts a string to lower case.') }, + { func: 'percentage($number)', desc: scssCompletion_localize('scss.builtin.percentage', 'Converts a unitless number to a percentage.'), type: 'percentage' }, + { func: 'round($number)', desc: scssCompletion_localize('scss.builtin.round', 'Rounds a number to the nearest whole number.') }, + { func: 'ceil($number)', desc: scssCompletion_localize('scss.builtin.ceil', 'Rounds a number up to the next whole number.') }, + { func: 'floor($number)', desc: scssCompletion_localize('scss.builtin.floor', 'Rounds a number down to the previous whole number.') }, + { func: 'abs($number)', desc: scssCompletion_localize('scss.builtin.abs', 'Returns the absolute value of a number.') }, + { func: 'min($numbers)', desc: scssCompletion_localize('scss.builtin.min', 'Finds the minimum of several numbers.') }, + { func: 'max($numbers)', desc: scssCompletion_localize('scss.builtin.max', 'Finds the maximum of several numbers.') }, + { func: 'random([$limit])', desc: scssCompletion_localize('scss.builtin.random', 'Returns a random number.') }, + { func: 'length($list)', desc: scssCompletion_localize('scss.builtin.length', 'Returns the length of a list.') }, + { func: 'nth($list, $n)', desc: scssCompletion_localize('scss.builtin.nth', 'Returns a specific item in a list.') }, + { func: 'set-nth($list, $n, $value)', desc: scssCompletion_localize('scss.builtin.set-nth', 'Replaces the nth item in a list.') }, + { func: 'join($list1, $list2, [$separator])', desc: scssCompletion_localize('scss.builtin.join', 'Joins together two lists into one.') }, + { func: 'append($list1, $val, [$separator])', desc: scssCompletion_localize('scss.builtin.append', 'Appends a single value onto the end of a list.') }, + { func: 'zip($lists)', desc: scssCompletion_localize('scss.builtin.zip', 'Combines several lists into a single multidimensional list.') }, + { func: 'index($list, $value)', desc: scssCompletion_localize('scss.builtin.index', 'Returns the position of a value within a list.') }, + { func: 'list-separator(#list)', desc: scssCompletion_localize('scss.builtin.list-separator', 'Returns the separator of a list.') }, + { func: 'map-get($map, $key)', desc: scssCompletion_localize('scss.builtin.map-get', 'Returns the value in a map associated with a given key.') }, + { func: 'map-merge($map1, $map2)', desc: scssCompletion_localize('scss.builtin.map-merge', 'Merges two maps together into a new map.') }, + { func: 'map-remove($map, $keys)', desc: scssCompletion_localize('scss.builtin.map-remove', 'Returns a new map with keys removed.') }, + { func: 'map-keys($map)', desc: scssCompletion_localize('scss.builtin.map-keys', 'Returns a list of all keys in a map.') }, + { func: 'map-values($map)', desc: scssCompletion_localize('scss.builtin.map-values', 'Returns a list of all values in a map.') }, + { func: 'map-has-key($map, $key)', desc: scssCompletion_localize('scss.builtin.map-has-key', 'Returns whether a map has a value associated with a given key.') }, + { func: 'keywords($args)', desc: scssCompletion_localize('scss.builtin.keywords', 'Returns the keywords passed to a function that takes variable arguments.') }, + { func: 'feature-exists($feature)', desc: scssCompletion_localize('scss.builtin.feature-exists', 'Returns whether a feature exists in the current Sass runtime.') }, + { func: 'variable-exists($name)', desc: scssCompletion_localize('scss.builtin.variable-exists', 'Returns whether a variable with the given name exists in the current scope.') }, + { func: 'global-variable-exists($name)', desc: scssCompletion_localize('scss.builtin.global-variable-exists', 'Returns whether a variable with the given name exists in the global scope.') }, + { func: 'function-exists($name)', desc: scssCompletion_localize('scss.builtin.function-exists', 'Returns whether a function with the given name exists.') }, + { func: 'mixin-exists($name)', desc: scssCompletion_localize('scss.builtin.mixin-exists', 'Returns whether a mixin with the given name exists.') }, + { func: 'inspect($value)', desc: scssCompletion_localize('scss.builtin.inspect', 'Returns the string representation of a value as it would be represented in Sass.') }, + { func: 'type-of($value)', desc: scssCompletion_localize('scss.builtin.type-of', 'Returns the type of a value.') }, + { func: 'unit($number)', desc: scssCompletion_localize('scss.builtin.unit', 'Returns the unit(s) associated with a number.') }, + { func: 'unitless($number)', desc: scssCompletion_localize('scss.builtin.unitless', 'Returns whether a number has units.') }, + { func: 'comparable($number1, $number2)', desc: scssCompletion_localize('scss.builtin.comparable', 'Returns whether two numbers can be added, subtracted, or compared.') }, + { func: 'call($name, $args…)', desc: scssCompletion_localize('scss.builtin.call', 'Dynamically calls a Sass function.') } + ]; + SCSSCompletion.scssAtDirectives = [ + { + label: "@extend", + documentation: scssCompletion_localize("scss.builtin.@extend", "Inherits the styles of another selector."), + kind: main_CompletionItemKind.Keyword + }, + { + label: "@at-root", + documentation: scssCompletion_localize("scss.builtin.@at-root", "Causes one or more rules to be emitted at the root of the document."), + kind: main_CompletionItemKind.Keyword + }, + { + label: "@debug", + documentation: scssCompletion_localize("scss.builtin.@debug", "Prints the value of an expression to the standard error output stream. Useful for debugging complicated Sass files."), + kind: main_CompletionItemKind.Keyword + }, + { + label: "@warn", + documentation: scssCompletion_localize("scss.builtin.@warn", "Prints the value of an expression to the standard error output stream. Useful for libraries that need to warn users of deprecations or recovering from minor mixin usage mistakes. Warnings can be turned off with the `--quiet` command-line option or the `:quiet` Sass option."), + kind: main_CompletionItemKind.Keyword + }, + { + label: "@error", + documentation: scssCompletion_localize("scss.builtin.@error", "Throws the value of an expression as a fatal error with stack trace. Useful for validating arguments to mixins and functions."), + kind: main_CompletionItemKind.Keyword + }, + { + label: "@if", + documentation: scssCompletion_localize("scss.builtin.@if", "Includes the body if the expression does not evaluate to `false` or `null`."), + insertText: "@if ${1:expr} {\n\t$0\n}", + insertTextFormat: InsertTextFormat.Snippet, + kind: main_CompletionItemKind.Keyword + }, + { + label: "@for", + documentation: scssCompletion_localize("scss.builtin.@for", "For loop that repeatedly outputs a set of styles for each `$var` in the `from/through` or `from/to` clause."), + insertText: "@for \\$${1:var} from ${2:start} ${3|to,through|} ${4:end} {\n\t$0\n}", + insertTextFormat: InsertTextFormat.Snippet, + kind: main_CompletionItemKind.Keyword + }, + { + label: "@each", + documentation: scssCompletion_localize("scss.builtin.@each", "Each loop that sets `$var` to each item in the list or map, then outputs the styles it contains using that value of `$var`."), + insertText: "@each \\$${1:var} in ${2:list} {\n\t$0\n}", + insertTextFormat: InsertTextFormat.Snippet, + kind: main_CompletionItemKind.Keyword + }, + { + label: "@while", + documentation: scssCompletion_localize("scss.builtin.@while", "While loop that takes an expression and repeatedly outputs the nested styles until the statement evaluates to `false`."), + insertText: "@while ${1:condition} {\n\t$0\n}", + insertTextFormat: InsertTextFormat.Snippet, + kind: main_CompletionItemKind.Keyword + }, + { + label: "@mixin", + documentation: scssCompletion_localize("scss.builtin.@mixin", "Defines styles that can be re-used throughout the stylesheet with `@include`."), + insertText: "@mixin ${1:name} {\n\t$0\n}", + insertTextFormat: InsertTextFormat.Snippet, + kind: main_CompletionItemKind.Keyword + }, + { + label: "@include", + documentation: scssCompletion_localize("scss.builtin.@include", "Includes the styles defined by another mixin into the current rule."), + kind: main_CompletionItemKind.Keyword + }, + ]; + return SCSSCompletion; +}(cssCompletion_CSSCompletion)); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/lessScanner.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var lessScanner_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + +var lessScanner_FSL = '/'.charCodeAt(0); +var lessScanner_NWL = '\n'.charCodeAt(0); +var lessScanner_CAR = '\r'.charCodeAt(0); +var lessScanner_LFD = '\f'.charCodeAt(0); +var _TIC = '`'.charCodeAt(0); +var lessScanner_DOT = '.'.charCodeAt(0); +var lessScanner_customTokenValue = TokenType.CustomToken; +var lessScanner_Ellipsis = lessScanner_customTokenValue++; +var lessScanner_LESSScanner = /** @class */ (function (_super) { + lessScanner_extends(LESSScanner, _super); + function LESSScanner() { + return _super !== null && _super.apply(this, arguments) || this; + } + LESSScanner.prototype.scanNext = function (offset) { + // LESS: escaped JavaScript code `const a = "dddd"` + var tokenType = this.escapedJavaScript(); + if (tokenType !== null) { + return this.finishToken(offset, tokenType); + } + if (this.stream.advanceIfChars([lessScanner_DOT, lessScanner_DOT, lessScanner_DOT])) { + return this.finishToken(offset, lessScanner_Ellipsis); + } + return _super.prototype.scanNext.call(this, offset); + }; + LESSScanner.prototype.comment = function () { + if (_super.prototype.comment.call(this)) { + return true; + } + if (!this.inURL && this.stream.advanceIfChars([lessScanner_FSL, lessScanner_FSL])) { + this.stream.advanceWhileChar(function (ch) { + switch (ch) { + case lessScanner_NWL: + case lessScanner_CAR: + case lessScanner_LFD: + return false; + default: + return true; + } + }); + return true; + } + else { + return false; + } + }; + LESSScanner.prototype.escapedJavaScript = function () { + var ch = this.stream.peekChar(); + if (ch === _TIC) { + this.stream.advance(1); + this.stream.advanceWhileChar(function (ch) { return ch !== _TIC; }); + return this.stream.advanceIfChar(_TIC) ? TokenType.EscapedJavaScript : TokenType.BadEscapedJavaScript; + } + return null; + }; + return LESSScanner; +}(Scanner)); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/parser/lessParser.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var lessParser_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + + +/// +/// A parser for LESS +/// http://lesscss.org/ +/// +var lessParser_LESSParser = /** @class */ (function (_super) { + lessParser_extends(LESSParser, _super); + function LESSParser() { + return _super.call(this, new lessScanner_LESSScanner()) || this; + } + LESSParser.prototype._parseStylesheetStatement = function (isNested) { + if (isNested === void 0) { isNested = false; } + if (this.peek(TokenType.AtKeyword)) { + return this._parseVariableDeclaration() + || this._parsePlugin() + || _super.prototype._parseStylesheetAtStatement.call(this, isNested); + } + return this._tryParseMixinDeclaration() + || this._tryParseMixinReference() + || this._parseFunction() + || this._parseRuleset(true); + }; + LESSParser.prototype._parseImport = function () { + if (!this.peekKeyword('@import') && !this.peekKeyword('@import-once') /* deprecated in less 1.4.1 */) { + return null; + } + var node = this.create(Import); + this.consumeToken(); + // less 1.4.1: @import (css) "lib" + if (this.accept(TokenType.ParenthesisL)) { + if (!this.accept(TokenType.Ident)) { + return this.finish(node, ParseError.IdentifierExpected, [TokenType.SemiColon]); + } + do { + if (!this.accept(TokenType.Comma)) { + break; + } + } while (this.accept(TokenType.Ident)); + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected, [TokenType.SemiColon]); + } + } + if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { + return this.finish(node, ParseError.URIOrStringExpected, [TokenType.SemiColon]); + } + if (!this.peek(TokenType.SemiColon) && !this.peek(TokenType.EOF)) { + node.setMedialist(this._parseMediaQueryList()); + } + return this.finish(node); + }; + LESSParser.prototype._parsePlugin = function () { + if (!this.peekKeyword('@plugin')) { + return null; + } + var node = this.createNode(NodeType.Plugin); + this.consumeToken(); // @import + if (!node.addChild(this._parseStringLiteral())) { + return this.finish(node, ParseError.StringLiteralExpected); + } + if (!this.accept(TokenType.SemiColon)) { + return this.finish(node, ParseError.SemiColonExpected); + } + return this.finish(node); + }; + LESSParser.prototype._parseMediaQuery = function (resyncStopToken) { + var node = _super.prototype._parseMediaQuery.call(this, resyncStopToken); + if (!node) { + var node_1 = this.create(MediaQuery); + if (node_1.addChild(this._parseVariable())) { + return this.finish(node_1); + } + return null; + } + return node; + }; + LESSParser.prototype._parseMediaDeclaration = function (isNested) { + if (isNested === void 0) { isNested = false; } + return this._tryParseRuleset(isNested) + || this._tryToParseDeclaration() + || this._tryParseMixinDeclaration() + || this._tryParseMixinReference() + || this._parseDetachedRuleSetMixin() + || this._parseStylesheetStatement(isNested); + }; + LESSParser.prototype._parseMediaFeatureName = function () { + return this._parseIdent() || this._parseVariable(); + }; + LESSParser.prototype._parseVariableDeclaration = function (panic) { + if (panic === void 0) { panic = []; } + var node = this.create(VariableDeclaration); + var mark = this.mark(); + if (!this.peekDelim('@') && !this.peek(TokenType.AtKeyword) || !node.setVariable(this._parseVariable())) { + return null; + } + if (this.accept(TokenType.Colon)) { + node.colonPosition = this.prevToken.offset; + if (node.setValue(this._parseDetachedRuleSet())) { + node.needsSemicolon = false; + } + else if (!node.setValue(this._parseExpr())) { + return this.finish(node, ParseError.VariableValueExpected, [], panic); + } + node.addChild(this._parsePrio()); + } + else { + this.restoreAtMark(mark); + return null; // at keyword, but no ':', not a variable declaration but some at keyword + } + if (this.peek(TokenType.SemiColon)) { + node.semicolonPosition = this.token.offset; // not part of the declaration, but useful information for code assist + } + return this.finish(node); + }; + LESSParser.prototype._parseDetachedRuleSet = function () { + if (!this.peek(TokenType.CurlyL)) { + return null; + } + var content = this.create(BodyDeclaration); + this._parseBody(content, this._parseDetachedRuleSetBody.bind(this)); + return this.finish(content); + }; + LESSParser.prototype._parseDetachedRuleSetBody = function () { + return this._tryParseKeyframeSelector() || this._parseRuleSetDeclaration(); + }; + LESSParser.prototype._parseVariable = function () { + if (!this.peekDelim('@') && !this.peekDelim('$') && !this.peek(TokenType.AtKeyword)) { + return null; + } + var node = this.create(Variable); + var mark = this.mark(); + while (this.acceptDelim('@') || this.acceptDelim('$')) { + if (this.hasWhitespace()) { + this.restoreAtMark(mark); + return null; + } + } + if (!this.accept(TokenType.AtKeyword) && !this.accept(TokenType.Ident)) { + this.restoreAtMark(mark); + return null; + } + return node; + }; + LESSParser.prototype._parseTerm = function () { + var term = _super.prototype._parseTerm.call(this); + if (term) { + return term; + } + term = this.create(Term); + if (term.setExpression(this._parseVariable()) || + term.setExpression(this._parseEscaped()) || + term.setExpression(this._tryParseMixinReference())) { + return this.finish(term); + } + return null; + }; + LESSParser.prototype._parseEscaped = function () { + if (this.peek(TokenType.EscapedJavaScript) || + this.peek(TokenType.BadEscapedJavaScript)) { + var node = this.createNode(NodeType.EscapedValue); + this.consumeToken(); + return this.finish(node); + } + if (this.peekDelim('~')) { + var node = this.createNode(NodeType.EscapedValue); + this.consumeToken(); + if (this.accept(TokenType.String) || this.accept(TokenType.EscapedJavaScript)) { + return this.finish(node); + } + else { + return this.finish(node, ParseError.TermExpected); + } + } + return null; + }; + LESSParser.prototype._parseOperator = function () { + var node = this._parseGuardOperator(); + if (node) { + return node; + } + else { + return _super.prototype._parseOperator.call(this); + } + }; + LESSParser.prototype._parseGuardOperator = function () { + if (this.peekDelim('>')) { + var node = this.createNode(NodeType.Operator); + this.consumeToken(); + this.acceptDelim('='); + return node; + } + else if (this.peekDelim('=')) { + var node = this.createNode(NodeType.Operator); + this.consumeToken(); + this.acceptDelim('<'); + return node; + } + else if (this.peekDelim('<')) { + var node = this.createNode(NodeType.Operator); + this.consumeToken(); + this.acceptDelim('='); + return node; + } + return null; + }; + LESSParser.prototype._parseRuleSetDeclaration = function () { + if (this.peek(TokenType.AtKeyword)) { + return this._parseKeyframe() + || this._parseMedia(true) + || this._parseImport() + || this._parseSupports(true) // @supports + || this._parseDetachedRuleSetMixin() // less detached ruleset mixin + || this._parseVariableDeclaration() // Variable declarations + || this._parseUnknownAtRule(); + } + return this._tryParseMixinDeclaration() + || this._tryParseRuleset(true) // nested ruleset + || this._tryParseMixinReference() // less mixin reference + || this._parseFunction() + || this._parseExtend() // less extend declaration + || _super.prototype._parseRuleSetDeclaration.call(this); // try css ruleset declaration as the last option + }; + LESSParser.prototype._parseKeyframeIdent = function () { + return this._parseIdent([ReferenceType.Keyframe]) || this._parseVariable(); + }; + LESSParser.prototype._parseKeyframeSelector = function () { + return this._parseDetachedRuleSetMixin() // less detached ruleset mixin + || _super.prototype._parseKeyframeSelector.call(this); + }; + LESSParser.prototype._parseSimpleSelectorBody = function () { + return this._parseSelectorCombinator() || _super.prototype._parseSimpleSelectorBody.call(this); + }; + LESSParser.prototype._parseSelector = function (isNested) { + // CSS Guards + var node = this.create(Selector); + var hasContent = false; + if (isNested) { + // nested selectors can start with a combinator + hasContent = node.addChild(this._parseCombinator()); + } + while (node.addChild(this._parseSimpleSelector())) { + hasContent = true; + var mark = this.mark(); + if (node.addChild(this._parseGuard()) && this.peek(TokenType.CurlyL)) { + break; + } + this.restoreAtMark(mark); + node.addChild(this._parseCombinator()); // optional + } + return hasContent ? this.finish(node) : null; + }; + LESSParser.prototype._parseSelectorCombinator = function () { + if (this.peekDelim('&')) { + var node = this.createNode(NodeType.SelectorCombinator); + this.consumeToken(); + while (!this.hasWhitespace() && (this.acceptDelim('-') || this.accept(TokenType.Num) || this.accept(TokenType.Dimension) || node.addChild(this._parseIdent()) || this.acceptDelim('&'))) { + // support &-foo + } + return this.finish(node); + } + return null; + }; + LESSParser.prototype._parseSelectorIdent = function () { + if (!this.peekInterpolatedIdent()) { + return null; + } + var node = this.createNode(NodeType.SelectorInterpolation); + var hasContent = this._acceptInterpolatedIdent(node); + return hasContent ? this.finish(node) : null; + }; + LESSParser.prototype._parsePropertyIdentifier = function () { + if (!this.peekInterpolatedIdent()) { + return null; + } + var node = this.create(Identifier); + node.isCustomProperty = this.peekRegExp(TokenType.Ident, /^--/); + var hasContent = this._acceptInterpolatedIdent(node); + if (hasContent && !this.hasWhitespace()) { + this.acceptDelim('+'); + if (!this.hasWhitespace()) { + this.acceptIdent('_'); + } + } + return hasContent ? this.finish(node) : null; + }; + LESSParser.prototype.peekInterpolatedIdent = function () { + return this.peek(TokenType.Ident) || + this.peekDelim('@') || + this.peekDelim('$') || + this.peekDelim('-'); + }; + LESSParser.prototype._acceptInterpolatedIdent = function (node) { + var _this = this; + var hasContent = false; + var indentInterpolation = function () { + var pos = _this.mark(); + if (_this.acceptDelim('-')) { + if (!_this.hasWhitespace()) { + _this.acceptDelim('-'); + } + if (_this.hasWhitespace()) { + _this.restoreAtMark(pos); + return null; + } + } + return _this._parseInterpolation(); + }; + while (this.accept(TokenType.Ident) || node.addChild(indentInterpolation()) || (hasContent && (this.acceptDelim('-') || this.accept(TokenType.Num)))) { + hasContent = true; + if (this.hasWhitespace()) { + break; + } + } + return hasContent; + }; + LESSParser.prototype._parseInterpolation = function () { + // @{name} Variable or + // ${name} Property + var mark = this.mark(); + if (this.peekDelim('@') || this.peekDelim('$')) { + var node = this.createNode(NodeType.Interpolation); + this.consumeToken(); + if (this.hasWhitespace() || !this.accept(TokenType.CurlyL)) { + this.restoreAtMark(mark); + return null; + } + if (!node.addChild(this._parseIdent())) { + return this.finish(node, ParseError.IdentifierExpected); + } + if (!this.accept(TokenType.CurlyR)) { + return this.finish(node, ParseError.RightCurlyExpected); + } + return this.finish(node); + } + return null; + }; + LESSParser.prototype._tryParseMixinDeclaration = function () { + var mark = this.mark(); + var node = this.create(MixinDeclaration); + if (!node.setIdentifier(this._parseMixinDeclarationIdentifier()) || !this.accept(TokenType.ParenthesisL)) { + this.restoreAtMark(mark); + return null; + } + if (node.getParameters().addChild(this._parseMixinParameter())) { + while (this.accept(TokenType.Comma) || this.accept(TokenType.SemiColon)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.getParameters().addChild(this._parseMixinParameter())) { + this.markError(node, ParseError.IdentifierExpected, [], [TokenType.ParenthesisR]); + } + } + } + if (!this.accept(TokenType.ParenthesisR)) { + this.restoreAtMark(mark); + return null; + } + node.setGuard(this._parseGuard()); + if (!this.peek(TokenType.CurlyL)) { + this.restoreAtMark(mark); + return null; + } + return this._parseBody(node, this._parseMixInBodyDeclaration.bind(this)); + }; + LESSParser.prototype._parseMixInBodyDeclaration = function () { + return this._parseFontFace() || this._parseRuleSetDeclaration(); + }; + LESSParser.prototype._parseMixinDeclarationIdentifier = function () { + var identifier; + if (this.peekDelim('#') || this.peekDelim('.')) { + identifier = this.create(Identifier); + this.consumeToken(); // # or . + if (this.hasWhitespace() || !identifier.addChild(this._parseIdent())) { + return null; + } + } + else if (this.peek(TokenType.Hash)) { + identifier = this.create(Identifier); + this.consumeToken(); // TokenType.Hash + } + else { + return null; + } + identifier.referenceTypes = [ReferenceType.Mixin]; + return this.finish(identifier); + }; + LESSParser.prototype._parsePseudo = function () { + if (!this.peek(TokenType.Colon)) { + return null; + } + var mark = this.mark(); + var node = this.create(ExtendsReference); + this.consumeToken(); // : + if (this.acceptIdent('extend')) { + return this._completeExtends(node); + } + this.restoreAtMark(mark); + return _super.prototype._parsePseudo.call(this); + }; + LESSParser.prototype._parseExtend = function () { + if (!this.peekDelim('&')) { + return null; + } + var mark = this.mark(); + var node = this.create(ExtendsReference); + this.consumeToken(); // & + if (this.hasWhitespace() || !this.accept(TokenType.Colon) || !this.acceptIdent('extend')) { + this.restoreAtMark(mark); + return null; + } + return this._completeExtends(node); + }; + LESSParser.prototype._completeExtends = function (node) { + if (!this.accept(TokenType.ParenthesisL)) { + return this.finish(node, ParseError.LeftParenthesisExpected); + } + var selectors = node.getSelectors(); + if (!selectors.addChild(this._parseSelector(true))) { + return this.finish(node, ParseError.SelectorExpected); + } + while (this.accept(TokenType.Comma)) { + if (!selectors.addChild(this._parseSelector(true))) { + return this.finish(node, ParseError.SelectorExpected); + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + return this.finish(node); + }; + LESSParser.prototype._parseDetachedRuleSetMixin = function () { + if (!this.peek(TokenType.AtKeyword)) { + return null; + } + var mark = this.mark(); + var node = this.create(MixinReference); + if (node.addChild(this._parseVariable()) && (this.hasWhitespace() || !this.accept(TokenType.ParenthesisL))) { + this.restoreAtMark(mark); + return null; + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + return this.finish(node); + }; + LESSParser.prototype._tryParseMixinReference = function () { + var mark = this.mark(); + var node = this.create(MixinReference); + var identifier = this._parseMixinDeclarationIdentifier(); + while (identifier) { + this.acceptDelim('>'); + var nextId = this._parseMixinDeclarationIdentifier(); + if (nextId) { + node.getNamespaces().addChild(identifier); + identifier = nextId; + } + else { + break; + } + } + if (!node.setIdentifier(identifier)) { + this.restoreAtMark(mark); + return null; + } + var hasArguments = false; + if (!this.hasWhitespace() && this.accept(TokenType.ParenthesisL)) { + hasArguments = true; + if (node.getArguments().addChild(this._parseMixinArgument())) { + while (this.accept(TokenType.Comma) || this.accept(TokenType.SemiColon)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.getArguments().addChild(this._parseMixinArgument())) { + return this.finish(node, ParseError.ExpressionExpected); + } + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + identifier.referenceTypes = [ReferenceType.Mixin]; + } + else { + identifier.referenceTypes = [ReferenceType.Mixin, ReferenceType.Rule]; + } + node.addChild(this._parsePrio()); + if (!hasArguments && !this.peek(TokenType.SemiColon) && !this.peek(TokenType.CurlyR) && !this.peek(TokenType.EOF)) { + this.restoreAtMark(mark); + return null; + } + return this.finish(node); + }; + LESSParser.prototype._parseMixinArgument = function () { + // [variableName ':'] expression | variableName '...' + var node = this.create(FunctionArgument); + var pos = this.mark(); + var argument = this._parseVariable(); + if (argument) { + if (!this.accept(TokenType.Colon)) { + this.restoreAtMark(pos); + } + else { + node.setIdentifier(argument); + } + } + if (node.setValue(this._parseDetachedRuleSet() || this._parseExpr(true))) { + return this.finish(node); + } + this.restoreAtMark(pos); + return null; + }; + LESSParser.prototype._parseMixinParameter = function () { + var node = this.create(FunctionParameter); + // special rest variable: @rest... + if (this.peekKeyword('@rest')) { + var restNode = this.create(cssNodes_Node); + this.consumeToken(); + if (!this.accept(lessScanner_Ellipsis)) { + return this.finish(node, ParseError.DotExpected, [], [TokenType.Comma, TokenType.ParenthesisR]); + } + node.setIdentifier(this.finish(restNode)); + return this.finish(node); + } + // special const args: ... + if (this.peek(lessScanner_Ellipsis)) { + var varargsNode = this.create(cssNodes_Node); + this.consumeToken(); + node.setIdentifier(this.finish(varargsNode)); + return this.finish(node); + } + var hasContent = false; + // default variable declaration: @param: 12 or @name + if (node.setIdentifier(this._parseVariable())) { + this.accept(TokenType.Colon); + hasContent = true; + } + if (!node.setDefaultValue(this._parseDetachedRuleSet() || this._parseExpr(true)) && !hasContent) { + return null; + } + return this.finish(node); + }; + LESSParser.prototype._parseGuard = function () { + if (!this.peekIdent('when')) { + return null; + } + var node = this.create(LessGuard); + this.consumeToken(); // when + node.isNegated = this.acceptIdent('not'); + if (!node.getConditions().addChild(this._parseGuardCondition())) { + return this.finish(node, ParseError.ConditionExpected); + } + while (this.acceptIdent('and') || this.accept(TokenType.Comma)) { + if (!node.getConditions().addChild(this._parseGuardCondition())) { + return this.finish(node, ParseError.ConditionExpected); + } + } + return this.finish(node); + }; + LESSParser.prototype._parseGuardCondition = function () { + if (!this.peek(TokenType.ParenthesisL)) { + return null; + } + var node = this.create(GuardCondition); + this.consumeToken(); // ParenthesisL + if (!node.addChild(this._parseExpr())) { + // empty (?) + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + return this.finish(node); + }; + LESSParser.prototype._parseFunction = function () { + var pos = this.mark(); + var node = this.create(Function); + if (!node.setIdentifier(this._parseFunctionIdentifier())) { + return null; + } + if (this.hasWhitespace() || !this.accept(TokenType.ParenthesisL)) { + this.restoreAtMark(pos); + return null; + } + if (node.getArguments().addChild(this._parseMixinArgument())) { + while (this.accept(TokenType.Comma) || this.accept(TokenType.SemiColon)) { + if (this.peek(TokenType.ParenthesisR)) { + break; + } + if (!node.getArguments().addChild(this._parseMixinArgument())) { + return this.finish(node, ParseError.ExpressionExpected); + } + } + } + if (!this.accept(TokenType.ParenthesisR)) { + return this.finish(node, ParseError.RightParenthesisExpected); + } + return this.finish(node); + }; + LESSParser.prototype._parseFunctionIdentifier = function () { + if (this.peekDelim('%')) { + var node = this.create(Identifier); + node.referenceTypes = [ReferenceType.Function]; + this.consumeToken(); + return this.finish(node); + } + return _super.prototype._parseFunctionIdentifier.call(this); + }; + LESSParser.prototype._parseURLArgument = function () { + var pos = this.mark(); + var node = _super.prototype._parseURLArgument.call(this); + if (!node || !this.peek(TokenType.ParenthesisR)) { + this.restoreAtMark(pos); + var node_2 = this.create(cssNodes_Node); + node_2.addChild(this._parseBinaryExpr()); + return this.finish(node_2); + } + return node; + }; + return LESSParser; +}(cssParser_Parser)); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/lessCompletion.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var lessCompletion_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + +var lessCompletion_localize = loadMessageBundle(); +var lessCompletion_LESSCompletion = /** @class */ (function (_super) { + lessCompletion_extends(LESSCompletion, _super); + function LESSCompletion() { + return _super.call(this, '@') || this; + } + LESSCompletion.prototype.createFunctionProposals = function (proposals, existingNode, sortToEnd, result) { + for (var _i = 0, proposals_1 = proposals; _i < proposals_1.length; _i++) { + var p = proposals_1[_i]; + var item = { + label: p.name, + detail: p.example, + documentation: p.description, + textEdit: TextEdit.replace(this.getCompletionRange(existingNode), p.name + '($0)'), + insertTextFormat: InsertTextFormat.Snippet, + kind: main_CompletionItemKind.Function + }; + if (sortToEnd) { + item.sortText = 'z'; + } + result.items.push(item); + } + return result; + }; + LESSCompletion.prototype.getTermProposals = function (entry, existingNode, result) { + var functions = LESSCompletion.builtInProposals; + if (entry) { + functions = functions.filter(function (f) { return !f.type || entry.restrictions.indexOf(f.type) !== -1; }); + } + this.createFunctionProposals(functions, existingNode, true, result); + return _super.prototype.getTermProposals.call(this, entry, existingNode, result); + }; + LESSCompletion.prototype.getColorProposals = function (entry, existingNode, result) { + this.createFunctionProposals(LESSCompletion.colorProposals, existingNode, false, result); + return _super.prototype.getColorProposals.call(this, entry, existingNode, result); + }; + LESSCompletion.prototype.getCompletionsForDeclarationProperty = function (declaration, result) { + this.getCompletionsForSelector(null, true, result); + return _super.prototype.getCompletionsForDeclarationProperty.call(this, declaration, result); + }; + LESSCompletion.builtInProposals = [ + // Boolean functions + { + 'name': 'if', + 'example': 'if(condition, trueValue [, falseValue]);', + 'description': lessCompletion_localize('less.builtin.if', 'returns one of two values depending on a condition.') + }, + { + 'name': 'boolean', + 'example': 'boolean(condition);', + 'description': lessCompletion_localize('less.builtin.boolean', '"store" a boolean test for later evaluation in a guard or if().') + }, + // List functions + { + 'name': 'length', + 'example': 'length(@list);', + 'description': lessCompletion_localize('less.builtin.length', 'returns the number of elements in a value list') + }, + { + 'name': 'extract', + 'example': 'extract(@list, index);', + 'description': lessCompletion_localize('less.builtin.extract', 'returns a value at the specified position in the list') + }, + { + 'name': 'range', + 'example': 'range([start, ] end [, step]);', + 'description': lessCompletion_localize('less.builtin.range', 'generate a list spanning a range of values') + }, + { + 'name': 'each', + 'example': 'each(@list, ruleset);', + 'description': lessCompletion_localize('less.builtin.each', 'bind the evaluation of a ruleset to each member of a list.') + }, + // Other built-ins + { + 'name': 'escape', + 'example': 'escape(@string);', + 'description': lessCompletion_localize('less.builtin.escape', 'URL encodes a string') + }, + { + 'name': 'e', + 'example': 'e(@string);', + 'description': lessCompletion_localize('less.builtin.e', 'escape string content') + }, + { + 'name': 'replace', + 'example': 'replace(@string, @pattern, @replacement[, @flags]);', + 'description': lessCompletion_localize('less.builtin.replace', 'string replace') + }, + { + 'name': 'unit', + 'example': 'unit(@dimension, [@unit: \'\']);', + 'description': lessCompletion_localize('less.builtin.unit', 'remove or change the unit of a dimension') + }, + { + 'name': 'color', + 'example': 'color(@string);', + 'description': lessCompletion_localize('less.builtin.color', 'parses a string to a color'), + 'type': 'color' + }, + { + 'name': 'convert', + 'example': 'convert(@value, unit);', + 'description': lessCompletion_localize('less.builtin.convert', 'converts numbers from one type into another') + }, + { + 'name': 'data-uri', + 'example': 'data-uri([mimetype,] url);', + 'description': lessCompletion_localize('less.builtin.data-uri', 'inlines a resource and falls back to `url()`'), + 'type': 'url' + }, + { + 'name': 'abs', + 'description': lessCompletion_localize('less.builtin.abs', 'absolute value of a number'), + 'example': 'abs(number);' + }, + { + 'name': 'acos', + 'description': lessCompletion_localize('less.builtin.acos', 'arccosine - inverse of cosine function'), + 'example': 'acos(number);' + }, + { + 'name': 'asin', + 'description': lessCompletion_localize('less.builtin.asin', 'arcsine - inverse of sine function'), + 'example': 'asin(number);' + }, + { + 'name': 'ceil', + 'example': 'ceil(@number);', + 'description': lessCompletion_localize('less.builtin.ceil', 'rounds up to an integer') + }, + { + 'name': 'cos', + 'description': lessCompletion_localize('less.builtin.cos', 'cosine function'), + 'example': 'cos(number);' + }, + { + 'name': 'floor', + 'description': lessCompletion_localize('less.builtin.floor', 'rounds down to an integer'), + 'example': 'floor(@number);' + }, + { + 'name': 'percentage', + 'description': lessCompletion_localize('less.builtin.percentage', 'converts to a %, e.g. 0.5 > 50%'), + 'example': 'percentage(@number);', + 'type': 'percentage' + }, + { + 'name': 'round', + 'description': lessCompletion_localize('less.builtin.round', 'rounds a number to a number of places'), + 'example': 'round(number, [places: 0]);' + }, + { + 'name': 'sqrt', + 'description': lessCompletion_localize('less.builtin.sqrt', 'calculates square root of a number'), + 'example': 'sqrt(number);' + }, + { + 'name': 'sin', + 'description': lessCompletion_localize('less.builtin.sin', 'sine function'), + 'example': 'sin(number);' + }, + { + 'name': 'tan', + 'description': lessCompletion_localize('less.builtin.tan', 'tangent function'), + 'example': 'tan(number);' + }, + { + 'name': 'atan', + 'description': lessCompletion_localize('less.builtin.atan', 'arctangent - inverse of tangent function'), + 'example': 'atan(number);' + }, + { + 'name': 'pi', + 'description': lessCompletion_localize('less.builtin.pi', 'returns pi'), + 'example': 'pi();' + }, + { + 'name': 'pow', + 'description': lessCompletion_localize('less.builtin.pow', 'first argument raised to the power of the second argument'), + 'example': 'pow(@base, @exponent);' + }, + { + 'name': 'mod', + 'description': lessCompletion_localize('less.builtin.mod', 'first argument modulus second argument'), + 'example': 'mod(number, number);' + }, + { + 'name': 'min', + 'description': lessCompletion_localize('less.builtin.min', 'returns the lowest of one or more values'), + 'example': 'min(@x, @y);' + }, + { + 'name': 'max', + 'description': lessCompletion_localize('less.builtin.max', 'returns the lowest of one or more values'), + 'example': 'max(@x, @y);' + } + ]; + LESSCompletion.colorProposals = [ + { + 'name': 'argb', + 'example': 'argb(@color);', + 'description': lessCompletion_localize('less.builtin.argb', 'creates a #AARRGGBB') + }, + { + 'name': 'hsl', + 'example': 'hsl(@hue, @saturation, @lightness);', + 'description': lessCompletion_localize('less.builtin.hsl', 'creates a color') + }, + { + 'name': 'hsla', + 'example': 'hsla(@hue, @saturation, @lightness, @alpha);', + 'description': lessCompletion_localize('less.builtin.hsla', 'creates a color') + }, + { + 'name': 'hsv', + 'example': 'hsv(@hue, @saturation, @value);', + 'description': lessCompletion_localize('less.builtin.hsv', 'creates a color') + }, + { + 'name': 'hsva', + 'example': 'hsva(@hue, @saturation, @value, @alpha);', + 'description': lessCompletion_localize('less.builtin.hsva', 'creates a color') + }, + { + 'name': 'hue', + 'example': 'hue(@color);', + 'description': lessCompletion_localize('less.builtin.hue', 'returns the `hue` channel of `@color` in the HSL space') + }, + { + 'name': 'saturation', + 'example': 'saturation(@color);', + 'description': lessCompletion_localize('less.builtin.saturation', 'returns the `saturation` channel of `@color` in the HSL space') + }, + { + 'name': 'lightness', + 'example': 'lightness(@color);', + 'description': lessCompletion_localize('less.builtin.lightness', 'returns the `lightness` channel of `@color` in the HSL space') + }, + { + 'name': 'hsvhue', + 'example': 'hsvhue(@color);', + 'description': lessCompletion_localize('less.builtin.hsvhue', 'returns the `hue` channel of `@color` in the HSV space') + }, + { + 'name': 'hsvsaturation', + 'example': 'hsvsaturation(@color);', + 'description': lessCompletion_localize('less.builtin.hsvsaturation', 'returns the `saturation` channel of `@color` in the HSV space') + }, + { + 'name': 'hsvvalue', + 'example': 'hsvvalue(@color);', + 'description': lessCompletion_localize('less.builtin.hsvvalue', 'returns the `value` channel of `@color` in the HSV space') + }, + { + 'name': 'red', + 'example': 'red(@color);', + 'description': lessCompletion_localize('less.builtin.red', 'returns the `red` channel of `@color`') + }, + { + 'name': 'green', + 'example': 'green(@color);', + 'description': lessCompletion_localize('less.builtin.green', 'returns the `green` channel of `@color`') + }, + { + 'name': 'blue', + 'example': 'blue(@color);', + 'description': lessCompletion_localize('less.builtin.blue', 'returns the `blue` channel of `@color`') + }, + { + 'name': 'alpha', + 'example': 'alpha(@color);', + 'description': lessCompletion_localize('less.builtin.alpha', 'returns the `alpha` channel of `@color`') + }, + { + 'name': 'luma', + 'example': 'luma(@color);', + 'description': lessCompletion_localize('less.builtin.luma', 'returns the `luma` value (perceptual brightness) of `@color`') + }, + { + 'name': 'saturate', + 'example': 'saturate(@color, 10%);', + 'description': lessCompletion_localize('less.builtin.saturate', 'return `@color` 10% points more saturated') + }, + { + 'name': 'desaturate', + 'example': 'desaturate(@color, 10%);', + 'description': lessCompletion_localize('less.builtin.desaturate', 'return `@color` 10% points less saturated') + }, + { + 'name': 'lighten', + 'example': 'lighten(@color, 10%);', + 'description': lessCompletion_localize('less.builtin.lighten', 'return `@color` 10% points lighter') + }, + { + 'name': 'darken', + 'example': 'darken(@color, 10%);', + 'description': lessCompletion_localize('less.builtin.darken', 'return `@color` 10% points darker') + }, + { + 'name': 'fadein', + 'example': 'fadein(@color, 10%);', + 'description': lessCompletion_localize('less.builtin.fadein', 'return `@color` 10% points less transparent') + }, + { + 'name': 'fadeout', + 'example': 'fadeout(@color, 10%);', + 'description': lessCompletion_localize('less.builtin.fadeout', 'return `@color` 10% points more transparent') + }, + { + 'name': 'fade', + 'example': 'fade(@color, 50%);', + 'description': lessCompletion_localize('less.builtin.fade', 'return `@color` with 50% transparency') + }, + { + 'name': 'spin', + 'example': 'spin(@color, 10);', + 'description': lessCompletion_localize('less.builtin.spin', 'return `@color` with a 10 degree larger in hue') + }, + { + 'name': 'mix', + 'example': 'mix(@color1, @color2, [@weight: 50%]);', + 'description': lessCompletion_localize('less.builtin.mix', 'return a mix of `@color1` and `@color2`') + }, + { + 'name': 'greyscale', + 'example': 'greyscale(@color);', + 'description': lessCompletion_localize('less.builtin.greyscale', 'returns a grey, 100% desaturated color'), + }, + { + 'name': 'contrast', + 'example': 'contrast(@color1, [@darkcolor: black], [@lightcolor: white], [@threshold: 43%]);', + 'description': lessCompletion_localize('less.builtin.contrast', 'return `@darkcolor` if `@color1 is> 43% luma` otherwise return `@lightcolor`, see notes') + }, + { + 'name': 'multiply', + 'example': 'multiply(@color1, @color2);' + }, + { + 'name': 'screen', + 'example': 'screen(@color1, @color2);' + }, + { + 'name': 'overlay', + 'example': 'overlay(@color1, @color2);' + }, + { + 'name': 'softlight', + 'example': 'softlight(@color1, @color2);' + }, + { + 'name': 'hardlight', + 'example': 'hardlight(@color1, @color2);' + }, + { + 'name': 'difference', + 'example': 'difference(@color1, @color2);' + }, + { + 'name': 'exclusion', + 'example': 'exclusion(@color1, @color2);' + }, + { + 'name': 'average', + 'example': 'average(@color1, @color2);' + }, + { + 'name': 'negation', + 'example': 'negation(@color1, @color2);' + } + ]; + return LESSCompletion; +}(cssCompletion_CSSCompletion)); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssFolding.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -38005,20 +35919,353 @@ __webpack_require__.r(__webpack_exports__); -var CSSWorker = /** @class */ (function () { + +function getFoldingRanges(document, context) { + var ranges = computeFoldingRanges(document); + return limitFoldingRanges(ranges, context); +} +function computeFoldingRanges(document) { + function getStartLine(t) { + return document.positionAt(t.offset).line; + } + function getEndLine(t) { + return document.positionAt(t.offset + t.len).line; + } + function getScanner() { + switch (document.languageId) { + case 'scss': + return new scssScanner_SCSSScanner(); + case 'less': + return new lessScanner_LESSScanner(); + default: + return new Scanner(); + } + } + function tokenToRange(t, kind) { + var startLine = getStartLine(t); + var endLine = getEndLine(t); + if (startLine !== endLine) { + return { + startLine: startLine, + endLine: endLine, + kind: kind + }; + } + else { + return null; + } + } + var ranges = []; + var delimiterStack = []; + var scanner = getScanner(); + scanner.ignoreComment = false; + scanner.setSource(document.getText()); + var token = scanner.scan(); + var prevToken; + var _loop_1 = function () { + switch (token.type) { + case TokenType.CurlyL: + case InterpolationFunction: + { + delimiterStack.push({ line: getStartLine(token), type: 'brace', isStart: true }); + break; + } + case TokenType.CurlyR: { + if (delimiterStack.length !== 0) { + var prevDelimiter = popPrevStartDelimiterOfType(delimiterStack, 'brace'); + if (!prevDelimiter) { + break; + } + var endLine = getEndLine(token); + if (prevDelimiter.type === 'brace') { + /** + * Other than the case when curly brace is not on a new line by itself, for example + * .foo { + * color: red; } + * Use endLine minus one to show ending curly brace + */ + if (getEndLine(prevToken) !== endLine) { + endLine--; + } + if (prevDelimiter.line !== endLine) { + ranges.push({ + startLine: prevDelimiter.line, + endLine: endLine, + kind: undefined + }); + } + } + } + break; + } + /** + * In CSS, there is no single line comment prefixed with // + * All comments are marked as `Comment` + */ + case TokenType.Comment: { + var commentRegionMarkerToDelimiter_1 = function (marker) { + if (marker === '#region') { + return { line: getStartLine(token), type: 'comment', isStart: true }; + } + else { + return { line: getEndLine(token), type: 'comment', isStart: false }; + } + }; + var getCurrDelimiter = function (token) { + var matches = token.text.match(/^\s*\/\*\s*(#region|#endregion)\b\s*(.*?)\s*\*\//); + if (matches) { + return commentRegionMarkerToDelimiter_1(matches[1]); + } + else if (document.languageId === 'scss' || document.languageId === 'less') { + var matches_1 = token.text.match(/^\s*\/\/\s*(#region|#endregion)\b\s*(.*?)\s*/); + if (matches_1) { + return commentRegionMarkerToDelimiter_1(matches_1[1]); + } + } + return null; + }; + var currDelimiter = getCurrDelimiter(token); + // /* */ comment region folding + // All #region and #endregion cases + if (currDelimiter) { + if (currDelimiter.isStart) { + delimiterStack.push(currDelimiter); + } + else { + var prevDelimiter = popPrevStartDelimiterOfType(delimiterStack, 'comment'); + if (!prevDelimiter) { + break; + } + if (prevDelimiter.type === 'comment') { + if (prevDelimiter.line !== currDelimiter.line) { + ranges.push({ + startLine: prevDelimiter.line, + endLine: currDelimiter.line, + kind: 'region' + }); + } + } + } + } + // Multiline comment case + else { + var range = tokenToRange(token, 'comment'); + if (range) { + ranges.push(range); + } + } + break; + } + } + prevToken = token; + token = scanner.scan(); + }; + while (token.type !== TokenType.EOF) { + _loop_1(); + } + return ranges; +} +function popPrevStartDelimiterOfType(stack, type) { + if (stack.length === 0) { + return null; + } + for (var i = stack.length - 1; i >= 0; i--) { + if (stack[i].type === type && stack[i].isStart) { + return stack.splice(i, 1)[0]; + } + } + return null; +} +/** + * - Sort regions + * - Remove invalid regions (intersections) + * - If limit exceeds, only return `rangeLimit` amount of ranges + */ +function limitFoldingRanges(ranges, context) { + var maxRanges = context && context.rangeLimit || Number.MAX_VALUE; + var sortedRanges = ranges.sort(function (r1, r2) { + var diff = r1.startLine - r2.startLine; + if (diff === 0) { + diff = r1.endLine - r2.endLine; + } + return diff; + }); + var validRanges = []; + var prevEndLine = -1; + sortedRanges.forEach(function (r) { + if (!(r.startLine < prevEndLine && prevEndLine < r.endLine)) { + validRanges.push(r); + prevEndLine = r.endLine; + } + }); + if (validRanges.length < maxRanges) { + return validRanges; + } + else { + return validRanges.slice(0, maxRanges); + } +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/cssLanguageTypes.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + +// #region Proposed types, remove once added to vscode-languageserver-types +/** + * Enum of known selection range kinds + */ +var SelectionRangeKind; +(function (SelectionRangeKind) { + /** + * Empty Kind. + */ + SelectionRangeKind["Empty"] = ""; + /** + * The statment kind, its value is `statement`, possible extensions can be + * `statement.if` etc + */ + SelectionRangeKind["Statement"] = "statement"; + /** + * The declaration kind, its value is `declaration`, possible extensions can be + * `declaration.function`, `declaration.class` etc. + */ + SelectionRangeKind["Declaration"] = "declaration"; +})(SelectionRangeKind || (SelectionRangeKind = {})); + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/services/cssSelectionRange.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + + +function getSelectionRanges(document, positions, stylesheet) { + function getSelectionRange(position) { + var applicableRanges = getApplicableRanges(position); + var ranges = applicableRanges.map(function (pair) { + return { + range: main_Range.create(document.positionAt(pair[0]), document.positionAt(pair[1])), + kind: SelectionRangeKind.Statement + }; + }); + return ranges; + } + return positions.map(getSelectionRange); + function getApplicableRanges(position) { + var currNode = stylesheet.findChildAtOffset(document.offsetAt(position), true); + if (!currNode) { + return []; + } + var result = []; + while (currNode) { + if (currNode.parent && + currNode.offset === currNode.parent.offset && + currNode.end === currNode.parent.end) { + currNode = currNode.parent; + continue; + } + if (currNode.type === NodeType.Declarations) { + result.push([currNode.offset + 1, currNode.end - 1]); + } + else { + result.push([currNode.offset, currNode.end]); + } + currNode = currNode.parent; + } + return result; + } +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/_deps/vscode-css-languageservice/cssLanguageService.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + + + + + + + + + + + + + + +function createFacade(parser, completion, hover, navigation, codeActions, validation) { + return { + configure: validation.configure.bind(validation), + doValidation: validation.doValidation.bind(validation), + parseStylesheet: parser.parseStylesheet.bind(parser), + doComplete: completion.doComplete.bind(completion), + setCompletionParticipants: completion.setCompletionParticipants.bind(completion), + doHover: hover.doHover.bind(hover), + findDefinition: navigation.findDefinition.bind(navigation), + findReferences: navigation.findReferences.bind(navigation), + findDocumentHighlights: navigation.findDocumentHighlights.bind(navigation), + findDocumentLinks: navigation.findDocumentLinks.bind(navigation), + findDocumentSymbols: navigation.findDocumentSymbols.bind(navigation), + doCodeActions: codeActions.doCodeActions.bind(codeActions), + doCodeActions2: codeActions.doCodeActions2.bind(codeActions), + findColorSymbols: function (d, s) { return navigation.findDocumentColors(d, s).map(function (s) { return s.range; }); }, + findDocumentColors: navigation.findDocumentColors.bind(navigation), + getColorPresentations: navigation.getColorPresentations.bind(navigation), + doRename: navigation.doRename.bind(navigation), + getFoldingRanges: getFoldingRanges, + getSelectionRanges: getSelectionRanges + }; +} +function handleCustomData(options) { + if (options && options.customDataProviders) { + cssDataManager.addDataProviders(options.customDataProviders); + } +} +function getCSSLanguageService(options) { + handleCustomData(options); + return createFacade(new cssParser_Parser(), new cssCompletion_CSSCompletion(), new cssHover_CSSHover(), new cssNavigation_CSSNavigation(), new cssCodeActions_CSSCodeActions(), new cssValidation_CSSValidation()); +} +function getSCSSLanguageService(options) { + handleCustomData(options); + return createFacade(new scssParser_SCSSParser(), new scssCompletion_SCSSCompletion(), new cssHover_CSSHover(), new cssNavigation_CSSNavigation(), new cssCodeActions_CSSCodeActions(), new cssValidation_CSSValidation()); +} +function getLESSLanguageService(options) { + handleCustomData(options); + return createFacade(new lessParser_LESSParser(), new lessCompletion_LESSCompletion(), new cssHover_CSSHover(), new cssNavigation_CSSNavigation(), new cssCodeActions_CSSCodeActions(), new cssValidation_CSSValidation()); +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/cssWorker.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + +var cssWorker_CSSWorker = /** @class */ (function () { function CSSWorker(ctx, createData) { this._ctx = ctx; this._languageSettings = createData.languageSettings; this._languageId = createData.languageId; switch (this._languageId) { case 'css': - this._languageService = _deps_vscode_css_languageservice_cssLanguageService_js__WEBPACK_IMPORTED_MODULE_0__["getCSSLanguageService"](); + this._languageService = getCSSLanguageService(); break; case 'less': - this._languageService = _deps_vscode_css_languageservice_cssLanguageService_js__WEBPACK_IMPORTED_MODULE_0__["getLESSLanguageService"](); + this._languageService = getLESSLanguageService(); break; case 'scss': - this._languageService = _deps_vscode_css_languageservice_cssLanguageService_js__WEBPACK_IMPORTED_MODULE_0__["getSCSSLanguageService"](); + this._languageService = getSCSSLanguageService(); break; default: throw new Error('Invalid language id: ' + this._languageId); @@ -38105,7 +36352,7 @@ var CSSWorker = /** @class */ (function () { for (var _i = 0, models_1 = models; _i < models_1.length; _i++) { var model = models_1[_i]; if (model.uri.toString() === uri) { - return _deps_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["TextDocument"].create(uri, this._languageId, model.version, model.getValue()); + return TextDocument.create(uri, this._languageId, model.version, model.getValue()); } } return null; @@ -38113,57 +36360,323 @@ var CSSWorker = /** @class */ (function () { return CSSWorker; }()); -function create(ctx, createData) { - return new CSSWorker(ctx, createData); +function cssWorker_create(ctx, createData) { + return new cssWorker_CSSWorker(ctx, createData); } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/css/fillers/vscode-nls.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/css/fillers/vscode-nls.js ***! - \******************************************************************************/ -/*! exports provided: loadMessageBundle, config */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadMessageBundle", function() { return loadMessageBundle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "config", function() { return config; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/css/css.worker.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; -} + + + +self.onmessage = function () { + // ignore the first message + initialize(function (ctx, createData) { + return new cssWorker_CSSWorker(ctx, createData); + }); +}; + + +/***/ }), + +/***/ "URDS": +/***/ (function(module, exports, __webpack_require__) { + +/*! +Copyright (c) 2014 Taylor Hakes +Copyright (c) 2014 Forbes Lindesay + */ +(function (global, factory) { + true ? factory() : + undefined; +}(this, (function () { + 'use strict'; + + /** + * @this {Promise} + */ + function finallyConstructor(callback) { + var constructor = this.constructor; + return this.then( + function (value) { + return constructor.resolve(callback()).then(function () { + return value; + }); + }, + function (reason) { + return constructor.resolve(callback()).then(function () { + return constructor.reject(reason); + }); + } + ); + } + + // Store setTimeout reference so promise-polyfill will be unaffected by + // other code modifying setTimeout (like sinon.useFakeTimers()) + var setTimeoutFunc = setTimeout; + + function noop() { } + + // Polyfill for Function.prototype.bind + function bind(fn, thisArg) { + return function () { + fn.apply(thisArg, arguments); + }; + } + + /** + * @constructor + * @param {Function} fn + */ + function Promise(fn) { + if (!(this instanceof Promise)) + throw new TypeError('Promises must be constructed via new'); + if (typeof fn !== 'function') throw new TypeError('not a function'); + /** @type {!number} */ + this._state = 0; + /** @type {!boolean} */ + this._handled = false; + /** @type {Promise|undefined} */ + this._value = undefined; + /** @type {!Array} */ + this._deferreds = []; + + doResolve(fn, this); + } + + function handle(self, deferred) { + while (self._state === 3) { + self = self._value; + } + if (self._state === 0) { + self._deferreds.push(deferred); + return; + } + self._handled = true; + Promise._immediateFn(function () { + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (self._state === 1 ? resolve : reject)(deferred.promise, self._value); + return; + } + var ret; + try { + ret = cb(self._value); + } catch (e) { + reject(deferred.promise, e); + return; + } + resolve(deferred.promise, ret); + }); + } + + function resolve(self, newValue) { + try { + // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure + if (newValue === self) + throw new TypeError('A promise cannot be resolved with itself.'); + if ( + newValue && + (typeof newValue === 'object' || typeof newValue === 'function') + ) { + var then = newValue.then; + if (newValue instanceof Promise) { + self._state = 3; + self._value = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(bind(then, newValue), self); + return; + } + } + self._state = 1; + self._value = newValue; + finale(self); + } catch (e) { + reject(self, e); + } + } + + function reject(self, newValue) { + self._state = 2; + self._value = newValue; + finale(self); + } + + function finale(self) { + if (self._state === 2 && self._deferreds.length === 0) { + Promise._immediateFn(function () { + if (!self._handled) { + Promise._unhandledRejectionFn(self._value); + } + }); + } + + for (var i = 0, len = self._deferreds.length; i < len; i++) { + handle(self, self._deferreds[i]); + } + self._deferreds = null; + } + + /** + * @constructor + */ + function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; + } + + /** + * Take a potentially misbehaving resolver function and make sure + * onFulfilled and onRejected are only called once. + * + * Makes no guarantees about asynchrony. + */ + function doResolve(fn, self) { + var done = false; + try { + fn( + function (value) { + if (done) return; + done = true; + resolve(self, value); + }, + function (reason) { + if (done) return; + done = true; + reject(self, reason); + } + ); + } catch (ex) { + if (done) return; + done = true; + reject(self, ex); + } + } + + Promise.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); + }; + + Promise.prototype.then = function (onFulfilled, onRejected) { + // @ts-ignore + var prom = new this.constructor(noop); + + handle(this, new Handler(onFulfilled, onRejected, prom)); + return prom; + }; + + Promise.prototype['finally'] = finallyConstructor; + + Promise.all = function (arr) { + return new Promise(function (resolve, reject) { + if (!arr || typeof arr.length === 'undefined') + throw new TypeError('Promise.all accepts an array'); + var args = Array.prototype.slice.call(arr); + if (args.length === 0) return resolve([]); + var remaining = args.length; + + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call( + val, + function (val) { + res(i, val); + }, + reject + ); + return; + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); + } + } + + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + + Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; + } + + return new Promise(function (resolve) { + resolve(value); + }); + }; + + Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); + }; + + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var i = 0, len = values.length; i < len; i++) { + values[i].then(resolve, reject); + } + }); + }; + + // Use polyfill for setImmediate for performance gains + Promise._immediateFn = + (typeof setImmediate === 'function' && + function (fn) { + setImmediate(fn); + }) || + function (fn) { + setTimeoutFunc(fn, 0); + }; + + Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { + if (typeof console !== 'undefined' && console) { + console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console + } + }; + + /** @suppress {undefinedVars} */ + var globalNS = (function () { + // the only reliable means to get the global object is + // `Function('return this')()` + // However, this causes CSP violations in Chrome apps. + if (typeof self !== 'undefined') { + return self; + } + if (typeof window !== 'undefined') { + return window; + } + if (typeof global !== 'undefined') { + return global; + } + throw new Error('unable to locate global object'); + })(); + + if (!('Promise' in globalNS)) { + globalNS['Promise'] = Promise; + } else if (!globalNS.Promise.prototype['finally']) { + globalNS.Promise.prototype['finally'] = finallyConstructor; + } + +}))); /***/ }) -/******/ }); -//# sourceMappingURL=css.worker.js.map \ No newline at end of file +/******/ }); \ No newline at end of file diff --git a/public/static/monaco/editor.worker.js b/public/static/monaco/editor.worker.js index e8bf12e..9d07c61 100644 --- a/public/static/monaco/editor.worker.js +++ b/public/static/monaco/editor.worker.js @@ -87,40 +87,721 @@ /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./node_modules/monaco-editor/esm/vs/editor/editor.worker.js"); +/******/ return __webpack_require__(__webpack_require__.s = "5QBA"); /******/ }) /************************************************************************/ /******/ ({ -/***/ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/arrays.js ***! - \*****************************************************************/ -/*! exports provided: tail, tail2, equals, binarySearch, findFirstInSorted, mergeSort, groupBy, coalesce, isFalsyOrEmpty, isNonEmptyArray, distinct, distinctES6, firstIndex, first, flatten, range, arrayInsert, pushToStart, pushToEnd, asArray */ +/***/ "5QBA": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return tail; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tail2", function() { return tail2; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "binarySearch", function() { return binarySearch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findFirstInSorted", function() { return findFirstInSorted; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeSort", function() { return mergeSort; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return groupBy; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "coalesce", function() { return coalesce; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFalsyOrEmpty", function() { return isFalsyOrEmpty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNonEmptyArray", function() { return isNonEmptyArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return distinct; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctES6", function() { return distinctES6; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstIndex", function() { return firstIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return first; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return flatten; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayInsert", function() { return arrayInsert; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushToStart", function() { return pushToStart; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushToEnd", function() { return pushToEnd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asArray", function() { return asArray; }); + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/errors.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Avoid circular dependency on EventEmitter by implementing a subset of the interface. +var ErrorHandler = /** @class */ (function () { + function ErrorHandler() { + this.listeners = []; + this.unexpectedErrorHandler = function (e) { + setTimeout(function () { + if (e.stack) { + throw new Error(e.message + '\n\n' + e.stack); + } + throw e; + }, 0); + }; + } + ErrorHandler.prototype.emit = function (e) { + this.listeners.forEach(function (listener) { + listener(e); + }); + }; + ErrorHandler.prototype.onUnexpectedError = function (e) { + this.unexpectedErrorHandler(e); + this.emit(e); + }; + // For external errors, we don't want the listeners to be called + ErrorHandler.prototype.onUnexpectedExternalError = function (e) { + this.unexpectedErrorHandler(e); + }; + return ErrorHandler; +}()); + +var errorHandler = new ErrorHandler(); +function onUnexpectedError(e) { + // ignore errors from cancelled promises + if (!isPromiseCanceledError(e)) { + errorHandler.onUnexpectedError(e); + } + return undefined; +} +function onUnexpectedExternalError(e) { + // ignore errors from cancelled promises + if (!isPromiseCanceledError(e)) { + errorHandler.onUnexpectedExternalError(e); + } + return undefined; +} +function transformErrorForSerialization(error) { + if (error instanceof Error) { + var name_1 = error.name, message = error.message; + var stack = error.stacktrace || error.stack; + return { + $isError: true, + name: name_1, + message: message, + stack: stack + }; + } + // return as is + return error; +} +var canceledName = 'Canceled'; +/** + * Checks if the given error is a promise in canceled state + */ +function isPromiseCanceledError(error) { + return error instanceof Error && error.name === canceledName && error.message === canceledName; +} +/** + * Returns an error that signals cancellation. + */ +function canceled() { + var error = new Error(canceledName); + error.name = error.message; + return error; +} +function illegalArgument(name) { + if (name) { + return new Error("Illegal argument: " + name); + } + else { + return new Error('Illegal argument'); + } +} +function illegalState(name) { + if (name) { + return new Error("Illegal state: " + name); + } + else { + return new Error('Illegal state'); + } +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js +function isDisposable(thing) { + return typeof thing.dispose === 'function' + && thing.dispose.length === 0; +} +function lifecycle_dispose(first) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + if (Array.isArray(first)) { + first.forEach(function (d) { return d && d.dispose(); }); + return []; + } + else if (rest.length === 0) { + if (first) { + first.dispose(); + return first; + } + return undefined; + } + else { + lifecycle_dispose(first); + lifecycle_dispose(rest); + return []; + } +} +function combinedDisposable(disposables) { + return { dispose: function () { return lifecycle_dispose(disposables); } }; +} +function toDisposable(fn) { + return { dispose: function () { fn(); } }; +} +var Disposable = /** @class */ (function () { + function Disposable() { + this._toDispose = []; + this._lifecycle_disposable_isDisposed = false; + } + Disposable.prototype.dispose = function () { + this._lifecycle_disposable_isDisposed = true; + this._toDispose = lifecycle_dispose(this._toDispose); + }; + Disposable.prototype._register = function (t) { + if (this._lifecycle_disposable_isDisposed) { + console.warn('Registering disposable on object that has already been disposed.'); + t.dispose(); + } + else { + this._toDispose.push(t); + } + return t; + }; + Disposable.None = Object.freeze({ dispose: function () { } }); + return Disposable; +}()); + +var ImmortalReference = /** @class */ (function () { + function ImmortalReference(object) { + this.object = object; + } + ImmortalReference.prototype.dispose = function () { }; + return ImmortalReference; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/platform.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var LANGUAGE_DEFAULT = 'en'; +var _isWindows = false; +var _isMacintosh = false; +var _isLinux = false; +var _isNative = false; +var _isWeb = false; +var _locale = undefined; +var _language = LANGUAGE_DEFAULT; +var _translationsConfigFile = undefined; +var isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer'); +// OS detection +if (typeof navigator === 'object' && !isElectronRenderer) { + var userAgent = navigator.userAgent; + _isWindows = userAgent.indexOf('Windows') >= 0; + _isMacintosh = userAgent.indexOf('Macintosh') >= 0; + _isLinux = userAgent.indexOf('Linux') >= 0; + _isWeb = true; + _locale = navigator.language; + _language = _locale; +} +else if (typeof process === 'object') { + _isWindows = (process.platform === 'win32'); + _isMacintosh = (process.platform === 'darwin'); + _isLinux = (process.platform === 'linux'); + _locale = LANGUAGE_DEFAULT; + _language = LANGUAGE_DEFAULT; + var rawNlsConfig = process.env['VSCODE_NLS_CONFIG']; + if (rawNlsConfig) { + try { + var nlsConfig = JSON.parse(rawNlsConfig); + var resolved = nlsConfig.availableLanguages['*']; + _locale = nlsConfig.locale; + // VSCode's default language is 'en' + _language = resolved ? resolved : LANGUAGE_DEFAULT; + _translationsConfigFile = nlsConfig._translationsConfigFile; + } + catch (e) { + } + } + _isNative = true; +} +var _platform = 0 /* Web */; +if (_isNative) { + if (_isMacintosh) { + _platform = 1 /* Mac */; + } + else if (_isWindows) { + _platform = 3 /* Windows */; + } + else if (_isLinux) { + _platform = 2 /* Linux */; + } +} +var isWindows = _isWindows; +var isMacintosh = _isMacintosh; +var isLinux = _isLinux; +var isNative = _isNative; +var isWeb = _isWeb; +var _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {}); +var globals = _globals; +var _setImmediate = null; +function setImmediate(callback) { + if (_setImmediate === null) { + if (globals.setImmediate) { + _setImmediate = globals.setImmediate.bind(globals); + } + else if (typeof process !== 'undefined' && typeof process.nextTick === 'function') { + _setImmediate = process.nextTick.bind(process); + } + else { + _setImmediate = globals.setTimeout.bind(globals); + } + } + return _setImmediate(callback); +} +var OS = (_isMacintosh ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */)); + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/types.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var _typeof = { + number: 'number', + string: 'string', + undefined: 'undefined', + object: 'object', + function: 'function' +}; +/** + * @returns whether the provided parameter is a JavaScript Array or not. + */ +function isArray(array) { + if (Array.isArray) { + return Array.isArray(array); + } + if (array && typeof (array.length) === _typeof.number && array.constructor === Array) { + return true; + } + return false; +} +/** + * @returns whether the provided parameter is a JavaScript String or not. + */ +function isString(str) { + if (typeof (str) === _typeof.string || str instanceof String) { + return true; + } + return false; +} +/** + * + * @returns whether the provided parameter is of type `object` but **not** + * `null`, an `array`, a `regexp`, nor a `date`. + */ +function isObject(obj) { + // The method can't do a type cast since there are type (like strings) which + // are subclasses of any put not positvely matched by the function. Hence type + // narrowing results in wrong results. + return typeof obj === _typeof.object + && obj !== null + && !Array.isArray(obj) + && !(obj instanceof RegExp) + && !(obj instanceof Date); +} +/** + * In **contrast** to just checking `typeof` this will return `false` for `NaN`. + * @returns whether the provided parameter is a JavaScript Number or not. + */ +function isNumber(obj) { + if ((typeof (obj) === _typeof.number || obj instanceof Number) && !isNaN(obj)) { + return true; + } + return false; +} +/** + * @returns whether the provided parameter is a JavaScript Boolean or not. + */ +function isBoolean(obj) { + return obj === true || obj === false; +} +/** + * @returns whether the provided parameter is undefined. + */ +function isUndefined(obj) { + return typeof (obj) === _typeof.undefined; +} +/** + * @returns whether the provided parameter is undefined or null. + */ +function isUndefinedOrNull(obj) { + return isUndefined(obj) || obj === null; +} +var types_hasOwnProperty = Object.prototype.hasOwnProperty; +/** + * @returns whether the provided parameter is an empty JavaScript Object or not. + */ +function isEmptyObject(obj) { + if (!isObject(obj)) { + return false; + } + for (var key in obj) { + if (types_hasOwnProperty.call(obj, key)) { + return false; + } + } + return true; +} +/** + * @returns whether the provided parameter is a JavaScript Function or not. + */ +function isFunction(obj) { + return typeof obj === _typeof.function; +} +function validateConstraints(args, constraints) { + var len = Math.min(args.length, constraints.length); + for (var i = 0; i < len; i++) { + validateConstraint(args[i], constraints[i]); + } +} +function validateConstraint(arg, constraint) { + if (isString(constraint)) { + if (typeof arg !== constraint) { + throw new Error("argument does not match constraint: typeof " + constraint); + } + } + else if (isFunction(constraint)) { + try { + if (arg instanceof constraint) { + return; + } + } + catch (_a) { + // ignore + } + if (!isUndefinedOrNull(arg) && arg.constructor === constraint) { + return; + } + if (constraint.length === 1 && constraint.call(undefined, arg) === true) { + return; + } + throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true"); + } +} +function getAllPropertyNames(obj) { + var res = []; + var proto = Object.getPrototypeOf(obj); + while (Object.prototype !== proto) { + res = res.concat(Object.getOwnPropertyNames(proto)); + proto = Object.getPrototypeOf(proto); + } + return res; +} +/** + * Converts null to undefined, passes all other values through. + */ +function withNullAsUndefined(x) { + return x === null ? undefined : x; +} +/** + * Converts undefined to null, passes all other values through. + */ +function withUndefinedAsNull(x) { + return typeof x === 'undefined' ? null : x; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var __extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + +var INITIALIZE = '$initialize'; +var webWorkerWarningLogged = false; +function logOnceWebWorkerWarning(err) { + if (!isWeb) { + // running tests + return; + } + if (!webWorkerWarningLogged) { + webWorkerWarningLogged = true; + console.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq'); + } + console.warn(err.message); +} +var simpleWorker_SimpleWorkerProtocol = /** @class */ (function () { + function SimpleWorkerProtocol(handler) { + this._workerId = -1; + this._handler = handler; + this._lastSentReq = 0; + this._pendingReplies = Object.create(null); + } + SimpleWorkerProtocol.prototype.setWorkerId = function (workerId) { + this._workerId = workerId; + }; + SimpleWorkerProtocol.prototype.sendMessage = function (method, args) { + var _this = this; + var req = String(++this._lastSentReq); + return new Promise(function (resolve, reject) { + _this._pendingReplies[req] = { + resolve: resolve, + reject: reject + }; + _this._send({ + vsWorker: _this._workerId, + req: req, + method: method, + args: args + }); + }); + }; + SimpleWorkerProtocol.prototype.handleMessage = function (serializedMessage) { + var message; + try { + message = JSON.parse(serializedMessage); + } + catch (e) { + // nothing + return; + } + if (!message || !message.vsWorker) { + return; + } + if (this._workerId !== -1 && message.vsWorker !== this._workerId) { + return; + } + this._handleMessage(message); + }; + SimpleWorkerProtocol.prototype._handleMessage = function (msg) { + var _this = this; + if (msg.seq) { + var replyMessage = msg; + if (!this._pendingReplies[replyMessage.seq]) { + console.warn('Got reply to unknown seq'); + return; + } + var reply = this._pendingReplies[replyMessage.seq]; + delete this._pendingReplies[replyMessage.seq]; + if (replyMessage.err) { + var err = replyMessage.err; + if (replyMessage.err.$isError) { + err = new Error(); + err.name = replyMessage.err.name; + err.message = replyMessage.err.message; + err.stack = replyMessage.err.stack; + } + reply.reject(err); + return; + } + reply.resolve(replyMessage.res); + return; + } + var requestMessage = msg; + var req = requestMessage.req; + var result = this._handler.handleMessage(requestMessage.method, requestMessage.args); + result.then(function (r) { + _this._send({ + vsWorker: _this._workerId, + seq: req, + res: r, + err: undefined + }); + }, function (e) { + if (e.detail instanceof Error) { + // Loading errors have a detail property that points to the actual error + e.detail = transformErrorForSerialization(e.detail); + } + _this._send({ + vsWorker: _this._workerId, + seq: req, + res: undefined, + err: transformErrorForSerialization(e) + }); + }); + }; + SimpleWorkerProtocol.prototype._send = function (msg) { + var strMsg = JSON.stringify(msg); + // console.log('SENDING: ' + strMsg); + this._handler.sendMessage(strMsg); + }; + return SimpleWorkerProtocol; +}()); +/** + * Main thread side + */ +var SimpleWorkerClient = /** @class */ (function (_super) { + __extends(SimpleWorkerClient, _super); + function SimpleWorkerClient(workerFactory, moduleId) { + var _this = _super.call(this) || this; + var lazyProxyReject = null; + _this._worker = _this._register(workerFactory.create('vs/base/common/worker/simpleWorker', function (msg) { + _this._protocol.handleMessage(msg); + }, function (err) { + // in Firefox, web workers fail lazily :( + // we will reject the proxy + if (lazyProxyReject) { + lazyProxyReject(err); + } + })); + _this._protocol = new simpleWorker_SimpleWorkerProtocol({ + sendMessage: function (msg) { + _this._worker.postMessage(msg); + }, + handleMessage: function (method, args) { + // Intentionally not supporting worker -> main requests + return Promise.resolve(null); + } + }); + _this._protocol.setWorkerId(_this._worker.getId()); + // Gather loader configuration + var loaderConfiguration = null; + if (typeof self.require !== 'undefined' && typeof self.require.getConfig === 'function') { + // Get the configuration from the Monaco AMD Loader + loaderConfiguration = self.require.getConfig(); + } + else if (typeof self.requirejs !== 'undefined') { + // Get the configuration from requirejs + loaderConfiguration = self.requirejs.s.contexts._.config; + } + // Send initialize message + _this._onModuleLoaded = _this._protocol.sendMessage(INITIALIZE, [ + _this._worker.getId(), + moduleId, + loaderConfiguration + ]); + _this._lazyProxy = new Promise(function (resolve, reject) { + lazyProxyReject = reject; + _this._onModuleLoaded.then(function (availableMethods) { + var proxy = {}; + for (var _i = 0, availableMethods_1 = availableMethods; _i < availableMethods_1.length; _i++) { + var methodName = availableMethods_1[_i]; + proxy[methodName] = createProxyMethod(methodName, proxyMethodRequest); + } + resolve(proxy); + }, function (e) { + reject(e); + _this._onError('Worker failed to load ' + moduleId, e); + }); + }); + // Create proxy to loaded code + var proxyMethodRequest = function (method, args) { + return _this._request(method, args); + }; + var createProxyMethod = function (method, proxyMethodRequest) { + return function () { + var args = Array.prototype.slice.call(arguments, 0); + return proxyMethodRequest(method, args); + }; + }; + return _this; + } + SimpleWorkerClient.prototype.getProxyObject = function () { + return this._lazyProxy; + }; + SimpleWorkerClient.prototype._request = function (method, args) { + var _this = this; + return new Promise(function (resolve, reject) { + _this._onModuleLoaded.then(function () { + _this._protocol.sendMessage(method, args).then(resolve, reject); + }, reject); + }); + }; + SimpleWorkerClient.prototype._onError = function (message, error) { + console.error(message); + console.info(error); + }; + return SimpleWorkerClient; +}(Disposable)); + +/** + * Worker side + */ +var simpleWorker_SimpleWorkerServer = /** @class */ (function () { + function SimpleWorkerServer(postSerializedMessage, requestHandler) { + var _this = this; + this._requestHandler = requestHandler; + this._protocol = new simpleWorker_SimpleWorkerProtocol({ + sendMessage: function (msg) { + postSerializedMessage(msg); + }, + handleMessage: function (method, args) { return _this._handleMessage(method, args); } + }); + } + SimpleWorkerServer.prototype.onmessage = function (msg) { + this._protocol.handleMessage(msg); + }; + SimpleWorkerServer.prototype._handleMessage = function (method, args) { + if (method === INITIALIZE) { + return this.initialize(args[0], args[1], args[2]); + } + if (!this._requestHandler || typeof this._requestHandler[method] !== 'function') { + return Promise.reject(new Error('Missing requestHandler or method: ' + method)); + } + try { + return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args)); + } + catch (e) { + return Promise.reject(e); + } + }; + SimpleWorkerServer.prototype.initialize = function (workerId, moduleId, loaderConfig) { + var _this = this; + this._protocol.setWorkerId(workerId); + if (this._requestHandler) { + // static request handler + var methods = []; + for (var _i = 0, _a = getAllPropertyNames(this._requestHandler); _i < _a.length; _i++) { + var prop = _a[_i]; + if (typeof this._requestHandler[prop] === 'function') { + methods.push(prop); + } + } + return Promise.resolve(methods); + } + if (loaderConfig) { + // Remove 'baseUrl', handling it is beyond scope for now + if (typeof loaderConfig.baseUrl !== 'undefined') { + delete loaderConfig['baseUrl']; + } + if (typeof loaderConfig.paths !== 'undefined') { + if (typeof loaderConfig.paths.vs !== 'undefined') { + delete loaderConfig.paths['vs']; + } + } + // Since this is in a web worker, enable catching errors + loaderConfig.catchError = true; + self.require.config(loaderConfig); + } + return new Promise(function (resolve, reject) { + // Use the global require to be sure to get the global config + self.require([moduleId], function () { + var result = []; + for (var _i = 0; _i < arguments.length; _i++) { + result[_i] = arguments[_i]; + } + var handlerModule = result[0]; + _this._requestHandler = handlerModule.create(); + if (!_this._requestHandler) { + reject(new Error("No RequestHandler!")); + return; + } + var methods = []; + for (var _a = 0, _b = getAllPropertyNames(_this._requestHandler); _a < _b.length; _a++) { + var prop = _b[_a]; + if (typeof _this._requestHandler[prop] === 'function') { + methods.push(prop); + } + } + resolve(methods); + }, reject); + }); + }; + return SimpleWorkerServer; +}()); + +/** + * Called on the worker side + */ +function create(postMessage) { + return new simpleWorker_SimpleWorkerServer(postMessage, null); +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/arrays.js /** * Returns the last element of an array. * @param array The array. @@ -323,7 +1004,7 @@ function flatten(arr) { var _a; return (_a = []).concat.apply(_a, arr); } -function range(arg, to) { +function arrays_range(arg, to) { var from = typeof to === 'number' ? arg : 0; if (typeof to === 'number') { from = arg; @@ -378,161 +1059,43 @@ function asArray(x) { return Array.isArray(x) ? x : [x]; } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/cancellation.js ***! - \***********************************************************************/ -/*! exports provided: CancellationToken, CancellationTokenSource */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationToken", function() { return CancellationToken; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationTokenSource", function() { return CancellationTokenSource; }); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -var shortcutEvent = Object.freeze(function (callback, context) { - var handle = setTimeout(callback.bind(context), 0); - return { dispose: function () { clearTimeout(handle); } }; -}); -var CancellationToken; -(function (CancellationToken) { - function isCancellationToken(thing) { - if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) { - return true; - } - if (thing instanceof MutableToken) { - return true; - } - if (!thing || typeof thing !== 'object') { - return false; - } - return typeof thing.isCancellationRequested === 'boolean' - && typeof thing.onCancellationRequested === 'function'; +/** + * Represents information about a specific difference between two sequences. + */ +var DiffChange = /** @class */ (function () { + /** + * Constructs a new DiffChange with the given sequence information + * and content. + */ + function DiffChange(originalStart, originalLength, modifiedStart, modifiedLength) { + //Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0"); + this.originalStart = originalStart; + this.originalLength = originalLength; + this.modifiedStart = modifiedStart; + this.modifiedLength = modifiedLength; } - CancellationToken.isCancellationToken = isCancellationToken; - CancellationToken.None = Object.freeze({ - isCancellationRequested: false, - onCancellationRequested: _event_js__WEBPACK_IMPORTED_MODULE_0__["Event"].None - }); - CancellationToken.Cancelled = Object.freeze({ - isCancellationRequested: true, - onCancellationRequested: shortcutEvent - }); -})(CancellationToken || (CancellationToken = {})); -var MutableToken = /** @class */ (function () { - function MutableToken() { - this._isCancelled = false; - this._emitter = null; - } - MutableToken.prototype.cancel = function () { - if (!this._isCancelled) { - this._isCancelled = true; - if (this._emitter) { - this._emitter.fire(undefined); - this.dispose(); - } - } + /** + * The end point (exclusive) of the change in the original sequence. + */ + DiffChange.prototype.getOriginalEnd = function () { + return this.originalStart + this.originalLength; }; - Object.defineProperty(MutableToken.prototype, "isCancellationRequested", { - get: function () { - return this._isCancelled; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(MutableToken.prototype, "onCancellationRequested", { - get: function () { - if (this._isCancelled) { - return shortcutEvent; - } - if (!this._emitter) { - this._emitter = new _event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - } - return this._emitter.event; - }, - enumerable: true, - configurable: true - }); - MutableToken.prototype.dispose = function () { - if (this._emitter) { - this._emitter.dispose(); - this._emitter = null; - } + /** + * The end point (exclusive) of the change in the modified sequence. + */ + DiffChange.prototype.getModifiedEnd = function () { + return this.modifiedStart + this.modifiedLength; }; - return MutableToken; -}()); -var CancellationTokenSource = /** @class */ (function () { - function CancellationTokenSource(parent) { - this._token = undefined; - this._parentListener = undefined; - this._parentListener = parent && parent.onCancellationRequested(this.cancel, this); - } - Object.defineProperty(CancellationTokenSource.prototype, "token", { - get: function () { - if (!this._token) { - // be lazy and create the token only when - // actually needed - this._token = new MutableToken(); - } - return this._token; - }, - enumerable: true, - configurable: true - }); - CancellationTokenSource.prototype.cancel = function () { - if (!this._token) { - // save an object by returning the default - // cancelled token when cancellation happens - // before someone asks for the token - this._token = CancellationToken.Cancelled; - } - else if (this._token instanceof MutableToken) { - // actually cancel - this._token.cancel(); - } - }; - CancellationTokenSource.prototype.dispose = function () { - if (this._parentListener) { - this._parentListener.dispose(); - } - if (!this._token) { - // ensure to initialize with an empty token if we had none - this._token = CancellationToken.None; - } - else if (this._token instanceof MutableToken) { - // actually dispose - this._token.dispose(); - } - }; - return CancellationTokenSource; + return DiffChange; }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js ***! - \********************************************************************/ -/*! exports provided: stringDiff, Debug, MyArray, LcsDiff */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringDiff", function() { return stringDiff; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Debug", function() { return Debug; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MyArray", function() { return MyArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LcsDiff", function() { return LcsDiff; }); -/* harmony import */ var _diffChange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diffChange.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -545,7 +1108,7 @@ function createStringSequence(a) { }; } function stringDiff(original, modified, pretty) { - return new LcsDiff(createStringSequence(original), createStringSequence(modified)).ComputeDiff(pretty); + return new diff_LcsDiff(createStringSequence(original), createStringSequence(modified)).ComputeDiff(pretty); } // // The code below has been ported from a C# implementation in VS @@ -608,7 +1171,7 @@ var MaxDifferencesHistory = 1447; * distinct changes. At the end, the Changes property can be called to retrieve * the constructed changes. */ -var DiffChangeHelper = /** @class */ (function () { +var diff_DiffChangeHelper = /** @class */ (function () { /** * Constructs a new DiffChangeHelper for the given DiffSequences. */ @@ -626,7 +1189,7 @@ var DiffChangeHelper = /** @class */ (function () { // Only add to the list if there is something to add if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { // Add the new change to our list - this.m_changes.push(new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)); + this.m_changes.push(new DiffChange(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)); } // Reset for the next change this.m_originalCount = 0; @@ -687,7 +1250,7 @@ var DiffChangeHelper = /** @class */ (function () { * An implementation of the difference algorithm described in * "An O(ND) Difference Algorithm and its variations" by Eugene W. Myers */ -var LcsDiff = /** @class */ (function () { +var diff_LcsDiff = /** @class */ (function () { /** * Constructs the DiffFinder */ @@ -751,14 +1314,14 @@ var LcsDiff = /** @class */ (function () { Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd'); // All insertions changes = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1) + new DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1) ]; } else if (originalStart <= originalEnd) { Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd'); // All deletions changes = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, 0) + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0) ]; } else { @@ -793,20 +1356,20 @@ var LcsDiff = /** @class */ (function () { // We did't have time to finish the first half, so we don't have time to compute this half. // Consider the entire rest of the sequence different. rightChanges = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1) + new DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1) ]; } return this.ConcatenateChanges(leftChanges, rightChanges); } // If we hit here, we quit early, and so can't return anything meaningful return [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) ]; }; LcsDiff.prototype.WALKTRACE = function (diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) { var forwardChanges = null, reverseChanges = null; // First, walk backward through the forward diagonals history - var changeHelper = new DiffChangeHelper(); + var changeHelper = new diff_DiffChangeHelper(); var diagonalMin = diagonalForwardStart; var diagonalMax = diagonalForwardEnd; var diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalForwardOffset; @@ -860,12 +1423,12 @@ var LcsDiff = /** @class */ (function () { modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd()); } reverseChanges = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1) + new DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1) ]; } else { // Now walk backward through the reverse diagonals history - changeHelper = new DiffChangeHelper(); + changeHelper = new diff_DiffChangeHelper(); diagonalMin = diagonalReverseStart; diagonalMax = diagonalReverseEnd; diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalReverseOffset; @@ -1048,7 +1611,7 @@ var LcsDiff = /** @class */ (function () { originalStart++; modifiedStart++; return [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) ]; } } @@ -1279,7 +1842,7 @@ var LcsDiff = /** @class */ (function () { if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) { modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart; } - mergedChangeArr[0] = new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalLength, modifiedStart, modifiedLength); + mergedChangeArr[0] = new DiffChange(originalStart, originalLength, modifiedStart, modifiedLength); return true; } else { @@ -1322,952 +1885,12 @@ var LcsDiff = /** @class */ (function () { }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js ***! - \**************************************************************************/ -/*! exports provided: DiffChange */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffChange", function() { return DiffChange; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/iterator.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -/** - * Represents information about a specific difference between two sequences. - */ -var DiffChange = /** @class */ (function () { - /** - * Constructs a new DiffChange with the given sequence information - * and content. - */ - function DiffChange(originalStart, originalLength, modifiedStart, modifiedLength) { - //Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0"); - this.originalStart = originalStart; - this.originalLength = originalLength; - this.modifiedStart = modifiedStart; - this.modifiedLength = modifiedLength; - } - /** - * The end point (exclusive) of the change in the original sequence. - */ - DiffChange.prototype.getOriginalEnd = function () { - return this.originalStart + this.originalLength; - }; - /** - * The end point (exclusive) of the change in the modified sequence. - */ - DiffChange.prototype.getModifiedEnd = function () { - return this.modifiedStart + this.modifiedLength; - }; - return DiffChange; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/errors.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/errors.js ***! - \*****************************************************************/ -/*! exports provided: ErrorHandler, errorHandler, onUnexpectedError, onUnexpectedExternalError, transformErrorForSerialization, isPromiseCanceledError, canceled, illegalArgument, illegalState */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorHandler", function() { return ErrorHandler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "errorHandler", function() { return errorHandler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedError", function() { return onUnexpectedError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedExternalError", function() { return onUnexpectedExternalError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformErrorForSerialization", function() { return transformErrorForSerialization; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPromiseCanceledError", function() { return isPromiseCanceledError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canceled", function() { return canceled; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalArgument", function() { return illegalArgument; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalState", function() { return illegalState; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -// Avoid circular dependency on EventEmitter by implementing a subset of the interface. -var ErrorHandler = /** @class */ (function () { - function ErrorHandler() { - this.listeners = []; - this.unexpectedErrorHandler = function (e) { - setTimeout(function () { - if (e.stack) { - throw new Error(e.message + '\n\n' + e.stack); - } - throw e; - }, 0); - }; - } - ErrorHandler.prototype.emit = function (e) { - this.listeners.forEach(function (listener) { - listener(e); - }); - }; - ErrorHandler.prototype.onUnexpectedError = function (e) { - this.unexpectedErrorHandler(e); - this.emit(e); - }; - // For external errors, we don't want the listeners to be called - ErrorHandler.prototype.onUnexpectedExternalError = function (e) { - this.unexpectedErrorHandler(e); - }; - return ErrorHandler; -}()); - -var errorHandler = new ErrorHandler(); -function onUnexpectedError(e) { - // ignore errors from cancelled promises - if (!isPromiseCanceledError(e)) { - errorHandler.onUnexpectedError(e); - } - return undefined; -} -function onUnexpectedExternalError(e) { - // ignore errors from cancelled promises - if (!isPromiseCanceledError(e)) { - errorHandler.onUnexpectedExternalError(e); - } - return undefined; -} -function transformErrorForSerialization(error) { - if (error instanceof Error) { - var name_1 = error.name, message = error.message; - var stack = error.stacktrace || error.stack; - return { - $isError: true, - name: name_1, - message: message, - stack: stack - }; - } - // return as is - return error; -} -var canceledName = 'Canceled'; -/** - * Checks if the given error is a promise in canceled state - */ -function isPromiseCanceledError(error) { - return error instanceof Error && error.name === canceledName && error.message === canceledName; -} -/** - * Returns an error that signals cancellation. - */ -function canceled() { - var error = new Error(canceledName); - error.name = error.message; - return error; -} -function illegalArgument(name) { - if (name) { - return new Error("Illegal argument: " + name); - } - else { - return new Error('Illegal argument'); - } -} -function illegalState(name) { - if (name) { - return new Error("Illegal state: " + name); - } - else { - return new Error('Illegal state'); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/event.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/event.js ***! - \****************************************************************/ -/*! exports provided: Event, Emitter, PauseableEmitter, EventMultiplexer, EventBufferer, Relay */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Event", function() { return Event; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Emitter", function() { return Emitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PauseableEmitter", function() { return PauseableEmitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventMultiplexer", function() { return EventMultiplexer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventBufferer", function() { return EventBufferer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Relay", function() { return Relay; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _functional_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functional.js */ "./node_modules/monaco-editor/esm/vs/base/common/functional.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _linkedList_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./linkedList.js */ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -var Event; -(function (Event) { - var _disposable = { dispose: function () { } }; - Event.None = function () { return _disposable; }; - /** - * Given an event, returns another event which only fires once. - */ - function once(event) { - return function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - // we need this, in case the event fires during the listener call - var didFire = false; - var result; - result = event(function (e) { - if (didFire) { - return; - } - else if (result) { - result.dispose(); - } - else { - didFire = true; - } - return listener.call(thisArgs, e); - }, null, disposables); - if (didFire) { - result.dispose(); - } - return result; - }; - } - Event.once = once; - /** - * Given an event and a `map` function, returns another event which maps each element - * throught the mapping function. - */ - function map(event, map) { - return snapshot(function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return event(function (i) { return listener.call(thisArgs, map(i)); }, null, disposables); - }); - } - Event.map = map; - /** - * Given an event and an `each` function, returns another identical event and calls - * the `each` function per each element. - */ - function forEach(event, each) { - return snapshot(function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return event(function (i) { each(i); listener.call(thisArgs, i); }, null, disposables); - }); - } - Event.forEach = forEach; - function filter(event, filter) { - return snapshot(function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return event(function (e) { return filter(e) && listener.call(thisArgs, e); }, null, disposables); - }); - } - Event.filter = filter; - /** - * Given an event, returns the same event but typed as `Event`. - */ - function signal(event) { - return event; - } - Event.signal = signal; - /** - * Given a collection of events, returns a single event which emits - * whenever any of the provided events emit. - */ - function any() { - var events = []; - for (var _i = 0; _i < arguments.length; _i++) { - events[_i] = arguments[_i]; - } - return function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return Object(_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["combinedDisposable"])(events.map(function (event) { return event(function (e) { return listener.call(thisArgs, e); }, null, disposables); })); - }; - } - Event.any = any; - /** - * Given an event and a `merge` function, returns another event which maps each element - * and the cummulative result throught the `merge` function. Similar to `map`, but with memory. - */ - function reduce(event, merge, initial) { - var output = initial; - return map(event, function (e) { - output = merge(output, e); - return output; - }); - } - Event.reduce = reduce; - /** - * Given a chain of event processing functions (filter, map, etc), each - * function will be invoked per event & per listener. Snapshotting an event - * chain allows each function to be invoked just once per event. - */ - function snapshot(event) { - var listener; - var emitter = new Emitter({ - onFirstListenerAdd: function () { - listener = event(emitter.fire, emitter); - }, - onLastListenerRemove: function () { - listener.dispose(); - } - }); - return emitter.event; - } - Event.snapshot = snapshot; - function debounce(event, merge, delay, leading, leakWarningThreshold) { - if (delay === void 0) { delay = 100; } - if (leading === void 0) { leading = false; } - var subscription; - var output = undefined; - var handle = undefined; - var numDebouncedCalls = 0; - var emitter = new Emitter({ - leakWarningThreshold: leakWarningThreshold, - onFirstListenerAdd: function () { - subscription = event(function (cur) { - numDebouncedCalls++; - output = merge(output, cur); - if (leading && !handle) { - emitter.fire(output); - } - clearTimeout(handle); - handle = setTimeout(function () { - var _output = output; - output = undefined; - handle = undefined; - if (!leading || numDebouncedCalls > 1) { - emitter.fire(_output); - } - numDebouncedCalls = 0; - }, delay); - }); - }, - onLastListenerRemove: function () { - subscription.dispose(); - } - }); - return emitter.event; - } - Event.debounce = debounce; - /** - * Given an event, it returns another event which fires only once and as soon as - * the input event emits. The event data is the number of millis it took for the - * event to fire. - */ - function stopwatch(event) { - var start = new Date().getTime(); - return map(once(event), function (_) { return new Date().getTime() - start; }); - } - Event.stopwatch = stopwatch; - /** - * Given an event, it returns another event which fires only when the event - * element changes. - */ - function latch(event) { - var firstCall = true; - var cache; - return filter(event, function (value) { - var shouldEmit = firstCall || value !== cache; - firstCall = false; - cache = value; - return shouldEmit; - }); - } - Event.latch = latch; - /** - * Buffers the provided event until a first listener comes - * along, at which point fire all the events at once and - * pipe the event from then on. - * - * ```typescript - * const emitter = new Emitter(); - * const event = emitter.event; - * const bufferedEvent = buffer(event); - * - * emitter.fire(1); - * emitter.fire(2); - * emitter.fire(3); - * // nothing... - * - * const listener = bufferedEvent(num => console.log(num)); - * // 1, 2, 3 - * - * emitter.fire(4); - * // 4 - * ``` - */ - function buffer(event, nextTick, _buffer) { - if (nextTick === void 0) { nextTick = false; } - if (_buffer === void 0) { _buffer = []; } - var buffer = _buffer.slice(); - var listener = event(function (e) { - if (buffer) { - buffer.push(e); - } - else { - emitter.fire(e); - } - }); - var flush = function () { - if (buffer) { - buffer.forEach(function (e) { return emitter.fire(e); }); - } - buffer = null; - }; - var emitter = new Emitter({ - onFirstListenerAdd: function () { - if (!listener) { - listener = event(function (e) { return emitter.fire(e); }); - } - }, - onFirstListenerDidAdd: function () { - if (buffer) { - if (nextTick) { - setTimeout(flush); - } - else { - flush(); - } - } - }, - onLastListenerRemove: function () { - if (listener) { - listener.dispose(); - } - listener = null; - } - }); - return emitter.event; - } - Event.buffer = buffer; - var ChainableEvent = /** @class */ (function () { - function ChainableEvent(event) { - this.event = event; - } - ChainableEvent.prototype.map = function (fn) { - return new ChainableEvent(map(this.event, fn)); - }; - ChainableEvent.prototype.forEach = function (fn) { - return new ChainableEvent(forEach(this.event, fn)); - }; - ChainableEvent.prototype.filter = function (fn) { - return new ChainableEvent(filter(this.event, fn)); - }; - ChainableEvent.prototype.reduce = function (merge, initial) { - return new ChainableEvent(reduce(this.event, merge, initial)); - }; - ChainableEvent.prototype.latch = function () { - return new ChainableEvent(latch(this.event)); - }; - ChainableEvent.prototype.on = function (listener, thisArgs, disposables) { - return this.event(listener, thisArgs, disposables); - }; - ChainableEvent.prototype.once = function (listener, thisArgs, disposables) { - return once(this.event)(listener, thisArgs, disposables); - }; - return ChainableEvent; - }()); - function chain(event) { - return new ChainableEvent(event); - } - Event.chain = chain; - function fromNodeEventEmitter(emitter, eventName, map) { - if (map === void 0) { map = function (id) { return id; }; } - var fn = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return result.fire(map.apply(void 0, args)); - }; - var onFirstListenerAdd = function () { return emitter.on(eventName, fn); }; - var onLastListenerRemove = function () { return emitter.removeListener(eventName, fn); }; - var result = new Emitter({ onFirstListenerAdd: onFirstListenerAdd, onLastListenerRemove: onLastListenerRemove }); - return result.event; - } - Event.fromNodeEventEmitter = fromNodeEventEmitter; - function fromPromise(promise) { - var emitter = new Emitter(); - var shouldEmit = false; - promise - .then(undefined, function () { return null; }) - .then(function () { - if (!shouldEmit) { - setTimeout(function () { return emitter.fire(undefined); }, 0); - } - else { - emitter.fire(undefined); - } - }); - shouldEmit = true; - return emitter.event; - } - Event.fromPromise = fromPromise; - function toPromise(event) { - return new Promise(function (c) { return once(event)(c); }); - } - Event.toPromise = toPromise; -})(Event || (Event = {})); -var _globalLeakWarningThreshold = -1; -var LeakageMonitor = /** @class */ (function () { - function LeakageMonitor(customThreshold, name) { - if (name === void 0) { name = Math.random().toString(18).slice(2, 5); } - this.customThreshold = customThreshold; - this.name = name; - this._warnCountdown = 0; - } - LeakageMonitor.prototype.dispose = function () { - if (this._stacks) { - this._stacks.clear(); - } - }; - LeakageMonitor.prototype.check = function (listenerCount) { - var _this = this; - var threshold = _globalLeakWarningThreshold; - if (typeof this.customThreshold === 'number') { - threshold = this.customThreshold; - } - if (threshold <= 0 || listenerCount < threshold) { - return undefined; - } - if (!this._stacks) { - this._stacks = new Map(); - } - var stack = new Error().stack.split('\n').slice(3).join('\n'); - var count = (this._stacks.get(stack) || 0); - this._stacks.set(stack, count + 1); - this._warnCountdown -= 1; - if (this._warnCountdown <= 0) { - // only warn on first exceed and then every time the limit - // is exceeded by 50% again - this._warnCountdown = threshold * 0.5; - // find most frequent listener and print warning - var topStack_1; - var topCount_1 = 0; - this._stacks.forEach(function (count, stack) { - if (!topStack_1 || topCount_1 < count) { - topStack_1 = stack; - topCount_1 = count; - } - }); - console.warn("[" + this.name + "] potential listener LEAK detected, having " + listenerCount + " listeners already. MOST frequent listener (" + topCount_1 + "):"); - console.warn(topStack_1); - } - return function () { - var count = (_this._stacks.get(stack) || 0); - _this._stacks.set(stack, count - 1); - }; - }; - return LeakageMonitor; -}()); -/** - * The Emitter can be used to expose an Event to the public - * to fire it from the insides. - * Sample: - class Document { - - private _onDidChange = new Emitter<(value:string)=>any>(); - - public onDidChange = this._onDidChange.event; - - // getter-style - // get onDidChange(): Event<(value:string)=>any> { - // return this._onDidChange.event; - // } - - private _doIt() { - //... - this._onDidChange.fire(value); - } - } - */ -var Emitter = /** @class */ (function () { - function Emitter(options) { - this._disposed = false; - this._options = options; - this._leakageMon = _globalLeakWarningThreshold > 0 - ? new LeakageMonitor(this._options && this._options.leakWarningThreshold) - : undefined; - } - Object.defineProperty(Emitter.prototype, "event", { - /** - * For the public to allow to subscribe - * to events from this Emitter - */ - get: function () { - var _this = this; - if (!this._event) { - this._event = function (listener, thisArgs, disposables) { - if (!_this._listeners) { - _this._listeners = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"](); - } - var firstListener = _this._listeners.isEmpty(); - if (firstListener && _this._options && _this._options.onFirstListenerAdd) { - _this._options.onFirstListenerAdd(_this); - } - var remove = _this._listeners.push(!thisArgs ? listener : [listener, thisArgs]); - if (firstListener && _this._options && _this._options.onFirstListenerDidAdd) { - _this._options.onFirstListenerDidAdd(_this); - } - if (_this._options && _this._options.onListenerDidAdd) { - _this._options.onListenerDidAdd(_this, listener, thisArgs); - } - // check and record this emitter for potential leakage - var removeMonitor; - if (_this._leakageMon) { - removeMonitor = _this._leakageMon.check(_this._listeners.size); - } - var result; - result = { - dispose: function () { - if (removeMonitor) { - removeMonitor(); - } - result.dispose = Emitter._noop; - if (!_this._disposed) { - remove(); - if (_this._options && _this._options.onLastListenerRemove) { - var hasListeners = (_this._listeners && !_this._listeners.isEmpty()); - if (!hasListeners) { - _this._options.onLastListenerRemove(_this); - } - } - } - } - }; - if (Array.isArray(disposables)) { - disposables.push(result); - } - return result; - }; - } - return this._event; - }, - enumerable: true, - configurable: true - }); - /** - * To be kept private to fire an event to - * subscribers - */ - Emitter.prototype.fire = function (event) { - if (this._listeners) { - // put all [listener,event]-pairs into delivery queue - // then emit all event. an inner/nested event might be - // the driver of this - if (!this._deliveryQueue) { - this._deliveryQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"](); - } - for (var iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) { - this._deliveryQueue.push([e.value, event]); - } - while (this._deliveryQueue.size > 0) { - var _a = this._deliveryQueue.shift(), listener = _a[0], event_1 = _a[1]; - try { - if (typeof listener === 'function') { - listener.call(undefined, event_1); - } - else { - listener[0].call(listener[1], event_1); - } - } - catch (e) { - Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e); - } - } - } - }; - Emitter.prototype.dispose = function () { - if (this._listeners) { - this._listeners.clear(); - } - if (this._deliveryQueue) { - this._deliveryQueue.clear(); - } - if (this._leakageMon) { - this._leakageMon.dispose(); - } - this._disposed = true; - }; - Emitter._noop = function () { }; - return Emitter; -}()); - -var PauseableEmitter = /** @class */ (function (_super) { - __extends(PauseableEmitter, _super); - function PauseableEmitter(options) { - var _this = _super.call(this, options) || this; - _this._isPaused = 0; - _this._eventQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"](); - _this._mergeFn = options && options.merge; - return _this; - } - PauseableEmitter.prototype.pause = function () { - this._isPaused++; - }; - PauseableEmitter.prototype.resume = function () { - if (this._isPaused !== 0 && --this._isPaused === 0) { - if (this._mergeFn) { - // use the merge function to create a single composite - // event. make a copy in case firing pauses this emitter - var events = this._eventQueue.toArray(); - this._eventQueue.clear(); - _super.prototype.fire.call(this, this._mergeFn(events)); - } - else { - // no merging, fire each event individually and test - // that this emitter isn't paused halfway through - while (!this._isPaused && this._eventQueue.size !== 0) { - _super.prototype.fire.call(this, this._eventQueue.shift()); - } - } - } - }; - PauseableEmitter.prototype.fire = function (event) { - if (this._listeners) { - if (this._isPaused !== 0) { - this._eventQueue.push(event); - } - else { - _super.prototype.fire.call(this, event); - } - } - }; - return PauseableEmitter; -}(Emitter)); - -var EventMultiplexer = /** @class */ (function () { - function EventMultiplexer() { - var _this = this; - this.hasListeners = false; - this.events = []; - this.emitter = new Emitter({ - onFirstListenerAdd: function () { return _this.onFirstListenerAdd(); }, - onLastListenerRemove: function () { return _this.onLastListenerRemove(); } - }); - } - Object.defineProperty(EventMultiplexer.prototype, "event", { - get: function () { - return this.emitter.event; - }, - enumerable: true, - configurable: true - }); - EventMultiplexer.prototype.add = function (event) { - var _this = this; - var e = { event: event, listener: null }; - this.events.push(e); - if (this.hasListeners) { - this.hook(e); - } - var dispose = function () { - if (_this.hasListeners) { - _this.unhook(e); - } - var idx = _this.events.indexOf(e); - _this.events.splice(idx, 1); - }; - return Object(_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["toDisposable"])(Object(_functional_js__WEBPACK_IMPORTED_MODULE_1__["once"])(dispose)); - }; - EventMultiplexer.prototype.onFirstListenerAdd = function () { - var _this = this; - this.hasListeners = true; - this.events.forEach(function (e) { return _this.hook(e); }); - }; - EventMultiplexer.prototype.onLastListenerRemove = function () { - var _this = this; - this.hasListeners = false; - this.events.forEach(function (e) { return _this.unhook(e); }); - }; - EventMultiplexer.prototype.hook = function (e) { - var _this = this; - e.listener = e.event(function (r) { return _this.emitter.fire(r); }); - }; - EventMultiplexer.prototype.unhook = function (e) { - if (e.listener) { - e.listener.dispose(); - } - e.listener = null; - }; - EventMultiplexer.prototype.dispose = function () { - this.emitter.dispose(); - }; - return EventMultiplexer; -}()); - -/** - * The EventBufferer is useful in situations in which you want - * to delay firing your events during some code. - * You can wrap that code and be sure that the event will not - * be fired during that wrap. - * - * ``` - * const emitter: Emitter; - * const delayer = new EventDelayer(); - * const delayedEvent = delayer.wrapEvent(emitter.event); - * - * delayedEvent(console.log); - * - * delayer.bufferEvents(() => { - * emitter.fire(); // event will not be fired yet - * }); - * - * // event will only be fired at this point - * ``` - */ -var EventBufferer = /** @class */ (function () { - function EventBufferer() { - this.buffers = []; - } - EventBufferer.prototype.wrapEvent = function (event) { - var _this = this; - return function (listener, thisArgs, disposables) { - return event(function (i) { - var buffer = _this.buffers[_this.buffers.length - 1]; - if (buffer) { - buffer.push(function () { return listener.call(thisArgs, i); }); - } - else { - listener.call(thisArgs, i); - } - }, undefined, disposables); - }; - }; - EventBufferer.prototype.bufferEvents = function (fn) { - var buffer = []; - this.buffers.push(buffer); - var r = fn(); - this.buffers.pop(); - buffer.forEach(function (flush) { return flush(); }); - return r; - }; - return EventBufferer; -}()); - -/** - * A Relay is an event forwarder which functions as a replugabble event pipe. - * Once created, you can connect an input event to it and it will simply forward - * events from that input event through its own `event` property. The `input` - * can be changed at any point in time. - */ -var Relay = /** @class */ (function () { - function Relay() { - var _this = this; - this.listening = false; - this.inputEvent = Event.None; - this.inputEventListener = _lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"].None; - this.emitter = new Emitter({ - onFirstListenerDidAdd: function () { - _this.listening = true; - _this.inputEventListener = _this.inputEvent(_this.emitter.fire, _this.emitter); - }, - onLastListenerRemove: function () { - _this.listening = false; - _this.inputEventListener.dispose(); - } - }); - this.event = this.emitter.event; - } - Object.defineProperty(Relay.prototype, "input", { - set: function (event) { - this.inputEvent = event; - if (this.listening) { - this.inputEventListener.dispose(); - this.inputEventListener = event(this.emitter.fire, this.emitter); - } - }, - enumerable: true, - configurable: true - }); - Relay.prototype.dispose = function () { - this.inputEventListener.dispose(); - this.emitter.dispose(); - }; - return Relay; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/functional.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/functional.js ***! - \*********************************************************************/ -/*! exports provided: once */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "once", function() { return once; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function once(fn) { - var _this = this; - var didCall = false; - var result; - return function () { - if (didCall) { - return result; - } - didCall = true; - result = fn.apply(_this, arguments); - return result; - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/iterator.js ***! - \*******************************************************************/ -/*! exports provided: FIN, Iterator, getSequenceIterator, ArrayIterator, ArrayNavigator, MappedIterator */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FIN", function() { return FIN; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Iterator", function() { return Iterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSequenceIterator", function() { return getSequenceIterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayIterator", function() { return ArrayIterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayNavigator", function() { return ArrayNavigator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MappedIterator", function() { return MappedIterator; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { +var iterator_extends = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || @@ -2392,7 +2015,7 @@ var ArrayIterator = /** @class */ (function () { }()); var ArrayNavigator = /** @class */ (function (_super) { - __extends(ArrayNavigator, _super); + iterator_extends(ArrayNavigator, _super); function ArrayNavigator(items, start, end, index) { if (start === void 0) { start = 0; } if (end === void 0) { end = items.length; } @@ -2431,687 +2054,1057 @@ var MappedIterator = /** @class */ (function () { }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js ***! - \*******************************************************************/ -/*! exports provided: KeyCodeUtils, KeyChord, createKeybinding, createSimpleKeybinding, SimpleKeybinding, ChordKeybinding, ResolvedKeybindingPart, ResolvedKeybinding */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCodeUtils", function() { return KeyCodeUtils; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyChord", function() { return KeyChord; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createKeybinding", function() { return createKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSimpleKeybinding", function() { return createSimpleKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleKeybinding", function() { return SimpleKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChordKeybinding", function() { return ChordKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybindingPart", function() { return ResolvedKeybindingPart; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybinding", function() { return ResolvedKeybinding; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/uri.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -var KeyCodeStrMap = /** @class */ (function () { - function KeyCodeStrMap() { - this._keyCodeToStr = []; - this._strToKeyCode = Object.create(null); - } - KeyCodeStrMap.prototype.define = function (keyCode, str) { - this._keyCodeToStr[keyCode] = str; - this._strToKeyCode[str.toLowerCase()] = keyCode; +var uri_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); }; - KeyCodeStrMap.prototype.keyCodeToStr = function (keyCode) { - return this._keyCodeToStr[keyCode]; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; - KeyCodeStrMap.prototype.strToKeyCode = function (str) { - return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */; - }; - return KeyCodeStrMap; -}()); -var uiMap = new KeyCodeStrMap(); -var userSettingsUSMap = new KeyCodeStrMap(); -var userSettingsGeneralMap = new KeyCodeStrMap(); -(function () { - function define(keyCode, uiLabel, usUserSettingsLabel, generalUserSettingsLabel) { - if (usUserSettingsLabel === void 0) { usUserSettingsLabel = uiLabel; } - if (generalUserSettingsLabel === void 0) { generalUserSettingsLabel = usUserSettingsLabel; } - uiMap.define(keyCode, uiLabel); - userSettingsUSMap.define(keyCode, usUserSettingsLabel); - userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel); - } - define(0 /* Unknown */, 'unknown'); - define(1 /* Backspace */, 'Backspace'); - define(2 /* Tab */, 'Tab'); - define(3 /* Enter */, 'Enter'); - define(4 /* Shift */, 'Shift'); - define(5 /* Ctrl */, 'Ctrl'); - define(6 /* Alt */, 'Alt'); - define(7 /* PauseBreak */, 'PauseBreak'); - define(8 /* CapsLock */, 'CapsLock'); - define(9 /* Escape */, 'Escape'); - define(10 /* Space */, 'Space'); - define(11 /* PageUp */, 'PageUp'); - define(12 /* PageDown */, 'PageDown'); - define(13 /* End */, 'End'); - define(14 /* Home */, 'Home'); - define(15 /* LeftArrow */, 'LeftArrow', 'Left'); - define(16 /* UpArrow */, 'UpArrow', 'Up'); - define(17 /* RightArrow */, 'RightArrow', 'Right'); - define(18 /* DownArrow */, 'DownArrow', 'Down'); - define(19 /* Insert */, 'Insert'); - define(20 /* Delete */, 'Delete'); - define(21 /* KEY_0 */, '0'); - define(22 /* KEY_1 */, '1'); - define(23 /* KEY_2 */, '2'); - define(24 /* KEY_3 */, '3'); - define(25 /* KEY_4 */, '4'); - define(26 /* KEY_5 */, '5'); - define(27 /* KEY_6 */, '6'); - define(28 /* KEY_7 */, '7'); - define(29 /* KEY_8 */, '8'); - define(30 /* KEY_9 */, '9'); - define(31 /* KEY_A */, 'A'); - define(32 /* KEY_B */, 'B'); - define(33 /* KEY_C */, 'C'); - define(34 /* KEY_D */, 'D'); - define(35 /* KEY_E */, 'E'); - define(36 /* KEY_F */, 'F'); - define(37 /* KEY_G */, 'G'); - define(38 /* KEY_H */, 'H'); - define(39 /* KEY_I */, 'I'); - define(40 /* KEY_J */, 'J'); - define(41 /* KEY_K */, 'K'); - define(42 /* KEY_L */, 'L'); - define(43 /* KEY_M */, 'M'); - define(44 /* KEY_N */, 'N'); - define(45 /* KEY_O */, 'O'); - define(46 /* KEY_P */, 'P'); - define(47 /* KEY_Q */, 'Q'); - define(48 /* KEY_R */, 'R'); - define(49 /* KEY_S */, 'S'); - define(50 /* KEY_T */, 'T'); - define(51 /* KEY_U */, 'U'); - define(52 /* KEY_V */, 'V'); - define(53 /* KEY_W */, 'W'); - define(54 /* KEY_X */, 'X'); - define(55 /* KEY_Y */, 'Y'); - define(56 /* KEY_Z */, 'Z'); - define(57 /* Meta */, 'Meta'); - define(58 /* ContextMenu */, 'ContextMenu'); - define(59 /* F1 */, 'F1'); - define(60 /* F2 */, 'F2'); - define(61 /* F3 */, 'F3'); - define(62 /* F4 */, 'F4'); - define(63 /* F5 */, 'F5'); - define(64 /* F6 */, 'F6'); - define(65 /* F7 */, 'F7'); - define(66 /* F8 */, 'F8'); - define(67 /* F9 */, 'F9'); - define(68 /* F10 */, 'F10'); - define(69 /* F11 */, 'F11'); - define(70 /* F12 */, 'F12'); - define(71 /* F13 */, 'F13'); - define(72 /* F14 */, 'F14'); - define(73 /* F15 */, 'F15'); - define(74 /* F16 */, 'F16'); - define(75 /* F17 */, 'F17'); - define(76 /* F18 */, 'F18'); - define(77 /* F19 */, 'F19'); - define(78 /* NumLock */, 'NumLock'); - define(79 /* ScrollLock */, 'ScrollLock'); - define(80 /* US_SEMICOLON */, ';', ';', 'OEM_1'); - define(81 /* US_EQUAL */, '=', '=', 'OEM_PLUS'); - define(82 /* US_COMMA */, ',', ',', 'OEM_COMMA'); - define(83 /* US_MINUS */, '-', '-', 'OEM_MINUS'); - define(84 /* US_DOT */, '.', '.', 'OEM_PERIOD'); - define(85 /* US_SLASH */, '/', '/', 'OEM_2'); - define(86 /* US_BACKTICK */, '`', '`', 'OEM_3'); - define(110 /* ABNT_C1 */, 'ABNT_C1'); - define(111 /* ABNT_C2 */, 'ABNT_C2'); - define(87 /* US_OPEN_SQUARE_BRACKET */, '[', '[', 'OEM_4'); - define(88 /* US_BACKSLASH */, '\\', '\\', 'OEM_5'); - define(89 /* US_CLOSE_SQUARE_BRACKET */, ']', ']', 'OEM_6'); - define(90 /* US_QUOTE */, '\'', '\'', 'OEM_7'); - define(91 /* OEM_8 */, 'OEM_8'); - define(92 /* OEM_102 */, 'OEM_102'); - define(93 /* NUMPAD_0 */, 'NumPad0'); - define(94 /* NUMPAD_1 */, 'NumPad1'); - define(95 /* NUMPAD_2 */, 'NumPad2'); - define(96 /* NUMPAD_3 */, 'NumPad3'); - define(97 /* NUMPAD_4 */, 'NumPad4'); - define(98 /* NUMPAD_5 */, 'NumPad5'); - define(99 /* NUMPAD_6 */, 'NumPad6'); - define(100 /* NUMPAD_7 */, 'NumPad7'); - define(101 /* NUMPAD_8 */, 'NumPad8'); - define(102 /* NUMPAD_9 */, 'NumPad9'); - define(103 /* NUMPAD_MULTIPLY */, 'NumPad_Multiply'); - define(104 /* NUMPAD_ADD */, 'NumPad_Add'); - define(105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator'); - define(106 /* NUMPAD_SUBTRACT */, 'NumPad_Subtract'); - define(107 /* NUMPAD_DECIMAL */, 'NumPad_Decimal'); - define(108 /* NUMPAD_DIVIDE */, 'NumPad_Divide'); })(); -var KeyCodeUtils; -(function (KeyCodeUtils) { - function toString(keyCode) { - return uiMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toString = toString; - function fromString(key) { - return uiMap.strToKeyCode(key); - } - KeyCodeUtils.fromString = fromString; - function toUserSettingsUS(keyCode) { - return userSettingsUSMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toUserSettingsUS = toUserSettingsUS; - function toUserSettingsGeneral(keyCode) { - return userSettingsGeneralMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral; - function fromUserSettings(key) { - return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); - } - KeyCodeUtils.fromUserSettings = fromUserSettings; -})(KeyCodeUtils || (KeyCodeUtils = {})); -function KeyChord(firstPart, secondPart) { - var chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0; - return (firstPart | chordPart) >>> 0; -} -function createKeybinding(keybinding, OS) { - if (keybinding === 0) { - return null; - } - var firstPart = (keybinding & 0x0000FFFF) >>> 0; - var chordPart = (keybinding & 0xFFFF0000) >>> 16; - if (chordPart !== 0) { - return new ChordKeybinding([ - createSimpleKeybinding(firstPart, OS), - createSimpleKeybinding(chordPart, OS) - ]); - } - return new ChordKeybinding([createSimpleKeybinding(firstPart, OS)]); -} -function createSimpleKeybinding(keybinding, OS) { - var ctrlCmd = (keybinding & 2048 /* CtrlCmd */ ? true : false); - var winCtrl = (keybinding & 256 /* WinCtrl */ ? true : false); - var ctrlKey = (OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd); - var shiftKey = (keybinding & 1024 /* Shift */ ? true : false); - var altKey = (keybinding & 512 /* Alt */ ? true : false); - var metaKey = (OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl); - var keyCode = (keybinding & 255 /* KeyCode */); - return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode); -} -var SimpleKeybinding = /** @class */ (function () { - function SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode) { - this.ctrlKey = ctrlKey; - this.shiftKey = shiftKey; - this.altKey = altKey; - this.metaKey = metaKey; - this.keyCode = keyCode; - } - SimpleKeybinding.prototype.equals = function (other) { - return (this.ctrlKey === other.ctrlKey - && this.shiftKey === other.shiftKey - && this.altKey === other.altKey - && this.metaKey === other.metaKey - && this.keyCode === other.keyCode); - }; - SimpleKeybinding.prototype.isModifierKey = function () { - return (this.keyCode === 0 /* Unknown */ - || this.keyCode === 5 /* Ctrl */ - || this.keyCode === 57 /* Meta */ - || this.keyCode === 6 /* Alt */ - || this.keyCode === 4 /* Shift */); - }; - SimpleKeybinding.prototype.toChord = function () { - return new ChordKeybinding([this]); - }; - /** - * Does this keybinding refer to the key code of a modifier and it also has the modifier flag? - */ - SimpleKeybinding.prototype.isDuplicateModifierCase = function () { - return ((this.ctrlKey && this.keyCode === 5 /* Ctrl */) - || (this.shiftKey && this.keyCode === 4 /* Shift */) - || (this.altKey && this.keyCode === 6 /* Alt */) - || (this.metaKey && this.keyCode === 57 /* Meta */)); - }; - return SimpleKeybinding; -}()); +var uri_a; -var ChordKeybinding = /** @class */ (function () { - function ChordKeybinding(parts) { - if (parts.length === 0) { - throw Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["illegalArgument"])("parts"); - } - this.parts = parts; - } - ChordKeybinding.prototype.equals = function (other) { - if (other === null) { - return false; - } - if (this.parts.length !== other.parts.length) { - return false; - } - for (var i = 0; i < this.parts.length; i++) { - if (!this.parts[i].equals(other.parts[i])) { - return false; - } - } - return true; - }; - return ChordKeybinding; -}()); - -var ResolvedKeybindingPart = /** @class */ (function () { - function ResolvedKeybindingPart(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) { - this.ctrlKey = ctrlKey; - this.shiftKey = shiftKey; - this.altKey = altKey; - this.metaKey = metaKey; - this.keyLabel = kbLabel; - this.keyAriaLabel = kbAriaLabel; - } - return ResolvedKeybindingPart; -}()); - -/** - * A resolved keybinding. Can be a simple keybinding or a chord keybinding. - */ -var ResolvedKeybinding = /** @class */ (function () { - function ResolvedKeybinding() { - } - return ResolvedKeybinding; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js ***! - \********************************************************************/ -/*! exports provided: isDisposable, dispose, combinedDisposable, toDisposable, Disposable, ImmortalReference */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDisposable", function() { return isDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispose", function() { return dispose; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combinedDisposable", function() { return combinedDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toDisposable", function() { return toDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Disposable", function() { return Disposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImmortalReference", function() { return ImmortalReference; }); -function isDisposable(thing) { - return typeof thing.dispose === 'function' - && thing.dispose.length === 0; -} -function dispose(first) { - var rest = []; - for (var _i = 1; _i < arguments.length; _i++) { - rest[_i - 1] = arguments[_i]; - } - if (Array.isArray(first)) { - first.forEach(function (d) { return d && d.dispose(); }); - return []; - } - else if (rest.length === 0) { - if (first) { - first.dispose(); - return first; - } - return undefined; - } - else { - dispose(first); - dispose(rest); - return []; - } -} -function combinedDisposable(disposables) { - return { dispose: function () { return dispose(disposables); } }; -} -function toDisposable(fn) { - return { dispose: function () { fn(); } }; -} -var Disposable = /** @class */ (function () { - function Disposable() { - this._toDispose = []; - this._lifecycle_disposable_isDisposed = false; - } - Disposable.prototype.dispose = function () { - this._lifecycle_disposable_isDisposed = true; - this._toDispose = dispose(this._toDispose); - }; - Disposable.prototype._register = function (t) { - if (this._lifecycle_disposable_isDisposed) { - console.warn('Registering disposable on object that has already been disposed.'); - t.dispose(); +var _schemePattern = /^\w[\w\d+.-]*$/; +var _singleSlashStart = /^\//; +var _doubleSlashStart = /^\/\//; +var _throwOnMissingSchema = true; +function _validateUri(ret, _strict) { + // scheme, must be set + if (!ret.scheme) { + if (_strict || _throwOnMissingSchema) { + throw new Error("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); } else { - this._toDispose.push(t); + console.warn("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); } - return t; + } + // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 + // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) + if (ret.scheme && !_schemePattern.test(ret.scheme)) { + throw new Error('[UriError]: Scheme contains illegal characters.'); + } + // path, http://tools.ietf.org/html/rfc3986#section-3.3 + // If a URI contains an authority component, then the path component + // must either be empty or begin with a slash ("/") character. If a URI + // does not contain an authority component, then the path cannot begin + // with two slash characters ("//"). + if (ret.path) { + if (ret.authority) { + if (!_singleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); + } + } + else { + if (_doubleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); + } + } + } +} +// for a while we allowed uris *without* schemes and this is the migration +// for them, e.g. an uri without scheme and without strict-mode warns and falls +// back to the file-scheme. that should cause the least carnage and still be a +// clear warning +function _schemeFix(scheme, _strict) { + if (_strict || _throwOnMissingSchema) { + return scheme || _empty; + } + if (!scheme) { + console.trace('BAD uri lacks scheme, falling back to file-scheme.'); + scheme = 'file'; + } + return scheme; +} +// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 +function _referenceResolution(scheme, path) { + // the slash-character is our 'default base' as we don't + // support constructing URIs relative to other URIs. This + // also means that we alter and potentially break paths. + // see https://tools.ietf.org/html/rfc3986#section-5.1.4 + switch (scheme) { + case 'https': + case 'http': + case 'file': + if (!path) { + path = _slash; + } + else if (path[0] !== _slash) { + path = _slash + path; + } + break; + } + return path; +} +var _empty = ''; +var _slash = '/'; +var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; +/** + * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. + * This class is a simple parser which creates the basic component parts + * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation + * and encoding. + * + * foo://example.com:8042/over/there?name=ferret#nose + * \_/ \______________/\_________/ \_________/ \__/ + * | | | | | + * scheme authority path query fragment + * | _____________________|__ + * / \ / \ + * urn:example:animal:ferret:nose + */ +var uri_URI = /** @class */ (function () { + /** + * @internal + */ + function URI(schemeOrData, authority, path, query, fragment, _strict) { + if (_strict === void 0) { _strict = false; } + if (typeof schemeOrData === 'object') { + this.scheme = schemeOrData.scheme || _empty; + this.authority = schemeOrData.authority || _empty; + this.path = schemeOrData.path || _empty; + this.query = schemeOrData.query || _empty; + this.fragment = schemeOrData.fragment || _empty; + // no validation because it's this URI + // that creates uri components. + // _validateUri(this); + } + else { + this.scheme = _schemeFix(schemeOrData, _strict); + this.authority = authority || _empty; + this.path = _referenceResolution(this.scheme, path || _empty); + this.query = query || _empty; + this.fragment = fragment || _empty; + _validateUri(this, _strict); + } + } + URI.isUri = function (thing) { + if (thing instanceof URI) { + return true; + } + if (!thing) { + return false; + } + return typeof thing.authority === 'string' + && typeof thing.fragment === 'string' + && typeof thing.path === 'string' + && typeof thing.query === 'string' + && typeof thing.scheme === 'string' + && typeof thing.fsPath === 'function' + && typeof thing.with === 'function' + && typeof thing.toString === 'function'; }; - Disposable.None = Object.freeze({ dispose: function () { } }); - return Disposable; -}()); - -var ImmortalReference = /** @class */ (function () { - function ImmortalReference(object) { - this.object = object; - } - ImmortalReference.prototype.dispose = function () { }; - return ImmortalReference; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/linkedList.js ***! - \*********************************************************************/ -/*! exports provided: LinkedList */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkedList", function() { return LinkedList; }); -/* harmony import */ var _iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var Node = /** @class */ (function () { - function Node(element) { - this.element = element; - this.next = Node.Undefined; - this.prev = Node.Undefined; - } - Node.Undefined = new Node(undefined); - return Node; -}()); -var LinkedList = /** @class */ (function () { - function LinkedList() { - this._first = Node.Undefined; - this._last = Node.Undefined; - this._size = 0; - } - Object.defineProperty(LinkedList.prototype, "size", { + Object.defineProperty(URI.prototype, "fsPath", { + // ---- filesystem path ----------------------- + /** + * Returns a string representing the corresponding file system path of this URI. + * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the + * platform specific path separator. + * + * * Will *not* validate the path for invalid characters and semantics. + * * Will *not* look at the scheme of this URI. + * * The result shall *not* be used for display purposes but for accessing a file on disk. + * + * + * The *difference* to `URI#path` is the use of the platform specific separator and the handling + * of UNC paths. See the below sample of a file-uri with an authority (UNC path). + * + * ```ts + const u = URI.parse('file://server/c$/folder/file.txt') + u.authority === 'server' + u.path === '/shares/c$/file.txt' + u.fsPath === '\\server\c$\folder\file.txt' + ``` + * + * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, + * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working + * with URIs that represent files on disk (`file` scheme). + */ get: function () { - return this._size; + // if (this.scheme !== 'file') { + // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); + // } + return _makeFsPath(this); }, enumerable: true, configurable: true }); - LinkedList.prototype.isEmpty = function () { - return this._first === Node.Undefined; - }; - LinkedList.prototype.clear = function () { - this._first = Node.Undefined; - this._last = Node.Undefined; - this._size = 0; - }; - LinkedList.prototype.unshift = function (element) { - return this._insert(element, false); - }; - LinkedList.prototype.push = function (element) { - return this._insert(element, true); - }; - LinkedList.prototype._insert = function (element, atTheEnd) { - var _this = this; - var newNode = new Node(element); - if (this._first === Node.Undefined) { - this._first = newNode; - this._last = newNode; + // ---- modify to new ------------------------- + URI.prototype.with = function (change) { + if (!change) { + return this; } - else if (atTheEnd) { - // push - var oldLast = this._last; - this._last = newNode; - newNode.prev = oldLast; - oldLast.next = newNode; + var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment; + if (scheme === undefined) { + scheme = this.scheme; + } + else if (scheme === null) { + scheme = _empty; + } + if (authority === undefined) { + authority = this.authority; + } + else if (authority === null) { + authority = _empty; + } + if (path === undefined) { + path = this.path; + } + else if (path === null) { + path = _empty; + } + if (query === undefined) { + query = this.query; + } + else if (query === null) { + query = _empty; + } + if (fragment === undefined) { + fragment = this.fragment; + } + else if (fragment === null) { + fragment = _empty; + } + if (scheme === this.scheme + && authority === this.authority + && path === this.path + && query === this.query + && fragment === this.fragment) { + return this; + } + return new _URI(scheme, authority, path, query, fragment); + }; + // ---- parse & validate ------------------------ + /** + * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, + * `file:///usr/home`, or `scheme:with/path`. + * + * @param value A string which represents an URI (see `URI#toString`). + */ + URI.parse = function (value, _strict) { + if (_strict === void 0) { _strict = false; } + var match = _regexp.exec(value); + if (!match) { + return new _URI(_empty, _empty, _empty, _empty, _empty); + } + return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty), _strict); + }; + /** + * Creates a new URI from a file system path, e.g. `c:\my\files`, + * `/usr/home`, or `\\server\share\some\path`. + * + * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument + * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** + * `URI.parse('file://' + path)` because the path might contain characters that are + * interpreted (# and ?). See the following sample: + * ```ts + const good = URI.file('/coding/c#/project1'); + good.scheme === 'file'; + good.path === '/coding/c#/project1'; + good.fragment === ''; + const bad = URI.parse('file://' + '/coding/c#/project1'); + bad.scheme === 'file'; + bad.path === '/coding/c'; // path is now broken + bad.fragment === '/project1'; + ``` + * + * @param path A file system path (see `URI#fsPath`) + */ + URI.file = function (path) { + var authority = _empty; + // normalize to fwd-slashes on windows, + // on other systems bwd-slashes are valid + // filename character, eg /f\oo/ba\r.txt + if (isWindows) { + path = path.replace(/\\/g, _slash); + } + // check for authority as used in UNC shares + // or use the path as given + if (path[0] === _slash && path[1] === _slash) { + var idx = path.indexOf(_slash, 2); + if (idx === -1) { + authority = path.substring(2); + path = _slash; + } + else { + authority = path.substring(2, idx); + path = path.substring(idx) || _slash; + } + } + return new _URI('file', authority, path, _empty, _empty); + }; + URI.from = function (components) { + return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment); + }; + // ---- printing/externalize --------------------------- + /** + * Creates a string representation for this URI. It's guaranteed that calling + * `URI.parse` with the result of this function creates an URI which is equal + * to this URI. + * + * * The result shall *not* be used for display purposes but for externalization or transport. + * * The result will be encoded using the percentage encoding and encoding happens mostly + * ignore the scheme-specific encoding rules. + * + * @param skipEncoding Do not encode the result, default is `false` + */ + URI.prototype.toString = function (skipEncoding) { + if (skipEncoding === void 0) { skipEncoding = false; } + return _asFormatted(this, skipEncoding); + }; + URI.prototype.toJSON = function () { + return this; + }; + URI.revive = function (data) { + if (!data) { + return data; + } + else if (data instanceof URI) { + return data; } else { - // unshift - var oldFirst = this._first; - this._first = newNode; - newNode.next = oldFirst; - oldFirst.prev = newNode; - } - this._size += 1; - var didRemove = false; - return function () { - if (!didRemove) { - didRemove = true; - _this._remove(newNode); - } - }; - }; - LinkedList.prototype.shift = function () { - if (this._first === Node.Undefined) { - return undefined; - } - else { - var res = this._first.element; - this._remove(this._first); - return res; + var result = new _URI(data); + result._fsPath = data.fsPath; + result._formatted = data.external; + return result; } }; - LinkedList.prototype._remove = function (node) { - if (node.prev !== Node.Undefined && node.next !== Node.Undefined) { - // middle - var anchor = node.prev; - anchor.next = node.next; - node.next.prev = anchor; - } - else if (node.prev === Node.Undefined && node.next === Node.Undefined) { - // only node - this._first = Node.Undefined; - this._last = Node.Undefined; - } - else if (node.next === Node.Undefined) { - // last - this._last = this._last.prev; - this._last.next = Node.Undefined; - } - else if (node.prev === Node.Undefined) { - // first - this._first = this._first.next; - this._first.prev = Node.Undefined; - } - // done - this._size -= 1; - }; - LinkedList.prototype.iterator = function () { - var element; - var node = this._first; - return { - next: function () { - if (node === Node.Undefined) { - return _iterator_js__WEBPACK_IMPORTED_MODULE_0__["FIN"]; - } - if (!element) { - element = { done: false, value: node.element }; - } - else { - element.value = node.element; - } - node = node.next; - return element; - } - }; - }; - LinkedList.prototype.toArray = function () { - var result = []; - for (var node = this._first; node !== Node.Undefined; node = node.next) { - result.push(node.element); - } - return result; - }; - return LinkedList; + return URI; }()); +// tslint:disable-next-line:class-name +var _URI = /** @class */ (function (_super) { + uri_extends(_URI, _super); + function _URI() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._formatted = null; + _this._fsPath = null; + return _this; + } + Object.defineProperty(_URI.prototype, "fsPath", { + get: function () { + if (!this._fsPath) { + this._fsPath = _makeFsPath(this); + } + return this._fsPath; + }, + enumerable: true, + configurable: true + }); + _URI.prototype.toString = function (skipEncoding) { + if (skipEncoding === void 0) { skipEncoding = false; } + if (!skipEncoding) { + if (!this._formatted) { + this._formatted = _asFormatted(this, false); + } + return this._formatted; + } + else { + // we don't cache that + return _asFormatted(this, true); + } + }; + _URI.prototype.toJSON = function () { + var res = { + $mid: 1 + }; + // cached state + if (this._fsPath) { + res.fsPath = this._fsPath; + } + if (this._formatted) { + res.external = this._formatted; + } + // uri components + if (this.path) { + res.path = this.path; + } + if (this.scheme) { + res.scheme = this.scheme; + } + if (this.authority) { + res.authority = this.authority; + } + if (this.query) { + res.query = this.query; + } + if (this.fragment) { + res.fragment = this.fragment; + } + return res; + }; + return _URI; +}(uri_URI)); +// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 +var encodeTable = (uri_a = {}, + uri_a[58 /* Colon */] = '%3A', + uri_a[47 /* Slash */] = '%2F', + uri_a[63 /* QuestionMark */] = '%3F', + uri_a[35 /* Hash */] = '%23', + uri_a[91 /* OpenSquareBracket */] = '%5B', + uri_a[93 /* CloseSquareBracket */] = '%5D', + uri_a[64 /* AtSign */] = '%40', + uri_a[33 /* ExclamationMark */] = '%21', + uri_a[36 /* DollarSign */] = '%24', + uri_a[38 /* Ampersand */] = '%26', + uri_a[39 /* SingleQuote */] = '%27', + uri_a[40 /* OpenParen */] = '%28', + uri_a[41 /* CloseParen */] = '%29', + uri_a[42 /* Asterisk */] = '%2A', + uri_a[43 /* Plus */] = '%2B', + uri_a[44 /* Comma */] = '%2C', + uri_a[59 /* Semicolon */] = '%3B', + uri_a[61 /* Equals */] = '%3D', + uri_a[32 /* Space */] = '%20', + uri_a); +function encodeURIComponentFast(uriComponent, allowSlash) { + var res = undefined; + var nativeEncodePos = -1; + for (var pos = 0; pos < uriComponent.length; pos++) { + var code = uriComponent.charCodeAt(pos); + // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 + if ((code >= 97 /* a */ && code <= 122 /* z */) + || (code >= 65 /* A */ && code <= 90 /* Z */) + || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) + || code === 45 /* Dash */ + || code === 46 /* Period */ + || code === 95 /* Underline */ + || code === 126 /* Tilde */ + || (allowSlash && code === 47 /* Slash */)) { + // check if we are delaying native encode + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + // check if we write into a new string (by default we try to return the param) + if (res !== undefined) { + res += uriComponent.charAt(pos); + } + } + else { + // encoding needed, we need to allocate a new string + if (res === undefined) { + res = uriComponent.substr(0, pos); + } + // check with default table first + var escaped = encodeTable[code]; + if (escaped !== undefined) { + // check if we are delaying native encode + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + // append escaped variant to result + res += escaped; + } + else if (nativeEncodePos === -1) { + // use native encode only when needed + nativeEncodePos = pos; + } + } + } + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); + } + return res !== undefined ? res : uriComponent; +} +function encodeURIComponentMinimal(path) { + var res = undefined; + for (var pos = 0; pos < path.length; pos++) { + var code = path.charCodeAt(pos); + if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { + if (res === undefined) { + res = path.substr(0, pos); + } + res += encodeTable[code]; + } + else { + if (res !== undefined) { + res += path[pos]; + } + } + } + return res !== undefined ? res : path; +} +/** + * Compute `fsPath` for the given uri + */ +function _makeFsPath(uri) { + var value; + if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { + // unc path: file://shares/c$/far/boo + value = "//" + uri.authority + uri.path; + } + else if (uri.path.charCodeAt(0) === 47 /* Slash */ + && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) + && uri.path.charCodeAt(2) === 58 /* Colon */) { + // windows drive letter: file:///c:/far/boo + value = uri.path[1].toLowerCase() + uri.path.substr(2); + } + else { + // other path + value = uri.path; + } + if (isWindows) { + value = value.replace(/\//g, '\\'); + } + return value; +} +/** + * Create the external version of a uri + */ +function _asFormatted(uri, skipEncoding) { + var encoder = !skipEncoding + ? encodeURIComponentFast + : encodeURIComponentMinimal; + var res = ''; + var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment; + if (scheme) { + res += scheme; + res += ':'; + } + if (authority || scheme === 'file') { + res += _slash; + res += _slash; + } + if (authority) { + var idx = authority.indexOf('@'); + if (idx !== -1) { + // @ + var userinfo = authority.substr(0, idx); + authority = authority.substr(idx + 1); + idx = userinfo.indexOf(':'); + if (idx === -1) { + res += encoder(userinfo, false); + } + else { + // :@ + res += encoder(userinfo.substr(0, idx), false); + res += ':'; + res += encoder(userinfo.substr(idx + 1), false); + } + res += '@'; + } + authority = authority.toLowerCase(); + idx = authority.indexOf(':'); + if (idx === -1) { + res += encoder(authority, false); + } + else { + // : + res += encoder(authority.substr(0, idx), false); + res += authority.substr(idx); + } + } + if (path) { + // lower-case windows drive letters in /C:/fff or C:/fff + if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { + var code = path.charCodeAt(1); + if (code >= 65 /* A */ && code <= 90 /* Z */) { + path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3 + } + } + else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { + var code = path.charCodeAt(0); + if (code >= 65 /* A */ && code <= 90 /* Z */) { + path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3 + } + } + // encode the rest of the path + res += encoder(path, true); + } + if (query) { + res += '?'; + res += encoder(query, false); + } + if (fragment) { + res += '#'; + res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; + } + return res; +} - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/platform.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/platform.js ***! - \*******************************************************************/ -/*! exports provided: isWindows, isMacintosh, isLinux, isNative, isWeb, globals, setImmediate, OS */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWindows", function() { return isWindows; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMacintosh", function() { return isMacintosh; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinux", function() { return isLinux; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNative", function() { return isNative; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWeb", function() { return isWeb; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "globals", function() { return globals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setImmediate", function() { return setImmediate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OS", function() { return OS; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/position.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var LANGUAGE_DEFAULT = 'en'; -var _isWindows = false; -var _isMacintosh = false; -var _isLinux = false; -var _isNative = false; -var _isWeb = false; -var _locale = undefined; -var _language = LANGUAGE_DEFAULT; -var _translationsConfigFile = undefined; -var isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer'); -// OS detection -if (typeof navigator === 'object' && !isElectronRenderer) { - var userAgent = navigator.userAgent; - _isWindows = userAgent.indexOf('Windows') >= 0; - _isMacintosh = userAgent.indexOf('Macintosh') >= 0; - _isLinux = userAgent.indexOf('Linux') >= 0; - _isWeb = true; - _locale = navigator.language; - _language = _locale; -} -else if (typeof process === 'object') { - _isWindows = (process.platform === 'win32'); - _isMacintosh = (process.platform === 'darwin'); - _isLinux = (process.platform === 'linux'); - _locale = LANGUAGE_DEFAULT; - _language = LANGUAGE_DEFAULT; - var rawNlsConfig = process.env['VSCODE_NLS_CONFIG']; - if (rawNlsConfig) { - try { - var nlsConfig = JSON.parse(rawNlsConfig); - var resolved = nlsConfig.availableLanguages['*']; - _locale = nlsConfig.locale; - // VSCode's default language is 'en' - _language = resolved ? resolved : LANGUAGE_DEFAULT; - _translationsConfigFile = nlsConfig._translationsConfigFile; - } - catch (e) { - } +/** + * A position in the editor. + */ +var Position = /** @class */ (function () { + function Position(lineNumber, column) { + this.lineNumber = lineNumber; + this.column = column; } - _isNative = true; -} -var _platform = 0 /* Web */; -if (_isNative) { - if (_isMacintosh) { - _platform = 1 /* Mac */; - } - else if (_isWindows) { - _platform = 3 /* Windows */; - } - else if (_isLinux) { - _platform = 2 /* Linux */; - } -} -var isWindows = _isWindows; -var isMacintosh = _isMacintosh; -var isLinux = _isLinux; -var isNative = _isNative; -var isWeb = _isWeb; -var _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {}); -var globals = _globals; -var _setImmediate = null; -function setImmediate(callback) { - if (_setImmediate === null) { - if (globals.setImmediate) { - _setImmediate = globals.setImmediate.bind(globals); - } - else if (typeof process !== 'undefined' && typeof process.nextTick === 'function') { - _setImmediate = process.nextTick.bind(process); + /** + * Create a new postion from this position. + * + * @param newLineNumber new line number + * @param newColumn new column + */ + Position.prototype.with = function (newLineNumber, newColumn) { + if (newLineNumber === void 0) { newLineNumber = this.lineNumber; } + if (newColumn === void 0) { newColumn = this.column; } + if (newLineNumber === this.lineNumber && newColumn === this.column) { + return this; } else { - _setImmediate = globals.setTimeout.bind(globals); + return new Position(newLineNumber, newColumn); + } + }; + /** + * Derive a new position from this position. + * + * @param deltaLineNumber line number delta + * @param deltaColumn column delta + */ + Position.prototype.delta = function (deltaLineNumber, deltaColumn) { + if (deltaLineNumber === void 0) { deltaLineNumber = 0; } + if (deltaColumn === void 0) { deltaColumn = 0; } + return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn); + }; + /** + * Test if this position equals other position + */ + Position.prototype.equals = function (other) { + return Position.equals(this, other); + }; + /** + * Test if position `a` equals position `b` + */ + Position.equals = function (a, b) { + if (!a && !b) { + return true; + } + return (!!a && + !!b && + a.lineNumber === b.lineNumber && + a.column === b.column); + }; + /** + * Test if this position is before other position. + * If the two positions are equal, the result will be false. + */ + Position.prototype.isBefore = function (other) { + return Position.isBefore(this, other); + }; + /** + * Test if position `a` is before position `b`. + * If the two positions are equal, the result will be false. + */ + Position.isBefore = function (a, b) { + if (a.lineNumber < b.lineNumber) { + return true; + } + if (b.lineNumber < a.lineNumber) { + return false; + } + return a.column < b.column; + }; + /** + * Test if this position is before other position. + * If the two positions are equal, the result will be true. + */ + Position.prototype.isBeforeOrEqual = function (other) { + return Position.isBeforeOrEqual(this, other); + }; + /** + * Test if position `a` is before position `b`. + * If the two positions are equal, the result will be true. + */ + Position.isBeforeOrEqual = function (a, b) { + if (a.lineNumber < b.lineNumber) { + return true; + } + if (b.lineNumber < a.lineNumber) { + return false; + } + return a.column <= b.column; + }; + /** + * A function that compares positions, useful for sorting + */ + Position.compare = function (a, b) { + var aLineNumber = a.lineNumber | 0; + var bLineNumber = b.lineNumber | 0; + if (aLineNumber === bLineNumber) { + var aColumn = a.column | 0; + var bColumn = b.column | 0; + return aColumn - bColumn; + } + return aLineNumber - bLineNumber; + }; + /** + * Clone this position. + */ + Position.prototype.clone = function () { + return new Position(this.lineNumber, this.column); + }; + /** + * Convert to a human-readable representation. + */ + Position.prototype.toString = function () { + return '(' + this.lineNumber + ',' + this.column + ')'; + }; + // --- + /** + * Create a `Position` from an `IPosition`. + */ + Position.lift = function (pos) { + return new Position(pos.lineNumber, pos.column); + }; + /** + * Test if `obj` is an `IPosition`. + */ + Position.isIPosition = function (obj) { + return (obj + && (typeof obj.lineNumber === 'number') + && (typeof obj.column === 'number')); + }; + return Position; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/range.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/** + * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn) + */ +var range_Range = /** @class */ (function () { + function Range(startLineNumber, startColumn, endLineNumber, endColumn) { + if ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) { + this.startLineNumber = endLineNumber; + this.startColumn = endColumn; + this.endLineNumber = startLineNumber; + this.endColumn = startColumn; + } + else { + this.startLineNumber = startLineNumber; + this.startColumn = startColumn; + this.endLineNumber = endLineNumber; + this.endColumn = endColumn; } } - return _setImmediate(callback); -} -var OS = (_isMacintosh ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */)); + /** + * Test if this range is empty. + */ + Range.prototype.isEmpty = function () { + return Range.isEmpty(this); + }; + /** + * Test if `range` is empty. + */ + Range.isEmpty = function (range) { + return (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn); + }; + /** + * Test if position is in this range. If the position is at the edges, will return true. + */ + Range.prototype.containsPosition = function (position) { + return Range.containsPosition(this, position); + }; + /** + * Test if `position` is in `range`. If the position is at the edges, will return true. + */ + Range.containsPosition = function (range, position) { + if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) { + return false; + } + if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) { + return false; + } + if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) { + return false; + } + return true; + }; + /** + * Test if range is in this range. If the range is equal to this range, will return true. + */ + Range.prototype.containsRange = function (range) { + return Range.containsRange(this, range); + }; + /** + * Test if `otherRange` is in `range`. If the ranges are equal, will return true. + */ + Range.containsRange = function (range, otherRange) { + if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { + return false; + } + if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { + return false; + } + if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) { + return false; + } + if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) { + return false; + } + return true; + }; + /** + * A reunion of the two ranges. + * The smallest position will be used as the start point, and the largest one as the end point. + */ + Range.prototype.plusRange = function (range) { + return Range.plusRange(this, range); + }; + /** + * A reunion of the two ranges. + * The smallest position will be used as the start point, and the largest one as the end point. + */ + Range.plusRange = function (a, b) { + var startLineNumber; + var startColumn; + var endLineNumber; + var endColumn; + if (b.startLineNumber < a.startLineNumber) { + startLineNumber = b.startLineNumber; + startColumn = b.startColumn; + } + else if (b.startLineNumber === a.startLineNumber) { + startLineNumber = b.startLineNumber; + startColumn = Math.min(b.startColumn, a.startColumn); + } + else { + startLineNumber = a.startLineNumber; + startColumn = a.startColumn; + } + if (b.endLineNumber > a.endLineNumber) { + endLineNumber = b.endLineNumber; + endColumn = b.endColumn; + } + else if (b.endLineNumber === a.endLineNumber) { + endLineNumber = b.endLineNumber; + endColumn = Math.max(b.endColumn, a.endColumn); + } + else { + endLineNumber = a.endLineNumber; + endColumn = a.endColumn; + } + return new Range(startLineNumber, startColumn, endLineNumber, endColumn); + }; + /** + * A intersection of the two ranges. + */ + Range.prototype.intersectRanges = function (range) { + return Range.intersectRanges(this, range); + }; + /** + * A intersection of the two ranges. + */ + Range.intersectRanges = function (a, b) { + var resultStartLineNumber = a.startLineNumber; + var resultStartColumn = a.startColumn; + var resultEndLineNumber = a.endLineNumber; + var resultEndColumn = a.endColumn; + var otherStartLineNumber = b.startLineNumber; + var otherStartColumn = b.startColumn; + var otherEndLineNumber = b.endLineNumber; + var otherEndColumn = b.endColumn; + if (resultStartLineNumber < otherStartLineNumber) { + resultStartLineNumber = otherStartLineNumber; + resultStartColumn = otherStartColumn; + } + else if (resultStartLineNumber === otherStartLineNumber) { + resultStartColumn = Math.max(resultStartColumn, otherStartColumn); + } + if (resultEndLineNumber > otherEndLineNumber) { + resultEndLineNumber = otherEndLineNumber; + resultEndColumn = otherEndColumn; + } + else if (resultEndLineNumber === otherEndLineNumber) { + resultEndColumn = Math.min(resultEndColumn, otherEndColumn); + } + // Check if selection is now empty + if (resultStartLineNumber > resultEndLineNumber) { + return null; + } + if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) { + return null; + } + return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn); + }; + /** + * Test if this range equals other. + */ + Range.prototype.equalsRange = function (other) { + return Range.equalsRange(this, other); + }; + /** + * Test if range `a` equals `b`. + */ + Range.equalsRange = function (a, b) { + return (!!a && + !!b && + a.startLineNumber === b.startLineNumber && + a.startColumn === b.startColumn && + a.endLineNumber === b.endLineNumber && + a.endColumn === b.endColumn); + }; + /** + * Return the end position (which will be after or equal to the start position) + */ + Range.prototype.getEndPosition = function () { + return new Position(this.endLineNumber, this.endColumn); + }; + /** + * Return the start position (which will be before or equal to the end position) + */ + Range.prototype.getStartPosition = function () { + return new Position(this.startLineNumber, this.startColumn); + }; + /** + * Transform to a user presentable string representation. + */ + Range.prototype.toString = function () { + return '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']'; + }; + /** + * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position. + */ + Range.prototype.setEndPosition = function (endLineNumber, endColumn) { + return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn); + }; + /** + * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position. + */ + Range.prototype.setStartPosition = function (startLineNumber, startColumn) { + return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn); + }; + /** + * Create a new empty range using this range's start position. + */ + Range.prototype.collapseToStart = function () { + return Range.collapseToStart(this); + }; + /** + * Create a new empty range using this range's start position. + */ + Range.collapseToStart = function (range) { + return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn); + }; + // --- + Range.fromPositions = function (start, end) { + if (end === void 0) { end = start; } + return new Range(start.lineNumber, start.column, end.lineNumber, end.column); + }; + Range.lift = function (range) { + if (!range) { + return null; + } + return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); + }; + /** + * Test if `obj` is an `IRange`. + */ + Range.isIRange = function (obj) { + return (obj + && (typeof obj.startLineNumber === 'number') + && (typeof obj.startColumn === 'number') + && (typeof obj.endLineNumber === 'number') + && (typeof obj.endColumn === 'number')); + }; + /** + * Test if the two ranges are touching in any way. + */ + Range.areIntersectingOrTouching = function (a, b) { + // Check if `a` is before `b` + if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) { + return false; + } + // Check if `b` is before `a` + if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) { + return false; + } + // These ranges must intersect + return true; + }; + /** + * Test if the two ranges are intersecting. If the ranges are touching it returns true. + */ + Range.areIntersecting = function (a, b) { + // Check if `a` is before `b` + if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) { + return false; + } + // Check if `b` is before `a` + if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) { + return false; + } + // These ranges must intersect + return true; + }; + /** + * A function that compares ranges, useful for sorting ranges + * It will first compare ranges on the startPosition and then on the endPosition + */ + Range.compareRangesUsingStarts = function (a, b) { + if (a && b) { + var aStartLineNumber = a.startLineNumber | 0; + var bStartLineNumber = b.startLineNumber | 0; + if (aStartLineNumber === bStartLineNumber) { + var aStartColumn = a.startColumn | 0; + var bStartColumn = b.startColumn | 0; + if (aStartColumn === bStartColumn) { + var aEndLineNumber = a.endLineNumber | 0; + var bEndLineNumber = b.endLineNumber | 0; + if (aEndLineNumber === bEndLineNumber) { + var aEndColumn = a.endColumn | 0; + var bEndColumn = b.endColumn | 0; + return aEndColumn - bEndColumn; + } + return aEndLineNumber - bEndLineNumber; + } + return aStartColumn - bStartColumn; + } + return aStartLineNumber - bStartLineNumber; + } + var aExists = (a ? 1 : 0); + var bExists = (b ? 1 : 0); + return aExists - bExists; + }; + /** + * A function that compares ranges, useful for sorting ranges + * It will first compare ranges on the endPosition and then on the startPosition + */ + Range.compareRangesUsingEnds = function (a, b) { + if (a.endLineNumber === b.endLineNumber) { + if (a.endColumn === b.endColumn) { + if (a.startLineNumber === b.startLineNumber) { + return a.startColumn - b.startColumn; + } + return a.startLineNumber - b.startLineNumber; + } + return a.endColumn - b.endColumn; + } + return a.endLineNumber - b.endLineNumber; + }; + /** + * Test if the range spans multiple lines. + */ + Range.spansMultipleLines = function (range) { + return range.endLineNumber > range.startLineNumber; + }; + return Range; +}()); -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/strings.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/strings.js ***! - \******************************************************************/ -/*! exports provided: empty, isFalsyOrWhitespace, pad, format, escape, escapeRegExpCharacters, trim, ltrim, rtrim, convertSimple2RegExpPattern, startsWith, endsWith, createRegExp, regExpLeadsToEndlessLoop, regExpFlags, firstNonWhitespaceIndex, getLeadingWhitespace, lastNonWhitespaceIndex, compare, isLowerAsciiLetter, isUpperAsciiLetter, equalsIgnoreCase, startsWithIgnoreCase, commonPrefixLength, commonSuffixLength, isHighSurrogate, isLowSurrogate, containsRTL, containsEmoji, isBasicASCII, containsFullWidthCharacter, isFullWidthCharacter, UTF8_BOM_CHARACTER, startsWithUTF8BOM, safeBtoa, repeat */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFalsyOrWhitespace", function() { return isFalsyOrWhitespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return pad; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "format", function() { return format; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return escape; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeRegExpCharacters", function() { return escapeRegExpCharacters; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trim", function() { return trim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ltrim", function() { return ltrim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rtrim", function() { return rtrim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertSimple2RegExpPattern", function() { return convertSimple2RegExpPattern; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return startsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return endsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRegExp", function() { return createRegExp; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpLeadsToEndlessLoop", function() { return regExpLeadsToEndlessLoop; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpFlags", function() { return regExpFlags; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstNonWhitespaceIndex", function() { return firstNonWhitespaceIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLeadingWhitespace", function() { return getLeadingWhitespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lastNonWhitespaceIndex", function() { return lastNonWhitespaceIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compare", function() { return compare; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowerAsciiLetter", function() { return isLowerAsciiLetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUpperAsciiLetter", function() { return isUpperAsciiLetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equalsIgnoreCase", function() { return equalsIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithIgnoreCase", function() { return startsWithIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonPrefixLength", function() { return commonPrefixLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonSuffixLength", function() { return commonSuffixLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHighSurrogate", function() { return isHighSurrogate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowSurrogate", function() { return isLowSurrogate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsRTL", function() { return containsRTL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsEmoji", function() { return containsEmoji; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBasicASCII", function() { return isBasicASCII; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsFullWidthCharacter", function() { return containsFullWidthCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFullWidthCharacter", function() { return isFullWidthCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UTF8_BOM_CHARACTER", function() { return UTF8_BOM_CHARACTER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithUTF8BOM", function() { return startsWithUTF8BOM; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeBtoa", function() { return safeBtoa; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return repeat; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/strings.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -3164,7 +3157,7 @@ function format(value) { * Converts HTML characters inside the string to use entities instead. Makes the string safe from * being used e.g. in HTMLElement.innerHTML. */ -function escape(html) { +function strings_escape(html) { return html.replace(/[<>&]/g, function (match) { switch (match) { case '<': return '<'; @@ -3561,1964 +3554,7 @@ function repeat(s, count) { return result; } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/types.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/types.js ***! - \****************************************************************/ -/*! exports provided: isArray, isString, isObject, isNumber, isBoolean, isUndefined, isUndefinedOrNull, isEmptyObject, isFunction, validateConstraints, validateConstraint, getAllPropertyNames, withNullAsUndefined, withUndefinedAsNull */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return isArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return isString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return isNumber; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return isBoolean; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return isUndefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefinedOrNull", function() { return isUndefinedOrNull; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmptyObject", function() { return isEmptyObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraints", function() { return validateConstraints; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraint", function() { return validateConstraint; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllPropertyNames", function() { return getAllPropertyNames; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withNullAsUndefined", function() { return withNullAsUndefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withUndefinedAsNull", function() { return withUndefinedAsNull; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var _typeof = { - number: 'number', - string: 'string', - undefined: 'undefined', - object: 'object', - function: 'function' -}; -/** - * @returns whether the provided parameter is a JavaScript Array or not. - */ -function isArray(array) { - if (Array.isArray) { - return Array.isArray(array); - } - if (array && typeof (array.length) === _typeof.number && array.constructor === Array) { - return true; - } - return false; -} -/** - * @returns whether the provided parameter is a JavaScript String or not. - */ -function isString(str) { - if (typeof (str) === _typeof.string || str instanceof String) { - return true; - } - return false; -} -/** - * - * @returns whether the provided parameter is of type `object` but **not** - * `null`, an `array`, a `regexp`, nor a `date`. - */ -function isObject(obj) { - // The method can't do a type cast since there are type (like strings) which - // are subclasses of any put not positvely matched by the function. Hence type - // narrowing results in wrong results. - return typeof obj === _typeof.object - && obj !== null - && !Array.isArray(obj) - && !(obj instanceof RegExp) - && !(obj instanceof Date); -} -/** - * In **contrast** to just checking `typeof` this will return `false` for `NaN`. - * @returns whether the provided parameter is a JavaScript Number or not. - */ -function isNumber(obj) { - if ((typeof (obj) === _typeof.number || obj instanceof Number) && !isNaN(obj)) { - return true; - } - return false; -} -/** - * @returns whether the provided parameter is a JavaScript Boolean or not. - */ -function isBoolean(obj) { - return obj === true || obj === false; -} -/** - * @returns whether the provided parameter is undefined. - */ -function isUndefined(obj) { - return typeof (obj) === _typeof.undefined; -} -/** - * @returns whether the provided parameter is undefined or null. - */ -function isUndefinedOrNull(obj) { - return isUndefined(obj) || obj === null; -} -var hasOwnProperty = Object.prototype.hasOwnProperty; -/** - * @returns whether the provided parameter is an empty JavaScript Object or not. - */ -function isEmptyObject(obj) { - if (!isObject(obj)) { - return false; - } - for (var key in obj) { - if (hasOwnProperty.call(obj, key)) { - return false; - } - } - return true; -} -/** - * @returns whether the provided parameter is a JavaScript Function or not. - */ -function isFunction(obj) { - return typeof obj === _typeof.function; -} -function validateConstraints(args, constraints) { - var len = Math.min(args.length, constraints.length); - for (var i = 0; i < len; i++) { - validateConstraint(args[i], constraints[i]); - } -} -function validateConstraint(arg, constraint) { - if (isString(constraint)) { - if (typeof arg !== constraint) { - throw new Error("argument does not match constraint: typeof " + constraint); - } - } - else if (isFunction(constraint)) { - try { - if (arg instanceof constraint) { - return; - } - } - catch (_a) { - // ignore - } - if (!isUndefinedOrNull(arg) && arg.constructor === constraint) { - return; - } - if (constraint.length === 1 && constraint.call(undefined, arg) === true) { - return; - } - throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true"); - } -} -function getAllPropertyNames(obj) { - var res = []; - var proto = Object.getPrototypeOf(obj); - while (Object.prototype !== proto) { - res = res.concat(Object.getOwnPropertyNames(proto)); - proto = Object.getPrototypeOf(proto); - } - return res; -} -/** - * Converts null to undefined, passes all other values through. - */ -function withNullAsUndefined(x) { - return x === null ? undefined : x; -} -/** - * Converts undefined to null, passes all other values through. - */ -function withUndefinedAsNull(x) { - return typeof x === 'undefined' ? null : x; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/uri.js": -/*!**************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/uri.js ***! - \**************************************************************/ -/*! exports provided: URI */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "URI", function() { return URI; }); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var _a; - -var _schemePattern = /^\w[\w\d+.-]*$/; -var _singleSlashStart = /^\//; -var _doubleSlashStart = /^\/\//; -var _throwOnMissingSchema = true; -function _validateUri(ret, _strict) { - // scheme, must be set - if (!ret.scheme) { - if (_strict || _throwOnMissingSchema) { - throw new Error("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); - } - else { - console.warn("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); - } - } - // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 - // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - if (ret.scheme && !_schemePattern.test(ret.scheme)) { - throw new Error('[UriError]: Scheme contains illegal characters.'); - } - // path, http://tools.ietf.org/html/rfc3986#section-3.3 - // If a URI contains an authority component, then the path component - // must either be empty or begin with a slash ("/") character. If a URI - // does not contain an authority component, then the path cannot begin - // with two slash characters ("//"). - if (ret.path) { - if (ret.authority) { - if (!_singleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); - } - } - else { - if (_doubleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); - } - } - } -} -// for a while we allowed uris *without* schemes and this is the migration -// for them, e.g. an uri without scheme and without strict-mode warns and falls -// back to the file-scheme. that should cause the least carnage and still be a -// clear warning -function _schemeFix(scheme, _strict) { - if (_strict || _throwOnMissingSchema) { - return scheme || _empty; - } - if (!scheme) { - console.trace('BAD uri lacks scheme, falling back to file-scheme.'); - scheme = 'file'; - } - return scheme; -} -// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 -function _referenceResolution(scheme, path) { - // the slash-character is our 'default base' as we don't - // support constructing URIs relative to other URIs. This - // also means that we alter and potentially break paths. - // see https://tools.ietf.org/html/rfc3986#section-5.1.4 - switch (scheme) { - case 'https': - case 'http': - case 'file': - if (!path) { - path = _slash; - } - else if (path[0] !== _slash) { - path = _slash + path; - } - break; - } - return path; -} -var _empty = ''; -var _slash = '/'; -var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; -/** - * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. - * This class is a simple parser which creates the basic component parts - * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation - * and encoding. - * - * foo://example.com:8042/over/there?name=ferret#nose - * \_/ \______________/\_________/ \_________/ \__/ - * | | | | | - * scheme authority path query fragment - * | _____________________|__ - * / \ / \ - * urn:example:animal:ferret:nose - */ -var URI = /** @class */ (function () { - /** - * @internal - */ - function URI(schemeOrData, authority, path, query, fragment, _strict) { - if (_strict === void 0) { _strict = false; } - if (typeof schemeOrData === 'object') { - this.scheme = schemeOrData.scheme || _empty; - this.authority = schemeOrData.authority || _empty; - this.path = schemeOrData.path || _empty; - this.query = schemeOrData.query || _empty; - this.fragment = schemeOrData.fragment || _empty; - // no validation because it's this URI - // that creates uri components. - // _validateUri(this); - } - else { - this.scheme = _schemeFix(schemeOrData, _strict); - this.authority = authority || _empty; - this.path = _referenceResolution(this.scheme, path || _empty); - this.query = query || _empty; - this.fragment = fragment || _empty; - _validateUri(this, _strict); - } - } - URI.isUri = function (thing) { - if (thing instanceof URI) { - return true; - } - if (!thing) { - return false; - } - return typeof thing.authority === 'string' - && typeof thing.fragment === 'string' - && typeof thing.path === 'string' - && typeof thing.query === 'string' - && typeof thing.scheme === 'string' - && typeof thing.fsPath === 'function' - && typeof thing.with === 'function' - && typeof thing.toString === 'function'; - }; - Object.defineProperty(URI.prototype, "fsPath", { - // ---- filesystem path ----------------------- - /** - * Returns a string representing the corresponding file system path of this URI. - * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the - * platform specific path separator. - * - * * Will *not* validate the path for invalid characters and semantics. - * * Will *not* look at the scheme of this URI. - * * The result shall *not* be used for display purposes but for accessing a file on disk. - * - * - * The *difference* to `URI#path` is the use of the platform specific separator and the handling - * of UNC paths. See the below sample of a file-uri with an authority (UNC path). - * - * ```ts - const u = URI.parse('file://server/c$/folder/file.txt') - u.authority === 'server' - u.path === '/shares/c$/file.txt' - u.fsPath === '\\server\c$\folder\file.txt' - ``` - * - * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, - * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working - * with URIs that represent files on disk (`file` scheme). - */ - get: function () { - // if (this.scheme !== 'file') { - // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); - // } - return _makeFsPath(this); - }, - enumerable: true, - configurable: true - }); - // ---- modify to new ------------------------- - URI.prototype.with = function (change) { - if (!change) { - return this; - } - var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment; - if (scheme === undefined) { - scheme = this.scheme; - } - else if (scheme === null) { - scheme = _empty; - } - if (authority === undefined) { - authority = this.authority; - } - else if (authority === null) { - authority = _empty; - } - if (path === undefined) { - path = this.path; - } - else if (path === null) { - path = _empty; - } - if (query === undefined) { - query = this.query; - } - else if (query === null) { - query = _empty; - } - if (fragment === undefined) { - fragment = this.fragment; - } - else if (fragment === null) { - fragment = _empty; - } - if (scheme === this.scheme - && authority === this.authority - && path === this.path - && query === this.query - && fragment === this.fragment) { - return this; - } - return new _URI(scheme, authority, path, query, fragment); - }; - // ---- parse & validate ------------------------ - /** - * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, - * `file:///usr/home`, or `scheme:with/path`. - * - * @param value A string which represents an URI (see `URI#toString`). - */ - URI.parse = function (value, _strict) { - if (_strict === void 0) { _strict = false; } - var match = _regexp.exec(value); - if (!match) { - return new _URI(_empty, _empty, _empty, _empty, _empty); - } - return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty), _strict); - }; - /** - * Creates a new URI from a file system path, e.g. `c:\my\files`, - * `/usr/home`, or `\\server\share\some\path`. - * - * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument - * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** - * `URI.parse('file://' + path)` because the path might contain characters that are - * interpreted (# and ?). See the following sample: - * ```ts - const good = URI.file('/coding/c#/project1'); - good.scheme === 'file'; - good.path === '/coding/c#/project1'; - good.fragment === ''; - const bad = URI.parse('file://' + '/coding/c#/project1'); - bad.scheme === 'file'; - bad.path === '/coding/c'; // path is now broken - bad.fragment === '/project1'; - ``` - * - * @param path A file system path (see `URI#fsPath`) - */ - URI.file = function (path) { - var authority = _empty; - // normalize to fwd-slashes on windows, - // on other systems bwd-slashes are valid - // filename character, eg /f\oo/ba\r.txt - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) { - path = path.replace(/\\/g, _slash); - } - // check for authority as used in UNC shares - // or use the path as given - if (path[0] === _slash && path[1] === _slash) { - var idx = path.indexOf(_slash, 2); - if (idx === -1) { - authority = path.substring(2); - path = _slash; - } - else { - authority = path.substring(2, idx); - path = path.substring(idx) || _slash; - } - } - return new _URI('file', authority, path, _empty, _empty); - }; - URI.from = function (components) { - return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment); - }; - // ---- printing/externalize --------------------------- - /** - * Creates a string representation for this URI. It's guaranteed that calling - * `URI.parse` with the result of this function creates an URI which is equal - * to this URI. - * - * * The result shall *not* be used for display purposes but for externalization or transport. - * * The result will be encoded using the percentage encoding and encoding happens mostly - * ignore the scheme-specific encoding rules. - * - * @param skipEncoding Do not encode the result, default is `false` - */ - URI.prototype.toString = function (skipEncoding) { - if (skipEncoding === void 0) { skipEncoding = false; } - return _asFormatted(this, skipEncoding); - }; - URI.prototype.toJSON = function () { - return this; - }; - URI.revive = function (data) { - if (!data) { - return data; - } - else if (data instanceof URI) { - return data; - } - else { - var result = new _URI(data); - result._fsPath = data.fsPath; - result._formatted = data.external; - return result; - } - }; - return URI; -}()); - -// tslint:disable-next-line:class-name -var _URI = /** @class */ (function (_super) { - __extends(_URI, _super); - function _URI() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._formatted = null; - _this._fsPath = null; - return _this; - } - Object.defineProperty(_URI.prototype, "fsPath", { - get: function () { - if (!this._fsPath) { - this._fsPath = _makeFsPath(this); - } - return this._fsPath; - }, - enumerable: true, - configurable: true - }); - _URI.prototype.toString = function (skipEncoding) { - if (skipEncoding === void 0) { skipEncoding = false; } - if (!skipEncoding) { - if (!this._formatted) { - this._formatted = _asFormatted(this, false); - } - return this._formatted; - } - else { - // we don't cache that - return _asFormatted(this, true); - } - }; - _URI.prototype.toJSON = function () { - var res = { - $mid: 1 - }; - // cached state - if (this._fsPath) { - res.fsPath = this._fsPath; - } - if (this._formatted) { - res.external = this._formatted; - } - // uri components - if (this.path) { - res.path = this.path; - } - if (this.scheme) { - res.scheme = this.scheme; - } - if (this.authority) { - res.authority = this.authority; - } - if (this.query) { - res.query = this.query; - } - if (this.fragment) { - res.fragment = this.fragment; - } - return res; - }; - return _URI; -}(URI)); -// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 -var encodeTable = (_a = {}, - _a[58 /* Colon */] = '%3A', - _a[47 /* Slash */] = '%2F', - _a[63 /* QuestionMark */] = '%3F', - _a[35 /* Hash */] = '%23', - _a[91 /* OpenSquareBracket */] = '%5B', - _a[93 /* CloseSquareBracket */] = '%5D', - _a[64 /* AtSign */] = '%40', - _a[33 /* ExclamationMark */] = '%21', - _a[36 /* DollarSign */] = '%24', - _a[38 /* Ampersand */] = '%26', - _a[39 /* SingleQuote */] = '%27', - _a[40 /* OpenParen */] = '%28', - _a[41 /* CloseParen */] = '%29', - _a[42 /* Asterisk */] = '%2A', - _a[43 /* Plus */] = '%2B', - _a[44 /* Comma */] = '%2C', - _a[59 /* Semicolon */] = '%3B', - _a[61 /* Equals */] = '%3D', - _a[32 /* Space */] = '%20', - _a); -function encodeURIComponentFast(uriComponent, allowSlash) { - var res = undefined; - var nativeEncodePos = -1; - for (var pos = 0; pos < uriComponent.length; pos++) { - var code = uriComponent.charCodeAt(pos); - // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 - if ((code >= 97 /* a */ && code <= 122 /* z */) - || (code >= 65 /* A */ && code <= 90 /* Z */) - || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) - || code === 45 /* Dash */ - || code === 46 /* Period */ - || code === 95 /* Underline */ - || code === 126 /* Tilde */ - || (allowSlash && code === 47 /* Slash */)) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // check if we write into a new string (by default we try to return the param) - if (res !== undefined) { - res += uriComponent.charAt(pos); - } - } - else { - // encoding needed, we need to allocate a new string - if (res === undefined) { - res = uriComponent.substr(0, pos); - } - // check with default table first - var escaped = encodeTable[code]; - if (escaped !== undefined) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // append escaped variant to result - res += escaped; - } - else if (nativeEncodePos === -1) { - // use native encode only when needed - nativeEncodePos = pos; - } - } - } - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); - } - return res !== undefined ? res : uriComponent; -} -function encodeURIComponentMinimal(path) { - var res = undefined; - for (var pos = 0; pos < path.length; pos++) { - var code = path.charCodeAt(pos); - if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { - if (res === undefined) { - res = path.substr(0, pos); - } - res += encodeTable[code]; - } - else { - if (res !== undefined) { - res += path[pos]; - } - } - } - return res !== undefined ? res : path; -} -/** - * Compute `fsPath` for the given uri - */ -function _makeFsPath(uri) { - var value; - if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { - // unc path: file://shares/c$/far/boo - value = "//" + uri.authority + uri.path; - } - else if (uri.path.charCodeAt(0) === 47 /* Slash */ - && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) - && uri.path.charCodeAt(2) === 58 /* Colon */) { - // windows drive letter: file:///c:/far/boo - value = uri.path[1].toLowerCase() + uri.path.substr(2); - } - else { - // other path - value = uri.path; - } - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) { - value = value.replace(/\//g, '\\'); - } - return value; -} -/** - * Create the external version of a uri - */ -function _asFormatted(uri, skipEncoding) { - var encoder = !skipEncoding - ? encodeURIComponentFast - : encodeURIComponentMinimal; - var res = ''; - var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment; - if (scheme) { - res += scheme; - res += ':'; - } - if (authority || scheme === 'file') { - res += _slash; - res += _slash; - } - if (authority) { - var idx = authority.indexOf('@'); - if (idx !== -1) { - // @ - var userinfo = authority.substr(0, idx); - authority = authority.substr(idx + 1); - idx = userinfo.indexOf(':'); - if (idx === -1) { - res += encoder(userinfo, false); - } - else { - // :@ - res += encoder(userinfo.substr(0, idx), false); - res += ':'; - res += encoder(userinfo.substr(idx + 1), false); - } - res += '@'; - } - authority = authority.toLowerCase(); - idx = authority.indexOf(':'); - if (idx === -1) { - res += encoder(authority, false); - } - else { - // : - res += encoder(authority.substr(0, idx), false); - res += authority.substr(idx); - } - } - if (path) { - // lower-case windows drive letters in /C:/fff or C:/fff - if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { - var code = path.charCodeAt(1); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3 - } - } - else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { - var code = path.charCodeAt(0); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3 - } - } - // encode the rest of the path - res += encoder(path, true); - } - if (query) { - res += '?'; - res += encoder(query, false); - } - if (fragment) { - res += '#'; - res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; - } - return res; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js ***! - \******************************************************************************/ -/*! exports provided: logOnceWebWorkerWarning, SimpleWorkerClient, SimpleWorkerServer, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logOnceWebWorkerWarning", function() { return logOnceWebWorkerWarning; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerClient", function() { return SimpleWorkerClient; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerServer", function() { return SimpleWorkerServer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -var INITIALIZE = '$initialize'; -var webWorkerWarningLogged = false; -function logOnceWebWorkerWarning(err) { - if (!_platform_js__WEBPACK_IMPORTED_MODULE_2__["isWeb"]) { - // running tests - return; - } - if (!webWorkerWarningLogged) { - webWorkerWarningLogged = true; - console.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq'); - } - console.warn(err.message); -} -var SimpleWorkerProtocol = /** @class */ (function () { - function SimpleWorkerProtocol(handler) { - this._workerId = -1; - this._handler = handler; - this._lastSentReq = 0; - this._pendingReplies = Object.create(null); - } - SimpleWorkerProtocol.prototype.setWorkerId = function (workerId) { - this._workerId = workerId; - }; - SimpleWorkerProtocol.prototype.sendMessage = function (method, args) { - var _this = this; - var req = String(++this._lastSentReq); - return new Promise(function (resolve, reject) { - _this._pendingReplies[req] = { - resolve: resolve, - reject: reject - }; - _this._send({ - vsWorker: _this._workerId, - req: req, - method: method, - args: args - }); - }); - }; - SimpleWorkerProtocol.prototype.handleMessage = function (serializedMessage) { - var message; - try { - message = JSON.parse(serializedMessage); - } - catch (e) { - // nothing - return; - } - if (!message || !message.vsWorker) { - return; - } - if (this._workerId !== -1 && message.vsWorker !== this._workerId) { - return; - } - this._handleMessage(message); - }; - SimpleWorkerProtocol.prototype._handleMessage = function (msg) { - var _this = this; - if (msg.seq) { - var replyMessage = msg; - if (!this._pendingReplies[replyMessage.seq]) { - console.warn('Got reply to unknown seq'); - return; - } - var reply = this._pendingReplies[replyMessage.seq]; - delete this._pendingReplies[replyMessage.seq]; - if (replyMessage.err) { - var err = replyMessage.err; - if (replyMessage.err.$isError) { - err = new Error(); - err.name = replyMessage.err.name; - err.message = replyMessage.err.message; - err.stack = replyMessage.err.stack; - } - reply.reject(err); - return; - } - reply.resolve(replyMessage.res); - return; - } - var requestMessage = msg; - var req = requestMessage.req; - var result = this._handler.handleMessage(requestMessage.method, requestMessage.args); - result.then(function (r) { - _this._send({ - vsWorker: _this._workerId, - seq: req, - res: r, - err: undefined - }); - }, function (e) { - if (e.detail instanceof Error) { - // Loading errors have a detail property that points to the actual error - e.detail = Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e.detail); - } - _this._send({ - vsWorker: _this._workerId, - seq: req, - res: undefined, - err: Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e) - }); - }); - }; - SimpleWorkerProtocol.prototype._send = function (msg) { - var strMsg = JSON.stringify(msg); - // console.log('SENDING: ' + strMsg); - this._handler.sendMessage(strMsg); - }; - return SimpleWorkerProtocol; -}()); -/** - * Main thread side - */ -var SimpleWorkerClient = /** @class */ (function (_super) { - __extends(SimpleWorkerClient, _super); - function SimpleWorkerClient(workerFactory, moduleId) { - var _this = _super.call(this) || this; - var lazyProxyReject = null; - _this._worker = _this._register(workerFactory.create('vs/base/common/worker/simpleWorker', function (msg) { - _this._protocol.handleMessage(msg); - }, function (err) { - // in Firefox, web workers fail lazily :( - // we will reject the proxy - if (lazyProxyReject) { - lazyProxyReject(err); - } - })); - _this._protocol = new SimpleWorkerProtocol({ - sendMessage: function (msg) { - _this._worker.postMessage(msg); - }, - handleMessage: function (method, args) { - // Intentionally not supporting worker -> main requests - return Promise.resolve(null); - } - }); - _this._protocol.setWorkerId(_this._worker.getId()); - // Gather loader configuration - var loaderConfiguration = null; - if (typeof self.require !== 'undefined' && typeof self.require.getConfig === 'function') { - // Get the configuration from the Monaco AMD Loader - loaderConfiguration = self.require.getConfig(); - } - else if (typeof self.requirejs !== 'undefined') { - // Get the configuration from requirejs - loaderConfiguration = self.requirejs.s.contexts._.config; - } - // Send initialize message - _this._onModuleLoaded = _this._protocol.sendMessage(INITIALIZE, [ - _this._worker.getId(), - moduleId, - loaderConfiguration - ]); - _this._lazyProxy = new Promise(function (resolve, reject) { - lazyProxyReject = reject; - _this._onModuleLoaded.then(function (availableMethods) { - var proxy = {}; - for (var _i = 0, availableMethods_1 = availableMethods; _i < availableMethods_1.length; _i++) { - var methodName = availableMethods_1[_i]; - proxy[methodName] = createProxyMethod(methodName, proxyMethodRequest); - } - resolve(proxy); - }, function (e) { - reject(e); - _this._onError('Worker failed to load ' + moduleId, e); - }); - }); - // Create proxy to loaded code - var proxyMethodRequest = function (method, args) { - return _this._request(method, args); - }; - var createProxyMethod = function (method, proxyMethodRequest) { - return function () { - var args = Array.prototype.slice.call(arguments, 0); - return proxyMethodRequest(method, args); - }; - }; - return _this; - } - SimpleWorkerClient.prototype.getProxyObject = function () { - return this._lazyProxy; - }; - SimpleWorkerClient.prototype._request = function (method, args) { - var _this = this; - return new Promise(function (resolve, reject) { - _this._onModuleLoaded.then(function () { - _this._protocol.sendMessage(method, args).then(resolve, reject); - }, reject); - }); - }; - SimpleWorkerClient.prototype._onError = function (message, error) { - console.error(message); - console.info(error); - }; - return SimpleWorkerClient; -}(_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"])); - -/** - * Worker side - */ -var SimpleWorkerServer = /** @class */ (function () { - function SimpleWorkerServer(postSerializedMessage, requestHandler) { - var _this = this; - this._requestHandler = requestHandler; - this._protocol = new SimpleWorkerProtocol({ - sendMessage: function (msg) { - postSerializedMessage(msg); - }, - handleMessage: function (method, args) { return _this._handleMessage(method, args); } - }); - } - SimpleWorkerServer.prototype.onmessage = function (msg) { - this._protocol.handleMessage(msg); - }; - SimpleWorkerServer.prototype._handleMessage = function (method, args) { - if (method === INITIALIZE) { - return this.initialize(args[0], args[1], args[2]); - } - if (!this._requestHandler || typeof this._requestHandler[method] !== 'function') { - return Promise.reject(new Error('Missing requestHandler or method: ' + method)); - } - try { - return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args)); - } - catch (e) { - return Promise.reject(e); - } - }; - SimpleWorkerServer.prototype.initialize = function (workerId, moduleId, loaderConfig) { - var _this = this; - this._protocol.setWorkerId(workerId); - if (this._requestHandler) { - // static request handler - var methods = []; - for (var _i = 0, _a = Object(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllPropertyNames"])(this._requestHandler); _i < _a.length; _i++) { - var prop = _a[_i]; - if (typeof this._requestHandler[prop] === 'function') { - methods.push(prop); - } - } - return Promise.resolve(methods); - } - if (loaderConfig) { - // Remove 'baseUrl', handling it is beyond scope for now - if (typeof loaderConfig.baseUrl !== 'undefined') { - delete loaderConfig['baseUrl']; - } - if (typeof loaderConfig.paths !== 'undefined') { - if (typeof loaderConfig.paths.vs !== 'undefined') { - delete loaderConfig.paths['vs']; - } - } - // Since this is in a web worker, enable catching errors - loaderConfig.catchError = true; - self.require.config(loaderConfig); - } - return new Promise(function (resolve, reject) { - // Use the global require to be sure to get the global config - self.require([moduleId], function () { - var result = []; - for (var _i = 0; _i < arguments.length; _i++) { - result[_i] = arguments[_i]; - } - var handlerModule = result[0]; - _this._requestHandler = handlerModule.create(); - if (!_this._requestHandler) { - reject(new Error("No RequestHandler!")); - return; - } - var methods = []; - for (var _a = 0, _b = Object(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllPropertyNames"])(_this._requestHandler); _a < _b.length; _a++) { - var prop = _b[_a]; - if (typeof _this._requestHandler[prop] === 'function') { - methods.push(prop); - } - } - resolve(methods); - }, reject); - }); - }; - return SimpleWorkerServer; -}()); - -/** - * Called on the worker side - */ -function create(postMessage) { - return new SimpleWorkerServer(postMessage, null); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js ***! - \*************************************************************************************/ -/*! exports provided: CharacterClassifier, CharacterSet */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterClassifier", function() { return CharacterClassifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterSet", function() { return CharacterSet; }); -/* harmony import */ var _uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uint.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * A fast character classifier that uses a compact array for ASCII values. - */ -var CharacterClassifier = /** @class */ (function () { - function CharacterClassifier(_defaultValue) { - var defaultValue = Object(_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_defaultValue); - this._defaultValue = defaultValue; - this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue); - this._map = new Map(); - } - CharacterClassifier._createAsciiMap = function (defaultValue) { - var asciiMap = new Uint8Array(256); - for (var i = 0; i < 256; i++) { - asciiMap[i] = defaultValue; - } - return asciiMap; - }; - CharacterClassifier.prototype.set = function (charCode, _value) { - var value = Object(_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_value); - if (charCode >= 0 && charCode < 256) { - this._asciiMap[charCode] = value; - } - else { - this._map.set(charCode, value); - } - }; - CharacterClassifier.prototype.get = function (charCode) { - if (charCode >= 0 && charCode < 256) { - return this._asciiMap[charCode]; - } - else { - return (this._map.get(charCode) || this._defaultValue); - } - }; - return CharacterClassifier; -}()); - -var CharacterSet = /** @class */ (function () { - function CharacterSet() { - this._actual = new CharacterClassifier(0 /* False */); - } - CharacterSet.prototype.add = function (charCode) { - this._actual.set(charCode, 1 /* True */); - }; - CharacterSet.prototype.has = function (charCode) { - return (this._actual.get(charCode) === 1 /* True */); - }; - return CharacterSet; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/position.js ***! - \**************************************************************************/ -/*! exports provided: Position */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -/** - * A position in the editor. - */ -var Position = /** @class */ (function () { - function Position(lineNumber, column) { - this.lineNumber = lineNumber; - this.column = column; - } - /** - * Create a new postion from this position. - * - * @param newLineNumber new line number - * @param newColumn new column - */ - Position.prototype.with = function (newLineNumber, newColumn) { - if (newLineNumber === void 0) { newLineNumber = this.lineNumber; } - if (newColumn === void 0) { newColumn = this.column; } - if (newLineNumber === this.lineNumber && newColumn === this.column) { - return this; - } - else { - return new Position(newLineNumber, newColumn); - } - }; - /** - * Derive a new position from this position. - * - * @param deltaLineNumber line number delta - * @param deltaColumn column delta - */ - Position.prototype.delta = function (deltaLineNumber, deltaColumn) { - if (deltaLineNumber === void 0) { deltaLineNumber = 0; } - if (deltaColumn === void 0) { deltaColumn = 0; } - return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn); - }; - /** - * Test if this position equals other position - */ - Position.prototype.equals = function (other) { - return Position.equals(this, other); - }; - /** - * Test if position `a` equals position `b` - */ - Position.equals = function (a, b) { - if (!a && !b) { - return true; - } - return (!!a && - !!b && - a.lineNumber === b.lineNumber && - a.column === b.column); - }; - /** - * Test if this position is before other position. - * If the two positions are equal, the result will be false. - */ - Position.prototype.isBefore = function (other) { - return Position.isBefore(this, other); - }; - /** - * Test if position `a` is before position `b`. - * If the two positions are equal, the result will be false. - */ - Position.isBefore = function (a, b) { - if (a.lineNumber < b.lineNumber) { - return true; - } - if (b.lineNumber < a.lineNumber) { - return false; - } - return a.column < b.column; - }; - /** - * Test if this position is before other position. - * If the two positions are equal, the result will be true. - */ - Position.prototype.isBeforeOrEqual = function (other) { - return Position.isBeforeOrEqual(this, other); - }; - /** - * Test if position `a` is before position `b`. - * If the two positions are equal, the result will be true. - */ - Position.isBeforeOrEqual = function (a, b) { - if (a.lineNumber < b.lineNumber) { - return true; - } - if (b.lineNumber < a.lineNumber) { - return false; - } - return a.column <= b.column; - }; - /** - * A function that compares positions, useful for sorting - */ - Position.compare = function (a, b) { - var aLineNumber = a.lineNumber | 0; - var bLineNumber = b.lineNumber | 0; - if (aLineNumber === bLineNumber) { - var aColumn = a.column | 0; - var bColumn = b.column | 0; - return aColumn - bColumn; - } - return aLineNumber - bLineNumber; - }; - /** - * Clone this position. - */ - Position.prototype.clone = function () { - return new Position(this.lineNumber, this.column); - }; - /** - * Convert to a human-readable representation. - */ - Position.prototype.toString = function () { - return '(' + this.lineNumber + ',' + this.column + ')'; - }; - // --- - /** - * Create a `Position` from an `IPosition`. - */ - Position.lift = function (pos) { - return new Position(pos.lineNumber, pos.column); - }; - /** - * Test if `obj` is an `IPosition`. - */ - Position.isIPosition = function (obj) { - return (obj - && (typeof obj.lineNumber === 'number') - && (typeof obj.column === 'number')); - }; - return Position; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/range.js ***! - \***********************************************************************/ -/*! exports provided: Range */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; }); -/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn) - */ -var Range = /** @class */ (function () { - function Range(startLineNumber, startColumn, endLineNumber, endColumn) { - if ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) { - this.startLineNumber = endLineNumber; - this.startColumn = endColumn; - this.endLineNumber = startLineNumber; - this.endColumn = startColumn; - } - else { - this.startLineNumber = startLineNumber; - this.startColumn = startColumn; - this.endLineNumber = endLineNumber; - this.endColumn = endColumn; - } - } - /** - * Test if this range is empty. - */ - Range.prototype.isEmpty = function () { - return Range.isEmpty(this); - }; - /** - * Test if `range` is empty. - */ - Range.isEmpty = function (range) { - return (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn); - }; - /** - * Test if position is in this range. If the position is at the edges, will return true. - */ - Range.prototype.containsPosition = function (position) { - return Range.containsPosition(this, position); - }; - /** - * Test if `position` is in `range`. If the position is at the edges, will return true. - */ - Range.containsPosition = function (range, position) { - if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) { - return false; - } - if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) { - return false; - } - if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) { - return false; - } - return true; - }; - /** - * Test if range is in this range. If the range is equal to this range, will return true. - */ - Range.prototype.containsRange = function (range) { - return Range.containsRange(this, range); - }; - /** - * Test if `otherRange` is in `range`. If the ranges are equal, will return true. - */ - Range.containsRange = function (range, otherRange) { - if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { - return false; - } - if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { - return false; - } - if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) { - return false; - } - if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) { - return false; - } - return true; - }; - /** - * A reunion of the two ranges. - * The smallest position will be used as the start point, and the largest one as the end point. - */ - Range.prototype.plusRange = function (range) { - return Range.plusRange(this, range); - }; - /** - * A reunion of the two ranges. - * The smallest position will be used as the start point, and the largest one as the end point. - */ - Range.plusRange = function (a, b) { - var startLineNumber; - var startColumn; - var endLineNumber; - var endColumn; - if (b.startLineNumber < a.startLineNumber) { - startLineNumber = b.startLineNumber; - startColumn = b.startColumn; - } - else if (b.startLineNumber === a.startLineNumber) { - startLineNumber = b.startLineNumber; - startColumn = Math.min(b.startColumn, a.startColumn); - } - else { - startLineNumber = a.startLineNumber; - startColumn = a.startColumn; - } - if (b.endLineNumber > a.endLineNumber) { - endLineNumber = b.endLineNumber; - endColumn = b.endColumn; - } - else if (b.endLineNumber === a.endLineNumber) { - endLineNumber = b.endLineNumber; - endColumn = Math.max(b.endColumn, a.endColumn); - } - else { - endLineNumber = a.endLineNumber; - endColumn = a.endColumn; - } - return new Range(startLineNumber, startColumn, endLineNumber, endColumn); - }; - /** - * A intersection of the two ranges. - */ - Range.prototype.intersectRanges = function (range) { - return Range.intersectRanges(this, range); - }; - /** - * A intersection of the two ranges. - */ - Range.intersectRanges = function (a, b) { - var resultStartLineNumber = a.startLineNumber; - var resultStartColumn = a.startColumn; - var resultEndLineNumber = a.endLineNumber; - var resultEndColumn = a.endColumn; - var otherStartLineNumber = b.startLineNumber; - var otherStartColumn = b.startColumn; - var otherEndLineNumber = b.endLineNumber; - var otherEndColumn = b.endColumn; - if (resultStartLineNumber < otherStartLineNumber) { - resultStartLineNumber = otherStartLineNumber; - resultStartColumn = otherStartColumn; - } - else if (resultStartLineNumber === otherStartLineNumber) { - resultStartColumn = Math.max(resultStartColumn, otherStartColumn); - } - if (resultEndLineNumber > otherEndLineNumber) { - resultEndLineNumber = otherEndLineNumber; - resultEndColumn = otherEndColumn; - } - else if (resultEndLineNumber === otherEndLineNumber) { - resultEndColumn = Math.min(resultEndColumn, otherEndColumn); - } - // Check if selection is now empty - if (resultStartLineNumber > resultEndLineNumber) { - return null; - } - if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) { - return null; - } - return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn); - }; - /** - * Test if this range equals other. - */ - Range.prototype.equalsRange = function (other) { - return Range.equalsRange(this, other); - }; - /** - * Test if range `a` equals `b`. - */ - Range.equalsRange = function (a, b) { - return (!!a && - !!b && - a.startLineNumber === b.startLineNumber && - a.startColumn === b.startColumn && - a.endLineNumber === b.endLineNumber && - a.endColumn === b.endColumn); - }; - /** - * Return the end position (which will be after or equal to the start position) - */ - Range.prototype.getEndPosition = function () { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.endLineNumber, this.endColumn); - }; - /** - * Return the start position (which will be before or equal to the end position) - */ - Range.prototype.getStartPosition = function () { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.startLineNumber, this.startColumn); - }; - /** - * Transform to a user presentable string representation. - */ - Range.prototype.toString = function () { - return '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']'; - }; - /** - * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position. - */ - Range.prototype.setEndPosition = function (endLineNumber, endColumn) { - return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn); - }; - /** - * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position. - */ - Range.prototype.setStartPosition = function (startLineNumber, startColumn) { - return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn); - }; - /** - * Create a new empty range using this range's start position. - */ - Range.prototype.collapseToStart = function () { - return Range.collapseToStart(this); - }; - /** - * Create a new empty range using this range's start position. - */ - Range.collapseToStart = function (range) { - return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn); - }; - // --- - Range.fromPositions = function (start, end) { - if (end === void 0) { end = start; } - return new Range(start.lineNumber, start.column, end.lineNumber, end.column); - }; - Range.lift = function (range) { - if (!range) { - return null; - } - return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); - }; - /** - * Test if `obj` is an `IRange`. - */ - Range.isIRange = function (obj) { - return (obj - && (typeof obj.startLineNumber === 'number') - && (typeof obj.startColumn === 'number') - && (typeof obj.endLineNumber === 'number') - && (typeof obj.endColumn === 'number')); - }; - /** - * Test if the two ranges are touching in any way. - */ - Range.areIntersectingOrTouching = function (a, b) { - // Check if `a` is before `b` - if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) { - return false; - } - // Check if `b` is before `a` - if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) { - return false; - } - // These ranges must intersect - return true; - }; - /** - * Test if the two ranges are intersecting. If the ranges are touching it returns true. - */ - Range.areIntersecting = function (a, b) { - // Check if `a` is before `b` - if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) { - return false; - } - // Check if `b` is before `a` - if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) { - return false; - } - // These ranges must intersect - return true; - }; - /** - * A function that compares ranges, useful for sorting ranges - * It will first compare ranges on the startPosition and then on the endPosition - */ - Range.compareRangesUsingStarts = function (a, b) { - if (a && b) { - var aStartLineNumber = a.startLineNumber | 0; - var bStartLineNumber = b.startLineNumber | 0; - if (aStartLineNumber === bStartLineNumber) { - var aStartColumn = a.startColumn | 0; - var bStartColumn = b.startColumn | 0; - if (aStartColumn === bStartColumn) { - var aEndLineNumber = a.endLineNumber | 0; - var bEndLineNumber = b.endLineNumber | 0; - if (aEndLineNumber === bEndLineNumber) { - var aEndColumn = a.endColumn | 0; - var bEndColumn = b.endColumn | 0; - return aEndColumn - bEndColumn; - } - return aEndLineNumber - bEndLineNumber; - } - return aStartColumn - bStartColumn; - } - return aStartLineNumber - bStartLineNumber; - } - var aExists = (a ? 1 : 0); - var bExists = (b ? 1 : 0); - return aExists - bExists; - }; - /** - * A function that compares ranges, useful for sorting ranges - * It will first compare ranges on the endPosition and then on the startPosition - */ - Range.compareRangesUsingEnds = function (a, b) { - if (a.endLineNumber === b.endLineNumber) { - if (a.endColumn === b.endColumn) { - if (a.startLineNumber === b.startLineNumber) { - return a.startColumn - b.startColumn; - } - return a.startLineNumber - b.startLineNumber; - } - return a.endColumn - b.endColumn; - } - return a.endLineNumber - b.endLineNumber; - }; - /** - * Test if the range spans multiple lines. - */ - Range.spansMultipleLines = function (range) { - return range.endLineNumber > range.startLineNumber; - }; - return Range; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js ***! - \***************************************************************************/ -/*! exports provided: Selection */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Selection", function() { return Selection; }); -/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -/** - * A selection in the editor. - * The selection is a range that has an orientation. - */ -var Selection = /** @class */ (function (_super) { - __extends(Selection, _super); - function Selection(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) { - var _this = _super.call(this, selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) || this; - _this.selectionStartLineNumber = selectionStartLineNumber; - _this.selectionStartColumn = selectionStartColumn; - _this.positionLineNumber = positionLineNumber; - _this.positionColumn = positionColumn; - return _this; - } - /** - * Clone this selection. - */ - Selection.prototype.clone = function () { - return new Selection(this.selectionStartLineNumber, this.selectionStartColumn, this.positionLineNumber, this.positionColumn); - }; - /** - * Transform to a human-readable representation. - */ - Selection.prototype.toString = function () { - return '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']'; - }; - /** - * Test if equals other selection. - */ - Selection.prototype.equalsSelection = function (other) { - return (Selection.selectionsEqual(this, other)); - }; - /** - * Test if the two selections are equal. - */ - Selection.selectionsEqual = function (a, b) { - return (a.selectionStartLineNumber === b.selectionStartLineNumber && - a.selectionStartColumn === b.selectionStartColumn && - a.positionLineNumber === b.positionLineNumber && - a.positionColumn === b.positionColumn); - }; - /** - * Get directions (LTR or RTL). - */ - Selection.prototype.getDirection = function () { - if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) { - return 0 /* LTR */; - } - return 1 /* RTL */; - }; - /** - * Create a new selection with a different `positionLineNumber` and `positionColumn`. - */ - Selection.prototype.setEndPosition = function (endLineNumber, endColumn) { - if (this.getDirection() === 0 /* LTR */) { - return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn); - } - return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn); - }; - /** - * Get the position at `positionLineNumber` and `positionColumn`. - */ - Selection.prototype.getPosition = function () { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.positionLineNumber, this.positionColumn); - }; - /** - * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. - */ - Selection.prototype.setStartPosition = function (startLineNumber, startColumn) { - if (this.getDirection() === 0 /* LTR */) { - return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn); - } - return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn); - }; - // ---- - /** - * Create a `Selection` from one or two positions - */ - Selection.fromPositions = function (start, end) { - if (end === void 0) { end = start; } - return new Selection(start.lineNumber, start.column, end.lineNumber, end.column); - }; - /** - * Create a `Selection` from an `ISelection`. - */ - Selection.liftSelection = function (sel) { - return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn); - }; - /** - * `a` equals `b`. - */ - Selection.selectionsArrEqual = function (a, b) { - if (a && !b || !a && b) { - return false; - } - if (!a && !b) { - return true; - } - if (a.length !== b.length) { - return false; - } - for (var i = 0, len = a.length; i < len; i++) { - if (!this.selectionsEqual(a[i], b[i])) { - return false; - } - } - return true; - }; - /** - * Test if `obj` is an `ISelection`. - */ - Selection.isISelection = function (obj) { - return (obj - && (typeof obj.selectionStartLineNumber === 'number') - && (typeof obj.selectionStartColumn === 'number') - && (typeof obj.positionLineNumber === 'number') - && (typeof obj.positionColumn === 'number')); - }; - /** - * Create with a direction. - */ - Selection.createWithDirection = function (startLineNumber, startColumn, endLineNumber, endColumn, direction) { - if (direction === 0 /* LTR */) { - return new Selection(startLineNumber, startColumn, endLineNumber, endColumn); - } - return new Selection(endLineNumber, endColumn, startLineNumber, startColumn); - }; - return Selection; -}(_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"])); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/token.js ***! - \***********************************************************************/ -/*! exports provided: Token, TokenizationResult, TokenizationResult2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Token", function() { return Token; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult", function() { return TokenizationResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult2", function() { return TokenizationResult2; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var Token = /** @class */ (function () { - function Token(offset, type, language) { - this.offset = offset | 0; // @perf - this.type = type; - this.language = language; - } - Token.prototype.toString = function () { - return '(' + this.offset + ', ' + this.type + ')'; - }; - return Token; -}()); - -var TokenizationResult = /** @class */ (function () { - function TokenizationResult(tokens, endState) { - this.tokens = tokens; - this.endState = endState; - } - return TokenizationResult; -}()); - -var TokenizationResult2 = /** @class */ (function () { - function TokenizationResult2(tokens, endState) { - this.tokens = tokens; - this.endState = endState; - } - return TokenizationResult2; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js ***! - \**********************************************************************/ -/*! exports provided: Uint8Matrix, toUint8, toUint32, toUint32Array */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uint8Matrix", function() { return Uint8Matrix; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint8", function() { return toUint8; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint32", function() { return toUint32; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint32Array", function() { return toUint32Array; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var Uint8Matrix = /** @class */ (function () { - function Uint8Matrix(rows, cols, defaultValue) { - var data = new Uint8Array(rows * cols); - for (var i = 0, len = rows * cols; i < len; i++) { - data[i] = defaultValue; - } - this._data = data; - this.rows = rows; - this.cols = cols; - } - Uint8Matrix.prototype.get = function (row, col) { - return this._data[row * this.cols + col]; - }; - Uint8Matrix.prototype.set = function (row, col, value) { - this._data[row * this.cols + col] = value; - }; - return Uint8Matrix; -}()); - -function toUint8(v) { - if (v < 0) { - return 0; - } - if (v > 255 /* MAX_UINT_8 */) { - return 255 /* MAX_UINT_8 */; - } - return v | 0; -} -function toUint32(v) { - if (v < 0) { - return 0; - } - if (v > 4294967295 /* MAX_UINT_32 */) { - return 4294967295 /* MAX_UINT_32 */; - } - return v | 0; -} -function toUint32Array(arr) { - var len = arr.length; - var r = new Uint32Array(len); - for (var i = 0; i < len; i++) { - r[i] = toUint32(arr[i]); - } - return r; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js ***! - \******************************************************************************/ -/*! exports provided: DiffComputer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffComputer", function() { return DiffComputer; }); -/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -5528,10 +3564,10 @@ __webpack_require__.r(__webpack_exports__); var MAXIMUM_RUN_TIME = 5000; // 5 seconds var MINIMUM_MATCHING_CHARACTER_LENGTH = 3; function computeDiff(originalSequence, modifiedSequence, continueProcessingPredicate, pretty) { - var diffAlgo = new _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__["LcsDiff"](originalSequence, modifiedSequence, continueProcessingPredicate); + var diffAlgo = new diff_LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate); return diffAlgo.ComputeDiff(pretty); } -var LineMarkerSequence = /** @class */ (function () { +var diffComputer_LineMarkerSequence = /** @class */ (function () { function LineMarkerSequence(lines) { var startColumns = []; var endColumns = []; @@ -5556,14 +3592,14 @@ var LineMarkerSequence = /** @class */ (function () { return i + 1; }; LineMarkerSequence._getFirstNonBlankColumn = function (txt, defaultValue) { - var r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["firstNonWhitespaceIndex"](txt); + var r = firstNonWhitespaceIndex(txt); if (r === -1) { return defaultValue; } return r + 1; }; LineMarkerSequence._getLastNonBlankColumn = function (txt, defaultValue) { - var r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["lastNonWhitespaceIndex"](txt); + var r = lastNonWhitespaceIndex(txt); if (r === -1) { return defaultValue; } @@ -5743,8 +3779,8 @@ var DiffComputer = /** @class */ (function () { this.maximumRunTimeMs = MAXIMUM_RUN_TIME; this.originalLines = originalLines; this.modifiedLines = modifiedLines; - this.original = new LineMarkerSequence(originalLines); - this.modified = new LineMarkerSequence(modifiedLines); + this.original = new diffComputer_LineMarkerSequence(originalLines); + this.modified = new diffComputer_LineMarkerSequence(modifiedLines); } DiffComputer.prototype.computeDiff = function () { if (this.original.getLength() === 1 && this.original.getElementAtIndex(0).length === 0) { @@ -5812,8 +3848,8 @@ var DiffComputer = /** @class */ (function () { // These lines differ only in trim whitespace // Check the leading whitespace { - var originalStartColumn = LineMarkerSequence._getFirstNonBlankColumn(originalLine, 1); - var modifiedStartColumn = LineMarkerSequence._getFirstNonBlankColumn(modifiedLine, 1); + var originalStartColumn = diffComputer_LineMarkerSequence._getFirstNonBlankColumn(originalLine, 1); + var modifiedStartColumn = diffComputer_LineMarkerSequence._getFirstNonBlankColumn(modifiedLine, 1); while (originalStartColumn > 1 && modifiedStartColumn > 1) { var originalChar = originalLine.charCodeAt(originalStartColumn - 2); var modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2); @@ -5829,8 +3865,8 @@ var DiffComputer = /** @class */ (function () { } // Check the trailing whitespace { - var originalEndColumn = LineMarkerSequence._getLastNonBlankColumn(originalLine, 1); - var modifiedEndColumn = LineMarkerSequence._getLastNonBlankColumn(modifiedLine, 1); + var originalEndColumn = diffComputer_LineMarkerSequence._getLastNonBlankColumn(originalLine, 1); + var modifiedEndColumn = diffComputer_LineMarkerSequence._getLastNonBlankColumn(modifiedLine, 1); var originalMaxColumn = originalLine.length + 1; var modifiedMaxColumn = modifiedLine.length + 1; while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) { @@ -5901,28 +3937,267 @@ var DiffComputer = /** @class */ (function () { }()); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var Uint8Matrix = /** @class */ (function () { + function Uint8Matrix(rows, cols, defaultValue) { + var data = new Uint8Array(rows * cols); + for (var i = 0, len = rows * cols; i < len; i++) { + data[i] = defaultValue; + } + this._data = data; + this.rows = rows; + this.cols = cols; + } + Uint8Matrix.prototype.get = function (row, col) { + return this._data[row * this.cols + col]; + }; + Uint8Matrix.prototype.set = function (row, col, value) { + this._data[row * this.cols + col] = value; + }; + return Uint8Matrix; +}()); -/***/ }), +function toUint8(v) { + if (v < 0) { + return 0; + } + if (v > 255 /* MAX_UINT_8 */) { + return 255 /* MAX_UINT_8 */; + } + return v | 0; +} +function toUint32(v) { + if (v < 0) { + return 0; + } + if (v > 4294967295 /* MAX_UINT_32 */) { + return 4294967295 /* MAX_UINT_32 */; + } + return v | 0; +} +function toUint32Array(arr) { + var len = arr.length; + var r = new Uint32Array(len); + for (var i = 0; i < len; i++) { + r[i] = toUint32(arr[i]); + } + return r; +} -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js ***! - \**********************************************************************************/ -/*! exports provided: MirrorTextModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MirrorTextModel", function() { return MirrorTextModel; }); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../viewModel/prefixSumComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js"); +var PrefixSumIndexOfResult = /** @class */ (function () { + function PrefixSumIndexOfResult(index, remainder) { + this.index = index; + this.remainder = remainder; + } + return PrefixSumIndexOfResult; +}()); + +var prefixSumComputer_PrefixSumComputer = /** @class */ (function () { + function PrefixSumComputer(values) { + this.values = values; + this.prefixSum = new Uint32Array(values.length); + this.prefixSumValidIndex = new Int32Array(1); + this.prefixSumValidIndex[0] = -1; + } + PrefixSumComputer.prototype.getCount = function () { + return this.values.length; + }; + PrefixSumComputer.prototype.insertValues = function (insertIndex, insertValues) { + insertIndex = toUint32(insertIndex); + var oldValues = this.values; + var oldPrefixSum = this.prefixSum; + var insertValuesLen = insertValues.length; + if (insertValuesLen === 0) { + return false; + } + this.values = new Uint32Array(oldValues.length + insertValuesLen); + this.values.set(oldValues.subarray(0, insertIndex), 0); + this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen); + this.values.set(insertValues, insertIndex); + if (insertIndex - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = insertIndex - 1; + } + this.prefixSum = new Uint32Array(this.values.length); + if (this.prefixSumValidIndex[0] >= 0) { + this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); + } + return true; + }; + PrefixSumComputer.prototype.changeValue = function (index, value) { + index = toUint32(index); + value = toUint32(value); + if (this.values[index] === value) { + return false; + } + this.values[index] = value; + if (index - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = index - 1; + } + return true; + }; + PrefixSumComputer.prototype.removeValues = function (startIndex, cnt) { + startIndex = toUint32(startIndex); + cnt = toUint32(cnt); + var oldValues = this.values; + var oldPrefixSum = this.prefixSum; + if (startIndex >= oldValues.length) { + return false; + } + var maxCnt = oldValues.length - startIndex; + if (cnt >= maxCnt) { + cnt = maxCnt; + } + if (cnt === 0) { + return false; + } + this.values = new Uint32Array(oldValues.length - cnt); + this.values.set(oldValues.subarray(0, startIndex), 0); + this.values.set(oldValues.subarray(startIndex + cnt), startIndex); + this.prefixSum = new Uint32Array(this.values.length); + if (startIndex - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = startIndex - 1; + } + if (this.prefixSumValidIndex[0] >= 0) { + this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); + } + return true; + }; + PrefixSumComputer.prototype.getTotalValue = function () { + if (this.values.length === 0) { + return 0; + } + return this._getAccumulatedValue(this.values.length - 1); + }; + PrefixSumComputer.prototype.getAccumulatedValue = function (index) { + if (index < 0) { + return 0; + } + index = toUint32(index); + return this._getAccumulatedValue(index); + }; + PrefixSumComputer.prototype._getAccumulatedValue = function (index) { + if (index <= this.prefixSumValidIndex[0]) { + return this.prefixSum[index]; + } + var startIndex = this.prefixSumValidIndex[0] + 1; + if (startIndex === 0) { + this.prefixSum[0] = this.values[0]; + startIndex++; + } + if (index >= this.values.length) { + index = this.values.length - 1; + } + for (var i = startIndex; i <= index; i++) { + this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i]; + } + this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index); + return this.prefixSum[index]; + }; + PrefixSumComputer.prototype.getIndexOf = function (accumulatedValue) { + accumulatedValue = Math.floor(accumulatedValue); //@perf + // Compute all sums (to get a fully valid prefixSum) + this.getTotalValue(); + var low = 0; + var high = this.values.length - 1; + var mid = 0; + var midStop = 0; + var midStart = 0; + while (low <= high) { + mid = low + ((high - low) / 2) | 0; + midStop = this.prefixSum[mid]; + midStart = midStop - this.values[mid]; + if (accumulatedValue < midStart) { + high = mid - 1; + } + else if (accumulatedValue >= midStop) { + low = mid + 1; + } + else { + break; + } + } + return new PrefixSumIndexOfResult(mid, accumulatedValue - midStart); + }; + return PrefixSumComputer; +}()); + +var PrefixSumComputerWithCache = /** @class */ (function () { + function PrefixSumComputerWithCache(values) { + this._cacheAccumulatedValueStart = 0; + this._cache = null; + this._actual = new prefixSumComputer_PrefixSumComputer(values); + this._bustCache(); + } + PrefixSumComputerWithCache.prototype._bustCache = function () { + this._cacheAccumulatedValueStart = 0; + this._cache = null; + }; + PrefixSumComputerWithCache.prototype.insertValues = function (insertIndex, insertValues) { + if (this._actual.insertValues(insertIndex, insertValues)) { + this._bustCache(); + } + }; + PrefixSumComputerWithCache.prototype.changeValue = function (index, value) { + if (this._actual.changeValue(index, value)) { + this._bustCache(); + } + }; + PrefixSumComputerWithCache.prototype.removeValues = function (startIndex, cnt) { + if (this._actual.removeValues(startIndex, cnt)) { + this._bustCache(); + } + }; + PrefixSumComputerWithCache.prototype.getTotalValue = function () { + return this._actual.getTotalValue(); + }; + PrefixSumComputerWithCache.prototype.getAccumulatedValue = function (index) { + return this._actual.getAccumulatedValue(index); + }; + PrefixSumComputerWithCache.prototype.getIndexOf = function (accumulatedValue) { + accumulatedValue = Math.floor(accumulatedValue); //@perf + if (this._cache !== null) { + var cacheIndex = accumulatedValue - this._cacheAccumulatedValueStart; + if (cacheIndex >= 0 && cacheIndex < this._cache.length) { + // Cache hit! + return this._cache[cacheIndex]; + } + } + // Cache miss! + return this._actual.getIndexOf(accumulatedValue); + }; + /** + * Gives a hint that a lot of requests are about to come in for these accumulated values. + */ + PrefixSumComputerWithCache.prototype.warmUpCache = function (accumulatedValueStart, accumulatedValueEnd) { + var newCache = []; + for (var accumulatedValue = accumulatedValueStart; accumulatedValue <= accumulatedValueEnd; accumulatedValue++) { + newCache[accumulatedValue - accumulatedValueStart] = this.getIndexOf(accumulatedValue); + } + this._cache = newCache; + this._cacheAccumulatedValueStart = accumulatedValueStart; + }; + return PrefixSumComputerWithCache; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var MirrorTextModel = /** @class */ (function () { +var mirrorTextModel_MirrorTextModel = /** @class */ (function () { function MirrorTextModel(uri, lines, eol, versionId) { this._uri = uri; this._lines = lines; @@ -5946,7 +4221,7 @@ var MirrorTextModel = /** @class */ (function () { for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) { var change = changes_1[_i]; this._acceptDeleteRange(change.range); - this._acceptInsertText(new _core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](change.range.startLineNumber, change.range.startColumn), change.text); + this._acceptInsertText(new Position(change.range.startLineNumber, change.range.startColumn), change.text); } this._versionId = e.versionId; }; @@ -5958,7 +4233,7 @@ var MirrorTextModel = /** @class */ (function () { for (var i = 0; i < linesLength; i++) { lineStartValues[i] = this._lines[i].length + eolLength; } - this._lineStarts = new _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__["PrefixSumComputer"](lineStartValues); + this._lineStarts = new prefixSumComputer_PrefixSumComputer(lineStartValues); } }; /** @@ -6025,22 +4300,7 @@ var MirrorTextModel = /** @class */ (function () { }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js ***! - \*****************************************************************************/ -/*! exports provided: USUAL_WORD_SEPARATORS, DEFAULT_WORD_REGEXP, ensureValidWordDefinition, getWordAtText */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USUAL_WORD_SEPARATORS", function() { return USUAL_WORD_SEPARATORS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_WORD_REGEXP", function() { return DEFAULT_WORD_REGEXP; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureValidWordDefinition", function() { return ensureValidWordDefinition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWordAtText", function() { return getWordAtText; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -6154,30 +4414,71 @@ function getWordAtText(column, wordDefinition, text, textOffset) { return ret; } +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ -/***/ }), +/** + * A fast character classifier that uses a compact array for ASCII values. + */ +var characterClassifier_CharacterClassifier = /** @class */ (function () { + function CharacterClassifier(_defaultValue) { + var defaultValue = toUint8(_defaultValue); + this._defaultValue = defaultValue; + this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue); + this._map = new Map(); + } + CharacterClassifier._createAsciiMap = function (defaultValue) { + var asciiMap = new Uint8Array(256); + for (var i = 0; i < 256; i++) { + asciiMap[i] = defaultValue; + } + return asciiMap; + }; + CharacterClassifier.prototype.set = function (charCode, _value) { + var value = toUint8(_value); + if (charCode >= 0 && charCode < 256) { + this._asciiMap[charCode] = value; + } + else { + this._map.set(charCode, value); + } + }; + CharacterClassifier.prototype.get = function (charCode) { + if (charCode >= 0 && charCode < 256) { + return this._asciiMap[charCode]; + } + else { + return (this._map.get(charCode) || this._defaultValue); + } + }; + return CharacterClassifier; +}()); -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js ***! - \*******************************************************************************/ -/*! exports provided: StateMachine, LinkComputer, computeLinks */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +var CharacterSet = /** @class */ (function () { + function CharacterSet() { + this._actual = new characterClassifier_CharacterClassifier(0 /* False */); + } + CharacterSet.prototype.add = function (charCode) { + this._actual.set(charCode, 1 /* True */); + }; + CharacterSet.prototype.has = function (charCode) { + return (this._actual.get(charCode) === 1 /* True */); + }; + return CharacterSet; +}()); -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StateMachine", function() { return StateMachine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkComputer", function() { return LinkComputer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeLinks", function() { return computeLinks; }); -/* harmony import */ var _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/characterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js"); -/* harmony import */ var _core_uint_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/uint.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js"); + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var StateMachine = /** @class */ (function () { +var linkComputer_StateMachine = /** @class */ (function () { function StateMachine(edges) { var maxCharCode = 0; var maxState = 0 /* Invalid */; @@ -6195,7 +4496,7 @@ var StateMachine = /** @class */ (function () { } maxCharCode++; maxState++; - var states = new _core_uint_js__WEBPACK_IMPORTED_MODULE_1__["Uint8Matrix"](maxState, maxCharCode, 0 /* Invalid */); + var states = new Uint8Matrix(maxState, maxCharCode, 0 /* Invalid */); for (var i = 0, len = edges.length; i < len; i++) { var _b = edges[i], from = _b[0], chCode = _b[1], to = _b[2]; states.set(from, chCode, to); @@ -6216,7 +4517,7 @@ var StateMachine = /** @class */ (function () { var _stateMachine = null; function getStateMachine() { if (_stateMachine === null) { - _stateMachine = new StateMachine([ + _stateMachine = new linkComputer_StateMachine([ [1 /* Start */, 104 /* h */, 2 /* H */], [1 /* Start */, 72 /* H */, 2 /* H */], [1 /* Start */, 102 /* f */, 6 /* F */], @@ -6246,7 +4547,7 @@ function getStateMachine() { var _classifier = null; function getClassifier() { if (_classifier === null) { - _classifier = new _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__["CharacterClassifier"](0 /* None */); + _classifier = new characterClassifier_CharacterClassifier(0 /* None */); var FORCE_TERMINATION_CHARACTERS = ' \t<>\'\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…'; for (var i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) { _classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), 1 /* ForceTermination */); @@ -6412,19 +4713,7 @@ function computeLinks(model) { return LinkComputer.computeLinks(model); } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js ***! - \*************************************************************************************************/ -/*! exports provided: BasicInplaceReplace */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BasicInplaceReplace", function() { return BasicInplaceReplace; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -6513,40 +4802,171 @@ var BasicInplaceReplace = /** @class */ (function () { }()); +// EXTERNAL MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js +var polyfill = __webpack_require__("URDS"); -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js ***! - \****************************************************************************************/ -/*! exports provided: BaseEditorSimpleWorker, EditorSimpleWorkerImpl, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseEditorSimpleWorker", function() { return BaseEditorSimpleWorker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorSimpleWorkerImpl", function() { return EditorSimpleWorkerImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js"); -/* harmony import */ var _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../diff/diffComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js"); -/* harmony import */ var _model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../model/mirrorTextModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js"); -/* harmony import */ var _model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../model/wordHelper.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js"); -/* harmony import */ var _modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../modes/linkComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js"); -/* harmony import */ var _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../modes/supports/inplaceReplaceSupport.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js"); -/* harmony import */ var _standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../standalone/standaloneBase.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/functional.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { +function functional_once(fn) { + var _this = this; + var didCall = false; + var result; + return function () { + if (didCall) { + return result; + } + didCall = true; + result = fn.apply(_this, arguments); + return result; + }; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/linkedList.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var Node = /** @class */ (function () { + function Node(element) { + this.element = element; + this.next = Node.Undefined; + this.prev = Node.Undefined; + } + Node.Undefined = new Node(undefined); + return Node; +}()); +var linkedList_LinkedList = /** @class */ (function () { + function LinkedList() { + this._first = Node.Undefined; + this._last = Node.Undefined; + this._size = 0; + } + Object.defineProperty(LinkedList.prototype, "size", { + get: function () { + return this._size; + }, + enumerable: true, + configurable: true + }); + LinkedList.prototype.isEmpty = function () { + return this._first === Node.Undefined; + }; + LinkedList.prototype.clear = function () { + this._first = Node.Undefined; + this._last = Node.Undefined; + this._size = 0; + }; + LinkedList.prototype.unshift = function (element) { + return this._insert(element, false); + }; + LinkedList.prototype.push = function (element) { + return this._insert(element, true); + }; + LinkedList.prototype._insert = function (element, atTheEnd) { + var _this = this; + var newNode = new Node(element); + if (this._first === Node.Undefined) { + this._first = newNode; + this._last = newNode; + } + else if (atTheEnd) { + // push + var oldLast = this._last; + this._last = newNode; + newNode.prev = oldLast; + oldLast.next = newNode; + } + else { + // unshift + var oldFirst = this._first; + this._first = newNode; + newNode.next = oldFirst; + oldFirst.prev = newNode; + } + this._size += 1; + var didRemove = false; + return function () { + if (!didRemove) { + didRemove = true; + _this._remove(newNode); + } + }; + }; + LinkedList.prototype.shift = function () { + if (this._first === Node.Undefined) { + return undefined; + } + else { + var res = this._first.element; + this._remove(this._first); + return res; + } + }; + LinkedList.prototype._remove = function (node) { + if (node.prev !== Node.Undefined && node.next !== Node.Undefined) { + // middle + var anchor = node.prev; + anchor.next = node.next; + node.next.prev = anchor; + } + else if (node.prev === Node.Undefined && node.next === Node.Undefined) { + // only node + this._first = Node.Undefined; + this._last = Node.Undefined; + } + else if (node.next === Node.Undefined) { + // last + this._last = this._last.prev; + this._last.next = Node.Undefined; + } + else if (node.prev === Node.Undefined) { + // first + this._first = this._first.next; + this._first.prev = Node.Undefined; + } + // done + this._size -= 1; + }; + LinkedList.prototype.iterator = function () { + var element; + var node = this._first; + return { + next: function () { + if (node === Node.Undefined) { + return FIN; + } + if (!element) { + element = { done: false, value: node.element }; + } + else { + element.value = node.element; + } + node = node.next; + return element; + } + }; + }; + LinkedList.prototype.toArray = function () { + var result = []; + for (var node = this._first; node !== Node.Undefined; node = node.next) { + result.push(node.element); + } + return result; + }; + return LinkedList; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/event.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var event_extends = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || @@ -6563,944 +4983,1282 @@ var __extends = (undefined && undefined.__extends) || (function () { - - - - - - - - - - -/** - * @internal - */ -var MirrorModel = /** @class */ (function (_super) { - __extends(MirrorModel, _super); - function MirrorModel() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(MirrorModel.prototype, "uri", { - get: function () { - return this._uri; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(MirrorModel.prototype, "version", { - get: function () { - return this._versionId; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(MirrorModel.prototype, "eol", { - get: function () { - return this._eol; - }, - enumerable: true, - configurable: true - }); - MirrorModel.prototype.getValue = function () { - return this.getText(); - }; - MirrorModel.prototype.getLinesContent = function () { - return this._lines.slice(0); - }; - MirrorModel.prototype.getLineCount = function () { - return this._lines.length; - }; - MirrorModel.prototype.getLineContent = function (lineNumber) { - return this._lines[lineNumber - 1]; - }; - MirrorModel.prototype.getWordAtPosition = function (position, wordDefinition) { - var wordAtText = Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__["getWordAtText"])(position.column, Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__["ensureValidWordDefinition"])(wordDefinition), this._lines[position.lineNumber - 1], 0); - if (wordAtText) { - return new _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn); - } - return null; - }; - MirrorModel.prototype.getWordUntilPosition = function (position, wordDefinition) { - var wordAtPosition = this.getWordAtPosition(position, wordDefinition); - if (!wordAtPosition) { - return { - word: '', - startColumn: position.column, - endColumn: position.column - }; - } - return { - word: this._lines[position.lineNumber - 1].substring(wordAtPosition.startColumn - 1, position.column - 1), - startColumn: wordAtPosition.startColumn, - endColumn: position.column - }; - }; - MirrorModel.prototype.createWordIterator = function (wordDefinition) { - var _this = this; - var obj; - var lineNumber = 0; - var lineText; - var wordRangesIdx = 0; - var wordRanges = []; - var next = function () { - if (wordRangesIdx < wordRanges.length) { - var value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end); - wordRangesIdx += 1; - if (!obj) { - obj = { done: false, value: value }; +var event_Event; +(function (Event) { + var _disposable = { dispose: function () { } }; + Event.None = function () { return _disposable; }; + /** + * Given an event, returns another event which only fires once. + */ + function once(event) { + return function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + // we need this, in case the event fires during the listener call + var didFire = false; + var result; + result = event(function (e) { + if (didFire) { + return; + } + else if (result) { + result.dispose(); } else { - obj.value = value; + didFire = true; } - return obj; + return listener.call(thisArgs, e); + }, null, disposables); + if (didFire) { + result.dispose(); } - else if (lineNumber >= _this._lines.length) { - return _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_2__["FIN"]; + return result; + }; + } + Event.once = once; + /** + * Given an event and a `map` function, returns another event which maps each element + * throught the mapping function. + */ + function map(event, map) { + return snapshot(function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return event(function (i) { return listener.call(thisArgs, map(i)); }, null, disposables); + }); + } + Event.map = map; + /** + * Given an event and an `each` function, returns another identical event and calls + * the `each` function per each element. + */ + function forEach(event, each) { + return snapshot(function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return event(function (i) { each(i); listener.call(thisArgs, i); }, null, disposables); + }); + } + Event.forEach = forEach; + function filter(event, filter) { + return snapshot(function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return event(function (e) { return filter(e) && listener.call(thisArgs, e); }, null, disposables); + }); + } + Event.filter = filter; + /** + * Given an event, returns the same event but typed as `Event`. + */ + function signal(event) { + return event; + } + Event.signal = signal; + /** + * Given a collection of events, returns a single event which emits + * whenever any of the provided events emit. + */ + function any() { + var events = []; + for (var _i = 0; _i < arguments.length; _i++) { + events[_i] = arguments[_i]; + } + return function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return combinedDisposable(events.map(function (event) { return event(function (e) { return listener.call(thisArgs, e); }, null, disposables); })); + }; + } + Event.any = any; + /** + * Given an event and a `merge` function, returns another event which maps each element + * and the cummulative result throught the `merge` function. Similar to `map`, but with memory. + */ + function reduce(event, merge, initial) { + var output = initial; + return map(event, function (e) { + output = merge(output, e); + return output; + }); + } + Event.reduce = reduce; + /** + * Given a chain of event processing functions (filter, map, etc), each + * function will be invoked per event & per listener. Snapshotting an event + * chain allows each function to be invoked just once per event. + */ + function snapshot(event) { + var listener; + var emitter = new event_Emitter({ + onFirstListenerAdd: function () { + listener = event(emitter.fire, emitter); + }, + onLastListenerRemove: function () { + listener.dispose(); + } + }); + return emitter.event; + } + Event.snapshot = snapshot; + function debounce(event, merge, delay, leading, leakWarningThreshold) { + if (delay === void 0) { delay = 100; } + if (leading === void 0) { leading = false; } + var subscription; + var output = undefined; + var handle = undefined; + var numDebouncedCalls = 0; + var emitter = new event_Emitter({ + leakWarningThreshold: leakWarningThreshold, + onFirstListenerAdd: function () { + subscription = event(function (cur) { + numDebouncedCalls++; + output = merge(output, cur); + if (leading && !handle) { + emitter.fire(output); + } + clearTimeout(handle); + handle = setTimeout(function () { + var _output = output; + output = undefined; + handle = undefined; + if (!leading || numDebouncedCalls > 1) { + emitter.fire(_output); + } + numDebouncedCalls = 0; + }, delay); + }); + }, + onLastListenerRemove: function () { + subscription.dispose(); + } + }); + return emitter.event; + } + Event.debounce = debounce; + /** + * Given an event, it returns another event which fires only once and as soon as + * the input event emits. The event data is the number of millis it took for the + * event to fire. + */ + function stopwatch(event) { + var start = new Date().getTime(); + return map(once(event), function (_) { return new Date().getTime() - start; }); + } + Event.stopwatch = stopwatch; + /** + * Given an event, it returns another event which fires only when the event + * element changes. + */ + function latch(event) { + var firstCall = true; + var cache; + return filter(event, function (value) { + var shouldEmit = firstCall || value !== cache; + firstCall = false; + cache = value; + return shouldEmit; + }); + } + Event.latch = latch; + /** + * Buffers the provided event until a first listener comes + * along, at which point fire all the events at once and + * pipe the event from then on. + * + * ```typescript + * const emitter = new Emitter(); + * const event = emitter.event; + * const bufferedEvent = buffer(event); + * + * emitter.fire(1); + * emitter.fire(2); + * emitter.fire(3); + * // nothing... + * + * const listener = bufferedEvent(num => console.log(num)); + * // 1, 2, 3 + * + * emitter.fire(4); + * // 4 + * ``` + */ + function buffer(event, nextTick, _buffer) { + if (nextTick === void 0) { nextTick = false; } + if (_buffer === void 0) { _buffer = []; } + var buffer = _buffer.slice(); + var listener = event(function (e) { + if (buffer) { + buffer.push(e); } else { - lineText = _this._lines[lineNumber]; - wordRanges = _this._wordenize(lineText, wordDefinition); - wordRangesIdx = 0; - lineNumber += 1; - return next(); + emitter.fire(e); } + }); + var flush = function () { + if (buffer) { + buffer.forEach(function (e) { return emitter.fire(e); }); + } + buffer = null; }; - return { next: next }; - }; - MirrorModel.prototype.getLineWords = function (lineNumber, wordDefinition) { - var content = this._lines[lineNumber - 1]; - var ranges = this._wordenize(content, wordDefinition); - var words = []; - for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { - var range = ranges_1[_i]; - words.push({ - word: content.substring(range.start, range.end), - startColumn: range.start + 1, - endColumn: range.end + 1 - }); - } - return words; - }; - MirrorModel.prototype._wordenize = function (content, wordDefinition) { - var result = []; - var match; - wordDefinition.lastIndex = 0; // reset lastIndex just to be sure - while (match = wordDefinition.exec(content)) { - if (match[0].length === 0) { - // it did match the empty string - break; + var emitter = new event_Emitter({ + onFirstListenerAdd: function () { + if (!listener) { + listener = event(function (e) { return emitter.fire(e); }); + } + }, + onFirstListenerDidAdd: function () { + if (buffer) { + if (nextTick) { + setTimeout(flush); + } + else { + flush(); + } + } + }, + onLastListenerRemove: function () { + if (listener) { + listener.dispose(); + } + listener = null; } - result.push({ start: match.index, end: match.index + match[0].length }); - } - return result; - }; - MirrorModel.prototype.getValueInRange = function (range) { - range = this._validateRange(range); - if (range.startLineNumber === range.endLineNumber) { - return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); - } - var lineEnding = this._eol; - var startLineIndex = range.startLineNumber - 1; - var endLineIndex = range.endLineNumber - 1; - var resultLines = []; - resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); - for (var i = startLineIndex + 1; i < endLineIndex; i++) { - resultLines.push(this._lines[i]); - } - resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); - return resultLines.join(lineEnding); - }; - MirrorModel.prototype.offsetAt = function (position) { - position = this._validatePosition(position); - this._ensureLineStarts(); - return this._lineStarts.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1); - }; - MirrorModel.prototype.positionAt = function (offset) { - offset = Math.floor(offset); - offset = Math.max(0, offset); - this._ensureLineStarts(); - var out = this._lineStarts.getIndexOf(offset); - var lineLength = this._lines[out.index].length; - // Ensure we return a valid position - return { - lineNumber: 1 + out.index, - column: 1 + Math.min(out.remainder, lineLength) - }; - }; - MirrorModel.prototype._validateRange = function (range) { - var start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn }); - var end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn }); - if (start.lineNumber !== range.startLineNumber - || start.column !== range.startColumn - || end.lineNumber !== range.endLineNumber - || end.column !== range.endColumn) { - return { - startLineNumber: start.lineNumber, - startColumn: start.column, - endLineNumber: end.lineNumber, - endColumn: end.column - }; - } - return range; - }; - MirrorModel.prototype._validatePosition = function (position) { - if (!_core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"].isIPosition(position)) { - throw new Error('bad position'); - } - var lineNumber = position.lineNumber, column = position.column; - var hasChanged = false; - if (lineNumber < 1) { - lineNumber = 1; - column = 1; - hasChanged = true; - } - else if (lineNumber > this._lines.length) { - lineNumber = this._lines.length; - column = this._lines[lineNumber - 1].length + 1; - hasChanged = true; - } - else { - var maxCharacter = this._lines[lineNumber - 1].length + 1; - if (column < 1) { - column = 1; - hasChanged = true; - } - else if (column > maxCharacter) { - column = maxCharacter; - hasChanged = true; - } - } - if (!hasChanged) { - return position; - } - else { - return { lineNumber: lineNumber, column: column }; - } - }; - return MirrorModel; -}(_model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_8__["MirrorTextModel"])); -/** - * @internal - */ -var BaseEditorSimpleWorker = /** @class */ (function () { - function BaseEditorSimpleWorker(foreignModuleFactory) { - this._foreignModuleFactory = foreignModuleFactory; - this._foreignModule = null; + }); + return emitter.event; } - // ---- BEGIN diff -------------------------------------------------------------------------- - BaseEditorSimpleWorker.prototype.computeDiff = function (originalUrl, modifiedUrl, ignoreTrimWhitespace) { - var original = this._getModel(originalUrl); - var modified = this._getModel(modifiedUrl); - if (!original || !modified) { - return Promise.resolve(null); + Event.buffer = buffer; + var ChainableEvent = /** @class */ (function () { + function ChainableEvent(event) { + this.event = event; } - var originalLines = original.getLinesContent(); - var modifiedLines = modified.getLinesContent(); - var diffComputer = new _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_7__["DiffComputer"](originalLines, modifiedLines, { - shouldComputeCharChanges: true, - shouldPostProcessCharChanges: true, - shouldIgnoreTrimWhitespace: ignoreTrimWhitespace, - shouldMakePrettyDiff: true - }); - var changes = diffComputer.computeDiff(); - var identical = (changes.length > 0 ? false : this._modelsAreIdentical(original, modified)); - return Promise.resolve({ - identical: identical, - changes: changes - }); - }; - BaseEditorSimpleWorker.prototype._modelsAreIdentical = function (original, modified) { - var originalLineCount = original.getLineCount(); - var modifiedLineCount = modified.getLineCount(); - if (originalLineCount !== modifiedLineCount) { - return false; - } - for (var line = 1; line <= originalLineCount; line++) { - var originalLine = original.getLineContent(line); - var modifiedLine = modified.getLineContent(line); - if (originalLine !== modifiedLine) { - return false; - } - } - return true; - }; - BaseEditorSimpleWorker.prototype.computeMoreMinimalEdits = function (modelUrl, edits) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(edits); - } - var result = []; - var lastEol = undefined; - edits = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["mergeSort"])(edits, function (a, b) { - if (a.range && b.range) { - return _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].compareRangesUsingStarts(a.range, b.range); - } - // eol only changes should go to the end - var aRng = a.range ? 0 : 1; - var bRng = b.range ? 0 : 1; - return aRng - bRng; - }); - for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { - var _a = edits_1[_i], range = _a.range, text = _a.text, eol = _a.eol; - if (typeof eol === 'number') { - lastEol = eol; - } - if (_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].isEmpty(range) && !text) { - // empty change - continue; - } - var original = model.getValueInRange(range); - text = text.replace(/\r\n|\n|\r/g, model.eol); - if (original === text) { - // noop - continue; - } - // make sure diff won't take too long - if (Math.max(text.length, original.length) > BaseEditorSimpleWorker._diffLimit) { - result.push({ range: range, text: text }); - continue; - } - // compute diff between original and edit.text - var changes = Object(_base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__["stringDiff"])(original, text, false); - var editOffset = model.offsetAt(_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].lift(range).getStartPosition()); - for (var _b = 0, changes_1 = changes; _b < changes_1.length; _b++) { - var change = changes_1[_b]; - var start = model.positionAt(editOffset + change.originalStart); - var end = model.positionAt(editOffset + change.originalStart + change.originalLength); - var newEdit = { - text: text.substr(change.modifiedStart, change.modifiedLength), - range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column } - }; - if (model.getValueInRange(newEdit.range) !== newEdit.text) { - result.push(newEdit); - } - } - } - if (typeof lastEol === 'number') { - result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }); - } - return Promise.resolve(result); - }; - // ---- END minimal edits --------------------------------------------------------------- - BaseEditorSimpleWorker.prototype.computeLinks = function (modelUrl) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(null); - } - return Promise.resolve(Object(_modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_10__["computeLinks"])(model)); - }; - BaseEditorSimpleWorker.prototype.textualSuggest = function (modelUrl, position, wordDef, wordDefFlags) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(null); - } - var seen = Object.create(null); - var suggestions = []; - var wordDefRegExp = new RegExp(wordDef, wordDefFlags); - var wordUntil = model.getWordUntilPosition(position, wordDefRegExp); - var wordAt = model.getWordAtPosition(position, wordDefRegExp); - if (wordAt) { - seen[model.getValueInRange(wordAt)] = true; - } - for (var iter = model.createWordIterator(wordDefRegExp), e = iter.next(); !e.done && suggestions.length <= BaseEditorSimpleWorker._suggestionsLimit; e = iter.next()) { - var word = e.value; - if (seen[word]) { - continue; - } - seen[word] = true; - if (!isNaN(Number(word))) { - continue; - } - suggestions.push({ - kind: 18 /* Text */, - label: word, - insertText: word, - range: { startLineNumber: position.lineNumber, startColumn: wordUntil.startColumn, endLineNumber: position.lineNumber, endColumn: wordUntil.endColumn } - }); - } - return Promise.resolve({ suggestions: suggestions }); - }; - // ---- END suggest -------------------------------------------------------------------------- - //#region -- word ranges -- - BaseEditorSimpleWorker.prototype.computeWordRanges = function (modelUrl, range, wordDef, wordDefFlags) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(Object.create(null)); - } - var wordDefRegExp = new RegExp(wordDef, wordDefFlags); - var result = Object.create(null); - for (var line = range.startLineNumber; line < range.endLineNumber; line++) { - var words = model.getLineWords(line, wordDefRegExp); - for (var _i = 0, words_1 = words; _i < words_1.length; _i++) { - var word = words_1[_i]; - if (!isNaN(Number(word.word))) { - continue; - } - var array = result[word.word]; - if (!array) { - array = []; - result[word.word] = array; - } - array.push({ - startLineNumber: line, - startColumn: word.startColumn, - endLineNumber: line, - endColumn: word.endColumn - }); - } - } - return Promise.resolve(result); - }; - //#endregion - BaseEditorSimpleWorker.prototype.navigateValueSet = function (modelUrl, range, up, wordDef, wordDefFlags) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(null); - } - var wordDefRegExp = new RegExp(wordDef, wordDefFlags); - if (range.startColumn === range.endColumn) { - range = { - startLineNumber: range.startLineNumber, - startColumn: range.startColumn, - endLineNumber: range.endLineNumber, - endColumn: range.endColumn + 1 - }; - } - var selectionText = model.getValueInRange(range); - var wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp); - if (!wordRange) { - return Promise.resolve(null); - } - var word = model.getValueInRange(wordRange); - var result = _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_11__["BasicInplaceReplace"].INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up); - return Promise.resolve(result); - }; - // ---- BEGIN foreign module support -------------------------------------------------------------------------- - BaseEditorSimpleWorker.prototype.loadForeignModule = function (moduleId, createData) { - var _this = this; - var ctx = { - getMirrorModels: function () { - return _this._getModels(); - } + ChainableEvent.prototype.map = function (fn) { + return new ChainableEvent(map(this.event, fn)); }; - if (this._foreignModuleFactory) { - this._foreignModule = this._foreignModuleFactory(ctx, createData); - // static foreing module - var methods = []; - for (var _i = 0, _a = Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_13__["getAllPropertyNames"])(this._foreignModule); _i < _a.length; _i++) { - var prop = _a[_i]; - if (typeof this._foreignModule[prop] === 'function') { - methods.push(prop); + ChainableEvent.prototype.forEach = function (fn) { + return new ChainableEvent(forEach(this.event, fn)); + }; + ChainableEvent.prototype.filter = function (fn) { + return new ChainableEvent(filter(this.event, fn)); + }; + ChainableEvent.prototype.reduce = function (merge, initial) { + return new ChainableEvent(reduce(this.event, merge, initial)); + }; + ChainableEvent.prototype.latch = function () { + return new ChainableEvent(latch(this.event)); + }; + ChainableEvent.prototype.on = function (listener, thisArgs, disposables) { + return this.event(listener, thisArgs, disposables); + }; + ChainableEvent.prototype.once = function (listener, thisArgs, disposables) { + return once(this.event)(listener, thisArgs, disposables); + }; + return ChainableEvent; + }()); + function chain(event) { + return new ChainableEvent(event); + } + Event.chain = chain; + function fromNodeEventEmitter(emitter, eventName, map) { + if (map === void 0) { map = function (id) { return id; }; } + var fn = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return result.fire(map.apply(void 0, args)); + }; + var onFirstListenerAdd = function () { return emitter.on(eventName, fn); }; + var onLastListenerRemove = function () { return emitter.removeListener(eventName, fn); }; + var result = new event_Emitter({ onFirstListenerAdd: onFirstListenerAdd, onLastListenerRemove: onLastListenerRemove }); + return result.event; + } + Event.fromNodeEventEmitter = fromNodeEventEmitter; + function fromPromise(promise) { + var emitter = new event_Emitter(); + var shouldEmit = false; + promise + .then(undefined, function () { return null; }) + .then(function () { + if (!shouldEmit) { + setTimeout(function () { return emitter.fire(undefined); }, 0); + } + else { + emitter.fire(undefined); + } + }); + shouldEmit = true; + return emitter.event; + } + Event.fromPromise = fromPromise; + function toPromise(event) { + return new Promise(function (c) { return once(event)(c); }); + } + Event.toPromise = toPromise; +})(event_Event || (event_Event = {})); +var _globalLeakWarningThreshold = -1; +var LeakageMonitor = /** @class */ (function () { + function LeakageMonitor(customThreshold, name) { + if (name === void 0) { name = Math.random().toString(18).slice(2, 5); } + this.customThreshold = customThreshold; + this.name = name; + this._warnCountdown = 0; + } + LeakageMonitor.prototype.dispose = function () { + if (this._stacks) { + this._stacks.clear(); + } + }; + LeakageMonitor.prototype.check = function (listenerCount) { + var _this = this; + var threshold = _globalLeakWarningThreshold; + if (typeof this.customThreshold === 'number') { + threshold = this.customThreshold; + } + if (threshold <= 0 || listenerCount < threshold) { + return undefined; + } + if (!this._stacks) { + this._stacks = new Map(); + } + var stack = new Error().stack.split('\n').slice(3).join('\n'); + var count = (this._stacks.get(stack) || 0); + this._stacks.set(stack, count + 1); + this._warnCountdown -= 1; + if (this._warnCountdown <= 0) { + // only warn on first exceed and then every time the limit + // is exceeded by 50% again + this._warnCountdown = threshold * 0.5; + // find most frequent listener and print warning + var topStack_1; + var topCount_1 = 0; + this._stacks.forEach(function (count, stack) { + if (!topStack_1 || topCount_1 < count) { + topStack_1 = stack; + topCount_1 = count; + } + }); + console.warn("[" + this.name + "] potential listener LEAK detected, having " + listenerCount + " listeners already. MOST frequent listener (" + topCount_1 + "):"); + console.warn(topStack_1); + } + return function () { + var count = (_this._stacks.get(stack) || 0); + _this._stacks.set(stack, count - 1); + }; + }; + return LeakageMonitor; +}()); +/** + * The Emitter can be used to expose an Event to the public + * to fire it from the insides. + * Sample: + class Document { + + private _onDidChange = new Emitter<(value:string)=>any>(); + + public onDidChange = this._onDidChange.event; + + // getter-style + // get onDidChange(): Event<(value:string)=>any> { + // return this._onDidChange.event; + // } + + private _doIt() { + //... + this._onDidChange.fire(value); + } + } + */ +var event_Emitter = /** @class */ (function () { + function Emitter(options) { + this._disposed = false; + this._options = options; + this._leakageMon = _globalLeakWarningThreshold > 0 + ? new LeakageMonitor(this._options && this._options.leakWarningThreshold) + : undefined; + } + Object.defineProperty(Emitter.prototype, "event", { + /** + * For the public to allow to subscribe + * to events from this Emitter + */ + get: function () { + var _this = this; + if (!this._event) { + this._event = function (listener, thisArgs, disposables) { + if (!_this._listeners) { + _this._listeners = new linkedList_LinkedList(); + } + var firstListener = _this._listeners.isEmpty(); + if (firstListener && _this._options && _this._options.onFirstListenerAdd) { + _this._options.onFirstListenerAdd(_this); + } + var remove = _this._listeners.push(!thisArgs ? listener : [listener, thisArgs]); + if (firstListener && _this._options && _this._options.onFirstListenerDidAdd) { + _this._options.onFirstListenerDidAdd(_this); + } + if (_this._options && _this._options.onListenerDidAdd) { + _this._options.onListenerDidAdd(_this, listener, thisArgs); + } + // check and record this emitter for potential leakage + var removeMonitor; + if (_this._leakageMon) { + removeMonitor = _this._leakageMon.check(_this._listeners.size); + } + var result; + result = { + dispose: function () { + if (removeMonitor) { + removeMonitor(); + } + result.dispose = Emitter._noop; + if (!_this._disposed) { + remove(); + if (_this._options && _this._options.onLastListenerRemove) { + var hasListeners = (_this._listeners && !_this._listeners.isEmpty()); + if (!hasListeners) { + _this._options.onLastListenerRemove(_this); + } + } + } + } + }; + if (Array.isArray(disposables)) { + disposables.push(result); + } + return result; + }; + } + return this._event; + }, + enumerable: true, + configurable: true + }); + /** + * To be kept private to fire an event to + * subscribers + */ + Emitter.prototype.fire = function (event) { + if (this._listeners) { + // put all [listener,event]-pairs into delivery queue + // then emit all event. an inner/nested event might be + // the driver of this + if (!this._deliveryQueue) { + this._deliveryQueue = new linkedList_LinkedList(); + } + for (var iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) { + this._deliveryQueue.push([e.value, event]); + } + while (this._deliveryQueue.size > 0) { + var _a = this._deliveryQueue.shift(), listener = _a[0], event_1 = _a[1]; + try { + if (typeof listener === 'function') { + listener.call(undefined, event_1); + } + else { + listener[0].call(listener[1], event_1); + } + } + catch (e) { + onUnexpectedError(e); } } - return Promise.resolve(methods); - } - // ESM-comment-begin - // return new Promise((resolve, reject) => { - // require([moduleId], (foreignModule: { create: IForeignModuleFactory }) => { - // this._foreignModule = foreignModule.create(ctx, createData); - // - // let methods: string[] = []; - // for (const prop of getAllPropertyNames(this._foreignModule)) { - // if (typeof this._foreignModule[prop] === 'function') { - // methods.push(prop); - // } - // } - // - // resolve(methods); - // - // }, reject); - // }); - // ESM-comment-end - // ESM-uncomment-begin - return Promise.reject(new Error("Unexpected usage")); - // ESM-uncomment-end - }; - // foreign method request - BaseEditorSimpleWorker.prototype.fmr = function (method, args) { - if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') { - return Promise.reject(new Error('Missing requestHandler or method: ' + method)); - } - try { - return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args)); - } - catch (e) { - return Promise.reject(e); } }; - // ---- END diff -------------------------------------------------------------------------- - // ---- BEGIN minimal edits --------------------------------------------------------------- - BaseEditorSimpleWorker._diffLimit = 100000; - // ---- BEGIN suggest -------------------------------------------------------------------------- - BaseEditorSimpleWorker._suggestionsLimit = 10000; - return BaseEditorSimpleWorker; + Emitter.prototype.dispose = function () { + if (this._listeners) { + this._listeners.clear(); + } + if (this._deliveryQueue) { + this._deliveryQueue.clear(); + } + if (this._leakageMon) { + this._leakageMon.dispose(); + } + this._disposed = true; + }; + Emitter._noop = function () { }; + return Emitter; +}()); + +var event_PauseableEmitter = /** @class */ (function (_super) { + event_extends(PauseableEmitter, _super); + function PauseableEmitter(options) { + var _this = _super.call(this, options) || this; + _this._isPaused = 0; + _this._eventQueue = new linkedList_LinkedList(); + _this._mergeFn = options && options.merge; + return _this; + } + PauseableEmitter.prototype.pause = function () { + this._isPaused++; + }; + PauseableEmitter.prototype.resume = function () { + if (this._isPaused !== 0 && --this._isPaused === 0) { + if (this._mergeFn) { + // use the merge function to create a single composite + // event. make a copy in case firing pauses this emitter + var events = this._eventQueue.toArray(); + this._eventQueue.clear(); + _super.prototype.fire.call(this, this._mergeFn(events)); + } + else { + // no merging, fire each event individually and test + // that this emitter isn't paused halfway through + while (!this._isPaused && this._eventQueue.size !== 0) { + _super.prototype.fire.call(this, this._eventQueue.shift()); + } + } + } + }; + PauseableEmitter.prototype.fire = function (event) { + if (this._listeners) { + if (this._isPaused !== 0) { + this._eventQueue.push(event); + } + else { + _super.prototype.fire.call(this, event); + } + } + }; + return PauseableEmitter; +}(event_Emitter)); + +var event_EventMultiplexer = /** @class */ (function () { + function EventMultiplexer() { + var _this = this; + this.hasListeners = false; + this.events = []; + this.emitter = new event_Emitter({ + onFirstListenerAdd: function () { return _this.onFirstListenerAdd(); }, + onLastListenerRemove: function () { return _this.onLastListenerRemove(); } + }); + } + Object.defineProperty(EventMultiplexer.prototype, "event", { + get: function () { + return this.emitter.event; + }, + enumerable: true, + configurable: true + }); + EventMultiplexer.prototype.add = function (event) { + var _this = this; + var e = { event: event, listener: null }; + this.events.push(e); + if (this.hasListeners) { + this.hook(e); + } + var dispose = function () { + if (_this.hasListeners) { + _this.unhook(e); + } + var idx = _this.events.indexOf(e); + _this.events.splice(idx, 1); + }; + return toDisposable(functional_once(dispose)); + }; + EventMultiplexer.prototype.onFirstListenerAdd = function () { + var _this = this; + this.hasListeners = true; + this.events.forEach(function (e) { return _this.hook(e); }); + }; + EventMultiplexer.prototype.onLastListenerRemove = function () { + var _this = this; + this.hasListeners = false; + this.events.forEach(function (e) { return _this.unhook(e); }); + }; + EventMultiplexer.prototype.hook = function (e) { + var _this = this; + e.listener = e.event(function (r) { return _this.emitter.fire(r); }); + }; + EventMultiplexer.prototype.unhook = function (e) { + if (e.listener) { + e.listener.dispose(); + } + e.listener = null; + }; + EventMultiplexer.prototype.dispose = function () { + this.emitter.dispose(); + }; + return EventMultiplexer; }()); /** - * @internal + * The EventBufferer is useful in situations in which you want + * to delay firing your events during some code. + * You can wrap that code and be sure that the event will not + * be fired during that wrap. + * + * ``` + * const emitter: Emitter; + * const delayer = new EventDelayer(); + * const delayedEvent = delayer.wrapEvent(emitter.event); + * + * delayedEvent(console.log); + * + * delayer.bufferEvents(() => { + * emitter.fire(); // event will not be fired yet + * }); + * + * // event will only be fired at this point + * ``` */ -var EditorSimpleWorkerImpl = /** @class */ (function (_super) { - __extends(EditorSimpleWorkerImpl, _super); - function EditorSimpleWorkerImpl(foreignModuleFactory) { - var _this = _super.call(this, foreignModuleFactory) || this; - _this._models = Object.create(null); - return _this; +var EventBufferer = /** @class */ (function () { + function EventBufferer() { + this.buffers = []; } - EditorSimpleWorkerImpl.prototype.dispose = function () { - this._models = Object.create(null); - }; - EditorSimpleWorkerImpl.prototype._getModel = function (uri) { - return this._models[uri]; - }; - EditorSimpleWorkerImpl.prototype._getModels = function () { + EventBufferer.prototype.wrapEvent = function (event) { var _this = this; - var all = []; - Object.keys(this._models).forEach(function (key) { return all.push(_this._models[key]); }); - return all; + return function (listener, thisArgs, disposables) { + return event(function (i) { + var buffer = _this.buffers[_this.buffers.length - 1]; + if (buffer) { + buffer.push(function () { return listener.call(thisArgs, i); }); + } + else { + listener.call(thisArgs, i); + } + }, undefined, disposables); + }; }; - EditorSimpleWorkerImpl.prototype.acceptNewModel = function (data) { - this._models[data.url] = new MirrorModel(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"].parse(data.url), data.lines, data.EOL, data.versionId); + EventBufferer.prototype.bufferEvents = function (fn) { + var buffer = []; + this.buffers.push(buffer); + var r = fn(); + this.buffers.pop(); + buffer.forEach(function (flush) { return flush(); }); + return r; }; - EditorSimpleWorkerImpl.prototype.acceptModelChanged = function (strURL, e) { - if (!this._models[strURL]) { - return; - } - var model = this._models[strURL]; - model.onEvents(e); - }; - EditorSimpleWorkerImpl.prototype.acceptRemovedModel = function (strURL) { - if (!this._models[strURL]) { - return; - } - delete this._models[strURL]; - }; - return EditorSimpleWorkerImpl; -}(BaseEditorSimpleWorker)); + return EventBufferer; +}()); /** - * Called on the worker side - * @internal + * A Relay is an event forwarder which functions as a replugabble event pipe. + * Once created, you can connect an input event to it and it will simply forward + * events from that input event through its own `event` property. The `input` + * can be changed at any point in time. */ -function create() { - return new EditorSimpleWorkerImpl(null); -} -if (typeof importScripts === 'function') { - // Running in a web worker - _base_common_platform_js__WEBPACK_IMPORTED_MODULE_3__["globals"].monaco = Object(_standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_12__["createMonacoBaseAPI"])(); -} +var event_Relay = /** @class */ (function () { + function Relay() { + var _this = this; + this.listening = false; + this.inputEvent = event_Event.None; + this.inputEventListener = Disposable.None; + this.emitter = new event_Emitter({ + onFirstListenerDidAdd: function () { + _this.listening = true; + _this.inputEventListener = _this.inputEvent(_this.emitter.fire, _this.emitter); + }, + onLastListenerRemove: function () { + _this.listening = false; + _this.inputEventListener.dispose(); + } + }); + this.event = this.emitter.event; + } + Object.defineProperty(Relay.prototype, "input", { + set: function (event) { + this.inputEvent = event; + if (this.listening) { + this.inputEventListener.dispose(); + this.inputEventListener = event(this.emitter.fire, this.emitter); + } + }, + enumerable: true, + configurable: true + }); + Relay.prototype.dispose = function () { + this.inputEventListener.dispose(); + this.emitter.dispose(); + }; + return Relay; +}()); -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js ***! - \*************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/*! -Copyright (c) 2014 Taylor Hakes -Copyright (c) 2014 Forbes Lindesay - */ -(function (global, factory) { - true ? factory() : - undefined; -}(this, (function () { - 'use strict'; - - /** - * @this {Promise} - */ - function finallyConstructor(callback) { - var constructor = this.constructor; - return this.then( - function (value) { - return constructor.resolve(callback()).then(function () { - return value; - }); - }, - function (reason) { - return constructor.resolve(callback()).then(function () { - return constructor.reject(reason); - }); - } - ); - } - - // Store setTimeout reference so promise-polyfill will be unaffected by - // other code modifying setTimeout (like sinon.useFakeTimers()) - var setTimeoutFunc = setTimeout; - - function noop() { } - - // Polyfill for Function.prototype.bind - function bind(fn, thisArg) { - return function () { - fn.apply(thisArg, arguments); - }; - } - - /** - * @constructor - * @param {Function} fn - */ - function Promise(fn) { - if (!(this instanceof Promise)) - throw new TypeError('Promises must be constructed via new'); - if (typeof fn !== 'function') throw new TypeError('not a function'); - /** @type {!number} */ - this._state = 0; - /** @type {!boolean} */ - this._handled = false; - /** @type {Promise|undefined} */ - this._value = undefined; - /** @type {!Array} */ - this._deferreds = []; - - doResolve(fn, this); - } - - function handle(self, deferred) { - while (self._state === 3) { - self = self._value; - } - if (self._state === 0) { - self._deferreds.push(deferred); - return; - } - self._handled = true; - Promise._immediateFn(function () { - var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; - if (cb === null) { - (self._state === 1 ? resolve : reject)(deferred.promise, self._value); - return; - } - var ret; - try { - ret = cb(self._value); - } catch (e) { - reject(deferred.promise, e); - return; - } - resolve(deferred.promise, ret); - }); - } - - function resolve(self, newValue) { - try { - // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure - if (newValue === self) - throw new TypeError('A promise cannot be resolved with itself.'); - if ( - newValue && - (typeof newValue === 'object' || typeof newValue === 'function') - ) { - var then = newValue.then; - if (newValue instanceof Promise) { - self._state = 3; - self._value = newValue; - finale(self); - return; - } else if (typeof then === 'function') { - doResolve(bind(then, newValue), self); - return; - } - } - self._state = 1; - self._value = newValue; - finale(self); - } catch (e) { - reject(self, e); - } - } - - function reject(self, newValue) { - self._state = 2; - self._value = newValue; - finale(self); - } - - function finale(self) { - if (self._state === 2 && self._deferreds.length === 0) { - Promise._immediateFn(function () { - if (!self._handled) { - Promise._unhandledRejectionFn(self._value); - } - }); - } - - for (var i = 0, len = self._deferreds.length; i < len; i++) { - handle(self, self._deferreds[i]); - } - self._deferreds = null; - } - - /** - * @constructor - */ - function Handler(onFulfilled, onRejected, promise) { - this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; - this.onRejected = typeof onRejected === 'function' ? onRejected : null; - this.promise = promise; - } - - /** - * Take a potentially misbehaving resolver function and make sure - * onFulfilled and onRejected are only called once. - * - * Makes no guarantees about asynchrony. - */ - function doResolve(fn, self) { - var done = false; - try { - fn( - function (value) { - if (done) return; - done = true; - resolve(self, value); - }, - function (reason) { - if (done) return; - done = true; - reject(self, reason); - } - ); - } catch (ex) { - if (done) return; - done = true; - reject(self, ex); - } - } - - Promise.prototype['catch'] = function (onRejected) { - return this.then(null, onRejected); - }; - - Promise.prototype.then = function (onFulfilled, onRejected) { - // @ts-ignore - var prom = new this.constructor(noop); - - handle(this, new Handler(onFulfilled, onRejected, prom)); - return prom; - }; - - Promise.prototype['finally'] = finallyConstructor; - - Promise.all = function (arr) { - return new Promise(function (resolve, reject) { - if (!arr || typeof arr.length === 'undefined') - throw new TypeError('Promise.all accepts an array'); - var args = Array.prototype.slice.call(arr); - if (args.length === 0) return resolve([]); - var remaining = args.length; - - function res(i, val) { - try { - if (val && (typeof val === 'object' || typeof val === 'function')) { - var then = val.then; - if (typeof then === 'function') { - then.call( - val, - function (val) { - res(i, val); - }, - reject - ); - return; - } - } - args[i] = val; - if (--remaining === 0) { - resolve(args); - } - } catch (ex) { - reject(ex); - } - } - - for (var i = 0; i < args.length; i++) { - res(i, args[i]); - } - }); - }; - - Promise.resolve = function (value) { - if (value && typeof value === 'object' && value.constructor === Promise) { - return value; - } - - return new Promise(function (resolve) { - resolve(value); - }); - }; - - Promise.reject = function (value) { - return new Promise(function (resolve, reject) { - reject(value); - }); - }; - - Promise.race = function (values) { - return new Promise(function (resolve, reject) { - for (var i = 0, len = values.length; i < len; i++) { - values[i].then(resolve, reject); - } - }); - }; - - // Use polyfill for setImmediate for performance gains - Promise._immediateFn = - (typeof setImmediate === 'function' && - function (fn) { - setImmediate(fn); - }) || - function (fn) { - setTimeoutFunc(fn, 0); - }; - - Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { - if (typeof console !== 'undefined' && console) { - console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console - } - }; - - /** @suppress {undefinedVars} */ - var globalNS = (function () { - // the only reliable means to get the global object is - // `Function('return this')()` - // However, this causes CSP violations in Chrome apps. - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('unable to locate global object'); - })(); - - if (!('Promise' in globalNS)) { - globalNS['Promise'] = Promise; - } else if (!globalNS.Promise.prototype['finally']) { - globalNS.Promise.prototype['finally'] = finallyConstructor; - } - -}))); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js ***! - \**************************************************************************************/ -/*! exports provided: KeyMod, createMonacoBaseAPI */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyMod", function() { return KeyMod; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMonacoBaseAPI", function() { return createMonacoBaseAPI; }); -/* harmony import */ var _promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./promise-polyfill/polyfill.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js"); -/* harmony import */ var _promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _core_token_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../core/token.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js"); -/* harmony import */ var _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./standaloneEnums.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/cancellation.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - - - - - - - - - -var KeyMod = /** @class */ (function () { - function KeyMod() { +var shortcutEvent = Object.freeze(function (callback, context) { + var handle = setTimeout(callback.bind(context), 0); + return { dispose: function () { clearTimeout(handle); } }; +}); +var cancellation_CancellationToken; +(function (CancellationToken) { + function isCancellationToken(thing) { + if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) { + return true; + } + if (thing instanceof cancellation_MutableToken) { + return true; + } + if (!thing || typeof thing !== 'object') { + return false; + } + return typeof thing.isCancellationRequested === 'boolean' + && typeof thing.onCancellationRequested === 'function'; } - KeyMod.chord = function (firstPart, secondPart) { - return Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_3__["KeyChord"])(firstPart, secondPart); + CancellationToken.isCancellationToken = isCancellationToken; + CancellationToken.None = Object.freeze({ + isCancellationRequested: false, + onCancellationRequested: event_Event.None + }); + CancellationToken.Cancelled = Object.freeze({ + isCancellationRequested: true, + onCancellationRequested: shortcutEvent + }); +})(cancellation_CancellationToken || (cancellation_CancellationToken = {})); +var cancellation_MutableToken = /** @class */ (function () { + function MutableToken() { + this._isCancelled = false; + this._emitter = null; + } + MutableToken.prototype.cancel = function () { + if (!this._isCancelled) { + this._isCancelled = true; + if (this._emitter) { + this._emitter.fire(undefined); + this.dispose(); + } + } }; - KeyMod.CtrlCmd = 2048 /* CtrlCmd */; - KeyMod.Shift = 1024 /* Shift */; - KeyMod.Alt = 512 /* Alt */; - KeyMod.WinCtrl = 256 /* WinCtrl */; - return KeyMod; + Object.defineProperty(MutableToken.prototype, "isCancellationRequested", { + get: function () { + return this._isCancelled; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MutableToken.prototype, "onCancellationRequested", { + get: function () { + if (this._isCancelled) { + return shortcutEvent; + } + if (!this._emitter) { + this._emitter = new event_Emitter(); + } + return this._emitter.event; + }, + enumerable: true, + configurable: true + }); + MutableToken.prototype.dispose = function () { + if (this._emitter) { + this._emitter.dispose(); + this._emitter = null; + } + }; + return MutableToken; +}()); +var CancellationTokenSource = /** @class */ (function () { + function CancellationTokenSource(parent) { + this._token = undefined; + this._parentListener = undefined; + this._parentListener = parent && parent.onCancellationRequested(this.cancel, this); + } + Object.defineProperty(CancellationTokenSource.prototype, "token", { + get: function () { + if (!this._token) { + // be lazy and create the token only when + // actually needed + this._token = new cancellation_MutableToken(); + } + return this._token; + }, + enumerable: true, + configurable: true + }); + CancellationTokenSource.prototype.cancel = function () { + if (!this._token) { + // save an object by returning the default + // cancelled token when cancellation happens + // before someone asks for the token + this._token = cancellation_CancellationToken.Cancelled; + } + else if (this._token instanceof cancellation_MutableToken) { + // actually cancel + this._token.cancel(); + } + }; + CancellationTokenSource.prototype.dispose = function () { + if (this._parentListener) { + this._parentListener.dispose(); + } + if (!this._token) { + // ensure to initialize with an empty token if we had none + this._token = cancellation_CancellationToken.None; + } + else if (this._token instanceof cancellation_MutableToken) { + // actually dispose + this._token.dispose(); + } + }; + return CancellationTokenSource; }()); -function createMonacoBaseAPI() { - return { - editor: undefined, - languages: undefined, - CancellationTokenSource: _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationTokenSource"], - Emitter: _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"], - KeyCode: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["KeyCode"], - KeyMod: KeyMod, - Position: _core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"], - Range: _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"], - Selection: _core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"], - SelectionDirection: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["SelectionDirection"], - MarkerSeverity: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["MarkerSeverity"], - MarkerTag: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["MarkerTag"], - Uri: _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"], - Token: _core_token_js__WEBPACK_IMPORTED_MODULE_8__["Token"] + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var KeyCodeStrMap = /** @class */ (function () { + function KeyCodeStrMap() { + this._keyCodeToStr = []; + this._strToKeyCode = Object.create(null); + } + KeyCodeStrMap.prototype.define = function (keyCode, str) { + this._keyCodeToStr[keyCode] = str; + this._strToKeyCode[str.toLowerCase()] = keyCode; }; + KeyCodeStrMap.prototype.keyCodeToStr = function (keyCode) { + return this._keyCodeToStr[keyCode]; + }; + KeyCodeStrMap.prototype.strToKeyCode = function (str) { + return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */; + }; + return KeyCodeStrMap; +}()); +var uiMap = new KeyCodeStrMap(); +var userSettingsUSMap = new KeyCodeStrMap(); +var userSettingsGeneralMap = new KeyCodeStrMap(); +(function () { + function define(keyCode, uiLabel, usUserSettingsLabel, generalUserSettingsLabel) { + if (usUserSettingsLabel === void 0) { usUserSettingsLabel = uiLabel; } + if (generalUserSettingsLabel === void 0) { generalUserSettingsLabel = usUserSettingsLabel; } + uiMap.define(keyCode, uiLabel); + userSettingsUSMap.define(keyCode, usUserSettingsLabel); + userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel); + } + define(0 /* Unknown */, 'unknown'); + define(1 /* Backspace */, 'Backspace'); + define(2 /* Tab */, 'Tab'); + define(3 /* Enter */, 'Enter'); + define(4 /* Shift */, 'Shift'); + define(5 /* Ctrl */, 'Ctrl'); + define(6 /* Alt */, 'Alt'); + define(7 /* PauseBreak */, 'PauseBreak'); + define(8 /* CapsLock */, 'CapsLock'); + define(9 /* Escape */, 'Escape'); + define(10 /* Space */, 'Space'); + define(11 /* PageUp */, 'PageUp'); + define(12 /* PageDown */, 'PageDown'); + define(13 /* End */, 'End'); + define(14 /* Home */, 'Home'); + define(15 /* LeftArrow */, 'LeftArrow', 'Left'); + define(16 /* UpArrow */, 'UpArrow', 'Up'); + define(17 /* RightArrow */, 'RightArrow', 'Right'); + define(18 /* DownArrow */, 'DownArrow', 'Down'); + define(19 /* Insert */, 'Insert'); + define(20 /* Delete */, 'Delete'); + define(21 /* KEY_0 */, '0'); + define(22 /* KEY_1 */, '1'); + define(23 /* KEY_2 */, '2'); + define(24 /* KEY_3 */, '3'); + define(25 /* KEY_4 */, '4'); + define(26 /* KEY_5 */, '5'); + define(27 /* KEY_6 */, '6'); + define(28 /* KEY_7 */, '7'); + define(29 /* KEY_8 */, '8'); + define(30 /* KEY_9 */, '9'); + define(31 /* KEY_A */, 'A'); + define(32 /* KEY_B */, 'B'); + define(33 /* KEY_C */, 'C'); + define(34 /* KEY_D */, 'D'); + define(35 /* KEY_E */, 'E'); + define(36 /* KEY_F */, 'F'); + define(37 /* KEY_G */, 'G'); + define(38 /* KEY_H */, 'H'); + define(39 /* KEY_I */, 'I'); + define(40 /* KEY_J */, 'J'); + define(41 /* KEY_K */, 'K'); + define(42 /* KEY_L */, 'L'); + define(43 /* KEY_M */, 'M'); + define(44 /* KEY_N */, 'N'); + define(45 /* KEY_O */, 'O'); + define(46 /* KEY_P */, 'P'); + define(47 /* KEY_Q */, 'Q'); + define(48 /* KEY_R */, 'R'); + define(49 /* KEY_S */, 'S'); + define(50 /* KEY_T */, 'T'); + define(51 /* KEY_U */, 'U'); + define(52 /* KEY_V */, 'V'); + define(53 /* KEY_W */, 'W'); + define(54 /* KEY_X */, 'X'); + define(55 /* KEY_Y */, 'Y'); + define(56 /* KEY_Z */, 'Z'); + define(57 /* Meta */, 'Meta'); + define(58 /* ContextMenu */, 'ContextMenu'); + define(59 /* F1 */, 'F1'); + define(60 /* F2 */, 'F2'); + define(61 /* F3 */, 'F3'); + define(62 /* F4 */, 'F4'); + define(63 /* F5 */, 'F5'); + define(64 /* F6 */, 'F6'); + define(65 /* F7 */, 'F7'); + define(66 /* F8 */, 'F8'); + define(67 /* F9 */, 'F9'); + define(68 /* F10 */, 'F10'); + define(69 /* F11 */, 'F11'); + define(70 /* F12 */, 'F12'); + define(71 /* F13 */, 'F13'); + define(72 /* F14 */, 'F14'); + define(73 /* F15 */, 'F15'); + define(74 /* F16 */, 'F16'); + define(75 /* F17 */, 'F17'); + define(76 /* F18 */, 'F18'); + define(77 /* F19 */, 'F19'); + define(78 /* NumLock */, 'NumLock'); + define(79 /* ScrollLock */, 'ScrollLock'); + define(80 /* US_SEMICOLON */, ';', ';', 'OEM_1'); + define(81 /* US_EQUAL */, '=', '=', 'OEM_PLUS'); + define(82 /* US_COMMA */, ',', ',', 'OEM_COMMA'); + define(83 /* US_MINUS */, '-', '-', 'OEM_MINUS'); + define(84 /* US_DOT */, '.', '.', 'OEM_PERIOD'); + define(85 /* US_SLASH */, '/', '/', 'OEM_2'); + define(86 /* US_BACKTICK */, '`', '`', 'OEM_3'); + define(110 /* ABNT_C1 */, 'ABNT_C1'); + define(111 /* ABNT_C2 */, 'ABNT_C2'); + define(87 /* US_OPEN_SQUARE_BRACKET */, '[', '[', 'OEM_4'); + define(88 /* US_BACKSLASH */, '\\', '\\', 'OEM_5'); + define(89 /* US_CLOSE_SQUARE_BRACKET */, ']', ']', 'OEM_6'); + define(90 /* US_QUOTE */, '\'', '\'', 'OEM_7'); + define(91 /* OEM_8 */, 'OEM_8'); + define(92 /* OEM_102 */, 'OEM_102'); + define(93 /* NUMPAD_0 */, 'NumPad0'); + define(94 /* NUMPAD_1 */, 'NumPad1'); + define(95 /* NUMPAD_2 */, 'NumPad2'); + define(96 /* NUMPAD_3 */, 'NumPad3'); + define(97 /* NUMPAD_4 */, 'NumPad4'); + define(98 /* NUMPAD_5 */, 'NumPad5'); + define(99 /* NUMPAD_6 */, 'NumPad6'); + define(100 /* NUMPAD_7 */, 'NumPad7'); + define(101 /* NUMPAD_8 */, 'NumPad8'); + define(102 /* NUMPAD_9 */, 'NumPad9'); + define(103 /* NUMPAD_MULTIPLY */, 'NumPad_Multiply'); + define(104 /* NUMPAD_ADD */, 'NumPad_Add'); + define(105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator'); + define(106 /* NUMPAD_SUBTRACT */, 'NumPad_Subtract'); + define(107 /* NUMPAD_DECIMAL */, 'NumPad_Decimal'); + define(108 /* NUMPAD_DIVIDE */, 'NumPad_Divide'); +})(); +var KeyCodeUtils; +(function (KeyCodeUtils) { + function toString(keyCode) { + return uiMap.keyCodeToStr(keyCode); + } + KeyCodeUtils.toString = toString; + function fromString(key) { + return uiMap.strToKeyCode(key); + } + KeyCodeUtils.fromString = fromString; + function toUserSettingsUS(keyCode) { + return userSettingsUSMap.keyCodeToStr(keyCode); + } + KeyCodeUtils.toUserSettingsUS = toUserSettingsUS; + function toUserSettingsGeneral(keyCode) { + return userSettingsGeneralMap.keyCodeToStr(keyCode); + } + KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral; + function fromUserSettings(key) { + return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); + } + KeyCodeUtils.fromUserSettings = fromUserSettings; +})(KeyCodeUtils || (KeyCodeUtils = {})); +function KeyChord(firstPart, secondPart) { + var chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0; + return (firstPart | chordPart) >>> 0; } +function createKeybinding(keybinding, OS) { + if (keybinding === 0) { + return null; + } + var firstPart = (keybinding & 0x0000FFFF) >>> 0; + var chordPart = (keybinding & 0xFFFF0000) >>> 16; + if (chordPart !== 0) { + return new keyCodes_ChordKeybinding([ + createSimpleKeybinding(firstPart, OS), + createSimpleKeybinding(chordPart, OS) + ]); + } + return new keyCodes_ChordKeybinding([createSimpleKeybinding(firstPart, OS)]); +} +function createSimpleKeybinding(keybinding, OS) { + var ctrlCmd = (keybinding & 2048 /* CtrlCmd */ ? true : false); + var winCtrl = (keybinding & 256 /* WinCtrl */ ? true : false); + var ctrlKey = (OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd); + var shiftKey = (keybinding & 1024 /* Shift */ ? true : false); + var altKey = (keybinding & 512 /* Alt */ ? true : false); + var metaKey = (OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl); + var keyCode = (keybinding & 255 /* KeyCode */); + return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode); +} +var SimpleKeybinding = /** @class */ (function () { + function SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode) { + this.ctrlKey = ctrlKey; + this.shiftKey = shiftKey; + this.altKey = altKey; + this.metaKey = metaKey; + this.keyCode = keyCode; + } + SimpleKeybinding.prototype.equals = function (other) { + return (this.ctrlKey === other.ctrlKey + && this.shiftKey === other.shiftKey + && this.altKey === other.altKey + && this.metaKey === other.metaKey + && this.keyCode === other.keyCode); + }; + SimpleKeybinding.prototype.isModifierKey = function () { + return (this.keyCode === 0 /* Unknown */ + || this.keyCode === 5 /* Ctrl */ + || this.keyCode === 57 /* Meta */ + || this.keyCode === 6 /* Alt */ + || this.keyCode === 4 /* Shift */); + }; + SimpleKeybinding.prototype.toChord = function () { + return new keyCodes_ChordKeybinding([this]); + }; + /** + * Does this keybinding refer to the key code of a modifier and it also has the modifier flag? + */ + SimpleKeybinding.prototype.isDuplicateModifierCase = function () { + return ((this.ctrlKey && this.keyCode === 5 /* Ctrl */) + || (this.shiftKey && this.keyCode === 4 /* Shift */) + || (this.altKey && this.keyCode === 6 /* Alt */) + || (this.metaKey && this.keyCode === 57 /* Meta */)); + }; + return SimpleKeybinding; +}()); + +var keyCodes_ChordKeybinding = /** @class */ (function () { + function ChordKeybinding(parts) { + if (parts.length === 0) { + throw illegalArgument("parts"); + } + this.parts = parts; + } + ChordKeybinding.prototype.equals = function (other) { + if (other === null) { + return false; + } + if (this.parts.length !== other.parts.length) { + return false; + } + for (var i = 0; i < this.parts.length; i++) { + if (!this.parts[i].equals(other.parts[i])) { + return false; + } + } + return true; + }; + return ChordKeybinding; +}()); + +var ResolvedKeybindingPart = /** @class */ (function () { + function ResolvedKeybindingPart(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) { + this.ctrlKey = ctrlKey; + this.shiftKey = shiftKey; + this.altKey = altKey; + this.metaKey = metaKey; + this.keyLabel = kbLabel; + this.keyAriaLabel = kbAriaLabel; + } + return ResolvedKeybindingPart; +}()); + +/** + * A resolved keybinding. Can be a simple keybinding or a chord keybinding. + */ +var ResolvedKeybinding = /** @class */ (function () { + function ResolvedKeybinding() { + } + return ResolvedKeybinding; +}()); -/***/ }), +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var selection_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js ***! - \***************************************************************************************/ -/*! exports provided: MarkerTag, MarkerSeverity, KeyCode, SelectionDirection, ScrollbarVisibility, OverviewRulerLane, EndOfLinePreference, DefaultEndOfLine, EndOfLineSequence, TrackedRangeStickiness, ScrollType, CursorChangeReason, RenderMinimap, WrappingIndent, TextEditorCursorBlinkingStyle, TextEditorCursorStyle, RenderLineNumbersType, ContentWidgetPositionPreference, OverlayWidgetPositionPreference, MouseTargetType, IndentAction, CompletionItemKind, CompletionItemInsertTextRule, CompletionTriggerKind, SignatureHelpTriggerKind, DocumentHighlightKind, SymbolKind */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerTag", function() { return MarkerTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerSeverity", function() { return MarkerSeverity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCode", function() { return KeyCode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionDirection", function() { return SelectionDirection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollbarVisibility", function() { return ScrollbarVisibility; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverviewRulerLane", function() { return OverviewRulerLane; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLinePreference", function() { return EndOfLinePreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultEndOfLine", function() { return DefaultEndOfLine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLineSequence", function() { return EndOfLineSequence; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackedRangeStickiness", function() { return TrackedRangeStickiness; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollType", function() { return ScrollType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorChangeReason", function() { return CursorChangeReason; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderMinimap", function() { return RenderMinimap; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WrappingIndent", function() { return WrappingIndent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorBlinkingStyle", function() { return TextEditorCursorBlinkingStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorStyle", function() { return TextEditorCursorStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderLineNumbersType", function() { return RenderLineNumbersType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentWidgetPositionPreference", function() { return ContentWidgetPositionPreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverlayWidgetPositionPreference", function() { return OverlayWidgetPositionPreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MouseTargetType", function() { return MouseTargetType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentAction", function() { return IndentAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemInsertTextRule", function() { return CompletionItemInsertTextRule; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionTriggerKind", function() { return CompletionTriggerKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureHelpTriggerKind", function() { return SignatureHelpTriggerKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; }); +/** + * A selection in the editor. + * The selection is a range that has an orientation. + */ +var selection_Selection = /** @class */ (function (_super) { + selection_extends(Selection, _super); + function Selection(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) { + var _this = _super.call(this, selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) || this; + _this.selectionStartLineNumber = selectionStartLineNumber; + _this.selectionStartColumn = selectionStartColumn; + _this.positionLineNumber = positionLineNumber; + _this.positionColumn = positionColumn; + return _this; + } + /** + * Clone this selection. + */ + Selection.prototype.clone = function () { + return new Selection(this.selectionStartLineNumber, this.selectionStartColumn, this.positionLineNumber, this.positionColumn); + }; + /** + * Transform to a human-readable representation. + */ + Selection.prototype.toString = function () { + return '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']'; + }; + /** + * Test if equals other selection. + */ + Selection.prototype.equalsSelection = function (other) { + return (Selection.selectionsEqual(this, other)); + }; + /** + * Test if the two selections are equal. + */ + Selection.selectionsEqual = function (a, b) { + return (a.selectionStartLineNumber === b.selectionStartLineNumber && + a.selectionStartColumn === b.selectionStartColumn && + a.positionLineNumber === b.positionLineNumber && + a.positionColumn === b.positionColumn); + }; + /** + * Get directions (LTR or RTL). + */ + Selection.prototype.getDirection = function () { + if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) { + return 0 /* LTR */; + } + return 1 /* RTL */; + }; + /** + * Create a new selection with a different `positionLineNumber` and `positionColumn`. + */ + Selection.prototype.setEndPosition = function (endLineNumber, endColumn) { + if (this.getDirection() === 0 /* LTR */) { + return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn); + } + return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn); + }; + /** + * Get the position at `positionLineNumber` and `positionColumn`. + */ + Selection.prototype.getPosition = function () { + return new Position(this.positionLineNumber, this.positionColumn); + }; + /** + * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. + */ + Selection.prototype.setStartPosition = function (startLineNumber, startColumn) { + if (this.getDirection() === 0 /* LTR */) { + return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn); + } + return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn); + }; + // ---- + /** + * Create a `Selection` from one or two positions + */ + Selection.fromPositions = function (start, end) { + if (end === void 0) { end = start; } + return new Selection(start.lineNumber, start.column, end.lineNumber, end.column); + }; + /** + * Create a `Selection` from an `ISelection`. + */ + Selection.liftSelection = function (sel) { + return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn); + }; + /** + * `a` equals `b`. + */ + Selection.selectionsArrEqual = function (a, b) { + if (a && !b || !a && b) { + return false; + } + if (!a && !b) { + return true; + } + if (a.length !== b.length) { + return false; + } + for (var i = 0, len = a.length; i < len; i++) { + if (!this.selectionsEqual(a[i], b[i])) { + return false; + } + } + return true; + }; + /** + * Test if `obj` is an `ISelection`. + */ + Selection.isISelection = function (obj) { + return (obj + && (typeof obj.selectionStartLineNumber === 'number') + && (typeof obj.selectionStartColumn === 'number') + && (typeof obj.positionLineNumber === 'number') + && (typeof obj.positionColumn === 'number')); + }; + /** + * Create with a direction. + */ + Selection.createWithDirection = function (startLineNumber, startColumn, endLineNumber, endColumn, direction) { + if (direction === 0 /* LTR */) { + return new Selection(startLineNumber, startColumn, endLineNumber, endColumn); + } + return new Selection(endLineNumber, endColumn, startLineNumber, startColumn); + }; + return Selection; +}(range_Range)); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/token.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var Token = /** @class */ (function () { + function Token(offset, type, language) { + this.offset = offset | 0; // @perf + this.type = type; + this.language = language; + } + Token.prototype.toString = function () { + return '(' + this.offset + ', ' + this.type + ')'; + }; + return Token; +}()); + +var TokenizationResult = /** @class */ (function () { + function TokenizationResult(tokens, endState) { + this.tokens = tokens; + this.endState = endState; + } + return TokenizationResult; +}()); + +var TokenizationResult2 = /** @class */ (function () { + function TokenizationResult2(tokens, endState) { + this.tokens = tokens; + this.endState = endState; + } + return TokenizationResult2; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -8151,238 +6909,604 @@ var SymbolKind; SymbolKind[SymbolKind["TypeParameter"] = 25] = "TypeParameter"; })(SymbolKind || (SymbolKind = {})); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js ***! - \****************************************************************************************/ -/*! exports provided: PrefixSumIndexOfResult, PrefixSumComputer, PrefixSumComputerWithCache */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumIndexOfResult", function() { return PrefixSumIndexOfResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumComputer", function() { return PrefixSumComputer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumComputerWithCache", function() { return PrefixSumComputerWithCache; }); -/* harmony import */ var _core_uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/uint.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var PrefixSumIndexOfResult = /** @class */ (function () { - function PrefixSumIndexOfResult(index, remainder) { - this.index = index; - this.remainder = remainder; + + + + + + + + + +var standaloneBase_KeyMod = /** @class */ (function () { + function KeyMod() { } - return PrefixSumIndexOfResult; + KeyMod.chord = function (firstPart, secondPart) { + return KeyChord(firstPart, secondPart); + }; + KeyMod.CtrlCmd = 2048 /* CtrlCmd */; + KeyMod.Shift = 1024 /* Shift */; + KeyMod.Alt = 512 /* Alt */; + KeyMod.WinCtrl = 256 /* WinCtrl */; + return KeyMod; }()); -var PrefixSumComputer = /** @class */ (function () { - function PrefixSumComputer(values) { - this.values = values; - this.prefixSum = new Uint32Array(values.length); - this.prefixSumValidIndex = new Int32Array(1); - this.prefixSumValidIndex[0] = -1; +function createMonacoBaseAPI() { + return { + editor: undefined, + languages: undefined, + CancellationTokenSource: CancellationTokenSource, + Emitter: event_Emitter, + KeyCode: KeyCode, + KeyMod: standaloneBase_KeyMod, + Position: Position, + Range: range_Range, + Selection: selection_Selection, + SelectionDirection: SelectionDirection, + MarkerSeverity: MarkerSeverity, + MarkerTag: MarkerTag, + Uri: uri_URI, + Token: Token + }; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var editorSimpleWorker_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + + + + + + + + + + + +/** + * @internal + */ +var editorSimpleWorker_MirrorModel = /** @class */ (function (_super) { + editorSimpleWorker_extends(MirrorModel, _super); + function MirrorModel() { + return _super !== null && _super.apply(this, arguments) || this; } - PrefixSumComputer.prototype.getCount = function () { - return this.values.length; + Object.defineProperty(MirrorModel.prototype, "uri", { + get: function () { + return this._uri; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MirrorModel.prototype, "version", { + get: function () { + return this._versionId; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MirrorModel.prototype, "eol", { + get: function () { + return this._eol; + }, + enumerable: true, + configurable: true + }); + MirrorModel.prototype.getValue = function () { + return this.getText(); }; - PrefixSumComputer.prototype.insertValues = function (insertIndex, insertValues) { - insertIndex = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(insertIndex); - var oldValues = this.values; - var oldPrefixSum = this.prefixSum; - var insertValuesLen = insertValues.length; - if (insertValuesLen === 0) { - return false; - } - this.values = new Uint32Array(oldValues.length + insertValuesLen); - this.values.set(oldValues.subarray(0, insertIndex), 0); - this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen); - this.values.set(insertValues, insertIndex); - if (insertIndex - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = insertIndex - 1; - } - this.prefixSum = new Uint32Array(this.values.length); - if (this.prefixSumValidIndex[0] >= 0) { - this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); - } - return true; + MirrorModel.prototype.getLinesContent = function () { + return this._lines.slice(0); }; - PrefixSumComputer.prototype.changeValue = function (index, value) { - index = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index); - value = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(value); - if (this.values[index] === value) { - return false; - } - this.values[index] = value; - if (index - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = index - 1; - } - return true; + MirrorModel.prototype.getLineCount = function () { + return this._lines.length; }; - PrefixSumComputer.prototype.removeValues = function (startIndex, cnt) { - startIndex = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(startIndex); - cnt = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(cnt); - var oldValues = this.values; - var oldPrefixSum = this.prefixSum; - if (startIndex >= oldValues.length) { - return false; - } - var maxCnt = oldValues.length - startIndex; - if (cnt >= maxCnt) { - cnt = maxCnt; - } - if (cnt === 0) { - return false; - } - this.values = new Uint32Array(oldValues.length - cnt); - this.values.set(oldValues.subarray(0, startIndex), 0); - this.values.set(oldValues.subarray(startIndex + cnt), startIndex); - this.prefixSum = new Uint32Array(this.values.length); - if (startIndex - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = startIndex - 1; - } - if (this.prefixSumValidIndex[0] >= 0) { - this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); - } - return true; + MirrorModel.prototype.getLineContent = function (lineNumber) { + return this._lines[lineNumber - 1]; }; - PrefixSumComputer.prototype.getTotalValue = function () { - if (this.values.length === 0) { - return 0; + MirrorModel.prototype.getWordAtPosition = function (position, wordDefinition) { + var wordAtText = getWordAtText(position.column, ensureValidWordDefinition(wordDefinition), this._lines[position.lineNumber - 1], 0); + if (wordAtText) { + return new range_Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn); } - return this._getAccumulatedValue(this.values.length - 1); + return null; }; - PrefixSumComputer.prototype.getAccumulatedValue = function (index) { - if (index < 0) { - return 0; + MirrorModel.prototype.getWordUntilPosition = function (position, wordDefinition) { + var wordAtPosition = this.getWordAtPosition(position, wordDefinition); + if (!wordAtPosition) { + return { + word: '', + startColumn: position.column, + endColumn: position.column + }; } - index = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index); - return this._getAccumulatedValue(index); + return { + word: this._lines[position.lineNumber - 1].substring(wordAtPosition.startColumn - 1, position.column - 1), + startColumn: wordAtPosition.startColumn, + endColumn: position.column + }; }; - PrefixSumComputer.prototype._getAccumulatedValue = function (index) { - if (index <= this.prefixSumValidIndex[0]) { - return this.prefixSum[index]; - } - var startIndex = this.prefixSumValidIndex[0] + 1; - if (startIndex === 0) { - this.prefixSum[0] = this.values[0]; - startIndex++; - } - if (index >= this.values.length) { - index = this.values.length - 1; - } - for (var i = startIndex; i <= index; i++) { - this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i]; - } - this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index); - return this.prefixSum[index]; - }; - PrefixSumComputer.prototype.getIndexOf = function (accumulatedValue) { - accumulatedValue = Math.floor(accumulatedValue); //@perf - // Compute all sums (to get a fully valid prefixSum) - this.getTotalValue(); - var low = 0; - var high = this.values.length - 1; - var mid = 0; - var midStop = 0; - var midStart = 0; - while (low <= high) { - mid = low + ((high - low) / 2) | 0; - midStop = this.prefixSum[mid]; - midStart = midStop - this.values[mid]; - if (accumulatedValue < midStart) { - high = mid - 1; + MirrorModel.prototype.createWordIterator = function (wordDefinition) { + var _this = this; + var obj; + var lineNumber = 0; + var lineText; + var wordRangesIdx = 0; + var wordRanges = []; + var next = function () { + if (wordRangesIdx < wordRanges.length) { + var value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end); + wordRangesIdx += 1; + if (!obj) { + obj = { done: false, value: value }; + } + else { + obj.value = value; + } + return obj; } - else if (accumulatedValue >= midStop) { - low = mid + 1; + else if (lineNumber >= _this._lines.length) { + return FIN; } else { + lineText = _this._lines[lineNumber]; + wordRanges = _this._wordenize(lineText, wordDefinition); + wordRangesIdx = 0; + lineNumber += 1; + return next(); + } + }; + return { next: next }; + }; + MirrorModel.prototype.getLineWords = function (lineNumber, wordDefinition) { + var content = this._lines[lineNumber - 1]; + var ranges = this._wordenize(content, wordDefinition); + var words = []; + for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { + var range = ranges_1[_i]; + words.push({ + word: content.substring(range.start, range.end), + startColumn: range.start + 1, + endColumn: range.end + 1 + }); + } + return words; + }; + MirrorModel.prototype._wordenize = function (content, wordDefinition) { + var result = []; + var match; + wordDefinition.lastIndex = 0; // reset lastIndex just to be sure + while (match = wordDefinition.exec(content)) { + if (match[0].length === 0) { + // it did match the empty string break; } + result.push({ start: match.index, end: match.index + match[0].length }); } - return new PrefixSumIndexOfResult(mid, accumulatedValue - midStart); + return result; }; - return PrefixSumComputer; -}()); - -var PrefixSumComputerWithCache = /** @class */ (function () { - function PrefixSumComputerWithCache(values) { - this._cacheAccumulatedValueStart = 0; - this._cache = null; - this._actual = new PrefixSumComputer(values); - this._bustCache(); - } - PrefixSumComputerWithCache.prototype._bustCache = function () { - this._cacheAccumulatedValueStart = 0; - this._cache = null; - }; - PrefixSumComputerWithCache.prototype.insertValues = function (insertIndex, insertValues) { - if (this._actual.insertValues(insertIndex, insertValues)) { - this._bustCache(); + MirrorModel.prototype.getValueInRange = function (range) { + range = this._validateRange(range); + if (range.startLineNumber === range.endLineNumber) { + return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); } - }; - PrefixSumComputerWithCache.prototype.changeValue = function (index, value) { - if (this._actual.changeValue(index, value)) { - this._bustCache(); + var lineEnding = this._eol; + var startLineIndex = range.startLineNumber - 1; + var endLineIndex = range.endLineNumber - 1; + var resultLines = []; + resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); + for (var i = startLineIndex + 1; i < endLineIndex; i++) { + resultLines.push(this._lines[i]); } + resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); + return resultLines.join(lineEnding); }; - PrefixSumComputerWithCache.prototype.removeValues = function (startIndex, cnt) { - if (this._actual.removeValues(startIndex, cnt)) { - this._bustCache(); + MirrorModel.prototype.offsetAt = function (position) { + position = this._validatePosition(position); + this._ensureLineStarts(); + return this._lineStarts.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1); + }; + MirrorModel.prototype.positionAt = function (offset) { + offset = Math.floor(offset); + offset = Math.max(0, offset); + this._ensureLineStarts(); + var out = this._lineStarts.getIndexOf(offset); + var lineLength = this._lines[out.index].length; + // Ensure we return a valid position + return { + lineNumber: 1 + out.index, + column: 1 + Math.min(out.remainder, lineLength) + }; + }; + MirrorModel.prototype._validateRange = function (range) { + var start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn }); + var end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn }); + if (start.lineNumber !== range.startLineNumber + || start.column !== range.startColumn + || end.lineNumber !== range.endLineNumber + || end.column !== range.endColumn) { + return { + startLineNumber: start.lineNumber, + startColumn: start.column, + endLineNumber: end.lineNumber, + endColumn: end.column + }; } + return range; }; - PrefixSumComputerWithCache.prototype.getTotalValue = function () { - return this._actual.getTotalValue(); - }; - PrefixSumComputerWithCache.prototype.getAccumulatedValue = function (index) { - return this._actual.getAccumulatedValue(index); - }; - PrefixSumComputerWithCache.prototype.getIndexOf = function (accumulatedValue) { - accumulatedValue = Math.floor(accumulatedValue); //@perf - if (this._cache !== null) { - var cacheIndex = accumulatedValue - this._cacheAccumulatedValueStart; - if (cacheIndex >= 0 && cacheIndex < this._cache.length) { - // Cache hit! - return this._cache[cacheIndex]; + MirrorModel.prototype._validatePosition = function (position) { + if (!Position.isIPosition(position)) { + throw new Error('bad position'); + } + var lineNumber = position.lineNumber, column = position.column; + var hasChanged = false; + if (lineNumber < 1) { + lineNumber = 1; + column = 1; + hasChanged = true; + } + else if (lineNumber > this._lines.length) { + lineNumber = this._lines.length; + column = this._lines[lineNumber - 1].length + 1; + hasChanged = true; + } + else { + var maxCharacter = this._lines[lineNumber - 1].length + 1; + if (column < 1) { + column = 1; + hasChanged = true; + } + else if (column > maxCharacter) { + column = maxCharacter; + hasChanged = true; } } - // Cache miss! - return this._actual.getIndexOf(accumulatedValue); - }; - /** - * Gives a hint that a lot of requests are about to come in for these accumulated values. - */ - PrefixSumComputerWithCache.prototype.warmUpCache = function (accumulatedValueStart, accumulatedValueEnd) { - var newCache = []; - for (var accumulatedValue = accumulatedValueStart; accumulatedValue <= accumulatedValueEnd; accumulatedValue++) { - newCache[accumulatedValue - accumulatedValueStart] = this.getIndexOf(accumulatedValue); + if (!hasChanged) { + return position; + } + else { + return { lineNumber: lineNumber, column: column }; } - this._cache = newCache; - this._cacheAccumulatedValueStart = accumulatedValueStart; }; - return PrefixSumComputerWithCache; + return MirrorModel; +}(mirrorTextModel_MirrorTextModel)); +/** + * @internal + */ +var editorSimpleWorker_BaseEditorSimpleWorker = /** @class */ (function () { + function BaseEditorSimpleWorker(foreignModuleFactory) { + this._foreignModuleFactory = foreignModuleFactory; + this._foreignModule = null; + } + // ---- BEGIN diff -------------------------------------------------------------------------- + BaseEditorSimpleWorker.prototype.computeDiff = function (originalUrl, modifiedUrl, ignoreTrimWhitespace) { + var original = this._getModel(originalUrl); + var modified = this._getModel(modifiedUrl); + if (!original || !modified) { + return Promise.resolve(null); + } + var originalLines = original.getLinesContent(); + var modifiedLines = modified.getLinesContent(); + var diffComputer = new DiffComputer(originalLines, modifiedLines, { + shouldComputeCharChanges: true, + shouldPostProcessCharChanges: true, + shouldIgnoreTrimWhitespace: ignoreTrimWhitespace, + shouldMakePrettyDiff: true + }); + var changes = diffComputer.computeDiff(); + var identical = (changes.length > 0 ? false : this._modelsAreIdentical(original, modified)); + return Promise.resolve({ + identical: identical, + changes: changes + }); + }; + BaseEditorSimpleWorker.prototype._modelsAreIdentical = function (original, modified) { + var originalLineCount = original.getLineCount(); + var modifiedLineCount = modified.getLineCount(); + if (originalLineCount !== modifiedLineCount) { + return false; + } + for (var line = 1; line <= originalLineCount; line++) { + var originalLine = original.getLineContent(line); + var modifiedLine = modified.getLineContent(line); + if (originalLine !== modifiedLine) { + return false; + } + } + return true; + }; + BaseEditorSimpleWorker.prototype.computeMoreMinimalEdits = function (modelUrl, edits) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(edits); + } + var result = []; + var lastEol = undefined; + edits = mergeSort(edits, function (a, b) { + if (a.range && b.range) { + return range_Range.compareRangesUsingStarts(a.range, b.range); + } + // eol only changes should go to the end + var aRng = a.range ? 0 : 1; + var bRng = b.range ? 0 : 1; + return aRng - bRng; + }); + for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { + var _a = edits_1[_i], range = _a.range, text = _a.text, eol = _a.eol; + if (typeof eol === 'number') { + lastEol = eol; + } + if (range_Range.isEmpty(range) && !text) { + // empty change + continue; + } + var original = model.getValueInRange(range); + text = text.replace(/\r\n|\n|\r/g, model.eol); + if (original === text) { + // noop + continue; + } + // make sure diff won't take too long + if (Math.max(text.length, original.length) > BaseEditorSimpleWorker._diffLimit) { + result.push({ range: range, text: text }); + continue; + } + // compute diff between original and edit.text + var changes = stringDiff(original, text, false); + var editOffset = model.offsetAt(range_Range.lift(range).getStartPosition()); + for (var _b = 0, changes_1 = changes; _b < changes_1.length; _b++) { + var change = changes_1[_b]; + var start = model.positionAt(editOffset + change.originalStart); + var end = model.positionAt(editOffset + change.originalStart + change.originalLength); + var newEdit = { + text: text.substr(change.modifiedStart, change.modifiedLength), + range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column } + }; + if (model.getValueInRange(newEdit.range) !== newEdit.text) { + result.push(newEdit); + } + } + } + if (typeof lastEol === 'number') { + result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }); + } + return Promise.resolve(result); + }; + // ---- END minimal edits --------------------------------------------------------------- + BaseEditorSimpleWorker.prototype.computeLinks = function (modelUrl) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(null); + } + return Promise.resolve(computeLinks(model)); + }; + BaseEditorSimpleWorker.prototype.textualSuggest = function (modelUrl, position, wordDef, wordDefFlags) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(null); + } + var seen = Object.create(null); + var suggestions = []; + var wordDefRegExp = new RegExp(wordDef, wordDefFlags); + var wordUntil = model.getWordUntilPosition(position, wordDefRegExp); + var wordAt = model.getWordAtPosition(position, wordDefRegExp); + if (wordAt) { + seen[model.getValueInRange(wordAt)] = true; + } + for (var iter = model.createWordIterator(wordDefRegExp), e = iter.next(); !e.done && suggestions.length <= BaseEditorSimpleWorker._suggestionsLimit; e = iter.next()) { + var word = e.value; + if (seen[word]) { + continue; + } + seen[word] = true; + if (!isNaN(Number(word))) { + continue; + } + suggestions.push({ + kind: 18 /* Text */, + label: word, + insertText: word, + range: { startLineNumber: position.lineNumber, startColumn: wordUntil.startColumn, endLineNumber: position.lineNumber, endColumn: wordUntil.endColumn } + }); + } + return Promise.resolve({ suggestions: suggestions }); + }; + // ---- END suggest -------------------------------------------------------------------------- + //#region -- word ranges -- + BaseEditorSimpleWorker.prototype.computeWordRanges = function (modelUrl, range, wordDef, wordDefFlags) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(Object.create(null)); + } + var wordDefRegExp = new RegExp(wordDef, wordDefFlags); + var result = Object.create(null); + for (var line = range.startLineNumber; line < range.endLineNumber; line++) { + var words = model.getLineWords(line, wordDefRegExp); + for (var _i = 0, words_1 = words; _i < words_1.length; _i++) { + var word = words_1[_i]; + if (!isNaN(Number(word.word))) { + continue; + } + var array = result[word.word]; + if (!array) { + array = []; + result[word.word] = array; + } + array.push({ + startLineNumber: line, + startColumn: word.startColumn, + endLineNumber: line, + endColumn: word.endColumn + }); + } + } + return Promise.resolve(result); + }; + //#endregion + BaseEditorSimpleWorker.prototype.navigateValueSet = function (modelUrl, range, up, wordDef, wordDefFlags) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(null); + } + var wordDefRegExp = new RegExp(wordDef, wordDefFlags); + if (range.startColumn === range.endColumn) { + range = { + startLineNumber: range.startLineNumber, + startColumn: range.startColumn, + endLineNumber: range.endLineNumber, + endColumn: range.endColumn + 1 + }; + } + var selectionText = model.getValueInRange(range); + var wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp); + if (!wordRange) { + return Promise.resolve(null); + } + var word = model.getValueInRange(wordRange); + var result = BasicInplaceReplace.INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up); + return Promise.resolve(result); + }; + // ---- BEGIN foreign module support -------------------------------------------------------------------------- + BaseEditorSimpleWorker.prototype.loadForeignModule = function (moduleId, createData) { + var _this = this; + var ctx = { + getMirrorModels: function () { + return _this._getModels(); + } + }; + if (this._foreignModuleFactory) { + this._foreignModule = this._foreignModuleFactory(ctx, createData); + // static foreing module + var methods = []; + for (var _i = 0, _a = getAllPropertyNames(this._foreignModule); _i < _a.length; _i++) { + var prop = _a[_i]; + if (typeof this._foreignModule[prop] === 'function') { + methods.push(prop); + } + } + return Promise.resolve(methods); + } + // ESM-comment-begin + // return new Promise((resolve, reject) => { + // require([moduleId], (foreignModule: { create: IForeignModuleFactory }) => { + // this._foreignModule = foreignModule.create(ctx, createData); + // + // let methods: string[] = []; + // for (const prop of getAllPropertyNames(this._foreignModule)) { + // if (typeof this._foreignModule[prop] === 'function') { + // methods.push(prop); + // } + // } + // + // resolve(methods); + // + // }, reject); + // }); + // ESM-comment-end + // ESM-uncomment-begin + return Promise.reject(new Error("Unexpected usage")); + // ESM-uncomment-end + }; + // foreign method request + BaseEditorSimpleWorker.prototype.fmr = function (method, args) { + if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') { + return Promise.reject(new Error('Missing requestHandler or method: ' + method)); + } + try { + return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args)); + } + catch (e) { + return Promise.reject(e); + } + }; + // ---- END diff -------------------------------------------------------------------------- + // ---- BEGIN minimal edits --------------------------------------------------------------- + BaseEditorSimpleWorker._diffLimit = 100000; + // ---- BEGIN suggest -------------------------------------------------------------------------- + BaseEditorSimpleWorker._suggestionsLimit = 10000; + return BaseEditorSimpleWorker; }()); +/** + * @internal + */ +var editorSimpleWorker_EditorSimpleWorkerImpl = /** @class */ (function (_super) { + editorSimpleWorker_extends(EditorSimpleWorkerImpl, _super); + function EditorSimpleWorkerImpl(foreignModuleFactory) { + var _this = _super.call(this, foreignModuleFactory) || this; + _this._models = Object.create(null); + return _this; + } + EditorSimpleWorkerImpl.prototype.dispose = function () { + this._models = Object.create(null); + }; + EditorSimpleWorkerImpl.prototype._getModel = function (uri) { + return this._models[uri]; + }; + EditorSimpleWorkerImpl.prototype._getModels = function () { + var _this = this; + var all = []; + Object.keys(this._models).forEach(function (key) { return all.push(_this._models[key]); }); + return all; + }; + EditorSimpleWorkerImpl.prototype.acceptNewModel = function (data) { + this._models[data.url] = new editorSimpleWorker_MirrorModel(uri_URI.parse(data.url), data.lines, data.EOL, data.versionId); + }; + EditorSimpleWorkerImpl.prototype.acceptModelChanged = function (strURL, e) { + if (!this._models[strURL]) { + return; + } + var model = this._models[strURL]; + model.onEvents(e); + }; + EditorSimpleWorkerImpl.prototype.acceptRemovedModel = function (strURL) { + if (!this._models[strURL]) { + return; + } + delete this._models[strURL]; + }; + return EditorSimpleWorkerImpl; +}(editorSimpleWorker_BaseEditorSimpleWorker)); +/** + * Called on the worker side + * @internal + */ +function editorSimpleWorker_create() { + return new editorSimpleWorker_EditorSimpleWorkerImpl(null); +} +if (typeof importScripts === 'function') { + // Running in a web worker + globals.monaco = createMonacoBaseAPI(); +} -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/editor.worker.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/editor.worker.js ***! - \*******************************************************************/ -/*! exports provided: initialize */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/editor.worker.js /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initialize", function() { return initialize; }); -/* harmony import */ var _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/common/worker/simpleWorker.js */ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js"); -/* harmony import */ var _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/services/editorSimpleWorker.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js"); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -8395,8 +7519,8 @@ function initialize(foreignModule) { return; } initialized = true; - var editorWorker = new _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__["EditorSimpleWorkerImpl"](foreignModule); - var simpleWorker = new _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__["SimpleWorkerServer"](function (msg) { + var editorWorker = new editorSimpleWorker_EditorSimpleWorkerImpl(foreignModule); + var simpleWorker = new simpleWorker_SimpleWorkerServer(function (msg) { self.postMessage(msg); }, editorWorker); self.onmessage = function (e) { @@ -8411,7 +7535,303 @@ self.onmessage = function (e) { }; +/***/ }), + +/***/ "URDS": +/***/ (function(module, exports, __webpack_require__) { + +/*! +Copyright (c) 2014 Taylor Hakes +Copyright (c) 2014 Forbes Lindesay + */ +(function (global, factory) { + true ? factory() : + undefined; +}(this, (function () { + 'use strict'; + + /** + * @this {Promise} + */ + function finallyConstructor(callback) { + var constructor = this.constructor; + return this.then( + function (value) { + return constructor.resolve(callback()).then(function () { + return value; + }); + }, + function (reason) { + return constructor.resolve(callback()).then(function () { + return constructor.reject(reason); + }); + } + ); + } + + // Store setTimeout reference so promise-polyfill will be unaffected by + // other code modifying setTimeout (like sinon.useFakeTimers()) + var setTimeoutFunc = setTimeout; + + function noop() { } + + // Polyfill for Function.prototype.bind + function bind(fn, thisArg) { + return function () { + fn.apply(thisArg, arguments); + }; + } + + /** + * @constructor + * @param {Function} fn + */ + function Promise(fn) { + if (!(this instanceof Promise)) + throw new TypeError('Promises must be constructed via new'); + if (typeof fn !== 'function') throw new TypeError('not a function'); + /** @type {!number} */ + this._state = 0; + /** @type {!boolean} */ + this._handled = false; + /** @type {Promise|undefined} */ + this._value = undefined; + /** @type {!Array} */ + this._deferreds = []; + + doResolve(fn, this); + } + + function handle(self, deferred) { + while (self._state === 3) { + self = self._value; + } + if (self._state === 0) { + self._deferreds.push(deferred); + return; + } + self._handled = true; + Promise._immediateFn(function () { + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (self._state === 1 ? resolve : reject)(deferred.promise, self._value); + return; + } + var ret; + try { + ret = cb(self._value); + } catch (e) { + reject(deferred.promise, e); + return; + } + resolve(deferred.promise, ret); + }); + } + + function resolve(self, newValue) { + try { + // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure + if (newValue === self) + throw new TypeError('A promise cannot be resolved with itself.'); + if ( + newValue && + (typeof newValue === 'object' || typeof newValue === 'function') + ) { + var then = newValue.then; + if (newValue instanceof Promise) { + self._state = 3; + self._value = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(bind(then, newValue), self); + return; + } + } + self._state = 1; + self._value = newValue; + finale(self); + } catch (e) { + reject(self, e); + } + } + + function reject(self, newValue) { + self._state = 2; + self._value = newValue; + finale(self); + } + + function finale(self) { + if (self._state === 2 && self._deferreds.length === 0) { + Promise._immediateFn(function () { + if (!self._handled) { + Promise._unhandledRejectionFn(self._value); + } + }); + } + + for (var i = 0, len = self._deferreds.length; i < len; i++) { + handle(self, self._deferreds[i]); + } + self._deferreds = null; + } + + /** + * @constructor + */ + function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; + } + + /** + * Take a potentially misbehaving resolver function and make sure + * onFulfilled and onRejected are only called once. + * + * Makes no guarantees about asynchrony. + */ + function doResolve(fn, self) { + var done = false; + try { + fn( + function (value) { + if (done) return; + done = true; + resolve(self, value); + }, + function (reason) { + if (done) return; + done = true; + reject(self, reason); + } + ); + } catch (ex) { + if (done) return; + done = true; + reject(self, ex); + } + } + + Promise.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); + }; + + Promise.prototype.then = function (onFulfilled, onRejected) { + // @ts-ignore + var prom = new this.constructor(noop); + + handle(this, new Handler(onFulfilled, onRejected, prom)); + return prom; + }; + + Promise.prototype['finally'] = finallyConstructor; + + Promise.all = function (arr) { + return new Promise(function (resolve, reject) { + if (!arr || typeof arr.length === 'undefined') + throw new TypeError('Promise.all accepts an array'); + var args = Array.prototype.slice.call(arr); + if (args.length === 0) return resolve([]); + var remaining = args.length; + + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call( + val, + function (val) { + res(i, val); + }, + reject + ); + return; + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); + } + } + + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + + Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; + } + + return new Promise(function (resolve) { + resolve(value); + }); + }; + + Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); + }; + + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var i = 0, len = values.length; i < len; i++) { + values[i].then(resolve, reject); + } + }); + }; + + // Use polyfill for setImmediate for performance gains + Promise._immediateFn = + (typeof setImmediate === 'function' && + function (fn) { + setImmediate(fn); + }) || + function (fn) { + setTimeoutFunc(fn, 0); + }; + + Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { + if (typeof console !== 'undefined' && console) { + console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console + } + }; + + /** @suppress {undefinedVars} */ + var globalNS = (function () { + // the only reliable means to get the global object is + // `Function('return this')()` + // However, this causes CSP violations in Chrome apps. + if (typeof self !== 'undefined') { + return self; + } + if (typeof window !== 'undefined') { + return window; + } + if (typeof global !== 'undefined') { + return global; + } + throw new Error('unable to locate global object'); + })(); + + if (!('Promise' in globalNS)) { + globalNS['Promise'] = Promise; + } else if (!globalNS.Promise.prototype['finally']) { + globalNS.Promise.prototype['finally'] = finallyConstructor; + } + +}))); + + /***/ }) -/******/ }); -//# sourceMappingURL=editor.worker.js.map \ No newline at end of file +/******/ }); \ No newline at end of file diff --git a/public/static/monaco/html.worker.js b/public/static/monaco/html.worker.js index 3909bea..e6a9a78 100644 --- a/public/static/monaco/html.worker.js +++ b/public/static/monaco/html.worker.js @@ -87,40 +87,1018 @@ /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./node_modules/monaco-editor/esm/vs/language/html/html.worker.js"); +/******/ return __webpack_require__(__webpack_require__.s = "ZUp1"); /******/ }) /************************************************************************/ /******/ ({ -/***/ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/arrays.js ***! - \*****************************************************************/ -/*! exports provided: tail, tail2, equals, binarySearch, findFirstInSorted, mergeSort, groupBy, coalesce, isFalsyOrEmpty, isNonEmptyArray, distinct, distinctES6, firstIndex, first, flatten, range, arrayInsert, pushToStart, pushToEnd, asArray */ +/***/ "URDS": +/***/ (function(module, exports, __webpack_require__) { + +/*! +Copyright (c) 2014 Taylor Hakes +Copyright (c) 2014 Forbes Lindesay + */ +(function (global, factory) { + true ? factory() : + undefined; +}(this, (function () { + 'use strict'; + + /** + * @this {Promise} + */ + function finallyConstructor(callback) { + var constructor = this.constructor; + return this.then( + function (value) { + return constructor.resolve(callback()).then(function () { + return value; + }); + }, + function (reason) { + return constructor.resolve(callback()).then(function () { + return constructor.reject(reason); + }); + } + ); + } + + // Store setTimeout reference so promise-polyfill will be unaffected by + // other code modifying setTimeout (like sinon.useFakeTimers()) + var setTimeoutFunc = setTimeout; + + function noop() { } + + // Polyfill for Function.prototype.bind + function bind(fn, thisArg) { + return function () { + fn.apply(thisArg, arguments); + }; + } + + /** + * @constructor + * @param {Function} fn + */ + function Promise(fn) { + if (!(this instanceof Promise)) + throw new TypeError('Promises must be constructed via new'); + if (typeof fn !== 'function') throw new TypeError('not a function'); + /** @type {!number} */ + this._state = 0; + /** @type {!boolean} */ + this._handled = false; + /** @type {Promise|undefined} */ + this._value = undefined; + /** @type {!Array} */ + this._deferreds = []; + + doResolve(fn, this); + } + + function handle(self, deferred) { + while (self._state === 3) { + self = self._value; + } + if (self._state === 0) { + self._deferreds.push(deferred); + return; + } + self._handled = true; + Promise._immediateFn(function () { + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (self._state === 1 ? resolve : reject)(deferred.promise, self._value); + return; + } + var ret; + try { + ret = cb(self._value); + } catch (e) { + reject(deferred.promise, e); + return; + } + resolve(deferred.promise, ret); + }); + } + + function resolve(self, newValue) { + try { + // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure + if (newValue === self) + throw new TypeError('A promise cannot be resolved with itself.'); + if ( + newValue && + (typeof newValue === 'object' || typeof newValue === 'function') + ) { + var then = newValue.then; + if (newValue instanceof Promise) { + self._state = 3; + self._value = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(bind(then, newValue), self); + return; + } + } + self._state = 1; + self._value = newValue; + finale(self); + } catch (e) { + reject(self, e); + } + } + + function reject(self, newValue) { + self._state = 2; + self._value = newValue; + finale(self); + } + + function finale(self) { + if (self._state === 2 && self._deferreds.length === 0) { + Promise._immediateFn(function () { + if (!self._handled) { + Promise._unhandledRejectionFn(self._value); + } + }); + } + + for (var i = 0, len = self._deferreds.length; i < len; i++) { + handle(self, self._deferreds[i]); + } + self._deferreds = null; + } + + /** + * @constructor + */ + function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; + } + + /** + * Take a potentially misbehaving resolver function and make sure + * onFulfilled and onRejected are only called once. + * + * Makes no guarantees about asynchrony. + */ + function doResolve(fn, self) { + var done = false; + try { + fn( + function (value) { + if (done) return; + done = true; + resolve(self, value); + }, + function (reason) { + if (done) return; + done = true; + reject(self, reason); + } + ); + } catch (ex) { + if (done) return; + done = true; + reject(self, ex); + } + } + + Promise.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); + }; + + Promise.prototype.then = function (onFulfilled, onRejected) { + // @ts-ignore + var prom = new this.constructor(noop); + + handle(this, new Handler(onFulfilled, onRejected, prom)); + return prom; + }; + + Promise.prototype['finally'] = finallyConstructor; + + Promise.all = function (arr) { + return new Promise(function (resolve, reject) { + if (!arr || typeof arr.length === 'undefined') + throw new TypeError('Promise.all accepts an array'); + var args = Array.prototype.slice.call(arr); + if (args.length === 0) return resolve([]); + var remaining = args.length; + + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call( + val, + function (val) { + res(i, val); + }, + reject + ); + return; + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); + } + } + + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + + Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; + } + + return new Promise(function (resolve) { + resolve(value); + }); + }; + + Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); + }; + + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var i = 0, len = values.length; i < len; i++) { + values[i].then(resolve, reject); + } + }); + }; + + // Use polyfill for setImmediate for performance gains + Promise._immediateFn = + (typeof setImmediate === 'function' && + function (fn) { + setImmediate(fn); + }) || + function (fn) { + setTimeoutFunc(fn, 0); + }; + + Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { + if (typeof console !== 'undefined' && console) { + console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console + } + }; + + /** @suppress {undefinedVars} */ + var globalNS = (function () { + // the only reliable means to get the global object is + // `Function('return this')()` + // However, this causes CSP violations in Chrome apps. + if (typeof self !== 'undefined') { + return self; + } + if (typeof window !== 'undefined') { + return window; + } + if (typeof global !== 'undefined') { + return global; + } + throw new Error('unable to locate global object'); + })(); + + if (!('Promise' in globalNS)) { + globalNS['Promise'] = Promise; + } else if (!globalNS.Promise.prototype['finally']) { + globalNS.Promise.prototype['finally'] = finallyConstructor; + } + +}))); + + +/***/ }), + +/***/ "ZUp1": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return tail; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tail2", function() { return tail2; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "binarySearch", function() { return binarySearch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findFirstInSorted", function() { return findFirstInSorted; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeSort", function() { return mergeSort; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return groupBy; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "coalesce", function() { return coalesce; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFalsyOrEmpty", function() { return isFalsyOrEmpty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNonEmptyArray", function() { return isNonEmptyArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return distinct; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctES6", function() { return distinctES6; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstIndex", function() { return firstIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return first; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return flatten; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayInsert", function() { return arrayInsert; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushToStart", function() { return pushToStart; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushToEnd", function() { return pushToEnd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asArray", function() { return asArray; }); + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/errors.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Avoid circular dependency on EventEmitter by implementing a subset of the interface. +var ErrorHandler = /** @class */ (function () { + function ErrorHandler() { + this.listeners = []; + this.unexpectedErrorHandler = function (e) { + setTimeout(function () { + if (e.stack) { + throw new Error(e.message + '\n\n' + e.stack); + } + throw e; + }, 0); + }; + } + ErrorHandler.prototype.emit = function (e) { + this.listeners.forEach(function (listener) { + listener(e); + }); + }; + ErrorHandler.prototype.onUnexpectedError = function (e) { + this.unexpectedErrorHandler(e); + this.emit(e); + }; + // For external errors, we don't want the listeners to be called + ErrorHandler.prototype.onUnexpectedExternalError = function (e) { + this.unexpectedErrorHandler(e); + }; + return ErrorHandler; +}()); + +var errorHandler = new ErrorHandler(); +function onUnexpectedError(e) { + // ignore errors from cancelled promises + if (!isPromiseCanceledError(e)) { + errorHandler.onUnexpectedError(e); + } + return undefined; +} +function onUnexpectedExternalError(e) { + // ignore errors from cancelled promises + if (!isPromiseCanceledError(e)) { + errorHandler.onUnexpectedExternalError(e); + } + return undefined; +} +function transformErrorForSerialization(error) { + if (error instanceof Error) { + var name_1 = error.name, message = error.message; + var stack = error.stacktrace || error.stack; + return { + $isError: true, + name: name_1, + message: message, + stack: stack + }; + } + // return as is + return error; +} +var canceledName = 'Canceled'; +/** + * Checks if the given error is a promise in canceled state + */ +function isPromiseCanceledError(error) { + return error instanceof Error && error.name === canceledName && error.message === canceledName; +} +/** + * Returns an error that signals cancellation. + */ +function canceled() { + var error = new Error(canceledName); + error.name = error.message; + return error; +} +function illegalArgument(name) { + if (name) { + return new Error("Illegal argument: " + name); + } + else { + return new Error('Illegal argument'); + } +} +function illegalState(name) { + if (name) { + return new Error("Illegal state: " + name); + } + else { + return new Error('Illegal state'); + } +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js +function isDisposable(thing) { + return typeof thing.dispose === 'function' + && thing.dispose.length === 0; +} +function lifecycle_dispose(first) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + if (Array.isArray(first)) { + first.forEach(function (d) { return d && d.dispose(); }); + return []; + } + else if (rest.length === 0) { + if (first) { + first.dispose(); + return first; + } + return undefined; + } + else { + lifecycle_dispose(first); + lifecycle_dispose(rest); + return []; + } +} +function combinedDisposable(disposables) { + return { dispose: function () { return lifecycle_dispose(disposables); } }; +} +function toDisposable(fn) { + return { dispose: function () { fn(); } }; +} +var Disposable = /** @class */ (function () { + function Disposable() { + this._toDispose = []; + this._lifecycle_disposable_isDisposed = false; + } + Disposable.prototype.dispose = function () { + this._lifecycle_disposable_isDisposed = true; + this._toDispose = lifecycle_dispose(this._toDispose); + }; + Disposable.prototype._register = function (t) { + if (this._lifecycle_disposable_isDisposed) { + console.warn('Registering disposable on object that has already been disposed.'); + t.dispose(); + } + else { + this._toDispose.push(t); + } + return t; + }; + Disposable.None = Object.freeze({ dispose: function () { } }); + return Disposable; +}()); + +var ImmortalReference = /** @class */ (function () { + function ImmortalReference(object) { + this.object = object; + } + ImmortalReference.prototype.dispose = function () { }; + return ImmortalReference; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/platform.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var LANGUAGE_DEFAULT = 'en'; +var _isWindows = false; +var _isMacintosh = false; +var _isLinux = false; +var _isNative = false; +var _isWeb = false; +var _locale = undefined; +var _language = LANGUAGE_DEFAULT; +var _translationsConfigFile = undefined; +var isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer'); +// OS detection +if (typeof navigator === 'object' && !isElectronRenderer) { + var userAgent = navigator.userAgent; + _isWindows = userAgent.indexOf('Windows') >= 0; + _isMacintosh = userAgent.indexOf('Macintosh') >= 0; + _isLinux = userAgent.indexOf('Linux') >= 0; + _isWeb = true; + _locale = navigator.language; + _language = _locale; +} +else if (typeof process === 'object') { + _isWindows = (process.platform === 'win32'); + _isMacintosh = (process.platform === 'darwin'); + _isLinux = (process.platform === 'linux'); + _locale = LANGUAGE_DEFAULT; + _language = LANGUAGE_DEFAULT; + var rawNlsConfig = process.env['VSCODE_NLS_CONFIG']; + if (rawNlsConfig) { + try { + var nlsConfig = JSON.parse(rawNlsConfig); + var resolved = nlsConfig.availableLanguages['*']; + _locale = nlsConfig.locale; + // VSCode's default language is 'en' + _language = resolved ? resolved : LANGUAGE_DEFAULT; + _translationsConfigFile = nlsConfig._translationsConfigFile; + } + catch (e) { + } + } + _isNative = true; +} +var _platform = 0 /* Web */; +if (_isNative) { + if (_isMacintosh) { + _platform = 1 /* Mac */; + } + else if (_isWindows) { + _platform = 3 /* Windows */; + } + else if (_isLinux) { + _platform = 2 /* Linux */; + } +} +var isWindows = _isWindows; +var isMacintosh = _isMacintosh; +var isLinux = _isLinux; +var isNative = _isNative; +var isWeb = _isWeb; +var _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {}); +var globals = _globals; +var _setImmediate = null; +function setImmediate(callback) { + if (_setImmediate === null) { + if (globals.setImmediate) { + _setImmediate = globals.setImmediate.bind(globals); + } + else if (typeof process !== 'undefined' && typeof process.nextTick === 'function') { + _setImmediate = process.nextTick.bind(process); + } + else { + _setImmediate = globals.setTimeout.bind(globals); + } + } + return _setImmediate(callback); +} +var OS = (_isMacintosh ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */)); + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/types.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var _typeof = { + number: 'number', + string: 'string', + undefined: 'undefined', + object: 'object', + function: 'function' +}; +/** + * @returns whether the provided parameter is a JavaScript Array or not. + */ +function isArray(array) { + if (Array.isArray) { + return Array.isArray(array); + } + if (array && typeof (array.length) === _typeof.number && array.constructor === Array) { + return true; + } + return false; +} +/** + * @returns whether the provided parameter is a JavaScript String or not. + */ +function isString(str) { + if (typeof (str) === _typeof.string || str instanceof String) { + return true; + } + return false; +} +/** + * + * @returns whether the provided parameter is of type `object` but **not** + * `null`, an `array`, a `regexp`, nor a `date`. + */ +function isObject(obj) { + // The method can't do a type cast since there are type (like strings) which + // are subclasses of any put not positvely matched by the function. Hence type + // narrowing results in wrong results. + return typeof obj === _typeof.object + && obj !== null + && !Array.isArray(obj) + && !(obj instanceof RegExp) + && !(obj instanceof Date); +} +/** + * In **contrast** to just checking `typeof` this will return `false` for `NaN`. + * @returns whether the provided parameter is a JavaScript Number or not. + */ +function isNumber(obj) { + if ((typeof (obj) === _typeof.number || obj instanceof Number) && !isNaN(obj)) { + return true; + } + return false; +} +/** + * @returns whether the provided parameter is a JavaScript Boolean or not. + */ +function isBoolean(obj) { + return obj === true || obj === false; +} +/** + * @returns whether the provided parameter is undefined. + */ +function isUndefined(obj) { + return typeof (obj) === _typeof.undefined; +} +/** + * @returns whether the provided parameter is undefined or null. + */ +function isUndefinedOrNull(obj) { + return isUndefined(obj) || obj === null; +} +var types_hasOwnProperty = Object.prototype.hasOwnProperty; +/** + * @returns whether the provided parameter is an empty JavaScript Object or not. + */ +function isEmptyObject(obj) { + if (!isObject(obj)) { + return false; + } + for (var key in obj) { + if (types_hasOwnProperty.call(obj, key)) { + return false; + } + } + return true; +} +/** + * @returns whether the provided parameter is a JavaScript Function or not. + */ +function isFunction(obj) { + return typeof obj === _typeof.function; +} +function validateConstraints(args, constraints) { + var len = Math.min(args.length, constraints.length); + for (var i = 0; i < len; i++) { + validateConstraint(args[i], constraints[i]); + } +} +function validateConstraint(arg, constraint) { + if (isString(constraint)) { + if (typeof arg !== constraint) { + throw new Error("argument does not match constraint: typeof " + constraint); + } + } + else if (isFunction(constraint)) { + try { + if (arg instanceof constraint) { + return; + } + } + catch (_a) { + // ignore + } + if (!isUndefinedOrNull(arg) && arg.constructor === constraint) { + return; + } + if (constraint.length === 1 && constraint.call(undefined, arg) === true) { + return; + } + throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true"); + } +} +function getAllPropertyNames(obj) { + var res = []; + var proto = Object.getPrototypeOf(obj); + while (Object.prototype !== proto) { + res = res.concat(Object.getOwnPropertyNames(proto)); + proto = Object.getPrototypeOf(proto); + } + return res; +} +/** + * Converts null to undefined, passes all other values through. + */ +function withNullAsUndefined(x) { + return x === null ? undefined : x; +} +/** + * Converts undefined to null, passes all other values through. + */ +function withUndefinedAsNull(x) { + return typeof x === 'undefined' ? null : x; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var __extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + +var INITIALIZE = '$initialize'; +var webWorkerWarningLogged = false; +function logOnceWebWorkerWarning(err) { + if (!isWeb) { + // running tests + return; + } + if (!webWorkerWarningLogged) { + webWorkerWarningLogged = true; + console.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq'); + } + console.warn(err.message); +} +var simpleWorker_SimpleWorkerProtocol = /** @class */ (function () { + function SimpleWorkerProtocol(handler) { + this._workerId = -1; + this._handler = handler; + this._lastSentReq = 0; + this._pendingReplies = Object.create(null); + } + SimpleWorkerProtocol.prototype.setWorkerId = function (workerId) { + this._workerId = workerId; + }; + SimpleWorkerProtocol.prototype.sendMessage = function (method, args) { + var _this = this; + var req = String(++this._lastSentReq); + return new Promise(function (resolve, reject) { + _this._pendingReplies[req] = { + resolve: resolve, + reject: reject + }; + _this._send({ + vsWorker: _this._workerId, + req: req, + method: method, + args: args + }); + }); + }; + SimpleWorkerProtocol.prototype.handleMessage = function (serializedMessage) { + var message; + try { + message = JSON.parse(serializedMessage); + } + catch (e) { + // nothing + return; + } + if (!message || !message.vsWorker) { + return; + } + if (this._workerId !== -1 && message.vsWorker !== this._workerId) { + return; + } + this._handleMessage(message); + }; + SimpleWorkerProtocol.prototype._handleMessage = function (msg) { + var _this = this; + if (msg.seq) { + var replyMessage = msg; + if (!this._pendingReplies[replyMessage.seq]) { + console.warn('Got reply to unknown seq'); + return; + } + var reply = this._pendingReplies[replyMessage.seq]; + delete this._pendingReplies[replyMessage.seq]; + if (replyMessage.err) { + var err = replyMessage.err; + if (replyMessage.err.$isError) { + err = new Error(); + err.name = replyMessage.err.name; + err.message = replyMessage.err.message; + err.stack = replyMessage.err.stack; + } + reply.reject(err); + return; + } + reply.resolve(replyMessage.res); + return; + } + var requestMessage = msg; + var req = requestMessage.req; + var result = this._handler.handleMessage(requestMessage.method, requestMessage.args); + result.then(function (r) { + _this._send({ + vsWorker: _this._workerId, + seq: req, + res: r, + err: undefined + }); + }, function (e) { + if (e.detail instanceof Error) { + // Loading errors have a detail property that points to the actual error + e.detail = transformErrorForSerialization(e.detail); + } + _this._send({ + vsWorker: _this._workerId, + seq: req, + res: undefined, + err: transformErrorForSerialization(e) + }); + }); + }; + SimpleWorkerProtocol.prototype._send = function (msg) { + var strMsg = JSON.stringify(msg); + // console.log('SENDING: ' + strMsg); + this._handler.sendMessage(strMsg); + }; + return SimpleWorkerProtocol; +}()); +/** + * Main thread side + */ +var SimpleWorkerClient = /** @class */ (function (_super) { + __extends(SimpleWorkerClient, _super); + function SimpleWorkerClient(workerFactory, moduleId) { + var _this = _super.call(this) || this; + var lazyProxyReject = null; + _this._worker = _this._register(workerFactory.create('vs/base/common/worker/simpleWorker', function (msg) { + _this._protocol.handleMessage(msg); + }, function (err) { + // in Firefox, web workers fail lazily :( + // we will reject the proxy + if (lazyProxyReject) { + lazyProxyReject(err); + } + })); + _this._protocol = new simpleWorker_SimpleWorkerProtocol({ + sendMessage: function (msg) { + _this._worker.postMessage(msg); + }, + handleMessage: function (method, args) { + // Intentionally not supporting worker -> main requests + return Promise.resolve(null); + } + }); + _this._protocol.setWorkerId(_this._worker.getId()); + // Gather loader configuration + var loaderConfiguration = null; + if (typeof self.require !== 'undefined' && typeof self.require.getConfig === 'function') { + // Get the configuration from the Monaco AMD Loader + loaderConfiguration = self.require.getConfig(); + } + else if (typeof self.requirejs !== 'undefined') { + // Get the configuration from requirejs + loaderConfiguration = self.requirejs.s.contexts._.config; + } + // Send initialize message + _this._onModuleLoaded = _this._protocol.sendMessage(INITIALIZE, [ + _this._worker.getId(), + moduleId, + loaderConfiguration + ]); + _this._lazyProxy = new Promise(function (resolve, reject) { + lazyProxyReject = reject; + _this._onModuleLoaded.then(function (availableMethods) { + var proxy = {}; + for (var _i = 0, availableMethods_1 = availableMethods; _i < availableMethods_1.length; _i++) { + var methodName = availableMethods_1[_i]; + proxy[methodName] = createProxyMethod(methodName, proxyMethodRequest); + } + resolve(proxy); + }, function (e) { + reject(e); + _this._onError('Worker failed to load ' + moduleId, e); + }); + }); + // Create proxy to loaded code + var proxyMethodRequest = function (method, args) { + return _this._request(method, args); + }; + var createProxyMethod = function (method, proxyMethodRequest) { + return function () { + var args = Array.prototype.slice.call(arguments, 0); + return proxyMethodRequest(method, args); + }; + }; + return _this; + } + SimpleWorkerClient.prototype.getProxyObject = function () { + return this._lazyProxy; + }; + SimpleWorkerClient.prototype._request = function (method, args) { + var _this = this; + return new Promise(function (resolve, reject) { + _this._onModuleLoaded.then(function () { + _this._protocol.sendMessage(method, args).then(resolve, reject); + }, reject); + }); + }; + SimpleWorkerClient.prototype._onError = function (message, error) { + console.error(message); + console.info(error); + }; + return SimpleWorkerClient; +}(Disposable)); + +/** + * Worker side + */ +var simpleWorker_SimpleWorkerServer = /** @class */ (function () { + function SimpleWorkerServer(postSerializedMessage, requestHandler) { + var _this = this; + this._requestHandler = requestHandler; + this._protocol = new simpleWorker_SimpleWorkerProtocol({ + sendMessage: function (msg) { + postSerializedMessage(msg); + }, + handleMessage: function (method, args) { return _this._handleMessage(method, args); } + }); + } + SimpleWorkerServer.prototype.onmessage = function (msg) { + this._protocol.handleMessage(msg); + }; + SimpleWorkerServer.prototype._handleMessage = function (method, args) { + if (method === INITIALIZE) { + return this.initialize(args[0], args[1], args[2]); + } + if (!this._requestHandler || typeof this._requestHandler[method] !== 'function') { + return Promise.reject(new Error('Missing requestHandler or method: ' + method)); + } + try { + return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args)); + } + catch (e) { + return Promise.reject(e); + } + }; + SimpleWorkerServer.prototype.initialize = function (workerId, moduleId, loaderConfig) { + var _this = this; + this._protocol.setWorkerId(workerId); + if (this._requestHandler) { + // static request handler + var methods = []; + for (var _i = 0, _a = getAllPropertyNames(this._requestHandler); _i < _a.length; _i++) { + var prop = _a[_i]; + if (typeof this._requestHandler[prop] === 'function') { + methods.push(prop); + } + } + return Promise.resolve(methods); + } + if (loaderConfig) { + // Remove 'baseUrl', handling it is beyond scope for now + if (typeof loaderConfig.baseUrl !== 'undefined') { + delete loaderConfig['baseUrl']; + } + if (typeof loaderConfig.paths !== 'undefined') { + if (typeof loaderConfig.paths.vs !== 'undefined') { + delete loaderConfig.paths['vs']; + } + } + // Since this is in a web worker, enable catching errors + loaderConfig.catchError = true; + self.require.config(loaderConfig); + } + return new Promise(function (resolve, reject) { + // Use the global require to be sure to get the global config + self.require([moduleId], function () { + var result = []; + for (var _i = 0; _i < arguments.length; _i++) { + result[_i] = arguments[_i]; + } + var handlerModule = result[0]; + _this._requestHandler = handlerModule.create(); + if (!_this._requestHandler) { + reject(new Error("No RequestHandler!")); + return; + } + var methods = []; + for (var _a = 0, _b = getAllPropertyNames(_this._requestHandler); _a < _b.length; _a++) { + var prop = _b[_a]; + if (typeof _this._requestHandler[prop] === 'function') { + methods.push(prop); + } + } + resolve(methods); + }, reject); + }); + }; + return SimpleWorkerServer; +}()); + +/** + * Called on the worker side + */ +function create(postMessage) { + return new simpleWorker_SimpleWorkerServer(postMessage, null); +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/arrays.js /** * Returns the last element of an array. * @param array The array. @@ -323,7 +1301,7 @@ function flatten(arr) { var _a; return (_a = []).concat.apply(_a, arr); } -function range(arg, to) { +function arrays_range(arg, to) { var from = typeof to === 'number' ? arg : 0; if (typeof to === 'number') { from = arg; @@ -378,161 +1356,43 @@ function asArray(x) { return Array.isArray(x) ? x : [x]; } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/cancellation.js ***! - \***********************************************************************/ -/*! exports provided: CancellationToken, CancellationTokenSource */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationToken", function() { return CancellationToken; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationTokenSource", function() { return CancellationTokenSource; }); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -var shortcutEvent = Object.freeze(function (callback, context) { - var handle = setTimeout(callback.bind(context), 0); - return { dispose: function () { clearTimeout(handle); } }; -}); -var CancellationToken; -(function (CancellationToken) { - function isCancellationToken(thing) { - if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) { - return true; - } - if (thing instanceof MutableToken) { - return true; - } - if (!thing || typeof thing !== 'object') { - return false; - } - return typeof thing.isCancellationRequested === 'boolean' - && typeof thing.onCancellationRequested === 'function'; +/** + * Represents information about a specific difference between two sequences. + */ +var DiffChange = /** @class */ (function () { + /** + * Constructs a new DiffChange with the given sequence information + * and content. + */ + function DiffChange(originalStart, originalLength, modifiedStart, modifiedLength) { + //Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0"); + this.originalStart = originalStart; + this.originalLength = originalLength; + this.modifiedStart = modifiedStart; + this.modifiedLength = modifiedLength; } - CancellationToken.isCancellationToken = isCancellationToken; - CancellationToken.None = Object.freeze({ - isCancellationRequested: false, - onCancellationRequested: _event_js__WEBPACK_IMPORTED_MODULE_0__["Event"].None - }); - CancellationToken.Cancelled = Object.freeze({ - isCancellationRequested: true, - onCancellationRequested: shortcutEvent - }); -})(CancellationToken || (CancellationToken = {})); -var MutableToken = /** @class */ (function () { - function MutableToken() { - this._isCancelled = false; - this._emitter = null; - } - MutableToken.prototype.cancel = function () { - if (!this._isCancelled) { - this._isCancelled = true; - if (this._emitter) { - this._emitter.fire(undefined); - this.dispose(); - } - } + /** + * The end point (exclusive) of the change in the original sequence. + */ + DiffChange.prototype.getOriginalEnd = function () { + return this.originalStart + this.originalLength; }; - Object.defineProperty(MutableToken.prototype, "isCancellationRequested", { - get: function () { - return this._isCancelled; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(MutableToken.prototype, "onCancellationRequested", { - get: function () { - if (this._isCancelled) { - return shortcutEvent; - } - if (!this._emitter) { - this._emitter = new _event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - } - return this._emitter.event; - }, - enumerable: true, - configurable: true - }); - MutableToken.prototype.dispose = function () { - if (this._emitter) { - this._emitter.dispose(); - this._emitter = null; - } + /** + * The end point (exclusive) of the change in the modified sequence. + */ + DiffChange.prototype.getModifiedEnd = function () { + return this.modifiedStart + this.modifiedLength; }; - return MutableToken; -}()); -var CancellationTokenSource = /** @class */ (function () { - function CancellationTokenSource(parent) { - this._token = undefined; - this._parentListener = undefined; - this._parentListener = parent && parent.onCancellationRequested(this.cancel, this); - } - Object.defineProperty(CancellationTokenSource.prototype, "token", { - get: function () { - if (!this._token) { - // be lazy and create the token only when - // actually needed - this._token = new MutableToken(); - } - return this._token; - }, - enumerable: true, - configurable: true - }); - CancellationTokenSource.prototype.cancel = function () { - if (!this._token) { - // save an object by returning the default - // cancelled token when cancellation happens - // before someone asks for the token - this._token = CancellationToken.Cancelled; - } - else if (this._token instanceof MutableToken) { - // actually cancel - this._token.cancel(); - } - }; - CancellationTokenSource.prototype.dispose = function () { - if (this._parentListener) { - this._parentListener.dispose(); - } - if (!this._token) { - // ensure to initialize with an empty token if we had none - this._token = CancellationToken.None; - } - else if (this._token instanceof MutableToken) { - // actually dispose - this._token.dispose(); - } - }; - return CancellationTokenSource; + return DiffChange; }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js ***! - \********************************************************************/ -/*! exports provided: stringDiff, Debug, MyArray, LcsDiff */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringDiff", function() { return stringDiff; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Debug", function() { return Debug; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MyArray", function() { return MyArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LcsDiff", function() { return LcsDiff; }); -/* harmony import */ var _diffChange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diffChange.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -545,7 +1405,7 @@ function createStringSequence(a) { }; } function stringDiff(original, modified, pretty) { - return new LcsDiff(createStringSequence(original), createStringSequence(modified)).ComputeDiff(pretty); + return new diff_LcsDiff(createStringSequence(original), createStringSequence(modified)).ComputeDiff(pretty); } // // The code below has been ported from a C# implementation in VS @@ -608,7 +1468,7 @@ var MaxDifferencesHistory = 1447; * distinct changes. At the end, the Changes property can be called to retrieve * the constructed changes. */ -var DiffChangeHelper = /** @class */ (function () { +var diff_DiffChangeHelper = /** @class */ (function () { /** * Constructs a new DiffChangeHelper for the given DiffSequences. */ @@ -626,7 +1486,7 @@ var DiffChangeHelper = /** @class */ (function () { // Only add to the list if there is something to add if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { // Add the new change to our list - this.m_changes.push(new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)); + this.m_changes.push(new DiffChange(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)); } // Reset for the next change this.m_originalCount = 0; @@ -687,7 +1547,7 @@ var DiffChangeHelper = /** @class */ (function () { * An implementation of the difference algorithm described in * "An O(ND) Difference Algorithm and its variations" by Eugene W. Myers */ -var LcsDiff = /** @class */ (function () { +var diff_LcsDiff = /** @class */ (function () { /** * Constructs the DiffFinder */ @@ -751,14 +1611,14 @@ var LcsDiff = /** @class */ (function () { Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd'); // All insertions changes = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1) + new DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1) ]; } else if (originalStart <= originalEnd) { Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd'); // All deletions changes = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, 0) + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0) ]; } else { @@ -793,20 +1653,20 @@ var LcsDiff = /** @class */ (function () { // We did't have time to finish the first half, so we don't have time to compute this half. // Consider the entire rest of the sequence different. rightChanges = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1) + new DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1) ]; } return this.ConcatenateChanges(leftChanges, rightChanges); } // If we hit here, we quit early, and so can't return anything meaningful return [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) ]; }; LcsDiff.prototype.WALKTRACE = function (diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) { var forwardChanges = null, reverseChanges = null; // First, walk backward through the forward diagonals history - var changeHelper = new DiffChangeHelper(); + var changeHelper = new diff_DiffChangeHelper(); var diagonalMin = diagonalForwardStart; var diagonalMax = diagonalForwardEnd; var diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalForwardOffset; @@ -860,12 +1720,12 @@ var LcsDiff = /** @class */ (function () { modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd()); } reverseChanges = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1) + new DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1) ]; } else { // Now walk backward through the reverse diagonals history - changeHelper = new DiffChangeHelper(); + changeHelper = new diff_DiffChangeHelper(); diagonalMin = diagonalReverseStart; diagonalMax = diagonalReverseEnd; diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalReverseOffset; @@ -1048,7 +1908,7 @@ var LcsDiff = /** @class */ (function () { originalStart++; modifiedStart++; return [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) ]; } } @@ -1279,7 +2139,7 @@ var LcsDiff = /** @class */ (function () { if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) { modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart; } - mergedChangeArr[0] = new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalLength, modifiedStart, modifiedLength); + mergedChangeArr[0] = new DiffChange(originalStart, originalLength, modifiedStart, modifiedLength); return true; } else { @@ -1322,952 +2182,12 @@ var LcsDiff = /** @class */ (function () { }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js ***! - \**************************************************************************/ -/*! exports provided: DiffChange */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffChange", function() { return DiffChange; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/iterator.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -/** - * Represents information about a specific difference between two sequences. - */ -var DiffChange = /** @class */ (function () { - /** - * Constructs a new DiffChange with the given sequence information - * and content. - */ - function DiffChange(originalStart, originalLength, modifiedStart, modifiedLength) { - //Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0"); - this.originalStart = originalStart; - this.originalLength = originalLength; - this.modifiedStart = modifiedStart; - this.modifiedLength = modifiedLength; - } - /** - * The end point (exclusive) of the change in the original sequence. - */ - DiffChange.prototype.getOriginalEnd = function () { - return this.originalStart + this.originalLength; - }; - /** - * The end point (exclusive) of the change in the modified sequence. - */ - DiffChange.prototype.getModifiedEnd = function () { - return this.modifiedStart + this.modifiedLength; - }; - return DiffChange; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/errors.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/errors.js ***! - \*****************************************************************/ -/*! exports provided: ErrorHandler, errorHandler, onUnexpectedError, onUnexpectedExternalError, transformErrorForSerialization, isPromiseCanceledError, canceled, illegalArgument, illegalState */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorHandler", function() { return ErrorHandler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "errorHandler", function() { return errorHandler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedError", function() { return onUnexpectedError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedExternalError", function() { return onUnexpectedExternalError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformErrorForSerialization", function() { return transformErrorForSerialization; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPromiseCanceledError", function() { return isPromiseCanceledError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canceled", function() { return canceled; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalArgument", function() { return illegalArgument; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalState", function() { return illegalState; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -// Avoid circular dependency on EventEmitter by implementing a subset of the interface. -var ErrorHandler = /** @class */ (function () { - function ErrorHandler() { - this.listeners = []; - this.unexpectedErrorHandler = function (e) { - setTimeout(function () { - if (e.stack) { - throw new Error(e.message + '\n\n' + e.stack); - } - throw e; - }, 0); - }; - } - ErrorHandler.prototype.emit = function (e) { - this.listeners.forEach(function (listener) { - listener(e); - }); - }; - ErrorHandler.prototype.onUnexpectedError = function (e) { - this.unexpectedErrorHandler(e); - this.emit(e); - }; - // For external errors, we don't want the listeners to be called - ErrorHandler.prototype.onUnexpectedExternalError = function (e) { - this.unexpectedErrorHandler(e); - }; - return ErrorHandler; -}()); - -var errorHandler = new ErrorHandler(); -function onUnexpectedError(e) { - // ignore errors from cancelled promises - if (!isPromiseCanceledError(e)) { - errorHandler.onUnexpectedError(e); - } - return undefined; -} -function onUnexpectedExternalError(e) { - // ignore errors from cancelled promises - if (!isPromiseCanceledError(e)) { - errorHandler.onUnexpectedExternalError(e); - } - return undefined; -} -function transformErrorForSerialization(error) { - if (error instanceof Error) { - var name_1 = error.name, message = error.message; - var stack = error.stacktrace || error.stack; - return { - $isError: true, - name: name_1, - message: message, - stack: stack - }; - } - // return as is - return error; -} -var canceledName = 'Canceled'; -/** - * Checks if the given error is a promise in canceled state - */ -function isPromiseCanceledError(error) { - return error instanceof Error && error.name === canceledName && error.message === canceledName; -} -/** - * Returns an error that signals cancellation. - */ -function canceled() { - var error = new Error(canceledName); - error.name = error.message; - return error; -} -function illegalArgument(name) { - if (name) { - return new Error("Illegal argument: " + name); - } - else { - return new Error('Illegal argument'); - } -} -function illegalState(name) { - if (name) { - return new Error("Illegal state: " + name); - } - else { - return new Error('Illegal state'); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/event.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/event.js ***! - \****************************************************************/ -/*! exports provided: Event, Emitter, PauseableEmitter, EventMultiplexer, EventBufferer, Relay */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Event", function() { return Event; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Emitter", function() { return Emitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PauseableEmitter", function() { return PauseableEmitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventMultiplexer", function() { return EventMultiplexer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventBufferer", function() { return EventBufferer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Relay", function() { return Relay; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _functional_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functional.js */ "./node_modules/monaco-editor/esm/vs/base/common/functional.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _linkedList_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./linkedList.js */ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -var Event; -(function (Event) { - var _disposable = { dispose: function () { } }; - Event.None = function () { return _disposable; }; - /** - * Given an event, returns another event which only fires once. - */ - function once(event) { - return function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - // we need this, in case the event fires during the listener call - var didFire = false; - var result; - result = event(function (e) { - if (didFire) { - return; - } - else if (result) { - result.dispose(); - } - else { - didFire = true; - } - return listener.call(thisArgs, e); - }, null, disposables); - if (didFire) { - result.dispose(); - } - return result; - }; - } - Event.once = once; - /** - * Given an event and a `map` function, returns another event which maps each element - * throught the mapping function. - */ - function map(event, map) { - return snapshot(function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return event(function (i) { return listener.call(thisArgs, map(i)); }, null, disposables); - }); - } - Event.map = map; - /** - * Given an event and an `each` function, returns another identical event and calls - * the `each` function per each element. - */ - function forEach(event, each) { - return snapshot(function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return event(function (i) { each(i); listener.call(thisArgs, i); }, null, disposables); - }); - } - Event.forEach = forEach; - function filter(event, filter) { - return snapshot(function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return event(function (e) { return filter(e) && listener.call(thisArgs, e); }, null, disposables); - }); - } - Event.filter = filter; - /** - * Given an event, returns the same event but typed as `Event`. - */ - function signal(event) { - return event; - } - Event.signal = signal; - /** - * Given a collection of events, returns a single event which emits - * whenever any of the provided events emit. - */ - function any() { - var events = []; - for (var _i = 0; _i < arguments.length; _i++) { - events[_i] = arguments[_i]; - } - return function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return Object(_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["combinedDisposable"])(events.map(function (event) { return event(function (e) { return listener.call(thisArgs, e); }, null, disposables); })); - }; - } - Event.any = any; - /** - * Given an event and a `merge` function, returns another event which maps each element - * and the cummulative result throught the `merge` function. Similar to `map`, but with memory. - */ - function reduce(event, merge, initial) { - var output = initial; - return map(event, function (e) { - output = merge(output, e); - return output; - }); - } - Event.reduce = reduce; - /** - * Given a chain of event processing functions (filter, map, etc), each - * function will be invoked per event & per listener. Snapshotting an event - * chain allows each function to be invoked just once per event. - */ - function snapshot(event) { - var listener; - var emitter = new Emitter({ - onFirstListenerAdd: function () { - listener = event(emitter.fire, emitter); - }, - onLastListenerRemove: function () { - listener.dispose(); - } - }); - return emitter.event; - } - Event.snapshot = snapshot; - function debounce(event, merge, delay, leading, leakWarningThreshold) { - if (delay === void 0) { delay = 100; } - if (leading === void 0) { leading = false; } - var subscription; - var output = undefined; - var handle = undefined; - var numDebouncedCalls = 0; - var emitter = new Emitter({ - leakWarningThreshold: leakWarningThreshold, - onFirstListenerAdd: function () { - subscription = event(function (cur) { - numDebouncedCalls++; - output = merge(output, cur); - if (leading && !handle) { - emitter.fire(output); - } - clearTimeout(handle); - handle = setTimeout(function () { - var _output = output; - output = undefined; - handle = undefined; - if (!leading || numDebouncedCalls > 1) { - emitter.fire(_output); - } - numDebouncedCalls = 0; - }, delay); - }); - }, - onLastListenerRemove: function () { - subscription.dispose(); - } - }); - return emitter.event; - } - Event.debounce = debounce; - /** - * Given an event, it returns another event which fires only once and as soon as - * the input event emits. The event data is the number of millis it took for the - * event to fire. - */ - function stopwatch(event) { - var start = new Date().getTime(); - return map(once(event), function (_) { return new Date().getTime() - start; }); - } - Event.stopwatch = stopwatch; - /** - * Given an event, it returns another event which fires only when the event - * element changes. - */ - function latch(event) { - var firstCall = true; - var cache; - return filter(event, function (value) { - var shouldEmit = firstCall || value !== cache; - firstCall = false; - cache = value; - return shouldEmit; - }); - } - Event.latch = latch; - /** - * Buffers the provided event until a first listener comes - * along, at which point fire all the events at once and - * pipe the event from then on. - * - * ```typescript - * const emitter = new Emitter(); - * const event = emitter.event; - * const bufferedEvent = buffer(event); - * - * emitter.fire(1); - * emitter.fire(2); - * emitter.fire(3); - * // nothing... - * - * const listener = bufferedEvent(num => console.log(num)); - * // 1, 2, 3 - * - * emitter.fire(4); - * // 4 - * ``` - */ - function buffer(event, nextTick, _buffer) { - if (nextTick === void 0) { nextTick = false; } - if (_buffer === void 0) { _buffer = []; } - var buffer = _buffer.slice(); - var listener = event(function (e) { - if (buffer) { - buffer.push(e); - } - else { - emitter.fire(e); - } - }); - var flush = function () { - if (buffer) { - buffer.forEach(function (e) { return emitter.fire(e); }); - } - buffer = null; - }; - var emitter = new Emitter({ - onFirstListenerAdd: function () { - if (!listener) { - listener = event(function (e) { return emitter.fire(e); }); - } - }, - onFirstListenerDidAdd: function () { - if (buffer) { - if (nextTick) { - setTimeout(flush); - } - else { - flush(); - } - } - }, - onLastListenerRemove: function () { - if (listener) { - listener.dispose(); - } - listener = null; - } - }); - return emitter.event; - } - Event.buffer = buffer; - var ChainableEvent = /** @class */ (function () { - function ChainableEvent(event) { - this.event = event; - } - ChainableEvent.prototype.map = function (fn) { - return new ChainableEvent(map(this.event, fn)); - }; - ChainableEvent.prototype.forEach = function (fn) { - return new ChainableEvent(forEach(this.event, fn)); - }; - ChainableEvent.prototype.filter = function (fn) { - return new ChainableEvent(filter(this.event, fn)); - }; - ChainableEvent.prototype.reduce = function (merge, initial) { - return new ChainableEvent(reduce(this.event, merge, initial)); - }; - ChainableEvent.prototype.latch = function () { - return new ChainableEvent(latch(this.event)); - }; - ChainableEvent.prototype.on = function (listener, thisArgs, disposables) { - return this.event(listener, thisArgs, disposables); - }; - ChainableEvent.prototype.once = function (listener, thisArgs, disposables) { - return once(this.event)(listener, thisArgs, disposables); - }; - return ChainableEvent; - }()); - function chain(event) { - return new ChainableEvent(event); - } - Event.chain = chain; - function fromNodeEventEmitter(emitter, eventName, map) { - if (map === void 0) { map = function (id) { return id; }; } - var fn = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return result.fire(map.apply(void 0, args)); - }; - var onFirstListenerAdd = function () { return emitter.on(eventName, fn); }; - var onLastListenerRemove = function () { return emitter.removeListener(eventName, fn); }; - var result = new Emitter({ onFirstListenerAdd: onFirstListenerAdd, onLastListenerRemove: onLastListenerRemove }); - return result.event; - } - Event.fromNodeEventEmitter = fromNodeEventEmitter; - function fromPromise(promise) { - var emitter = new Emitter(); - var shouldEmit = false; - promise - .then(undefined, function () { return null; }) - .then(function () { - if (!shouldEmit) { - setTimeout(function () { return emitter.fire(undefined); }, 0); - } - else { - emitter.fire(undefined); - } - }); - shouldEmit = true; - return emitter.event; - } - Event.fromPromise = fromPromise; - function toPromise(event) { - return new Promise(function (c) { return once(event)(c); }); - } - Event.toPromise = toPromise; -})(Event || (Event = {})); -var _globalLeakWarningThreshold = -1; -var LeakageMonitor = /** @class */ (function () { - function LeakageMonitor(customThreshold, name) { - if (name === void 0) { name = Math.random().toString(18).slice(2, 5); } - this.customThreshold = customThreshold; - this.name = name; - this._warnCountdown = 0; - } - LeakageMonitor.prototype.dispose = function () { - if (this._stacks) { - this._stacks.clear(); - } - }; - LeakageMonitor.prototype.check = function (listenerCount) { - var _this = this; - var threshold = _globalLeakWarningThreshold; - if (typeof this.customThreshold === 'number') { - threshold = this.customThreshold; - } - if (threshold <= 0 || listenerCount < threshold) { - return undefined; - } - if (!this._stacks) { - this._stacks = new Map(); - } - var stack = new Error().stack.split('\n').slice(3).join('\n'); - var count = (this._stacks.get(stack) || 0); - this._stacks.set(stack, count + 1); - this._warnCountdown -= 1; - if (this._warnCountdown <= 0) { - // only warn on first exceed and then every time the limit - // is exceeded by 50% again - this._warnCountdown = threshold * 0.5; - // find most frequent listener and print warning - var topStack_1; - var topCount_1 = 0; - this._stacks.forEach(function (count, stack) { - if (!topStack_1 || topCount_1 < count) { - topStack_1 = stack; - topCount_1 = count; - } - }); - console.warn("[" + this.name + "] potential listener LEAK detected, having " + listenerCount + " listeners already. MOST frequent listener (" + topCount_1 + "):"); - console.warn(topStack_1); - } - return function () { - var count = (_this._stacks.get(stack) || 0); - _this._stacks.set(stack, count - 1); - }; - }; - return LeakageMonitor; -}()); -/** - * The Emitter can be used to expose an Event to the public - * to fire it from the insides. - * Sample: - class Document { - - private _onDidChange = new Emitter<(value:string)=>any>(); - - public onDidChange = this._onDidChange.event; - - // getter-style - // get onDidChange(): Event<(value:string)=>any> { - // return this._onDidChange.event; - // } - - private _doIt() { - //... - this._onDidChange.fire(value); - } - } - */ -var Emitter = /** @class */ (function () { - function Emitter(options) { - this._disposed = false; - this._options = options; - this._leakageMon = _globalLeakWarningThreshold > 0 - ? new LeakageMonitor(this._options && this._options.leakWarningThreshold) - : undefined; - } - Object.defineProperty(Emitter.prototype, "event", { - /** - * For the public to allow to subscribe - * to events from this Emitter - */ - get: function () { - var _this = this; - if (!this._event) { - this._event = function (listener, thisArgs, disposables) { - if (!_this._listeners) { - _this._listeners = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"](); - } - var firstListener = _this._listeners.isEmpty(); - if (firstListener && _this._options && _this._options.onFirstListenerAdd) { - _this._options.onFirstListenerAdd(_this); - } - var remove = _this._listeners.push(!thisArgs ? listener : [listener, thisArgs]); - if (firstListener && _this._options && _this._options.onFirstListenerDidAdd) { - _this._options.onFirstListenerDidAdd(_this); - } - if (_this._options && _this._options.onListenerDidAdd) { - _this._options.onListenerDidAdd(_this, listener, thisArgs); - } - // check and record this emitter for potential leakage - var removeMonitor; - if (_this._leakageMon) { - removeMonitor = _this._leakageMon.check(_this._listeners.size); - } - var result; - result = { - dispose: function () { - if (removeMonitor) { - removeMonitor(); - } - result.dispose = Emitter._noop; - if (!_this._disposed) { - remove(); - if (_this._options && _this._options.onLastListenerRemove) { - var hasListeners = (_this._listeners && !_this._listeners.isEmpty()); - if (!hasListeners) { - _this._options.onLastListenerRemove(_this); - } - } - } - } - }; - if (Array.isArray(disposables)) { - disposables.push(result); - } - return result; - }; - } - return this._event; - }, - enumerable: true, - configurable: true - }); - /** - * To be kept private to fire an event to - * subscribers - */ - Emitter.prototype.fire = function (event) { - if (this._listeners) { - // put all [listener,event]-pairs into delivery queue - // then emit all event. an inner/nested event might be - // the driver of this - if (!this._deliveryQueue) { - this._deliveryQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"](); - } - for (var iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) { - this._deliveryQueue.push([e.value, event]); - } - while (this._deliveryQueue.size > 0) { - var _a = this._deliveryQueue.shift(), listener = _a[0], event_1 = _a[1]; - try { - if (typeof listener === 'function') { - listener.call(undefined, event_1); - } - else { - listener[0].call(listener[1], event_1); - } - } - catch (e) { - Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e); - } - } - } - }; - Emitter.prototype.dispose = function () { - if (this._listeners) { - this._listeners.clear(); - } - if (this._deliveryQueue) { - this._deliveryQueue.clear(); - } - if (this._leakageMon) { - this._leakageMon.dispose(); - } - this._disposed = true; - }; - Emitter._noop = function () { }; - return Emitter; -}()); - -var PauseableEmitter = /** @class */ (function (_super) { - __extends(PauseableEmitter, _super); - function PauseableEmitter(options) { - var _this = _super.call(this, options) || this; - _this._isPaused = 0; - _this._eventQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"](); - _this._mergeFn = options && options.merge; - return _this; - } - PauseableEmitter.prototype.pause = function () { - this._isPaused++; - }; - PauseableEmitter.prototype.resume = function () { - if (this._isPaused !== 0 && --this._isPaused === 0) { - if (this._mergeFn) { - // use the merge function to create a single composite - // event. make a copy in case firing pauses this emitter - var events = this._eventQueue.toArray(); - this._eventQueue.clear(); - _super.prototype.fire.call(this, this._mergeFn(events)); - } - else { - // no merging, fire each event individually and test - // that this emitter isn't paused halfway through - while (!this._isPaused && this._eventQueue.size !== 0) { - _super.prototype.fire.call(this, this._eventQueue.shift()); - } - } - } - }; - PauseableEmitter.prototype.fire = function (event) { - if (this._listeners) { - if (this._isPaused !== 0) { - this._eventQueue.push(event); - } - else { - _super.prototype.fire.call(this, event); - } - } - }; - return PauseableEmitter; -}(Emitter)); - -var EventMultiplexer = /** @class */ (function () { - function EventMultiplexer() { - var _this = this; - this.hasListeners = false; - this.events = []; - this.emitter = new Emitter({ - onFirstListenerAdd: function () { return _this.onFirstListenerAdd(); }, - onLastListenerRemove: function () { return _this.onLastListenerRemove(); } - }); - } - Object.defineProperty(EventMultiplexer.prototype, "event", { - get: function () { - return this.emitter.event; - }, - enumerable: true, - configurable: true - }); - EventMultiplexer.prototype.add = function (event) { - var _this = this; - var e = { event: event, listener: null }; - this.events.push(e); - if (this.hasListeners) { - this.hook(e); - } - var dispose = function () { - if (_this.hasListeners) { - _this.unhook(e); - } - var idx = _this.events.indexOf(e); - _this.events.splice(idx, 1); - }; - return Object(_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["toDisposable"])(Object(_functional_js__WEBPACK_IMPORTED_MODULE_1__["once"])(dispose)); - }; - EventMultiplexer.prototype.onFirstListenerAdd = function () { - var _this = this; - this.hasListeners = true; - this.events.forEach(function (e) { return _this.hook(e); }); - }; - EventMultiplexer.prototype.onLastListenerRemove = function () { - var _this = this; - this.hasListeners = false; - this.events.forEach(function (e) { return _this.unhook(e); }); - }; - EventMultiplexer.prototype.hook = function (e) { - var _this = this; - e.listener = e.event(function (r) { return _this.emitter.fire(r); }); - }; - EventMultiplexer.prototype.unhook = function (e) { - if (e.listener) { - e.listener.dispose(); - } - e.listener = null; - }; - EventMultiplexer.prototype.dispose = function () { - this.emitter.dispose(); - }; - return EventMultiplexer; -}()); - -/** - * The EventBufferer is useful in situations in which you want - * to delay firing your events during some code. - * You can wrap that code and be sure that the event will not - * be fired during that wrap. - * - * ``` - * const emitter: Emitter; - * const delayer = new EventDelayer(); - * const delayedEvent = delayer.wrapEvent(emitter.event); - * - * delayedEvent(console.log); - * - * delayer.bufferEvents(() => { - * emitter.fire(); // event will not be fired yet - * }); - * - * // event will only be fired at this point - * ``` - */ -var EventBufferer = /** @class */ (function () { - function EventBufferer() { - this.buffers = []; - } - EventBufferer.prototype.wrapEvent = function (event) { - var _this = this; - return function (listener, thisArgs, disposables) { - return event(function (i) { - var buffer = _this.buffers[_this.buffers.length - 1]; - if (buffer) { - buffer.push(function () { return listener.call(thisArgs, i); }); - } - else { - listener.call(thisArgs, i); - } - }, undefined, disposables); - }; - }; - EventBufferer.prototype.bufferEvents = function (fn) { - var buffer = []; - this.buffers.push(buffer); - var r = fn(); - this.buffers.pop(); - buffer.forEach(function (flush) { return flush(); }); - return r; - }; - return EventBufferer; -}()); - -/** - * A Relay is an event forwarder which functions as a replugabble event pipe. - * Once created, you can connect an input event to it and it will simply forward - * events from that input event through its own `event` property. The `input` - * can be changed at any point in time. - */ -var Relay = /** @class */ (function () { - function Relay() { - var _this = this; - this.listening = false; - this.inputEvent = Event.None; - this.inputEventListener = _lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"].None; - this.emitter = new Emitter({ - onFirstListenerDidAdd: function () { - _this.listening = true; - _this.inputEventListener = _this.inputEvent(_this.emitter.fire, _this.emitter); - }, - onLastListenerRemove: function () { - _this.listening = false; - _this.inputEventListener.dispose(); - } - }); - this.event = this.emitter.event; - } - Object.defineProperty(Relay.prototype, "input", { - set: function (event) { - this.inputEvent = event; - if (this.listening) { - this.inputEventListener.dispose(); - this.inputEventListener = event(this.emitter.fire, this.emitter); - } - }, - enumerable: true, - configurable: true - }); - Relay.prototype.dispose = function () { - this.inputEventListener.dispose(); - this.emitter.dispose(); - }; - return Relay; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/functional.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/functional.js ***! - \*********************************************************************/ -/*! exports provided: once */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "once", function() { return once; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function once(fn) { - var _this = this; - var didCall = false; - var result; - return function () { - if (didCall) { - return result; - } - didCall = true; - result = fn.apply(_this, arguments); - return result; - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/iterator.js ***! - \*******************************************************************/ -/*! exports provided: FIN, Iterator, getSequenceIterator, ArrayIterator, ArrayNavigator, MappedIterator */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FIN", function() { return FIN; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Iterator", function() { return Iterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSequenceIterator", function() { return getSequenceIterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayIterator", function() { return ArrayIterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayNavigator", function() { return ArrayNavigator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MappedIterator", function() { return MappedIterator; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { +var iterator_extends = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || @@ -2392,7 +2312,7 @@ var ArrayIterator = /** @class */ (function () { }()); var ArrayNavigator = /** @class */ (function (_super) { - __extends(ArrayNavigator, _super); + iterator_extends(ArrayNavigator, _super); function ArrayNavigator(items, start, end, index) { if (start === void 0) { start = 0; } if (end === void 0) { end = items.length; } @@ -2431,687 +2351,1057 @@ var MappedIterator = /** @class */ (function () { }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js ***! - \*******************************************************************/ -/*! exports provided: KeyCodeUtils, KeyChord, createKeybinding, createSimpleKeybinding, SimpleKeybinding, ChordKeybinding, ResolvedKeybindingPart, ResolvedKeybinding */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCodeUtils", function() { return KeyCodeUtils; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyChord", function() { return KeyChord; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createKeybinding", function() { return createKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSimpleKeybinding", function() { return createSimpleKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleKeybinding", function() { return SimpleKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChordKeybinding", function() { return ChordKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybindingPart", function() { return ResolvedKeybindingPart; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybinding", function() { return ResolvedKeybinding; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/uri.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -var KeyCodeStrMap = /** @class */ (function () { - function KeyCodeStrMap() { - this._keyCodeToStr = []; - this._strToKeyCode = Object.create(null); - } - KeyCodeStrMap.prototype.define = function (keyCode, str) { - this._keyCodeToStr[keyCode] = str; - this._strToKeyCode[str.toLowerCase()] = keyCode; +var uri_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); }; - KeyCodeStrMap.prototype.keyCodeToStr = function (keyCode) { - return this._keyCodeToStr[keyCode]; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; - KeyCodeStrMap.prototype.strToKeyCode = function (str) { - return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */; - }; - return KeyCodeStrMap; -}()); -var uiMap = new KeyCodeStrMap(); -var userSettingsUSMap = new KeyCodeStrMap(); -var userSettingsGeneralMap = new KeyCodeStrMap(); -(function () { - function define(keyCode, uiLabel, usUserSettingsLabel, generalUserSettingsLabel) { - if (usUserSettingsLabel === void 0) { usUserSettingsLabel = uiLabel; } - if (generalUserSettingsLabel === void 0) { generalUserSettingsLabel = usUserSettingsLabel; } - uiMap.define(keyCode, uiLabel); - userSettingsUSMap.define(keyCode, usUserSettingsLabel); - userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel); - } - define(0 /* Unknown */, 'unknown'); - define(1 /* Backspace */, 'Backspace'); - define(2 /* Tab */, 'Tab'); - define(3 /* Enter */, 'Enter'); - define(4 /* Shift */, 'Shift'); - define(5 /* Ctrl */, 'Ctrl'); - define(6 /* Alt */, 'Alt'); - define(7 /* PauseBreak */, 'PauseBreak'); - define(8 /* CapsLock */, 'CapsLock'); - define(9 /* Escape */, 'Escape'); - define(10 /* Space */, 'Space'); - define(11 /* PageUp */, 'PageUp'); - define(12 /* PageDown */, 'PageDown'); - define(13 /* End */, 'End'); - define(14 /* Home */, 'Home'); - define(15 /* LeftArrow */, 'LeftArrow', 'Left'); - define(16 /* UpArrow */, 'UpArrow', 'Up'); - define(17 /* RightArrow */, 'RightArrow', 'Right'); - define(18 /* DownArrow */, 'DownArrow', 'Down'); - define(19 /* Insert */, 'Insert'); - define(20 /* Delete */, 'Delete'); - define(21 /* KEY_0 */, '0'); - define(22 /* KEY_1 */, '1'); - define(23 /* KEY_2 */, '2'); - define(24 /* KEY_3 */, '3'); - define(25 /* KEY_4 */, '4'); - define(26 /* KEY_5 */, '5'); - define(27 /* KEY_6 */, '6'); - define(28 /* KEY_7 */, '7'); - define(29 /* KEY_8 */, '8'); - define(30 /* KEY_9 */, '9'); - define(31 /* KEY_A */, 'A'); - define(32 /* KEY_B */, 'B'); - define(33 /* KEY_C */, 'C'); - define(34 /* KEY_D */, 'D'); - define(35 /* KEY_E */, 'E'); - define(36 /* KEY_F */, 'F'); - define(37 /* KEY_G */, 'G'); - define(38 /* KEY_H */, 'H'); - define(39 /* KEY_I */, 'I'); - define(40 /* KEY_J */, 'J'); - define(41 /* KEY_K */, 'K'); - define(42 /* KEY_L */, 'L'); - define(43 /* KEY_M */, 'M'); - define(44 /* KEY_N */, 'N'); - define(45 /* KEY_O */, 'O'); - define(46 /* KEY_P */, 'P'); - define(47 /* KEY_Q */, 'Q'); - define(48 /* KEY_R */, 'R'); - define(49 /* KEY_S */, 'S'); - define(50 /* KEY_T */, 'T'); - define(51 /* KEY_U */, 'U'); - define(52 /* KEY_V */, 'V'); - define(53 /* KEY_W */, 'W'); - define(54 /* KEY_X */, 'X'); - define(55 /* KEY_Y */, 'Y'); - define(56 /* KEY_Z */, 'Z'); - define(57 /* Meta */, 'Meta'); - define(58 /* ContextMenu */, 'ContextMenu'); - define(59 /* F1 */, 'F1'); - define(60 /* F2 */, 'F2'); - define(61 /* F3 */, 'F3'); - define(62 /* F4 */, 'F4'); - define(63 /* F5 */, 'F5'); - define(64 /* F6 */, 'F6'); - define(65 /* F7 */, 'F7'); - define(66 /* F8 */, 'F8'); - define(67 /* F9 */, 'F9'); - define(68 /* F10 */, 'F10'); - define(69 /* F11 */, 'F11'); - define(70 /* F12 */, 'F12'); - define(71 /* F13 */, 'F13'); - define(72 /* F14 */, 'F14'); - define(73 /* F15 */, 'F15'); - define(74 /* F16 */, 'F16'); - define(75 /* F17 */, 'F17'); - define(76 /* F18 */, 'F18'); - define(77 /* F19 */, 'F19'); - define(78 /* NumLock */, 'NumLock'); - define(79 /* ScrollLock */, 'ScrollLock'); - define(80 /* US_SEMICOLON */, ';', ';', 'OEM_1'); - define(81 /* US_EQUAL */, '=', '=', 'OEM_PLUS'); - define(82 /* US_COMMA */, ',', ',', 'OEM_COMMA'); - define(83 /* US_MINUS */, '-', '-', 'OEM_MINUS'); - define(84 /* US_DOT */, '.', '.', 'OEM_PERIOD'); - define(85 /* US_SLASH */, '/', '/', 'OEM_2'); - define(86 /* US_BACKTICK */, '`', '`', 'OEM_3'); - define(110 /* ABNT_C1 */, 'ABNT_C1'); - define(111 /* ABNT_C2 */, 'ABNT_C2'); - define(87 /* US_OPEN_SQUARE_BRACKET */, '[', '[', 'OEM_4'); - define(88 /* US_BACKSLASH */, '\\', '\\', 'OEM_5'); - define(89 /* US_CLOSE_SQUARE_BRACKET */, ']', ']', 'OEM_6'); - define(90 /* US_QUOTE */, '\'', '\'', 'OEM_7'); - define(91 /* OEM_8 */, 'OEM_8'); - define(92 /* OEM_102 */, 'OEM_102'); - define(93 /* NUMPAD_0 */, 'NumPad0'); - define(94 /* NUMPAD_1 */, 'NumPad1'); - define(95 /* NUMPAD_2 */, 'NumPad2'); - define(96 /* NUMPAD_3 */, 'NumPad3'); - define(97 /* NUMPAD_4 */, 'NumPad4'); - define(98 /* NUMPAD_5 */, 'NumPad5'); - define(99 /* NUMPAD_6 */, 'NumPad6'); - define(100 /* NUMPAD_7 */, 'NumPad7'); - define(101 /* NUMPAD_8 */, 'NumPad8'); - define(102 /* NUMPAD_9 */, 'NumPad9'); - define(103 /* NUMPAD_MULTIPLY */, 'NumPad_Multiply'); - define(104 /* NUMPAD_ADD */, 'NumPad_Add'); - define(105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator'); - define(106 /* NUMPAD_SUBTRACT */, 'NumPad_Subtract'); - define(107 /* NUMPAD_DECIMAL */, 'NumPad_Decimal'); - define(108 /* NUMPAD_DIVIDE */, 'NumPad_Divide'); })(); -var KeyCodeUtils; -(function (KeyCodeUtils) { - function toString(keyCode) { - return uiMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toString = toString; - function fromString(key) { - return uiMap.strToKeyCode(key); - } - KeyCodeUtils.fromString = fromString; - function toUserSettingsUS(keyCode) { - return userSettingsUSMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toUserSettingsUS = toUserSettingsUS; - function toUserSettingsGeneral(keyCode) { - return userSettingsGeneralMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral; - function fromUserSettings(key) { - return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); - } - KeyCodeUtils.fromUserSettings = fromUserSettings; -})(KeyCodeUtils || (KeyCodeUtils = {})); -function KeyChord(firstPart, secondPart) { - var chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0; - return (firstPart | chordPart) >>> 0; -} -function createKeybinding(keybinding, OS) { - if (keybinding === 0) { - return null; - } - var firstPart = (keybinding & 0x0000FFFF) >>> 0; - var chordPart = (keybinding & 0xFFFF0000) >>> 16; - if (chordPart !== 0) { - return new ChordKeybinding([ - createSimpleKeybinding(firstPart, OS), - createSimpleKeybinding(chordPart, OS) - ]); - } - return new ChordKeybinding([createSimpleKeybinding(firstPart, OS)]); -} -function createSimpleKeybinding(keybinding, OS) { - var ctrlCmd = (keybinding & 2048 /* CtrlCmd */ ? true : false); - var winCtrl = (keybinding & 256 /* WinCtrl */ ? true : false); - var ctrlKey = (OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd); - var shiftKey = (keybinding & 1024 /* Shift */ ? true : false); - var altKey = (keybinding & 512 /* Alt */ ? true : false); - var metaKey = (OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl); - var keyCode = (keybinding & 255 /* KeyCode */); - return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode); -} -var SimpleKeybinding = /** @class */ (function () { - function SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode) { - this.ctrlKey = ctrlKey; - this.shiftKey = shiftKey; - this.altKey = altKey; - this.metaKey = metaKey; - this.keyCode = keyCode; - } - SimpleKeybinding.prototype.equals = function (other) { - return (this.ctrlKey === other.ctrlKey - && this.shiftKey === other.shiftKey - && this.altKey === other.altKey - && this.metaKey === other.metaKey - && this.keyCode === other.keyCode); - }; - SimpleKeybinding.prototype.isModifierKey = function () { - return (this.keyCode === 0 /* Unknown */ - || this.keyCode === 5 /* Ctrl */ - || this.keyCode === 57 /* Meta */ - || this.keyCode === 6 /* Alt */ - || this.keyCode === 4 /* Shift */); - }; - SimpleKeybinding.prototype.toChord = function () { - return new ChordKeybinding([this]); - }; - /** - * Does this keybinding refer to the key code of a modifier and it also has the modifier flag? - */ - SimpleKeybinding.prototype.isDuplicateModifierCase = function () { - return ((this.ctrlKey && this.keyCode === 5 /* Ctrl */) - || (this.shiftKey && this.keyCode === 4 /* Shift */) - || (this.altKey && this.keyCode === 6 /* Alt */) - || (this.metaKey && this.keyCode === 57 /* Meta */)); - }; - return SimpleKeybinding; -}()); +var uri_a; -var ChordKeybinding = /** @class */ (function () { - function ChordKeybinding(parts) { - if (parts.length === 0) { - throw Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["illegalArgument"])("parts"); - } - this.parts = parts; - } - ChordKeybinding.prototype.equals = function (other) { - if (other === null) { - return false; - } - if (this.parts.length !== other.parts.length) { - return false; - } - for (var i = 0; i < this.parts.length; i++) { - if (!this.parts[i].equals(other.parts[i])) { - return false; - } - } - return true; - }; - return ChordKeybinding; -}()); - -var ResolvedKeybindingPart = /** @class */ (function () { - function ResolvedKeybindingPart(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) { - this.ctrlKey = ctrlKey; - this.shiftKey = shiftKey; - this.altKey = altKey; - this.metaKey = metaKey; - this.keyLabel = kbLabel; - this.keyAriaLabel = kbAriaLabel; - } - return ResolvedKeybindingPart; -}()); - -/** - * A resolved keybinding. Can be a simple keybinding or a chord keybinding. - */ -var ResolvedKeybinding = /** @class */ (function () { - function ResolvedKeybinding() { - } - return ResolvedKeybinding; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js ***! - \********************************************************************/ -/*! exports provided: isDisposable, dispose, combinedDisposable, toDisposable, Disposable, ImmortalReference */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDisposable", function() { return isDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispose", function() { return dispose; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combinedDisposable", function() { return combinedDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toDisposable", function() { return toDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Disposable", function() { return Disposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImmortalReference", function() { return ImmortalReference; }); -function isDisposable(thing) { - return typeof thing.dispose === 'function' - && thing.dispose.length === 0; -} -function dispose(first) { - var rest = []; - for (var _i = 1; _i < arguments.length; _i++) { - rest[_i - 1] = arguments[_i]; - } - if (Array.isArray(first)) { - first.forEach(function (d) { return d && d.dispose(); }); - return []; - } - else if (rest.length === 0) { - if (first) { - first.dispose(); - return first; - } - return undefined; - } - else { - dispose(first); - dispose(rest); - return []; - } -} -function combinedDisposable(disposables) { - return { dispose: function () { return dispose(disposables); } }; -} -function toDisposable(fn) { - return { dispose: function () { fn(); } }; -} -var Disposable = /** @class */ (function () { - function Disposable() { - this._toDispose = []; - this._lifecycle_disposable_isDisposed = false; - } - Disposable.prototype.dispose = function () { - this._lifecycle_disposable_isDisposed = true; - this._toDispose = dispose(this._toDispose); - }; - Disposable.prototype._register = function (t) { - if (this._lifecycle_disposable_isDisposed) { - console.warn('Registering disposable on object that has already been disposed.'); - t.dispose(); +var _schemePattern = /^\w[\w\d+.-]*$/; +var _singleSlashStart = /^\//; +var _doubleSlashStart = /^\/\//; +var _throwOnMissingSchema = true; +function _validateUri(ret, _strict) { + // scheme, must be set + if (!ret.scheme) { + if (_strict || _throwOnMissingSchema) { + throw new Error("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); } else { - this._toDispose.push(t); + console.warn("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); } - return t; + } + // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 + // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) + if (ret.scheme && !_schemePattern.test(ret.scheme)) { + throw new Error('[UriError]: Scheme contains illegal characters.'); + } + // path, http://tools.ietf.org/html/rfc3986#section-3.3 + // If a URI contains an authority component, then the path component + // must either be empty or begin with a slash ("/") character. If a URI + // does not contain an authority component, then the path cannot begin + // with two slash characters ("//"). + if (ret.path) { + if (ret.authority) { + if (!_singleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); + } + } + else { + if (_doubleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); + } + } + } +} +// for a while we allowed uris *without* schemes and this is the migration +// for them, e.g. an uri without scheme and without strict-mode warns and falls +// back to the file-scheme. that should cause the least carnage and still be a +// clear warning +function _schemeFix(scheme, _strict) { + if (_strict || _throwOnMissingSchema) { + return scheme || _empty; + } + if (!scheme) { + console.trace('BAD uri lacks scheme, falling back to file-scheme.'); + scheme = 'file'; + } + return scheme; +} +// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 +function _referenceResolution(scheme, path) { + // the slash-character is our 'default base' as we don't + // support constructing URIs relative to other URIs. This + // also means that we alter and potentially break paths. + // see https://tools.ietf.org/html/rfc3986#section-5.1.4 + switch (scheme) { + case 'https': + case 'http': + case 'file': + if (!path) { + path = _slash; + } + else if (path[0] !== _slash) { + path = _slash + path; + } + break; + } + return path; +} +var _empty = ''; +var _slash = '/'; +var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; +/** + * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. + * This class is a simple parser which creates the basic component parts + * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation + * and encoding. + * + * foo://example.com:8042/over/there?name=ferret#nose + * \_/ \______________/\_________/ \_________/ \__/ + * | | | | | + * scheme authority path query fragment + * | _____________________|__ + * / \ / \ + * urn:example:animal:ferret:nose + */ +var uri_URI = /** @class */ (function () { + /** + * @internal + */ + function URI(schemeOrData, authority, path, query, fragment, _strict) { + if (_strict === void 0) { _strict = false; } + if (typeof schemeOrData === 'object') { + this.scheme = schemeOrData.scheme || _empty; + this.authority = schemeOrData.authority || _empty; + this.path = schemeOrData.path || _empty; + this.query = schemeOrData.query || _empty; + this.fragment = schemeOrData.fragment || _empty; + // no validation because it's this URI + // that creates uri components. + // _validateUri(this); + } + else { + this.scheme = _schemeFix(schemeOrData, _strict); + this.authority = authority || _empty; + this.path = _referenceResolution(this.scheme, path || _empty); + this.query = query || _empty; + this.fragment = fragment || _empty; + _validateUri(this, _strict); + } + } + URI.isUri = function (thing) { + if (thing instanceof URI) { + return true; + } + if (!thing) { + return false; + } + return typeof thing.authority === 'string' + && typeof thing.fragment === 'string' + && typeof thing.path === 'string' + && typeof thing.query === 'string' + && typeof thing.scheme === 'string' + && typeof thing.fsPath === 'function' + && typeof thing.with === 'function' + && typeof thing.toString === 'function'; }; - Disposable.None = Object.freeze({ dispose: function () { } }); - return Disposable; -}()); - -var ImmortalReference = /** @class */ (function () { - function ImmortalReference(object) { - this.object = object; - } - ImmortalReference.prototype.dispose = function () { }; - return ImmortalReference; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/linkedList.js ***! - \*********************************************************************/ -/*! exports provided: LinkedList */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkedList", function() { return LinkedList; }); -/* harmony import */ var _iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var Node = /** @class */ (function () { - function Node(element) { - this.element = element; - this.next = Node.Undefined; - this.prev = Node.Undefined; - } - Node.Undefined = new Node(undefined); - return Node; -}()); -var LinkedList = /** @class */ (function () { - function LinkedList() { - this._first = Node.Undefined; - this._last = Node.Undefined; - this._size = 0; - } - Object.defineProperty(LinkedList.prototype, "size", { + Object.defineProperty(URI.prototype, "fsPath", { + // ---- filesystem path ----------------------- + /** + * Returns a string representing the corresponding file system path of this URI. + * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the + * platform specific path separator. + * + * * Will *not* validate the path for invalid characters and semantics. + * * Will *not* look at the scheme of this URI. + * * The result shall *not* be used for display purposes but for accessing a file on disk. + * + * + * The *difference* to `URI#path` is the use of the platform specific separator and the handling + * of UNC paths. See the below sample of a file-uri with an authority (UNC path). + * + * ```ts + const u = URI.parse('file://server/c$/folder/file.txt') + u.authority === 'server' + u.path === '/shares/c$/file.txt' + u.fsPath === '\\server\c$\folder\file.txt' + ``` + * + * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, + * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working + * with URIs that represent files on disk (`file` scheme). + */ get: function () { - return this._size; + // if (this.scheme !== 'file') { + // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); + // } + return _makeFsPath(this); }, enumerable: true, configurable: true }); - LinkedList.prototype.isEmpty = function () { - return this._first === Node.Undefined; - }; - LinkedList.prototype.clear = function () { - this._first = Node.Undefined; - this._last = Node.Undefined; - this._size = 0; - }; - LinkedList.prototype.unshift = function (element) { - return this._insert(element, false); - }; - LinkedList.prototype.push = function (element) { - return this._insert(element, true); - }; - LinkedList.prototype._insert = function (element, atTheEnd) { - var _this = this; - var newNode = new Node(element); - if (this._first === Node.Undefined) { - this._first = newNode; - this._last = newNode; + // ---- modify to new ------------------------- + URI.prototype.with = function (change) { + if (!change) { + return this; } - else if (atTheEnd) { - // push - var oldLast = this._last; - this._last = newNode; - newNode.prev = oldLast; - oldLast.next = newNode; + var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment; + if (scheme === undefined) { + scheme = this.scheme; + } + else if (scheme === null) { + scheme = _empty; + } + if (authority === undefined) { + authority = this.authority; + } + else if (authority === null) { + authority = _empty; + } + if (path === undefined) { + path = this.path; + } + else if (path === null) { + path = _empty; + } + if (query === undefined) { + query = this.query; + } + else if (query === null) { + query = _empty; + } + if (fragment === undefined) { + fragment = this.fragment; + } + else if (fragment === null) { + fragment = _empty; + } + if (scheme === this.scheme + && authority === this.authority + && path === this.path + && query === this.query + && fragment === this.fragment) { + return this; + } + return new _URI(scheme, authority, path, query, fragment); + }; + // ---- parse & validate ------------------------ + /** + * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, + * `file:///usr/home`, or `scheme:with/path`. + * + * @param value A string which represents an URI (see `URI#toString`). + */ + URI.parse = function (value, _strict) { + if (_strict === void 0) { _strict = false; } + var match = _regexp.exec(value); + if (!match) { + return new _URI(_empty, _empty, _empty, _empty, _empty); + } + return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty), _strict); + }; + /** + * Creates a new URI from a file system path, e.g. `c:\my\files`, + * `/usr/home`, or `\\server\share\some\path`. + * + * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument + * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** + * `URI.parse('file://' + path)` because the path might contain characters that are + * interpreted (# and ?). See the following sample: + * ```ts + const good = URI.file('/coding/c#/project1'); + good.scheme === 'file'; + good.path === '/coding/c#/project1'; + good.fragment === ''; + const bad = URI.parse('file://' + '/coding/c#/project1'); + bad.scheme === 'file'; + bad.path === '/coding/c'; // path is now broken + bad.fragment === '/project1'; + ``` + * + * @param path A file system path (see `URI#fsPath`) + */ + URI.file = function (path) { + var authority = _empty; + // normalize to fwd-slashes on windows, + // on other systems bwd-slashes are valid + // filename character, eg /f\oo/ba\r.txt + if (isWindows) { + path = path.replace(/\\/g, _slash); + } + // check for authority as used in UNC shares + // or use the path as given + if (path[0] === _slash && path[1] === _slash) { + var idx = path.indexOf(_slash, 2); + if (idx === -1) { + authority = path.substring(2); + path = _slash; + } + else { + authority = path.substring(2, idx); + path = path.substring(idx) || _slash; + } + } + return new _URI('file', authority, path, _empty, _empty); + }; + URI.from = function (components) { + return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment); + }; + // ---- printing/externalize --------------------------- + /** + * Creates a string representation for this URI. It's guaranteed that calling + * `URI.parse` with the result of this function creates an URI which is equal + * to this URI. + * + * * The result shall *not* be used for display purposes but for externalization or transport. + * * The result will be encoded using the percentage encoding and encoding happens mostly + * ignore the scheme-specific encoding rules. + * + * @param skipEncoding Do not encode the result, default is `false` + */ + URI.prototype.toString = function (skipEncoding) { + if (skipEncoding === void 0) { skipEncoding = false; } + return _asFormatted(this, skipEncoding); + }; + URI.prototype.toJSON = function () { + return this; + }; + URI.revive = function (data) { + if (!data) { + return data; + } + else if (data instanceof URI) { + return data; } else { - // unshift - var oldFirst = this._first; - this._first = newNode; - newNode.next = oldFirst; - oldFirst.prev = newNode; - } - this._size += 1; - var didRemove = false; - return function () { - if (!didRemove) { - didRemove = true; - _this._remove(newNode); - } - }; - }; - LinkedList.prototype.shift = function () { - if (this._first === Node.Undefined) { - return undefined; - } - else { - var res = this._first.element; - this._remove(this._first); - return res; + var result = new _URI(data); + result._fsPath = data.fsPath; + result._formatted = data.external; + return result; } }; - LinkedList.prototype._remove = function (node) { - if (node.prev !== Node.Undefined && node.next !== Node.Undefined) { - // middle - var anchor = node.prev; - anchor.next = node.next; - node.next.prev = anchor; - } - else if (node.prev === Node.Undefined && node.next === Node.Undefined) { - // only node - this._first = Node.Undefined; - this._last = Node.Undefined; - } - else if (node.next === Node.Undefined) { - // last - this._last = this._last.prev; - this._last.next = Node.Undefined; - } - else if (node.prev === Node.Undefined) { - // first - this._first = this._first.next; - this._first.prev = Node.Undefined; - } - // done - this._size -= 1; - }; - LinkedList.prototype.iterator = function () { - var element; - var node = this._first; - return { - next: function () { - if (node === Node.Undefined) { - return _iterator_js__WEBPACK_IMPORTED_MODULE_0__["FIN"]; - } - if (!element) { - element = { done: false, value: node.element }; - } - else { - element.value = node.element; - } - node = node.next; - return element; - } - }; - }; - LinkedList.prototype.toArray = function () { - var result = []; - for (var node = this._first; node !== Node.Undefined; node = node.next) { - result.push(node.element); - } - return result; - }; - return LinkedList; + return URI; }()); +// tslint:disable-next-line:class-name +var _URI = /** @class */ (function (_super) { + uri_extends(_URI, _super); + function _URI() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._formatted = null; + _this._fsPath = null; + return _this; + } + Object.defineProperty(_URI.prototype, "fsPath", { + get: function () { + if (!this._fsPath) { + this._fsPath = _makeFsPath(this); + } + return this._fsPath; + }, + enumerable: true, + configurable: true + }); + _URI.prototype.toString = function (skipEncoding) { + if (skipEncoding === void 0) { skipEncoding = false; } + if (!skipEncoding) { + if (!this._formatted) { + this._formatted = _asFormatted(this, false); + } + return this._formatted; + } + else { + // we don't cache that + return _asFormatted(this, true); + } + }; + _URI.prototype.toJSON = function () { + var res = { + $mid: 1 + }; + // cached state + if (this._fsPath) { + res.fsPath = this._fsPath; + } + if (this._formatted) { + res.external = this._formatted; + } + // uri components + if (this.path) { + res.path = this.path; + } + if (this.scheme) { + res.scheme = this.scheme; + } + if (this.authority) { + res.authority = this.authority; + } + if (this.query) { + res.query = this.query; + } + if (this.fragment) { + res.fragment = this.fragment; + } + return res; + }; + return _URI; +}(uri_URI)); +// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 +var encodeTable = (uri_a = {}, + uri_a[58 /* Colon */] = '%3A', + uri_a[47 /* Slash */] = '%2F', + uri_a[63 /* QuestionMark */] = '%3F', + uri_a[35 /* Hash */] = '%23', + uri_a[91 /* OpenSquareBracket */] = '%5B', + uri_a[93 /* CloseSquareBracket */] = '%5D', + uri_a[64 /* AtSign */] = '%40', + uri_a[33 /* ExclamationMark */] = '%21', + uri_a[36 /* DollarSign */] = '%24', + uri_a[38 /* Ampersand */] = '%26', + uri_a[39 /* SingleQuote */] = '%27', + uri_a[40 /* OpenParen */] = '%28', + uri_a[41 /* CloseParen */] = '%29', + uri_a[42 /* Asterisk */] = '%2A', + uri_a[43 /* Plus */] = '%2B', + uri_a[44 /* Comma */] = '%2C', + uri_a[59 /* Semicolon */] = '%3B', + uri_a[61 /* Equals */] = '%3D', + uri_a[32 /* Space */] = '%20', + uri_a); +function encodeURIComponentFast(uriComponent, allowSlash) { + var res = undefined; + var nativeEncodePos = -1; + for (var pos = 0; pos < uriComponent.length; pos++) { + var code = uriComponent.charCodeAt(pos); + // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 + if ((code >= 97 /* a */ && code <= 122 /* z */) + || (code >= 65 /* A */ && code <= 90 /* Z */) + || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) + || code === 45 /* Dash */ + || code === 46 /* Period */ + || code === 95 /* Underline */ + || code === 126 /* Tilde */ + || (allowSlash && code === 47 /* Slash */)) { + // check if we are delaying native encode + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + // check if we write into a new string (by default we try to return the param) + if (res !== undefined) { + res += uriComponent.charAt(pos); + } + } + else { + // encoding needed, we need to allocate a new string + if (res === undefined) { + res = uriComponent.substr(0, pos); + } + // check with default table first + var escaped = encodeTable[code]; + if (escaped !== undefined) { + // check if we are delaying native encode + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + // append escaped variant to result + res += escaped; + } + else if (nativeEncodePos === -1) { + // use native encode only when needed + nativeEncodePos = pos; + } + } + } + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); + } + return res !== undefined ? res : uriComponent; +} +function encodeURIComponentMinimal(path) { + var res = undefined; + for (var pos = 0; pos < path.length; pos++) { + var code = path.charCodeAt(pos); + if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { + if (res === undefined) { + res = path.substr(0, pos); + } + res += encodeTable[code]; + } + else { + if (res !== undefined) { + res += path[pos]; + } + } + } + return res !== undefined ? res : path; +} +/** + * Compute `fsPath` for the given uri + */ +function _makeFsPath(uri) { + var value; + if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { + // unc path: file://shares/c$/far/boo + value = "//" + uri.authority + uri.path; + } + else if (uri.path.charCodeAt(0) === 47 /* Slash */ + && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) + && uri.path.charCodeAt(2) === 58 /* Colon */) { + // windows drive letter: file:///c:/far/boo + value = uri.path[1].toLowerCase() + uri.path.substr(2); + } + else { + // other path + value = uri.path; + } + if (isWindows) { + value = value.replace(/\//g, '\\'); + } + return value; +} +/** + * Create the external version of a uri + */ +function _asFormatted(uri, skipEncoding) { + var encoder = !skipEncoding + ? encodeURIComponentFast + : encodeURIComponentMinimal; + var res = ''; + var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment; + if (scheme) { + res += scheme; + res += ':'; + } + if (authority || scheme === 'file') { + res += _slash; + res += _slash; + } + if (authority) { + var idx = authority.indexOf('@'); + if (idx !== -1) { + // @ + var userinfo = authority.substr(0, idx); + authority = authority.substr(idx + 1); + idx = userinfo.indexOf(':'); + if (idx === -1) { + res += encoder(userinfo, false); + } + else { + // :@ + res += encoder(userinfo.substr(0, idx), false); + res += ':'; + res += encoder(userinfo.substr(idx + 1), false); + } + res += '@'; + } + authority = authority.toLowerCase(); + idx = authority.indexOf(':'); + if (idx === -1) { + res += encoder(authority, false); + } + else { + // : + res += encoder(authority.substr(0, idx), false); + res += authority.substr(idx); + } + } + if (path) { + // lower-case windows drive letters in /C:/fff or C:/fff + if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { + var code = path.charCodeAt(1); + if (code >= 65 /* A */ && code <= 90 /* Z */) { + path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3 + } + } + else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { + var code = path.charCodeAt(0); + if (code >= 65 /* A */ && code <= 90 /* Z */) { + path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3 + } + } + // encode the rest of the path + res += encoder(path, true); + } + if (query) { + res += '?'; + res += encoder(query, false); + } + if (fragment) { + res += '#'; + res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; + } + return res; +} - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/platform.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/platform.js ***! - \*******************************************************************/ -/*! exports provided: isWindows, isMacintosh, isLinux, isNative, isWeb, globals, setImmediate, OS */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWindows", function() { return isWindows; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMacintosh", function() { return isMacintosh; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinux", function() { return isLinux; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNative", function() { return isNative; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWeb", function() { return isWeb; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "globals", function() { return globals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setImmediate", function() { return setImmediate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OS", function() { return OS; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/position.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var LANGUAGE_DEFAULT = 'en'; -var _isWindows = false; -var _isMacintosh = false; -var _isLinux = false; -var _isNative = false; -var _isWeb = false; -var _locale = undefined; -var _language = LANGUAGE_DEFAULT; -var _translationsConfigFile = undefined; -var isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer'); -// OS detection -if (typeof navigator === 'object' && !isElectronRenderer) { - var userAgent = navigator.userAgent; - _isWindows = userAgent.indexOf('Windows') >= 0; - _isMacintosh = userAgent.indexOf('Macintosh') >= 0; - _isLinux = userAgent.indexOf('Linux') >= 0; - _isWeb = true; - _locale = navigator.language; - _language = _locale; -} -else if (typeof process === 'object') { - _isWindows = (process.platform === 'win32'); - _isMacintosh = (process.platform === 'darwin'); - _isLinux = (process.platform === 'linux'); - _locale = LANGUAGE_DEFAULT; - _language = LANGUAGE_DEFAULT; - var rawNlsConfig = process.env['VSCODE_NLS_CONFIG']; - if (rawNlsConfig) { - try { - var nlsConfig = JSON.parse(rawNlsConfig); - var resolved = nlsConfig.availableLanguages['*']; - _locale = nlsConfig.locale; - // VSCode's default language is 'en' - _language = resolved ? resolved : LANGUAGE_DEFAULT; - _translationsConfigFile = nlsConfig._translationsConfigFile; - } - catch (e) { - } +/** + * A position in the editor. + */ +var Position = /** @class */ (function () { + function Position(lineNumber, column) { + this.lineNumber = lineNumber; + this.column = column; } - _isNative = true; -} -var _platform = 0 /* Web */; -if (_isNative) { - if (_isMacintosh) { - _platform = 1 /* Mac */; - } - else if (_isWindows) { - _platform = 3 /* Windows */; - } - else if (_isLinux) { - _platform = 2 /* Linux */; - } -} -var isWindows = _isWindows; -var isMacintosh = _isMacintosh; -var isLinux = _isLinux; -var isNative = _isNative; -var isWeb = _isWeb; -var _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {}); -var globals = _globals; -var _setImmediate = null; -function setImmediate(callback) { - if (_setImmediate === null) { - if (globals.setImmediate) { - _setImmediate = globals.setImmediate.bind(globals); - } - else if (typeof process !== 'undefined' && typeof process.nextTick === 'function') { - _setImmediate = process.nextTick.bind(process); + /** + * Create a new postion from this position. + * + * @param newLineNumber new line number + * @param newColumn new column + */ + Position.prototype.with = function (newLineNumber, newColumn) { + if (newLineNumber === void 0) { newLineNumber = this.lineNumber; } + if (newColumn === void 0) { newColumn = this.column; } + if (newLineNumber === this.lineNumber && newColumn === this.column) { + return this; } else { - _setImmediate = globals.setTimeout.bind(globals); + return new Position(newLineNumber, newColumn); + } + }; + /** + * Derive a new position from this position. + * + * @param deltaLineNumber line number delta + * @param deltaColumn column delta + */ + Position.prototype.delta = function (deltaLineNumber, deltaColumn) { + if (deltaLineNumber === void 0) { deltaLineNumber = 0; } + if (deltaColumn === void 0) { deltaColumn = 0; } + return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn); + }; + /** + * Test if this position equals other position + */ + Position.prototype.equals = function (other) { + return Position.equals(this, other); + }; + /** + * Test if position `a` equals position `b` + */ + Position.equals = function (a, b) { + if (!a && !b) { + return true; + } + return (!!a && + !!b && + a.lineNumber === b.lineNumber && + a.column === b.column); + }; + /** + * Test if this position is before other position. + * If the two positions are equal, the result will be false. + */ + Position.prototype.isBefore = function (other) { + return Position.isBefore(this, other); + }; + /** + * Test if position `a` is before position `b`. + * If the two positions are equal, the result will be false. + */ + Position.isBefore = function (a, b) { + if (a.lineNumber < b.lineNumber) { + return true; + } + if (b.lineNumber < a.lineNumber) { + return false; + } + return a.column < b.column; + }; + /** + * Test if this position is before other position. + * If the two positions are equal, the result will be true. + */ + Position.prototype.isBeforeOrEqual = function (other) { + return Position.isBeforeOrEqual(this, other); + }; + /** + * Test if position `a` is before position `b`. + * If the two positions are equal, the result will be true. + */ + Position.isBeforeOrEqual = function (a, b) { + if (a.lineNumber < b.lineNumber) { + return true; + } + if (b.lineNumber < a.lineNumber) { + return false; + } + return a.column <= b.column; + }; + /** + * A function that compares positions, useful for sorting + */ + Position.compare = function (a, b) { + var aLineNumber = a.lineNumber | 0; + var bLineNumber = b.lineNumber | 0; + if (aLineNumber === bLineNumber) { + var aColumn = a.column | 0; + var bColumn = b.column | 0; + return aColumn - bColumn; + } + return aLineNumber - bLineNumber; + }; + /** + * Clone this position. + */ + Position.prototype.clone = function () { + return new Position(this.lineNumber, this.column); + }; + /** + * Convert to a human-readable representation. + */ + Position.prototype.toString = function () { + return '(' + this.lineNumber + ',' + this.column + ')'; + }; + // --- + /** + * Create a `Position` from an `IPosition`. + */ + Position.lift = function (pos) { + return new Position(pos.lineNumber, pos.column); + }; + /** + * Test if `obj` is an `IPosition`. + */ + Position.isIPosition = function (obj) { + return (obj + && (typeof obj.lineNumber === 'number') + && (typeof obj.column === 'number')); + }; + return Position; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/range.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/** + * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn) + */ +var range_Range = /** @class */ (function () { + function Range(startLineNumber, startColumn, endLineNumber, endColumn) { + if ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) { + this.startLineNumber = endLineNumber; + this.startColumn = endColumn; + this.endLineNumber = startLineNumber; + this.endColumn = startColumn; + } + else { + this.startLineNumber = startLineNumber; + this.startColumn = startColumn; + this.endLineNumber = endLineNumber; + this.endColumn = endColumn; } } - return _setImmediate(callback); -} -var OS = (_isMacintosh ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */)); + /** + * Test if this range is empty. + */ + Range.prototype.isEmpty = function () { + return Range.isEmpty(this); + }; + /** + * Test if `range` is empty. + */ + Range.isEmpty = function (range) { + return (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn); + }; + /** + * Test if position is in this range. If the position is at the edges, will return true. + */ + Range.prototype.containsPosition = function (position) { + return Range.containsPosition(this, position); + }; + /** + * Test if `position` is in `range`. If the position is at the edges, will return true. + */ + Range.containsPosition = function (range, position) { + if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) { + return false; + } + if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) { + return false; + } + if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) { + return false; + } + return true; + }; + /** + * Test if range is in this range. If the range is equal to this range, will return true. + */ + Range.prototype.containsRange = function (range) { + return Range.containsRange(this, range); + }; + /** + * Test if `otherRange` is in `range`. If the ranges are equal, will return true. + */ + Range.containsRange = function (range, otherRange) { + if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { + return false; + } + if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { + return false; + } + if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) { + return false; + } + if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) { + return false; + } + return true; + }; + /** + * A reunion of the two ranges. + * The smallest position will be used as the start point, and the largest one as the end point. + */ + Range.prototype.plusRange = function (range) { + return Range.plusRange(this, range); + }; + /** + * A reunion of the two ranges. + * The smallest position will be used as the start point, and the largest one as the end point. + */ + Range.plusRange = function (a, b) { + var startLineNumber; + var startColumn; + var endLineNumber; + var endColumn; + if (b.startLineNumber < a.startLineNumber) { + startLineNumber = b.startLineNumber; + startColumn = b.startColumn; + } + else if (b.startLineNumber === a.startLineNumber) { + startLineNumber = b.startLineNumber; + startColumn = Math.min(b.startColumn, a.startColumn); + } + else { + startLineNumber = a.startLineNumber; + startColumn = a.startColumn; + } + if (b.endLineNumber > a.endLineNumber) { + endLineNumber = b.endLineNumber; + endColumn = b.endColumn; + } + else if (b.endLineNumber === a.endLineNumber) { + endLineNumber = b.endLineNumber; + endColumn = Math.max(b.endColumn, a.endColumn); + } + else { + endLineNumber = a.endLineNumber; + endColumn = a.endColumn; + } + return new Range(startLineNumber, startColumn, endLineNumber, endColumn); + }; + /** + * A intersection of the two ranges. + */ + Range.prototype.intersectRanges = function (range) { + return Range.intersectRanges(this, range); + }; + /** + * A intersection of the two ranges. + */ + Range.intersectRanges = function (a, b) { + var resultStartLineNumber = a.startLineNumber; + var resultStartColumn = a.startColumn; + var resultEndLineNumber = a.endLineNumber; + var resultEndColumn = a.endColumn; + var otherStartLineNumber = b.startLineNumber; + var otherStartColumn = b.startColumn; + var otherEndLineNumber = b.endLineNumber; + var otherEndColumn = b.endColumn; + if (resultStartLineNumber < otherStartLineNumber) { + resultStartLineNumber = otherStartLineNumber; + resultStartColumn = otherStartColumn; + } + else if (resultStartLineNumber === otherStartLineNumber) { + resultStartColumn = Math.max(resultStartColumn, otherStartColumn); + } + if (resultEndLineNumber > otherEndLineNumber) { + resultEndLineNumber = otherEndLineNumber; + resultEndColumn = otherEndColumn; + } + else if (resultEndLineNumber === otherEndLineNumber) { + resultEndColumn = Math.min(resultEndColumn, otherEndColumn); + } + // Check if selection is now empty + if (resultStartLineNumber > resultEndLineNumber) { + return null; + } + if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) { + return null; + } + return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn); + }; + /** + * Test if this range equals other. + */ + Range.prototype.equalsRange = function (other) { + return Range.equalsRange(this, other); + }; + /** + * Test if range `a` equals `b`. + */ + Range.equalsRange = function (a, b) { + return (!!a && + !!b && + a.startLineNumber === b.startLineNumber && + a.startColumn === b.startColumn && + a.endLineNumber === b.endLineNumber && + a.endColumn === b.endColumn); + }; + /** + * Return the end position (which will be after or equal to the start position) + */ + Range.prototype.getEndPosition = function () { + return new Position(this.endLineNumber, this.endColumn); + }; + /** + * Return the start position (which will be before or equal to the end position) + */ + Range.prototype.getStartPosition = function () { + return new Position(this.startLineNumber, this.startColumn); + }; + /** + * Transform to a user presentable string representation. + */ + Range.prototype.toString = function () { + return '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']'; + }; + /** + * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position. + */ + Range.prototype.setEndPosition = function (endLineNumber, endColumn) { + return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn); + }; + /** + * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position. + */ + Range.prototype.setStartPosition = function (startLineNumber, startColumn) { + return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn); + }; + /** + * Create a new empty range using this range's start position. + */ + Range.prototype.collapseToStart = function () { + return Range.collapseToStart(this); + }; + /** + * Create a new empty range using this range's start position. + */ + Range.collapseToStart = function (range) { + return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn); + }; + // --- + Range.fromPositions = function (start, end) { + if (end === void 0) { end = start; } + return new Range(start.lineNumber, start.column, end.lineNumber, end.column); + }; + Range.lift = function (range) { + if (!range) { + return null; + } + return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); + }; + /** + * Test if `obj` is an `IRange`. + */ + Range.isIRange = function (obj) { + return (obj + && (typeof obj.startLineNumber === 'number') + && (typeof obj.startColumn === 'number') + && (typeof obj.endLineNumber === 'number') + && (typeof obj.endColumn === 'number')); + }; + /** + * Test if the two ranges are touching in any way. + */ + Range.areIntersectingOrTouching = function (a, b) { + // Check if `a` is before `b` + if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) { + return false; + } + // Check if `b` is before `a` + if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) { + return false; + } + // These ranges must intersect + return true; + }; + /** + * Test if the two ranges are intersecting. If the ranges are touching it returns true. + */ + Range.areIntersecting = function (a, b) { + // Check if `a` is before `b` + if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) { + return false; + } + // Check if `b` is before `a` + if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) { + return false; + } + // These ranges must intersect + return true; + }; + /** + * A function that compares ranges, useful for sorting ranges + * It will first compare ranges on the startPosition and then on the endPosition + */ + Range.compareRangesUsingStarts = function (a, b) { + if (a && b) { + var aStartLineNumber = a.startLineNumber | 0; + var bStartLineNumber = b.startLineNumber | 0; + if (aStartLineNumber === bStartLineNumber) { + var aStartColumn = a.startColumn | 0; + var bStartColumn = b.startColumn | 0; + if (aStartColumn === bStartColumn) { + var aEndLineNumber = a.endLineNumber | 0; + var bEndLineNumber = b.endLineNumber | 0; + if (aEndLineNumber === bEndLineNumber) { + var aEndColumn = a.endColumn | 0; + var bEndColumn = b.endColumn | 0; + return aEndColumn - bEndColumn; + } + return aEndLineNumber - bEndLineNumber; + } + return aStartColumn - bStartColumn; + } + return aStartLineNumber - bStartLineNumber; + } + var aExists = (a ? 1 : 0); + var bExists = (b ? 1 : 0); + return aExists - bExists; + }; + /** + * A function that compares ranges, useful for sorting ranges + * It will first compare ranges on the endPosition and then on the startPosition + */ + Range.compareRangesUsingEnds = function (a, b) { + if (a.endLineNumber === b.endLineNumber) { + if (a.endColumn === b.endColumn) { + if (a.startLineNumber === b.startLineNumber) { + return a.startColumn - b.startColumn; + } + return a.startLineNumber - b.startLineNumber; + } + return a.endColumn - b.endColumn; + } + return a.endLineNumber - b.endLineNumber; + }; + /** + * Test if the range spans multiple lines. + */ + Range.spansMultipleLines = function (range) { + return range.endLineNumber > range.startLineNumber; + }; + return Range; +}()); -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/strings.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/strings.js ***! - \******************************************************************/ -/*! exports provided: empty, isFalsyOrWhitespace, pad, format, escape, escapeRegExpCharacters, trim, ltrim, rtrim, convertSimple2RegExpPattern, startsWith, endsWith, createRegExp, regExpLeadsToEndlessLoop, regExpFlags, firstNonWhitespaceIndex, getLeadingWhitespace, lastNonWhitespaceIndex, compare, isLowerAsciiLetter, isUpperAsciiLetter, equalsIgnoreCase, startsWithIgnoreCase, commonPrefixLength, commonSuffixLength, isHighSurrogate, isLowSurrogate, containsRTL, containsEmoji, isBasicASCII, containsFullWidthCharacter, isFullWidthCharacter, UTF8_BOM_CHARACTER, startsWithUTF8BOM, safeBtoa, repeat */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFalsyOrWhitespace", function() { return isFalsyOrWhitespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return pad; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "format", function() { return format; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return escape; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeRegExpCharacters", function() { return escapeRegExpCharacters; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trim", function() { return trim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ltrim", function() { return ltrim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rtrim", function() { return rtrim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertSimple2RegExpPattern", function() { return convertSimple2RegExpPattern; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return startsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return endsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRegExp", function() { return createRegExp; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpLeadsToEndlessLoop", function() { return regExpLeadsToEndlessLoop; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpFlags", function() { return regExpFlags; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstNonWhitespaceIndex", function() { return firstNonWhitespaceIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLeadingWhitespace", function() { return getLeadingWhitespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lastNonWhitespaceIndex", function() { return lastNonWhitespaceIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compare", function() { return compare; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowerAsciiLetter", function() { return isLowerAsciiLetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUpperAsciiLetter", function() { return isUpperAsciiLetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equalsIgnoreCase", function() { return equalsIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithIgnoreCase", function() { return startsWithIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonPrefixLength", function() { return commonPrefixLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonSuffixLength", function() { return commonSuffixLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHighSurrogate", function() { return isHighSurrogate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowSurrogate", function() { return isLowSurrogate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsRTL", function() { return containsRTL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsEmoji", function() { return containsEmoji; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBasicASCII", function() { return isBasicASCII; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsFullWidthCharacter", function() { return containsFullWidthCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFullWidthCharacter", function() { return isFullWidthCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UTF8_BOM_CHARACTER", function() { return UTF8_BOM_CHARACTER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithUTF8BOM", function() { return startsWithUTF8BOM; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeBtoa", function() { return safeBtoa; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return repeat; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/strings.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -3164,7 +3454,7 @@ function format(value) { * Converts HTML characters inside the string to use entities instead. Makes the string safe from * being used e.g. in HTMLElement.innerHTML. */ -function escape(html) { +function strings_escape(html) { return html.replace(/[<>&]/g, function (match) { switch (match) { case '<': return '<'; @@ -3561,1964 +3851,7 @@ function repeat(s, count) { return result; } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/types.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/types.js ***! - \****************************************************************/ -/*! exports provided: isArray, isString, isObject, isNumber, isBoolean, isUndefined, isUndefinedOrNull, isEmptyObject, isFunction, validateConstraints, validateConstraint, getAllPropertyNames, withNullAsUndefined, withUndefinedAsNull */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return isArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return isString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return isNumber; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return isBoolean; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return isUndefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefinedOrNull", function() { return isUndefinedOrNull; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmptyObject", function() { return isEmptyObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraints", function() { return validateConstraints; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraint", function() { return validateConstraint; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllPropertyNames", function() { return getAllPropertyNames; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withNullAsUndefined", function() { return withNullAsUndefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withUndefinedAsNull", function() { return withUndefinedAsNull; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var _typeof = { - number: 'number', - string: 'string', - undefined: 'undefined', - object: 'object', - function: 'function' -}; -/** - * @returns whether the provided parameter is a JavaScript Array or not. - */ -function isArray(array) { - if (Array.isArray) { - return Array.isArray(array); - } - if (array && typeof (array.length) === _typeof.number && array.constructor === Array) { - return true; - } - return false; -} -/** - * @returns whether the provided parameter is a JavaScript String or not. - */ -function isString(str) { - if (typeof (str) === _typeof.string || str instanceof String) { - return true; - } - return false; -} -/** - * - * @returns whether the provided parameter is of type `object` but **not** - * `null`, an `array`, a `regexp`, nor a `date`. - */ -function isObject(obj) { - // The method can't do a type cast since there are type (like strings) which - // are subclasses of any put not positvely matched by the function. Hence type - // narrowing results in wrong results. - return typeof obj === _typeof.object - && obj !== null - && !Array.isArray(obj) - && !(obj instanceof RegExp) - && !(obj instanceof Date); -} -/** - * In **contrast** to just checking `typeof` this will return `false` for `NaN`. - * @returns whether the provided parameter is a JavaScript Number or not. - */ -function isNumber(obj) { - if ((typeof (obj) === _typeof.number || obj instanceof Number) && !isNaN(obj)) { - return true; - } - return false; -} -/** - * @returns whether the provided parameter is a JavaScript Boolean or not. - */ -function isBoolean(obj) { - return obj === true || obj === false; -} -/** - * @returns whether the provided parameter is undefined. - */ -function isUndefined(obj) { - return typeof (obj) === _typeof.undefined; -} -/** - * @returns whether the provided parameter is undefined or null. - */ -function isUndefinedOrNull(obj) { - return isUndefined(obj) || obj === null; -} -var hasOwnProperty = Object.prototype.hasOwnProperty; -/** - * @returns whether the provided parameter is an empty JavaScript Object or not. - */ -function isEmptyObject(obj) { - if (!isObject(obj)) { - return false; - } - for (var key in obj) { - if (hasOwnProperty.call(obj, key)) { - return false; - } - } - return true; -} -/** - * @returns whether the provided parameter is a JavaScript Function or not. - */ -function isFunction(obj) { - return typeof obj === _typeof.function; -} -function validateConstraints(args, constraints) { - var len = Math.min(args.length, constraints.length); - for (var i = 0; i < len; i++) { - validateConstraint(args[i], constraints[i]); - } -} -function validateConstraint(arg, constraint) { - if (isString(constraint)) { - if (typeof arg !== constraint) { - throw new Error("argument does not match constraint: typeof " + constraint); - } - } - else if (isFunction(constraint)) { - try { - if (arg instanceof constraint) { - return; - } - } - catch (_a) { - // ignore - } - if (!isUndefinedOrNull(arg) && arg.constructor === constraint) { - return; - } - if (constraint.length === 1 && constraint.call(undefined, arg) === true) { - return; - } - throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true"); - } -} -function getAllPropertyNames(obj) { - var res = []; - var proto = Object.getPrototypeOf(obj); - while (Object.prototype !== proto) { - res = res.concat(Object.getOwnPropertyNames(proto)); - proto = Object.getPrototypeOf(proto); - } - return res; -} -/** - * Converts null to undefined, passes all other values through. - */ -function withNullAsUndefined(x) { - return x === null ? undefined : x; -} -/** - * Converts undefined to null, passes all other values through. - */ -function withUndefinedAsNull(x) { - return typeof x === 'undefined' ? null : x; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/uri.js": -/*!**************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/uri.js ***! - \**************************************************************/ -/*! exports provided: URI */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "URI", function() { return URI; }); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var _a; - -var _schemePattern = /^\w[\w\d+.-]*$/; -var _singleSlashStart = /^\//; -var _doubleSlashStart = /^\/\//; -var _throwOnMissingSchema = true; -function _validateUri(ret, _strict) { - // scheme, must be set - if (!ret.scheme) { - if (_strict || _throwOnMissingSchema) { - throw new Error("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); - } - else { - console.warn("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); - } - } - // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 - // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - if (ret.scheme && !_schemePattern.test(ret.scheme)) { - throw new Error('[UriError]: Scheme contains illegal characters.'); - } - // path, http://tools.ietf.org/html/rfc3986#section-3.3 - // If a URI contains an authority component, then the path component - // must either be empty or begin with a slash ("/") character. If a URI - // does not contain an authority component, then the path cannot begin - // with two slash characters ("//"). - if (ret.path) { - if (ret.authority) { - if (!_singleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); - } - } - else { - if (_doubleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); - } - } - } -} -// for a while we allowed uris *without* schemes and this is the migration -// for them, e.g. an uri without scheme and without strict-mode warns and falls -// back to the file-scheme. that should cause the least carnage and still be a -// clear warning -function _schemeFix(scheme, _strict) { - if (_strict || _throwOnMissingSchema) { - return scheme || _empty; - } - if (!scheme) { - console.trace('BAD uri lacks scheme, falling back to file-scheme.'); - scheme = 'file'; - } - return scheme; -} -// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 -function _referenceResolution(scheme, path) { - // the slash-character is our 'default base' as we don't - // support constructing URIs relative to other URIs. This - // also means that we alter and potentially break paths. - // see https://tools.ietf.org/html/rfc3986#section-5.1.4 - switch (scheme) { - case 'https': - case 'http': - case 'file': - if (!path) { - path = _slash; - } - else if (path[0] !== _slash) { - path = _slash + path; - } - break; - } - return path; -} -var _empty = ''; -var _slash = '/'; -var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; -/** - * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. - * This class is a simple parser which creates the basic component parts - * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation - * and encoding. - * - * foo://example.com:8042/over/there?name=ferret#nose - * \_/ \______________/\_________/ \_________/ \__/ - * | | | | | - * scheme authority path query fragment - * | _____________________|__ - * / \ / \ - * urn:example:animal:ferret:nose - */ -var URI = /** @class */ (function () { - /** - * @internal - */ - function URI(schemeOrData, authority, path, query, fragment, _strict) { - if (_strict === void 0) { _strict = false; } - if (typeof schemeOrData === 'object') { - this.scheme = schemeOrData.scheme || _empty; - this.authority = schemeOrData.authority || _empty; - this.path = schemeOrData.path || _empty; - this.query = schemeOrData.query || _empty; - this.fragment = schemeOrData.fragment || _empty; - // no validation because it's this URI - // that creates uri components. - // _validateUri(this); - } - else { - this.scheme = _schemeFix(schemeOrData, _strict); - this.authority = authority || _empty; - this.path = _referenceResolution(this.scheme, path || _empty); - this.query = query || _empty; - this.fragment = fragment || _empty; - _validateUri(this, _strict); - } - } - URI.isUri = function (thing) { - if (thing instanceof URI) { - return true; - } - if (!thing) { - return false; - } - return typeof thing.authority === 'string' - && typeof thing.fragment === 'string' - && typeof thing.path === 'string' - && typeof thing.query === 'string' - && typeof thing.scheme === 'string' - && typeof thing.fsPath === 'function' - && typeof thing.with === 'function' - && typeof thing.toString === 'function'; - }; - Object.defineProperty(URI.prototype, "fsPath", { - // ---- filesystem path ----------------------- - /** - * Returns a string representing the corresponding file system path of this URI. - * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the - * platform specific path separator. - * - * * Will *not* validate the path for invalid characters and semantics. - * * Will *not* look at the scheme of this URI. - * * The result shall *not* be used for display purposes but for accessing a file on disk. - * - * - * The *difference* to `URI#path` is the use of the platform specific separator and the handling - * of UNC paths. See the below sample of a file-uri with an authority (UNC path). - * - * ```ts - const u = URI.parse('file://server/c$/folder/file.txt') - u.authority === 'server' - u.path === '/shares/c$/file.txt' - u.fsPath === '\\server\c$\folder\file.txt' - ``` - * - * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, - * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working - * with URIs that represent files on disk (`file` scheme). - */ - get: function () { - // if (this.scheme !== 'file') { - // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); - // } - return _makeFsPath(this); - }, - enumerable: true, - configurable: true - }); - // ---- modify to new ------------------------- - URI.prototype.with = function (change) { - if (!change) { - return this; - } - var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment; - if (scheme === undefined) { - scheme = this.scheme; - } - else if (scheme === null) { - scheme = _empty; - } - if (authority === undefined) { - authority = this.authority; - } - else if (authority === null) { - authority = _empty; - } - if (path === undefined) { - path = this.path; - } - else if (path === null) { - path = _empty; - } - if (query === undefined) { - query = this.query; - } - else if (query === null) { - query = _empty; - } - if (fragment === undefined) { - fragment = this.fragment; - } - else if (fragment === null) { - fragment = _empty; - } - if (scheme === this.scheme - && authority === this.authority - && path === this.path - && query === this.query - && fragment === this.fragment) { - return this; - } - return new _URI(scheme, authority, path, query, fragment); - }; - // ---- parse & validate ------------------------ - /** - * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, - * `file:///usr/home`, or `scheme:with/path`. - * - * @param value A string which represents an URI (see `URI#toString`). - */ - URI.parse = function (value, _strict) { - if (_strict === void 0) { _strict = false; } - var match = _regexp.exec(value); - if (!match) { - return new _URI(_empty, _empty, _empty, _empty, _empty); - } - return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty), _strict); - }; - /** - * Creates a new URI from a file system path, e.g. `c:\my\files`, - * `/usr/home`, or `\\server\share\some\path`. - * - * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument - * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** - * `URI.parse('file://' + path)` because the path might contain characters that are - * interpreted (# and ?). See the following sample: - * ```ts - const good = URI.file('/coding/c#/project1'); - good.scheme === 'file'; - good.path === '/coding/c#/project1'; - good.fragment === ''; - const bad = URI.parse('file://' + '/coding/c#/project1'); - bad.scheme === 'file'; - bad.path === '/coding/c'; // path is now broken - bad.fragment === '/project1'; - ``` - * - * @param path A file system path (see `URI#fsPath`) - */ - URI.file = function (path) { - var authority = _empty; - // normalize to fwd-slashes on windows, - // on other systems bwd-slashes are valid - // filename character, eg /f\oo/ba\r.txt - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) { - path = path.replace(/\\/g, _slash); - } - // check for authority as used in UNC shares - // or use the path as given - if (path[0] === _slash && path[1] === _slash) { - var idx = path.indexOf(_slash, 2); - if (idx === -1) { - authority = path.substring(2); - path = _slash; - } - else { - authority = path.substring(2, idx); - path = path.substring(idx) || _slash; - } - } - return new _URI('file', authority, path, _empty, _empty); - }; - URI.from = function (components) { - return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment); - }; - // ---- printing/externalize --------------------------- - /** - * Creates a string representation for this URI. It's guaranteed that calling - * `URI.parse` with the result of this function creates an URI which is equal - * to this URI. - * - * * The result shall *not* be used for display purposes but for externalization or transport. - * * The result will be encoded using the percentage encoding and encoding happens mostly - * ignore the scheme-specific encoding rules. - * - * @param skipEncoding Do not encode the result, default is `false` - */ - URI.prototype.toString = function (skipEncoding) { - if (skipEncoding === void 0) { skipEncoding = false; } - return _asFormatted(this, skipEncoding); - }; - URI.prototype.toJSON = function () { - return this; - }; - URI.revive = function (data) { - if (!data) { - return data; - } - else if (data instanceof URI) { - return data; - } - else { - var result = new _URI(data); - result._fsPath = data.fsPath; - result._formatted = data.external; - return result; - } - }; - return URI; -}()); - -// tslint:disable-next-line:class-name -var _URI = /** @class */ (function (_super) { - __extends(_URI, _super); - function _URI() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._formatted = null; - _this._fsPath = null; - return _this; - } - Object.defineProperty(_URI.prototype, "fsPath", { - get: function () { - if (!this._fsPath) { - this._fsPath = _makeFsPath(this); - } - return this._fsPath; - }, - enumerable: true, - configurable: true - }); - _URI.prototype.toString = function (skipEncoding) { - if (skipEncoding === void 0) { skipEncoding = false; } - if (!skipEncoding) { - if (!this._formatted) { - this._formatted = _asFormatted(this, false); - } - return this._formatted; - } - else { - // we don't cache that - return _asFormatted(this, true); - } - }; - _URI.prototype.toJSON = function () { - var res = { - $mid: 1 - }; - // cached state - if (this._fsPath) { - res.fsPath = this._fsPath; - } - if (this._formatted) { - res.external = this._formatted; - } - // uri components - if (this.path) { - res.path = this.path; - } - if (this.scheme) { - res.scheme = this.scheme; - } - if (this.authority) { - res.authority = this.authority; - } - if (this.query) { - res.query = this.query; - } - if (this.fragment) { - res.fragment = this.fragment; - } - return res; - }; - return _URI; -}(URI)); -// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 -var encodeTable = (_a = {}, - _a[58 /* Colon */] = '%3A', - _a[47 /* Slash */] = '%2F', - _a[63 /* QuestionMark */] = '%3F', - _a[35 /* Hash */] = '%23', - _a[91 /* OpenSquareBracket */] = '%5B', - _a[93 /* CloseSquareBracket */] = '%5D', - _a[64 /* AtSign */] = '%40', - _a[33 /* ExclamationMark */] = '%21', - _a[36 /* DollarSign */] = '%24', - _a[38 /* Ampersand */] = '%26', - _a[39 /* SingleQuote */] = '%27', - _a[40 /* OpenParen */] = '%28', - _a[41 /* CloseParen */] = '%29', - _a[42 /* Asterisk */] = '%2A', - _a[43 /* Plus */] = '%2B', - _a[44 /* Comma */] = '%2C', - _a[59 /* Semicolon */] = '%3B', - _a[61 /* Equals */] = '%3D', - _a[32 /* Space */] = '%20', - _a); -function encodeURIComponentFast(uriComponent, allowSlash) { - var res = undefined; - var nativeEncodePos = -1; - for (var pos = 0; pos < uriComponent.length; pos++) { - var code = uriComponent.charCodeAt(pos); - // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 - if ((code >= 97 /* a */ && code <= 122 /* z */) - || (code >= 65 /* A */ && code <= 90 /* Z */) - || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) - || code === 45 /* Dash */ - || code === 46 /* Period */ - || code === 95 /* Underline */ - || code === 126 /* Tilde */ - || (allowSlash && code === 47 /* Slash */)) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // check if we write into a new string (by default we try to return the param) - if (res !== undefined) { - res += uriComponent.charAt(pos); - } - } - else { - // encoding needed, we need to allocate a new string - if (res === undefined) { - res = uriComponent.substr(0, pos); - } - // check with default table first - var escaped = encodeTable[code]; - if (escaped !== undefined) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // append escaped variant to result - res += escaped; - } - else if (nativeEncodePos === -1) { - // use native encode only when needed - nativeEncodePos = pos; - } - } - } - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); - } - return res !== undefined ? res : uriComponent; -} -function encodeURIComponentMinimal(path) { - var res = undefined; - for (var pos = 0; pos < path.length; pos++) { - var code = path.charCodeAt(pos); - if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { - if (res === undefined) { - res = path.substr(0, pos); - } - res += encodeTable[code]; - } - else { - if (res !== undefined) { - res += path[pos]; - } - } - } - return res !== undefined ? res : path; -} -/** - * Compute `fsPath` for the given uri - */ -function _makeFsPath(uri) { - var value; - if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { - // unc path: file://shares/c$/far/boo - value = "//" + uri.authority + uri.path; - } - else if (uri.path.charCodeAt(0) === 47 /* Slash */ - && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) - && uri.path.charCodeAt(2) === 58 /* Colon */) { - // windows drive letter: file:///c:/far/boo - value = uri.path[1].toLowerCase() + uri.path.substr(2); - } - else { - // other path - value = uri.path; - } - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) { - value = value.replace(/\//g, '\\'); - } - return value; -} -/** - * Create the external version of a uri - */ -function _asFormatted(uri, skipEncoding) { - var encoder = !skipEncoding - ? encodeURIComponentFast - : encodeURIComponentMinimal; - var res = ''; - var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment; - if (scheme) { - res += scheme; - res += ':'; - } - if (authority || scheme === 'file') { - res += _slash; - res += _slash; - } - if (authority) { - var idx = authority.indexOf('@'); - if (idx !== -1) { - // @ - var userinfo = authority.substr(0, idx); - authority = authority.substr(idx + 1); - idx = userinfo.indexOf(':'); - if (idx === -1) { - res += encoder(userinfo, false); - } - else { - // :@ - res += encoder(userinfo.substr(0, idx), false); - res += ':'; - res += encoder(userinfo.substr(idx + 1), false); - } - res += '@'; - } - authority = authority.toLowerCase(); - idx = authority.indexOf(':'); - if (idx === -1) { - res += encoder(authority, false); - } - else { - // : - res += encoder(authority.substr(0, idx), false); - res += authority.substr(idx); - } - } - if (path) { - // lower-case windows drive letters in /C:/fff or C:/fff - if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { - var code = path.charCodeAt(1); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3 - } - } - else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { - var code = path.charCodeAt(0); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3 - } - } - // encode the rest of the path - res += encoder(path, true); - } - if (query) { - res += '?'; - res += encoder(query, false); - } - if (fragment) { - res += '#'; - res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; - } - return res; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js ***! - \******************************************************************************/ -/*! exports provided: logOnceWebWorkerWarning, SimpleWorkerClient, SimpleWorkerServer, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logOnceWebWorkerWarning", function() { return logOnceWebWorkerWarning; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerClient", function() { return SimpleWorkerClient; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerServer", function() { return SimpleWorkerServer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -var INITIALIZE = '$initialize'; -var webWorkerWarningLogged = false; -function logOnceWebWorkerWarning(err) { - if (!_platform_js__WEBPACK_IMPORTED_MODULE_2__["isWeb"]) { - // running tests - return; - } - if (!webWorkerWarningLogged) { - webWorkerWarningLogged = true; - console.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq'); - } - console.warn(err.message); -} -var SimpleWorkerProtocol = /** @class */ (function () { - function SimpleWorkerProtocol(handler) { - this._workerId = -1; - this._handler = handler; - this._lastSentReq = 0; - this._pendingReplies = Object.create(null); - } - SimpleWorkerProtocol.prototype.setWorkerId = function (workerId) { - this._workerId = workerId; - }; - SimpleWorkerProtocol.prototype.sendMessage = function (method, args) { - var _this = this; - var req = String(++this._lastSentReq); - return new Promise(function (resolve, reject) { - _this._pendingReplies[req] = { - resolve: resolve, - reject: reject - }; - _this._send({ - vsWorker: _this._workerId, - req: req, - method: method, - args: args - }); - }); - }; - SimpleWorkerProtocol.prototype.handleMessage = function (serializedMessage) { - var message; - try { - message = JSON.parse(serializedMessage); - } - catch (e) { - // nothing - return; - } - if (!message || !message.vsWorker) { - return; - } - if (this._workerId !== -1 && message.vsWorker !== this._workerId) { - return; - } - this._handleMessage(message); - }; - SimpleWorkerProtocol.prototype._handleMessage = function (msg) { - var _this = this; - if (msg.seq) { - var replyMessage = msg; - if (!this._pendingReplies[replyMessage.seq]) { - console.warn('Got reply to unknown seq'); - return; - } - var reply = this._pendingReplies[replyMessage.seq]; - delete this._pendingReplies[replyMessage.seq]; - if (replyMessage.err) { - var err = replyMessage.err; - if (replyMessage.err.$isError) { - err = new Error(); - err.name = replyMessage.err.name; - err.message = replyMessage.err.message; - err.stack = replyMessage.err.stack; - } - reply.reject(err); - return; - } - reply.resolve(replyMessage.res); - return; - } - var requestMessage = msg; - var req = requestMessage.req; - var result = this._handler.handleMessage(requestMessage.method, requestMessage.args); - result.then(function (r) { - _this._send({ - vsWorker: _this._workerId, - seq: req, - res: r, - err: undefined - }); - }, function (e) { - if (e.detail instanceof Error) { - // Loading errors have a detail property that points to the actual error - e.detail = Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e.detail); - } - _this._send({ - vsWorker: _this._workerId, - seq: req, - res: undefined, - err: Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e) - }); - }); - }; - SimpleWorkerProtocol.prototype._send = function (msg) { - var strMsg = JSON.stringify(msg); - // console.log('SENDING: ' + strMsg); - this._handler.sendMessage(strMsg); - }; - return SimpleWorkerProtocol; -}()); -/** - * Main thread side - */ -var SimpleWorkerClient = /** @class */ (function (_super) { - __extends(SimpleWorkerClient, _super); - function SimpleWorkerClient(workerFactory, moduleId) { - var _this = _super.call(this) || this; - var lazyProxyReject = null; - _this._worker = _this._register(workerFactory.create('vs/base/common/worker/simpleWorker', function (msg) { - _this._protocol.handleMessage(msg); - }, function (err) { - // in Firefox, web workers fail lazily :( - // we will reject the proxy - if (lazyProxyReject) { - lazyProxyReject(err); - } - })); - _this._protocol = new SimpleWorkerProtocol({ - sendMessage: function (msg) { - _this._worker.postMessage(msg); - }, - handleMessage: function (method, args) { - // Intentionally not supporting worker -> main requests - return Promise.resolve(null); - } - }); - _this._protocol.setWorkerId(_this._worker.getId()); - // Gather loader configuration - var loaderConfiguration = null; - if (typeof self.require !== 'undefined' && typeof self.require.getConfig === 'function') { - // Get the configuration from the Monaco AMD Loader - loaderConfiguration = self.require.getConfig(); - } - else if (typeof self.requirejs !== 'undefined') { - // Get the configuration from requirejs - loaderConfiguration = self.requirejs.s.contexts._.config; - } - // Send initialize message - _this._onModuleLoaded = _this._protocol.sendMessage(INITIALIZE, [ - _this._worker.getId(), - moduleId, - loaderConfiguration - ]); - _this._lazyProxy = new Promise(function (resolve, reject) { - lazyProxyReject = reject; - _this._onModuleLoaded.then(function (availableMethods) { - var proxy = {}; - for (var _i = 0, availableMethods_1 = availableMethods; _i < availableMethods_1.length; _i++) { - var methodName = availableMethods_1[_i]; - proxy[methodName] = createProxyMethod(methodName, proxyMethodRequest); - } - resolve(proxy); - }, function (e) { - reject(e); - _this._onError('Worker failed to load ' + moduleId, e); - }); - }); - // Create proxy to loaded code - var proxyMethodRequest = function (method, args) { - return _this._request(method, args); - }; - var createProxyMethod = function (method, proxyMethodRequest) { - return function () { - var args = Array.prototype.slice.call(arguments, 0); - return proxyMethodRequest(method, args); - }; - }; - return _this; - } - SimpleWorkerClient.prototype.getProxyObject = function () { - return this._lazyProxy; - }; - SimpleWorkerClient.prototype._request = function (method, args) { - var _this = this; - return new Promise(function (resolve, reject) { - _this._onModuleLoaded.then(function () { - _this._protocol.sendMessage(method, args).then(resolve, reject); - }, reject); - }); - }; - SimpleWorkerClient.prototype._onError = function (message, error) { - console.error(message); - console.info(error); - }; - return SimpleWorkerClient; -}(_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"])); - -/** - * Worker side - */ -var SimpleWorkerServer = /** @class */ (function () { - function SimpleWorkerServer(postSerializedMessage, requestHandler) { - var _this = this; - this._requestHandler = requestHandler; - this._protocol = new SimpleWorkerProtocol({ - sendMessage: function (msg) { - postSerializedMessage(msg); - }, - handleMessage: function (method, args) { return _this._handleMessage(method, args); } - }); - } - SimpleWorkerServer.prototype.onmessage = function (msg) { - this._protocol.handleMessage(msg); - }; - SimpleWorkerServer.prototype._handleMessage = function (method, args) { - if (method === INITIALIZE) { - return this.initialize(args[0], args[1], args[2]); - } - if (!this._requestHandler || typeof this._requestHandler[method] !== 'function') { - return Promise.reject(new Error('Missing requestHandler or method: ' + method)); - } - try { - return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args)); - } - catch (e) { - return Promise.reject(e); - } - }; - SimpleWorkerServer.prototype.initialize = function (workerId, moduleId, loaderConfig) { - var _this = this; - this._protocol.setWorkerId(workerId); - if (this._requestHandler) { - // static request handler - var methods = []; - for (var _i = 0, _a = Object(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllPropertyNames"])(this._requestHandler); _i < _a.length; _i++) { - var prop = _a[_i]; - if (typeof this._requestHandler[prop] === 'function') { - methods.push(prop); - } - } - return Promise.resolve(methods); - } - if (loaderConfig) { - // Remove 'baseUrl', handling it is beyond scope for now - if (typeof loaderConfig.baseUrl !== 'undefined') { - delete loaderConfig['baseUrl']; - } - if (typeof loaderConfig.paths !== 'undefined') { - if (typeof loaderConfig.paths.vs !== 'undefined') { - delete loaderConfig.paths['vs']; - } - } - // Since this is in a web worker, enable catching errors - loaderConfig.catchError = true; - self.require.config(loaderConfig); - } - return new Promise(function (resolve, reject) { - // Use the global require to be sure to get the global config - self.require([moduleId], function () { - var result = []; - for (var _i = 0; _i < arguments.length; _i++) { - result[_i] = arguments[_i]; - } - var handlerModule = result[0]; - _this._requestHandler = handlerModule.create(); - if (!_this._requestHandler) { - reject(new Error("No RequestHandler!")); - return; - } - var methods = []; - for (var _a = 0, _b = Object(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllPropertyNames"])(_this._requestHandler); _a < _b.length; _a++) { - var prop = _b[_a]; - if (typeof _this._requestHandler[prop] === 'function') { - methods.push(prop); - } - } - resolve(methods); - }, reject); - }); - }; - return SimpleWorkerServer; -}()); - -/** - * Called on the worker side - */ -function create(postMessage) { - return new SimpleWorkerServer(postMessage, null); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js ***! - \*************************************************************************************/ -/*! exports provided: CharacterClassifier, CharacterSet */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterClassifier", function() { return CharacterClassifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterSet", function() { return CharacterSet; }); -/* harmony import */ var _uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uint.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * A fast character classifier that uses a compact array for ASCII values. - */ -var CharacterClassifier = /** @class */ (function () { - function CharacterClassifier(_defaultValue) { - var defaultValue = Object(_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_defaultValue); - this._defaultValue = defaultValue; - this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue); - this._map = new Map(); - } - CharacterClassifier._createAsciiMap = function (defaultValue) { - var asciiMap = new Uint8Array(256); - for (var i = 0; i < 256; i++) { - asciiMap[i] = defaultValue; - } - return asciiMap; - }; - CharacterClassifier.prototype.set = function (charCode, _value) { - var value = Object(_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_value); - if (charCode >= 0 && charCode < 256) { - this._asciiMap[charCode] = value; - } - else { - this._map.set(charCode, value); - } - }; - CharacterClassifier.prototype.get = function (charCode) { - if (charCode >= 0 && charCode < 256) { - return this._asciiMap[charCode]; - } - else { - return (this._map.get(charCode) || this._defaultValue); - } - }; - return CharacterClassifier; -}()); - -var CharacterSet = /** @class */ (function () { - function CharacterSet() { - this._actual = new CharacterClassifier(0 /* False */); - } - CharacterSet.prototype.add = function (charCode) { - this._actual.set(charCode, 1 /* True */); - }; - CharacterSet.prototype.has = function (charCode) { - return (this._actual.get(charCode) === 1 /* True */); - }; - return CharacterSet; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/position.js ***! - \**************************************************************************/ -/*! exports provided: Position */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -/** - * A position in the editor. - */ -var Position = /** @class */ (function () { - function Position(lineNumber, column) { - this.lineNumber = lineNumber; - this.column = column; - } - /** - * Create a new postion from this position. - * - * @param newLineNumber new line number - * @param newColumn new column - */ - Position.prototype.with = function (newLineNumber, newColumn) { - if (newLineNumber === void 0) { newLineNumber = this.lineNumber; } - if (newColumn === void 0) { newColumn = this.column; } - if (newLineNumber === this.lineNumber && newColumn === this.column) { - return this; - } - else { - return new Position(newLineNumber, newColumn); - } - }; - /** - * Derive a new position from this position. - * - * @param deltaLineNumber line number delta - * @param deltaColumn column delta - */ - Position.prototype.delta = function (deltaLineNumber, deltaColumn) { - if (deltaLineNumber === void 0) { deltaLineNumber = 0; } - if (deltaColumn === void 0) { deltaColumn = 0; } - return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn); - }; - /** - * Test if this position equals other position - */ - Position.prototype.equals = function (other) { - return Position.equals(this, other); - }; - /** - * Test if position `a` equals position `b` - */ - Position.equals = function (a, b) { - if (!a && !b) { - return true; - } - return (!!a && - !!b && - a.lineNumber === b.lineNumber && - a.column === b.column); - }; - /** - * Test if this position is before other position. - * If the two positions are equal, the result will be false. - */ - Position.prototype.isBefore = function (other) { - return Position.isBefore(this, other); - }; - /** - * Test if position `a` is before position `b`. - * If the two positions are equal, the result will be false. - */ - Position.isBefore = function (a, b) { - if (a.lineNumber < b.lineNumber) { - return true; - } - if (b.lineNumber < a.lineNumber) { - return false; - } - return a.column < b.column; - }; - /** - * Test if this position is before other position. - * If the two positions are equal, the result will be true. - */ - Position.prototype.isBeforeOrEqual = function (other) { - return Position.isBeforeOrEqual(this, other); - }; - /** - * Test if position `a` is before position `b`. - * If the two positions are equal, the result will be true. - */ - Position.isBeforeOrEqual = function (a, b) { - if (a.lineNumber < b.lineNumber) { - return true; - } - if (b.lineNumber < a.lineNumber) { - return false; - } - return a.column <= b.column; - }; - /** - * A function that compares positions, useful for sorting - */ - Position.compare = function (a, b) { - var aLineNumber = a.lineNumber | 0; - var bLineNumber = b.lineNumber | 0; - if (aLineNumber === bLineNumber) { - var aColumn = a.column | 0; - var bColumn = b.column | 0; - return aColumn - bColumn; - } - return aLineNumber - bLineNumber; - }; - /** - * Clone this position. - */ - Position.prototype.clone = function () { - return new Position(this.lineNumber, this.column); - }; - /** - * Convert to a human-readable representation. - */ - Position.prototype.toString = function () { - return '(' + this.lineNumber + ',' + this.column + ')'; - }; - // --- - /** - * Create a `Position` from an `IPosition`. - */ - Position.lift = function (pos) { - return new Position(pos.lineNumber, pos.column); - }; - /** - * Test if `obj` is an `IPosition`. - */ - Position.isIPosition = function (obj) { - return (obj - && (typeof obj.lineNumber === 'number') - && (typeof obj.column === 'number')); - }; - return Position; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/range.js ***! - \***********************************************************************/ -/*! exports provided: Range */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; }); -/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn) - */ -var Range = /** @class */ (function () { - function Range(startLineNumber, startColumn, endLineNumber, endColumn) { - if ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) { - this.startLineNumber = endLineNumber; - this.startColumn = endColumn; - this.endLineNumber = startLineNumber; - this.endColumn = startColumn; - } - else { - this.startLineNumber = startLineNumber; - this.startColumn = startColumn; - this.endLineNumber = endLineNumber; - this.endColumn = endColumn; - } - } - /** - * Test if this range is empty. - */ - Range.prototype.isEmpty = function () { - return Range.isEmpty(this); - }; - /** - * Test if `range` is empty. - */ - Range.isEmpty = function (range) { - return (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn); - }; - /** - * Test if position is in this range. If the position is at the edges, will return true. - */ - Range.prototype.containsPosition = function (position) { - return Range.containsPosition(this, position); - }; - /** - * Test if `position` is in `range`. If the position is at the edges, will return true. - */ - Range.containsPosition = function (range, position) { - if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) { - return false; - } - if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) { - return false; - } - if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) { - return false; - } - return true; - }; - /** - * Test if range is in this range. If the range is equal to this range, will return true. - */ - Range.prototype.containsRange = function (range) { - return Range.containsRange(this, range); - }; - /** - * Test if `otherRange` is in `range`. If the ranges are equal, will return true. - */ - Range.containsRange = function (range, otherRange) { - if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { - return false; - } - if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { - return false; - } - if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) { - return false; - } - if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) { - return false; - } - return true; - }; - /** - * A reunion of the two ranges. - * The smallest position will be used as the start point, and the largest one as the end point. - */ - Range.prototype.plusRange = function (range) { - return Range.plusRange(this, range); - }; - /** - * A reunion of the two ranges. - * The smallest position will be used as the start point, and the largest one as the end point. - */ - Range.plusRange = function (a, b) { - var startLineNumber; - var startColumn; - var endLineNumber; - var endColumn; - if (b.startLineNumber < a.startLineNumber) { - startLineNumber = b.startLineNumber; - startColumn = b.startColumn; - } - else if (b.startLineNumber === a.startLineNumber) { - startLineNumber = b.startLineNumber; - startColumn = Math.min(b.startColumn, a.startColumn); - } - else { - startLineNumber = a.startLineNumber; - startColumn = a.startColumn; - } - if (b.endLineNumber > a.endLineNumber) { - endLineNumber = b.endLineNumber; - endColumn = b.endColumn; - } - else if (b.endLineNumber === a.endLineNumber) { - endLineNumber = b.endLineNumber; - endColumn = Math.max(b.endColumn, a.endColumn); - } - else { - endLineNumber = a.endLineNumber; - endColumn = a.endColumn; - } - return new Range(startLineNumber, startColumn, endLineNumber, endColumn); - }; - /** - * A intersection of the two ranges. - */ - Range.prototype.intersectRanges = function (range) { - return Range.intersectRanges(this, range); - }; - /** - * A intersection of the two ranges. - */ - Range.intersectRanges = function (a, b) { - var resultStartLineNumber = a.startLineNumber; - var resultStartColumn = a.startColumn; - var resultEndLineNumber = a.endLineNumber; - var resultEndColumn = a.endColumn; - var otherStartLineNumber = b.startLineNumber; - var otherStartColumn = b.startColumn; - var otherEndLineNumber = b.endLineNumber; - var otherEndColumn = b.endColumn; - if (resultStartLineNumber < otherStartLineNumber) { - resultStartLineNumber = otherStartLineNumber; - resultStartColumn = otherStartColumn; - } - else if (resultStartLineNumber === otherStartLineNumber) { - resultStartColumn = Math.max(resultStartColumn, otherStartColumn); - } - if (resultEndLineNumber > otherEndLineNumber) { - resultEndLineNumber = otherEndLineNumber; - resultEndColumn = otherEndColumn; - } - else if (resultEndLineNumber === otherEndLineNumber) { - resultEndColumn = Math.min(resultEndColumn, otherEndColumn); - } - // Check if selection is now empty - if (resultStartLineNumber > resultEndLineNumber) { - return null; - } - if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) { - return null; - } - return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn); - }; - /** - * Test if this range equals other. - */ - Range.prototype.equalsRange = function (other) { - return Range.equalsRange(this, other); - }; - /** - * Test if range `a` equals `b`. - */ - Range.equalsRange = function (a, b) { - return (!!a && - !!b && - a.startLineNumber === b.startLineNumber && - a.startColumn === b.startColumn && - a.endLineNumber === b.endLineNumber && - a.endColumn === b.endColumn); - }; - /** - * Return the end position (which will be after or equal to the start position) - */ - Range.prototype.getEndPosition = function () { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.endLineNumber, this.endColumn); - }; - /** - * Return the start position (which will be before or equal to the end position) - */ - Range.prototype.getStartPosition = function () { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.startLineNumber, this.startColumn); - }; - /** - * Transform to a user presentable string representation. - */ - Range.prototype.toString = function () { - return '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']'; - }; - /** - * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position. - */ - Range.prototype.setEndPosition = function (endLineNumber, endColumn) { - return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn); - }; - /** - * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position. - */ - Range.prototype.setStartPosition = function (startLineNumber, startColumn) { - return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn); - }; - /** - * Create a new empty range using this range's start position. - */ - Range.prototype.collapseToStart = function () { - return Range.collapseToStart(this); - }; - /** - * Create a new empty range using this range's start position. - */ - Range.collapseToStart = function (range) { - return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn); - }; - // --- - Range.fromPositions = function (start, end) { - if (end === void 0) { end = start; } - return new Range(start.lineNumber, start.column, end.lineNumber, end.column); - }; - Range.lift = function (range) { - if (!range) { - return null; - } - return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); - }; - /** - * Test if `obj` is an `IRange`. - */ - Range.isIRange = function (obj) { - return (obj - && (typeof obj.startLineNumber === 'number') - && (typeof obj.startColumn === 'number') - && (typeof obj.endLineNumber === 'number') - && (typeof obj.endColumn === 'number')); - }; - /** - * Test if the two ranges are touching in any way. - */ - Range.areIntersectingOrTouching = function (a, b) { - // Check if `a` is before `b` - if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) { - return false; - } - // Check if `b` is before `a` - if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) { - return false; - } - // These ranges must intersect - return true; - }; - /** - * Test if the two ranges are intersecting. If the ranges are touching it returns true. - */ - Range.areIntersecting = function (a, b) { - // Check if `a` is before `b` - if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) { - return false; - } - // Check if `b` is before `a` - if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) { - return false; - } - // These ranges must intersect - return true; - }; - /** - * A function that compares ranges, useful for sorting ranges - * It will first compare ranges on the startPosition and then on the endPosition - */ - Range.compareRangesUsingStarts = function (a, b) { - if (a && b) { - var aStartLineNumber = a.startLineNumber | 0; - var bStartLineNumber = b.startLineNumber | 0; - if (aStartLineNumber === bStartLineNumber) { - var aStartColumn = a.startColumn | 0; - var bStartColumn = b.startColumn | 0; - if (aStartColumn === bStartColumn) { - var aEndLineNumber = a.endLineNumber | 0; - var bEndLineNumber = b.endLineNumber | 0; - if (aEndLineNumber === bEndLineNumber) { - var aEndColumn = a.endColumn | 0; - var bEndColumn = b.endColumn | 0; - return aEndColumn - bEndColumn; - } - return aEndLineNumber - bEndLineNumber; - } - return aStartColumn - bStartColumn; - } - return aStartLineNumber - bStartLineNumber; - } - var aExists = (a ? 1 : 0); - var bExists = (b ? 1 : 0); - return aExists - bExists; - }; - /** - * A function that compares ranges, useful for sorting ranges - * It will first compare ranges on the endPosition and then on the startPosition - */ - Range.compareRangesUsingEnds = function (a, b) { - if (a.endLineNumber === b.endLineNumber) { - if (a.endColumn === b.endColumn) { - if (a.startLineNumber === b.startLineNumber) { - return a.startColumn - b.startColumn; - } - return a.startLineNumber - b.startLineNumber; - } - return a.endColumn - b.endColumn; - } - return a.endLineNumber - b.endLineNumber; - }; - /** - * Test if the range spans multiple lines. - */ - Range.spansMultipleLines = function (range) { - return range.endLineNumber > range.startLineNumber; - }; - return Range; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js ***! - \***************************************************************************/ -/*! exports provided: Selection */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Selection", function() { return Selection; }); -/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -/** - * A selection in the editor. - * The selection is a range that has an orientation. - */ -var Selection = /** @class */ (function (_super) { - __extends(Selection, _super); - function Selection(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) { - var _this = _super.call(this, selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) || this; - _this.selectionStartLineNumber = selectionStartLineNumber; - _this.selectionStartColumn = selectionStartColumn; - _this.positionLineNumber = positionLineNumber; - _this.positionColumn = positionColumn; - return _this; - } - /** - * Clone this selection. - */ - Selection.prototype.clone = function () { - return new Selection(this.selectionStartLineNumber, this.selectionStartColumn, this.positionLineNumber, this.positionColumn); - }; - /** - * Transform to a human-readable representation. - */ - Selection.prototype.toString = function () { - return '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']'; - }; - /** - * Test if equals other selection. - */ - Selection.prototype.equalsSelection = function (other) { - return (Selection.selectionsEqual(this, other)); - }; - /** - * Test if the two selections are equal. - */ - Selection.selectionsEqual = function (a, b) { - return (a.selectionStartLineNumber === b.selectionStartLineNumber && - a.selectionStartColumn === b.selectionStartColumn && - a.positionLineNumber === b.positionLineNumber && - a.positionColumn === b.positionColumn); - }; - /** - * Get directions (LTR or RTL). - */ - Selection.prototype.getDirection = function () { - if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) { - return 0 /* LTR */; - } - return 1 /* RTL */; - }; - /** - * Create a new selection with a different `positionLineNumber` and `positionColumn`. - */ - Selection.prototype.setEndPosition = function (endLineNumber, endColumn) { - if (this.getDirection() === 0 /* LTR */) { - return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn); - } - return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn); - }; - /** - * Get the position at `positionLineNumber` and `positionColumn`. - */ - Selection.prototype.getPosition = function () { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.positionLineNumber, this.positionColumn); - }; - /** - * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. - */ - Selection.prototype.setStartPosition = function (startLineNumber, startColumn) { - if (this.getDirection() === 0 /* LTR */) { - return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn); - } - return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn); - }; - // ---- - /** - * Create a `Selection` from one or two positions - */ - Selection.fromPositions = function (start, end) { - if (end === void 0) { end = start; } - return new Selection(start.lineNumber, start.column, end.lineNumber, end.column); - }; - /** - * Create a `Selection` from an `ISelection`. - */ - Selection.liftSelection = function (sel) { - return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn); - }; - /** - * `a` equals `b`. - */ - Selection.selectionsArrEqual = function (a, b) { - if (a && !b || !a && b) { - return false; - } - if (!a && !b) { - return true; - } - if (a.length !== b.length) { - return false; - } - for (var i = 0, len = a.length; i < len; i++) { - if (!this.selectionsEqual(a[i], b[i])) { - return false; - } - } - return true; - }; - /** - * Test if `obj` is an `ISelection`. - */ - Selection.isISelection = function (obj) { - return (obj - && (typeof obj.selectionStartLineNumber === 'number') - && (typeof obj.selectionStartColumn === 'number') - && (typeof obj.positionLineNumber === 'number') - && (typeof obj.positionColumn === 'number')); - }; - /** - * Create with a direction. - */ - Selection.createWithDirection = function (startLineNumber, startColumn, endLineNumber, endColumn, direction) { - if (direction === 0 /* LTR */) { - return new Selection(startLineNumber, startColumn, endLineNumber, endColumn); - } - return new Selection(endLineNumber, endColumn, startLineNumber, startColumn); - }; - return Selection; -}(_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"])); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/token.js ***! - \***********************************************************************/ -/*! exports provided: Token, TokenizationResult, TokenizationResult2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Token", function() { return Token; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult", function() { return TokenizationResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult2", function() { return TokenizationResult2; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var Token = /** @class */ (function () { - function Token(offset, type, language) { - this.offset = offset | 0; // @perf - this.type = type; - this.language = language; - } - Token.prototype.toString = function () { - return '(' + this.offset + ', ' + this.type + ')'; - }; - return Token; -}()); - -var TokenizationResult = /** @class */ (function () { - function TokenizationResult(tokens, endState) { - this.tokens = tokens; - this.endState = endState; - } - return TokenizationResult; -}()); - -var TokenizationResult2 = /** @class */ (function () { - function TokenizationResult2(tokens, endState) { - this.tokens = tokens; - this.endState = endState; - } - return TokenizationResult2; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js ***! - \**********************************************************************/ -/*! exports provided: Uint8Matrix, toUint8, toUint32, toUint32Array */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uint8Matrix", function() { return Uint8Matrix; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint8", function() { return toUint8; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint32", function() { return toUint32; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint32Array", function() { return toUint32Array; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var Uint8Matrix = /** @class */ (function () { - function Uint8Matrix(rows, cols, defaultValue) { - var data = new Uint8Array(rows * cols); - for (var i = 0, len = rows * cols; i < len; i++) { - data[i] = defaultValue; - } - this._data = data; - this.rows = rows; - this.cols = cols; - } - Uint8Matrix.prototype.get = function (row, col) { - return this._data[row * this.cols + col]; - }; - Uint8Matrix.prototype.set = function (row, col, value) { - this._data[row * this.cols + col] = value; - }; - return Uint8Matrix; -}()); - -function toUint8(v) { - if (v < 0) { - return 0; - } - if (v > 255 /* MAX_UINT_8 */) { - return 255 /* MAX_UINT_8 */; - } - return v | 0; -} -function toUint32(v) { - if (v < 0) { - return 0; - } - if (v > 4294967295 /* MAX_UINT_32 */) { - return 4294967295 /* MAX_UINT_32 */; - } - return v | 0; -} -function toUint32Array(arr) { - var len = arr.length; - var r = new Uint32Array(len); - for (var i = 0; i < len; i++) { - r[i] = toUint32(arr[i]); - } - return r; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js ***! - \******************************************************************************/ -/*! exports provided: DiffComputer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffComputer", function() { return DiffComputer; }); -/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -5528,10 +3861,10 @@ __webpack_require__.r(__webpack_exports__); var MAXIMUM_RUN_TIME = 5000; // 5 seconds var MINIMUM_MATCHING_CHARACTER_LENGTH = 3; function computeDiff(originalSequence, modifiedSequence, continueProcessingPredicate, pretty) { - var diffAlgo = new _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__["LcsDiff"](originalSequence, modifiedSequence, continueProcessingPredicate); + var diffAlgo = new diff_LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate); return diffAlgo.ComputeDiff(pretty); } -var LineMarkerSequence = /** @class */ (function () { +var diffComputer_LineMarkerSequence = /** @class */ (function () { function LineMarkerSequence(lines) { var startColumns = []; var endColumns = []; @@ -5556,14 +3889,14 @@ var LineMarkerSequence = /** @class */ (function () { return i + 1; }; LineMarkerSequence._getFirstNonBlankColumn = function (txt, defaultValue) { - var r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["firstNonWhitespaceIndex"](txt); + var r = firstNonWhitespaceIndex(txt); if (r === -1) { return defaultValue; } return r + 1; }; LineMarkerSequence._getLastNonBlankColumn = function (txt, defaultValue) { - var r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["lastNonWhitespaceIndex"](txt); + var r = lastNonWhitespaceIndex(txt); if (r === -1) { return defaultValue; } @@ -5743,8 +4076,8 @@ var DiffComputer = /** @class */ (function () { this.maximumRunTimeMs = MAXIMUM_RUN_TIME; this.originalLines = originalLines; this.modifiedLines = modifiedLines; - this.original = new LineMarkerSequence(originalLines); - this.modified = new LineMarkerSequence(modifiedLines); + this.original = new diffComputer_LineMarkerSequence(originalLines); + this.modified = new diffComputer_LineMarkerSequence(modifiedLines); } DiffComputer.prototype.computeDiff = function () { if (this.original.getLength() === 1 && this.original.getElementAtIndex(0).length === 0) { @@ -5812,8 +4145,8 @@ var DiffComputer = /** @class */ (function () { // These lines differ only in trim whitespace // Check the leading whitespace { - var originalStartColumn = LineMarkerSequence._getFirstNonBlankColumn(originalLine, 1); - var modifiedStartColumn = LineMarkerSequence._getFirstNonBlankColumn(modifiedLine, 1); + var originalStartColumn = diffComputer_LineMarkerSequence._getFirstNonBlankColumn(originalLine, 1); + var modifiedStartColumn = diffComputer_LineMarkerSequence._getFirstNonBlankColumn(modifiedLine, 1); while (originalStartColumn > 1 && modifiedStartColumn > 1) { var originalChar = originalLine.charCodeAt(originalStartColumn - 2); var modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2); @@ -5829,8 +4162,8 @@ var DiffComputer = /** @class */ (function () { } // Check the trailing whitespace { - var originalEndColumn = LineMarkerSequence._getLastNonBlankColumn(originalLine, 1); - var modifiedEndColumn = LineMarkerSequence._getLastNonBlankColumn(modifiedLine, 1); + var originalEndColumn = diffComputer_LineMarkerSequence._getLastNonBlankColumn(originalLine, 1); + var modifiedEndColumn = diffComputer_LineMarkerSequence._getLastNonBlankColumn(modifiedLine, 1); var originalMaxColumn = originalLine.length + 1; var modifiedMaxColumn = modifiedLine.length + 1; while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) { @@ -5901,28 +4234,267 @@ var DiffComputer = /** @class */ (function () { }()); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var Uint8Matrix = /** @class */ (function () { + function Uint8Matrix(rows, cols, defaultValue) { + var data = new Uint8Array(rows * cols); + for (var i = 0, len = rows * cols; i < len; i++) { + data[i] = defaultValue; + } + this._data = data; + this.rows = rows; + this.cols = cols; + } + Uint8Matrix.prototype.get = function (row, col) { + return this._data[row * this.cols + col]; + }; + Uint8Matrix.prototype.set = function (row, col, value) { + this._data[row * this.cols + col] = value; + }; + return Uint8Matrix; +}()); -/***/ }), +function toUint8(v) { + if (v < 0) { + return 0; + } + if (v > 255 /* MAX_UINT_8 */) { + return 255 /* MAX_UINT_8 */; + } + return v | 0; +} +function toUint32(v) { + if (v < 0) { + return 0; + } + if (v > 4294967295 /* MAX_UINT_32 */) { + return 4294967295 /* MAX_UINT_32 */; + } + return v | 0; +} +function toUint32Array(arr) { + var len = arr.length; + var r = new Uint32Array(len); + for (var i = 0; i < len; i++) { + r[i] = toUint32(arr[i]); + } + return r; +} -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js ***! - \**********************************************************************************/ -/*! exports provided: MirrorTextModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MirrorTextModel", function() { return MirrorTextModel; }); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../viewModel/prefixSumComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js"); +var PrefixSumIndexOfResult = /** @class */ (function () { + function PrefixSumIndexOfResult(index, remainder) { + this.index = index; + this.remainder = remainder; + } + return PrefixSumIndexOfResult; +}()); + +var prefixSumComputer_PrefixSumComputer = /** @class */ (function () { + function PrefixSumComputer(values) { + this.values = values; + this.prefixSum = new Uint32Array(values.length); + this.prefixSumValidIndex = new Int32Array(1); + this.prefixSumValidIndex[0] = -1; + } + PrefixSumComputer.prototype.getCount = function () { + return this.values.length; + }; + PrefixSumComputer.prototype.insertValues = function (insertIndex, insertValues) { + insertIndex = toUint32(insertIndex); + var oldValues = this.values; + var oldPrefixSum = this.prefixSum; + var insertValuesLen = insertValues.length; + if (insertValuesLen === 0) { + return false; + } + this.values = new Uint32Array(oldValues.length + insertValuesLen); + this.values.set(oldValues.subarray(0, insertIndex), 0); + this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen); + this.values.set(insertValues, insertIndex); + if (insertIndex - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = insertIndex - 1; + } + this.prefixSum = new Uint32Array(this.values.length); + if (this.prefixSumValidIndex[0] >= 0) { + this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); + } + return true; + }; + PrefixSumComputer.prototype.changeValue = function (index, value) { + index = toUint32(index); + value = toUint32(value); + if (this.values[index] === value) { + return false; + } + this.values[index] = value; + if (index - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = index - 1; + } + return true; + }; + PrefixSumComputer.prototype.removeValues = function (startIndex, cnt) { + startIndex = toUint32(startIndex); + cnt = toUint32(cnt); + var oldValues = this.values; + var oldPrefixSum = this.prefixSum; + if (startIndex >= oldValues.length) { + return false; + } + var maxCnt = oldValues.length - startIndex; + if (cnt >= maxCnt) { + cnt = maxCnt; + } + if (cnt === 0) { + return false; + } + this.values = new Uint32Array(oldValues.length - cnt); + this.values.set(oldValues.subarray(0, startIndex), 0); + this.values.set(oldValues.subarray(startIndex + cnt), startIndex); + this.prefixSum = new Uint32Array(this.values.length); + if (startIndex - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = startIndex - 1; + } + if (this.prefixSumValidIndex[0] >= 0) { + this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); + } + return true; + }; + PrefixSumComputer.prototype.getTotalValue = function () { + if (this.values.length === 0) { + return 0; + } + return this._getAccumulatedValue(this.values.length - 1); + }; + PrefixSumComputer.prototype.getAccumulatedValue = function (index) { + if (index < 0) { + return 0; + } + index = toUint32(index); + return this._getAccumulatedValue(index); + }; + PrefixSumComputer.prototype._getAccumulatedValue = function (index) { + if (index <= this.prefixSumValidIndex[0]) { + return this.prefixSum[index]; + } + var startIndex = this.prefixSumValidIndex[0] + 1; + if (startIndex === 0) { + this.prefixSum[0] = this.values[0]; + startIndex++; + } + if (index >= this.values.length) { + index = this.values.length - 1; + } + for (var i = startIndex; i <= index; i++) { + this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i]; + } + this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index); + return this.prefixSum[index]; + }; + PrefixSumComputer.prototype.getIndexOf = function (accumulatedValue) { + accumulatedValue = Math.floor(accumulatedValue); //@perf + // Compute all sums (to get a fully valid prefixSum) + this.getTotalValue(); + var low = 0; + var high = this.values.length - 1; + var mid = 0; + var midStop = 0; + var midStart = 0; + while (low <= high) { + mid = low + ((high - low) / 2) | 0; + midStop = this.prefixSum[mid]; + midStart = midStop - this.values[mid]; + if (accumulatedValue < midStart) { + high = mid - 1; + } + else if (accumulatedValue >= midStop) { + low = mid + 1; + } + else { + break; + } + } + return new PrefixSumIndexOfResult(mid, accumulatedValue - midStart); + }; + return PrefixSumComputer; +}()); + +var PrefixSumComputerWithCache = /** @class */ (function () { + function PrefixSumComputerWithCache(values) { + this._cacheAccumulatedValueStart = 0; + this._cache = null; + this._actual = new prefixSumComputer_PrefixSumComputer(values); + this._bustCache(); + } + PrefixSumComputerWithCache.prototype._bustCache = function () { + this._cacheAccumulatedValueStart = 0; + this._cache = null; + }; + PrefixSumComputerWithCache.prototype.insertValues = function (insertIndex, insertValues) { + if (this._actual.insertValues(insertIndex, insertValues)) { + this._bustCache(); + } + }; + PrefixSumComputerWithCache.prototype.changeValue = function (index, value) { + if (this._actual.changeValue(index, value)) { + this._bustCache(); + } + }; + PrefixSumComputerWithCache.prototype.removeValues = function (startIndex, cnt) { + if (this._actual.removeValues(startIndex, cnt)) { + this._bustCache(); + } + }; + PrefixSumComputerWithCache.prototype.getTotalValue = function () { + return this._actual.getTotalValue(); + }; + PrefixSumComputerWithCache.prototype.getAccumulatedValue = function (index) { + return this._actual.getAccumulatedValue(index); + }; + PrefixSumComputerWithCache.prototype.getIndexOf = function (accumulatedValue) { + accumulatedValue = Math.floor(accumulatedValue); //@perf + if (this._cache !== null) { + var cacheIndex = accumulatedValue - this._cacheAccumulatedValueStart; + if (cacheIndex >= 0 && cacheIndex < this._cache.length) { + // Cache hit! + return this._cache[cacheIndex]; + } + } + // Cache miss! + return this._actual.getIndexOf(accumulatedValue); + }; + /** + * Gives a hint that a lot of requests are about to come in for these accumulated values. + */ + PrefixSumComputerWithCache.prototype.warmUpCache = function (accumulatedValueStart, accumulatedValueEnd) { + var newCache = []; + for (var accumulatedValue = accumulatedValueStart; accumulatedValue <= accumulatedValueEnd; accumulatedValue++) { + newCache[accumulatedValue - accumulatedValueStart] = this.getIndexOf(accumulatedValue); + } + this._cache = newCache; + this._cacheAccumulatedValueStart = accumulatedValueStart; + }; + return PrefixSumComputerWithCache; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var MirrorTextModel = /** @class */ (function () { +var mirrorTextModel_MirrorTextModel = /** @class */ (function () { function MirrorTextModel(uri, lines, eol, versionId) { this._uri = uri; this._lines = lines; @@ -5946,7 +4518,7 @@ var MirrorTextModel = /** @class */ (function () { for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) { var change = changes_1[_i]; this._acceptDeleteRange(change.range); - this._acceptInsertText(new _core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](change.range.startLineNumber, change.range.startColumn), change.text); + this._acceptInsertText(new Position(change.range.startLineNumber, change.range.startColumn), change.text); } this._versionId = e.versionId; }; @@ -5958,7 +4530,7 @@ var MirrorTextModel = /** @class */ (function () { for (var i = 0; i < linesLength; i++) { lineStartValues[i] = this._lines[i].length + eolLength; } - this._lineStarts = new _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__["PrefixSumComputer"](lineStartValues); + this._lineStarts = new prefixSumComputer_PrefixSumComputer(lineStartValues); } }; /** @@ -6025,22 +4597,7 @@ var MirrorTextModel = /** @class */ (function () { }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js ***! - \*****************************************************************************/ -/*! exports provided: USUAL_WORD_SEPARATORS, DEFAULT_WORD_REGEXP, ensureValidWordDefinition, getWordAtText */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USUAL_WORD_SEPARATORS", function() { return USUAL_WORD_SEPARATORS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_WORD_REGEXP", function() { return DEFAULT_WORD_REGEXP; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureValidWordDefinition", function() { return ensureValidWordDefinition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWordAtText", function() { return getWordAtText; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -6154,30 +4711,71 @@ function getWordAtText(column, wordDefinition, text, textOffset) { return ret; } +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ -/***/ }), +/** + * A fast character classifier that uses a compact array for ASCII values. + */ +var characterClassifier_CharacterClassifier = /** @class */ (function () { + function CharacterClassifier(_defaultValue) { + var defaultValue = toUint8(_defaultValue); + this._defaultValue = defaultValue; + this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue); + this._map = new Map(); + } + CharacterClassifier._createAsciiMap = function (defaultValue) { + var asciiMap = new Uint8Array(256); + for (var i = 0; i < 256; i++) { + asciiMap[i] = defaultValue; + } + return asciiMap; + }; + CharacterClassifier.prototype.set = function (charCode, _value) { + var value = toUint8(_value); + if (charCode >= 0 && charCode < 256) { + this._asciiMap[charCode] = value; + } + else { + this._map.set(charCode, value); + } + }; + CharacterClassifier.prototype.get = function (charCode) { + if (charCode >= 0 && charCode < 256) { + return this._asciiMap[charCode]; + } + else { + return (this._map.get(charCode) || this._defaultValue); + } + }; + return CharacterClassifier; +}()); -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js ***! - \*******************************************************************************/ -/*! exports provided: StateMachine, LinkComputer, computeLinks */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +var CharacterSet = /** @class */ (function () { + function CharacterSet() { + this._actual = new characterClassifier_CharacterClassifier(0 /* False */); + } + CharacterSet.prototype.add = function (charCode) { + this._actual.set(charCode, 1 /* True */); + }; + CharacterSet.prototype.has = function (charCode) { + return (this._actual.get(charCode) === 1 /* True */); + }; + return CharacterSet; +}()); -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StateMachine", function() { return StateMachine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkComputer", function() { return LinkComputer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeLinks", function() { return computeLinks; }); -/* harmony import */ var _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/characterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js"); -/* harmony import */ var _core_uint_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/uint.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js"); + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var StateMachine = /** @class */ (function () { +var linkComputer_StateMachine = /** @class */ (function () { function StateMachine(edges) { var maxCharCode = 0; var maxState = 0 /* Invalid */; @@ -6195,7 +4793,7 @@ var StateMachine = /** @class */ (function () { } maxCharCode++; maxState++; - var states = new _core_uint_js__WEBPACK_IMPORTED_MODULE_1__["Uint8Matrix"](maxState, maxCharCode, 0 /* Invalid */); + var states = new Uint8Matrix(maxState, maxCharCode, 0 /* Invalid */); for (var i = 0, len = edges.length; i < len; i++) { var _b = edges[i], from = _b[0], chCode = _b[1], to = _b[2]; states.set(from, chCode, to); @@ -6216,7 +4814,7 @@ var StateMachine = /** @class */ (function () { var _stateMachine = null; function getStateMachine() { if (_stateMachine === null) { - _stateMachine = new StateMachine([ + _stateMachine = new linkComputer_StateMachine([ [1 /* Start */, 104 /* h */, 2 /* H */], [1 /* Start */, 72 /* H */, 2 /* H */], [1 /* Start */, 102 /* f */, 6 /* F */], @@ -6246,7 +4844,7 @@ function getStateMachine() { var _classifier = null; function getClassifier() { if (_classifier === null) { - _classifier = new _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__["CharacterClassifier"](0 /* None */); + _classifier = new characterClassifier_CharacterClassifier(0 /* None */); var FORCE_TERMINATION_CHARACTERS = ' \t<>\'\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…'; for (var i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) { _classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), 1 /* ForceTermination */); @@ -6412,19 +5010,7 @@ function computeLinks(model) { return LinkComputer.computeLinks(model); } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js ***! - \*************************************************************************************************/ -/*! exports provided: BasicInplaceReplace */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BasicInplaceReplace", function() { return BasicInplaceReplace; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -6513,40 +5099,171 @@ var BasicInplaceReplace = /** @class */ (function () { }()); +// EXTERNAL MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js +var polyfill = __webpack_require__("URDS"); -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js ***! - \****************************************************************************************/ -/*! exports provided: BaseEditorSimpleWorker, EditorSimpleWorkerImpl, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseEditorSimpleWorker", function() { return BaseEditorSimpleWorker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorSimpleWorkerImpl", function() { return EditorSimpleWorkerImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js"); -/* harmony import */ var _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../diff/diffComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js"); -/* harmony import */ var _model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../model/mirrorTextModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js"); -/* harmony import */ var _model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../model/wordHelper.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js"); -/* harmony import */ var _modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../modes/linkComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js"); -/* harmony import */ var _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../modes/supports/inplaceReplaceSupport.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js"); -/* harmony import */ var _standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../standalone/standaloneBase.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/functional.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { +function functional_once(fn) { + var _this = this; + var didCall = false; + var result; + return function () { + if (didCall) { + return result; + } + didCall = true; + result = fn.apply(_this, arguments); + return result; + }; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/linkedList.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var linkedList_Node = /** @class */ (function () { + function Node(element) { + this.element = element; + this.next = Node.Undefined; + this.prev = Node.Undefined; + } + Node.Undefined = new Node(undefined); + return Node; +}()); +var linkedList_LinkedList = /** @class */ (function () { + function LinkedList() { + this._first = linkedList_Node.Undefined; + this._last = linkedList_Node.Undefined; + this._size = 0; + } + Object.defineProperty(LinkedList.prototype, "size", { + get: function () { + return this._size; + }, + enumerable: true, + configurable: true + }); + LinkedList.prototype.isEmpty = function () { + return this._first === linkedList_Node.Undefined; + }; + LinkedList.prototype.clear = function () { + this._first = linkedList_Node.Undefined; + this._last = linkedList_Node.Undefined; + this._size = 0; + }; + LinkedList.prototype.unshift = function (element) { + return this._insert(element, false); + }; + LinkedList.prototype.push = function (element) { + return this._insert(element, true); + }; + LinkedList.prototype._insert = function (element, atTheEnd) { + var _this = this; + var newNode = new linkedList_Node(element); + if (this._first === linkedList_Node.Undefined) { + this._first = newNode; + this._last = newNode; + } + else if (atTheEnd) { + // push + var oldLast = this._last; + this._last = newNode; + newNode.prev = oldLast; + oldLast.next = newNode; + } + else { + // unshift + var oldFirst = this._first; + this._first = newNode; + newNode.next = oldFirst; + oldFirst.prev = newNode; + } + this._size += 1; + var didRemove = false; + return function () { + if (!didRemove) { + didRemove = true; + _this._remove(newNode); + } + }; + }; + LinkedList.prototype.shift = function () { + if (this._first === linkedList_Node.Undefined) { + return undefined; + } + else { + var res = this._first.element; + this._remove(this._first); + return res; + } + }; + LinkedList.prototype._remove = function (node) { + if (node.prev !== linkedList_Node.Undefined && node.next !== linkedList_Node.Undefined) { + // middle + var anchor = node.prev; + anchor.next = node.next; + node.next.prev = anchor; + } + else if (node.prev === linkedList_Node.Undefined && node.next === linkedList_Node.Undefined) { + // only node + this._first = linkedList_Node.Undefined; + this._last = linkedList_Node.Undefined; + } + else if (node.next === linkedList_Node.Undefined) { + // last + this._last = this._last.prev; + this._last.next = linkedList_Node.Undefined; + } + else if (node.prev === linkedList_Node.Undefined) { + // first + this._first = this._first.next; + this._first.prev = linkedList_Node.Undefined; + } + // done + this._size -= 1; + }; + LinkedList.prototype.iterator = function () { + var element; + var node = this._first; + return { + next: function () { + if (node === linkedList_Node.Undefined) { + return FIN; + } + if (!element) { + element = { done: false, value: node.element }; + } + else { + element.value = node.element; + } + node = node.next; + return element; + } + }; + }; + LinkedList.prototype.toArray = function () { + var result = []; + for (var node = this._first; node !== linkedList_Node.Undefined; node = node.next) { + result.push(node.element); + } + return result; + }; + return LinkedList; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/event.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var event_extends = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || @@ -6563,944 +5280,1282 @@ var __extends = (undefined && undefined.__extends) || (function () { - - - - - - - - - - -/** - * @internal - */ -var MirrorModel = /** @class */ (function (_super) { - __extends(MirrorModel, _super); - function MirrorModel() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(MirrorModel.prototype, "uri", { - get: function () { - return this._uri; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(MirrorModel.prototype, "version", { - get: function () { - return this._versionId; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(MirrorModel.prototype, "eol", { - get: function () { - return this._eol; - }, - enumerable: true, - configurable: true - }); - MirrorModel.prototype.getValue = function () { - return this.getText(); - }; - MirrorModel.prototype.getLinesContent = function () { - return this._lines.slice(0); - }; - MirrorModel.prototype.getLineCount = function () { - return this._lines.length; - }; - MirrorModel.prototype.getLineContent = function (lineNumber) { - return this._lines[lineNumber - 1]; - }; - MirrorModel.prototype.getWordAtPosition = function (position, wordDefinition) { - var wordAtText = Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__["getWordAtText"])(position.column, Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__["ensureValidWordDefinition"])(wordDefinition), this._lines[position.lineNumber - 1], 0); - if (wordAtText) { - return new _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn); - } - return null; - }; - MirrorModel.prototype.getWordUntilPosition = function (position, wordDefinition) { - var wordAtPosition = this.getWordAtPosition(position, wordDefinition); - if (!wordAtPosition) { - return { - word: '', - startColumn: position.column, - endColumn: position.column - }; - } - return { - word: this._lines[position.lineNumber - 1].substring(wordAtPosition.startColumn - 1, position.column - 1), - startColumn: wordAtPosition.startColumn, - endColumn: position.column - }; - }; - MirrorModel.prototype.createWordIterator = function (wordDefinition) { - var _this = this; - var obj; - var lineNumber = 0; - var lineText; - var wordRangesIdx = 0; - var wordRanges = []; - var next = function () { - if (wordRangesIdx < wordRanges.length) { - var value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end); - wordRangesIdx += 1; - if (!obj) { - obj = { done: false, value: value }; +var event_Event; +(function (Event) { + var _disposable = { dispose: function () { } }; + Event.None = function () { return _disposable; }; + /** + * Given an event, returns another event which only fires once. + */ + function once(event) { + return function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + // we need this, in case the event fires during the listener call + var didFire = false; + var result; + result = event(function (e) { + if (didFire) { + return; + } + else if (result) { + result.dispose(); } else { - obj.value = value; + didFire = true; } - return obj; + return listener.call(thisArgs, e); + }, null, disposables); + if (didFire) { + result.dispose(); } - else if (lineNumber >= _this._lines.length) { - return _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_2__["FIN"]; + return result; + }; + } + Event.once = once; + /** + * Given an event and a `map` function, returns another event which maps each element + * throught the mapping function. + */ + function map(event, map) { + return snapshot(function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return event(function (i) { return listener.call(thisArgs, map(i)); }, null, disposables); + }); + } + Event.map = map; + /** + * Given an event and an `each` function, returns another identical event and calls + * the `each` function per each element. + */ + function forEach(event, each) { + return snapshot(function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return event(function (i) { each(i); listener.call(thisArgs, i); }, null, disposables); + }); + } + Event.forEach = forEach; + function filter(event, filter) { + return snapshot(function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return event(function (e) { return filter(e) && listener.call(thisArgs, e); }, null, disposables); + }); + } + Event.filter = filter; + /** + * Given an event, returns the same event but typed as `Event`. + */ + function signal(event) { + return event; + } + Event.signal = signal; + /** + * Given a collection of events, returns a single event which emits + * whenever any of the provided events emit. + */ + function any() { + var events = []; + for (var _i = 0; _i < arguments.length; _i++) { + events[_i] = arguments[_i]; + } + return function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return combinedDisposable(events.map(function (event) { return event(function (e) { return listener.call(thisArgs, e); }, null, disposables); })); + }; + } + Event.any = any; + /** + * Given an event and a `merge` function, returns another event which maps each element + * and the cummulative result throught the `merge` function. Similar to `map`, but with memory. + */ + function reduce(event, merge, initial) { + var output = initial; + return map(event, function (e) { + output = merge(output, e); + return output; + }); + } + Event.reduce = reduce; + /** + * Given a chain of event processing functions (filter, map, etc), each + * function will be invoked per event & per listener. Snapshotting an event + * chain allows each function to be invoked just once per event. + */ + function snapshot(event) { + var listener; + var emitter = new event_Emitter({ + onFirstListenerAdd: function () { + listener = event(emitter.fire, emitter); + }, + onLastListenerRemove: function () { + listener.dispose(); + } + }); + return emitter.event; + } + Event.snapshot = snapshot; + function debounce(event, merge, delay, leading, leakWarningThreshold) { + if (delay === void 0) { delay = 100; } + if (leading === void 0) { leading = false; } + var subscription; + var output = undefined; + var handle = undefined; + var numDebouncedCalls = 0; + var emitter = new event_Emitter({ + leakWarningThreshold: leakWarningThreshold, + onFirstListenerAdd: function () { + subscription = event(function (cur) { + numDebouncedCalls++; + output = merge(output, cur); + if (leading && !handle) { + emitter.fire(output); + } + clearTimeout(handle); + handle = setTimeout(function () { + var _output = output; + output = undefined; + handle = undefined; + if (!leading || numDebouncedCalls > 1) { + emitter.fire(_output); + } + numDebouncedCalls = 0; + }, delay); + }); + }, + onLastListenerRemove: function () { + subscription.dispose(); + } + }); + return emitter.event; + } + Event.debounce = debounce; + /** + * Given an event, it returns another event which fires only once and as soon as + * the input event emits. The event data is the number of millis it took for the + * event to fire. + */ + function stopwatch(event) { + var start = new Date().getTime(); + return map(once(event), function (_) { return new Date().getTime() - start; }); + } + Event.stopwatch = stopwatch; + /** + * Given an event, it returns another event which fires only when the event + * element changes. + */ + function latch(event) { + var firstCall = true; + var cache; + return filter(event, function (value) { + var shouldEmit = firstCall || value !== cache; + firstCall = false; + cache = value; + return shouldEmit; + }); + } + Event.latch = latch; + /** + * Buffers the provided event until a first listener comes + * along, at which point fire all the events at once and + * pipe the event from then on. + * + * ```typescript + * const emitter = new Emitter(); + * const event = emitter.event; + * const bufferedEvent = buffer(event); + * + * emitter.fire(1); + * emitter.fire(2); + * emitter.fire(3); + * // nothing... + * + * const listener = bufferedEvent(num => console.log(num)); + * // 1, 2, 3 + * + * emitter.fire(4); + * // 4 + * ``` + */ + function buffer(event, nextTick, _buffer) { + if (nextTick === void 0) { nextTick = false; } + if (_buffer === void 0) { _buffer = []; } + var buffer = _buffer.slice(); + var listener = event(function (e) { + if (buffer) { + buffer.push(e); } else { - lineText = _this._lines[lineNumber]; - wordRanges = _this._wordenize(lineText, wordDefinition); - wordRangesIdx = 0; - lineNumber += 1; - return next(); + emitter.fire(e); } + }); + var flush = function () { + if (buffer) { + buffer.forEach(function (e) { return emitter.fire(e); }); + } + buffer = null; }; - return { next: next }; - }; - MirrorModel.prototype.getLineWords = function (lineNumber, wordDefinition) { - var content = this._lines[lineNumber - 1]; - var ranges = this._wordenize(content, wordDefinition); - var words = []; - for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { - var range = ranges_1[_i]; - words.push({ - word: content.substring(range.start, range.end), - startColumn: range.start + 1, - endColumn: range.end + 1 - }); - } - return words; - }; - MirrorModel.prototype._wordenize = function (content, wordDefinition) { - var result = []; - var match; - wordDefinition.lastIndex = 0; // reset lastIndex just to be sure - while (match = wordDefinition.exec(content)) { - if (match[0].length === 0) { - // it did match the empty string - break; + var emitter = new event_Emitter({ + onFirstListenerAdd: function () { + if (!listener) { + listener = event(function (e) { return emitter.fire(e); }); + } + }, + onFirstListenerDidAdd: function () { + if (buffer) { + if (nextTick) { + setTimeout(flush); + } + else { + flush(); + } + } + }, + onLastListenerRemove: function () { + if (listener) { + listener.dispose(); + } + listener = null; } - result.push({ start: match.index, end: match.index + match[0].length }); - } - return result; - }; - MirrorModel.prototype.getValueInRange = function (range) { - range = this._validateRange(range); - if (range.startLineNumber === range.endLineNumber) { - return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); - } - var lineEnding = this._eol; - var startLineIndex = range.startLineNumber - 1; - var endLineIndex = range.endLineNumber - 1; - var resultLines = []; - resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); - for (var i = startLineIndex + 1; i < endLineIndex; i++) { - resultLines.push(this._lines[i]); - } - resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); - return resultLines.join(lineEnding); - }; - MirrorModel.prototype.offsetAt = function (position) { - position = this._validatePosition(position); - this._ensureLineStarts(); - return this._lineStarts.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1); - }; - MirrorModel.prototype.positionAt = function (offset) { - offset = Math.floor(offset); - offset = Math.max(0, offset); - this._ensureLineStarts(); - var out = this._lineStarts.getIndexOf(offset); - var lineLength = this._lines[out.index].length; - // Ensure we return a valid position - return { - lineNumber: 1 + out.index, - column: 1 + Math.min(out.remainder, lineLength) - }; - }; - MirrorModel.prototype._validateRange = function (range) { - var start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn }); - var end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn }); - if (start.lineNumber !== range.startLineNumber - || start.column !== range.startColumn - || end.lineNumber !== range.endLineNumber - || end.column !== range.endColumn) { - return { - startLineNumber: start.lineNumber, - startColumn: start.column, - endLineNumber: end.lineNumber, - endColumn: end.column - }; - } - return range; - }; - MirrorModel.prototype._validatePosition = function (position) { - if (!_core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"].isIPosition(position)) { - throw new Error('bad position'); - } - var lineNumber = position.lineNumber, column = position.column; - var hasChanged = false; - if (lineNumber < 1) { - lineNumber = 1; - column = 1; - hasChanged = true; - } - else if (lineNumber > this._lines.length) { - lineNumber = this._lines.length; - column = this._lines[lineNumber - 1].length + 1; - hasChanged = true; - } - else { - var maxCharacter = this._lines[lineNumber - 1].length + 1; - if (column < 1) { - column = 1; - hasChanged = true; - } - else if (column > maxCharacter) { - column = maxCharacter; - hasChanged = true; - } - } - if (!hasChanged) { - return position; - } - else { - return { lineNumber: lineNumber, column: column }; - } - }; - return MirrorModel; -}(_model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_8__["MirrorTextModel"])); -/** - * @internal - */ -var BaseEditorSimpleWorker = /** @class */ (function () { - function BaseEditorSimpleWorker(foreignModuleFactory) { - this._foreignModuleFactory = foreignModuleFactory; - this._foreignModule = null; + }); + return emitter.event; } - // ---- BEGIN diff -------------------------------------------------------------------------- - BaseEditorSimpleWorker.prototype.computeDiff = function (originalUrl, modifiedUrl, ignoreTrimWhitespace) { - var original = this._getModel(originalUrl); - var modified = this._getModel(modifiedUrl); - if (!original || !modified) { - return Promise.resolve(null); + Event.buffer = buffer; + var ChainableEvent = /** @class */ (function () { + function ChainableEvent(event) { + this.event = event; } - var originalLines = original.getLinesContent(); - var modifiedLines = modified.getLinesContent(); - var diffComputer = new _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_7__["DiffComputer"](originalLines, modifiedLines, { - shouldComputeCharChanges: true, - shouldPostProcessCharChanges: true, - shouldIgnoreTrimWhitespace: ignoreTrimWhitespace, - shouldMakePrettyDiff: true - }); - var changes = diffComputer.computeDiff(); - var identical = (changes.length > 0 ? false : this._modelsAreIdentical(original, modified)); - return Promise.resolve({ - identical: identical, - changes: changes - }); - }; - BaseEditorSimpleWorker.prototype._modelsAreIdentical = function (original, modified) { - var originalLineCount = original.getLineCount(); - var modifiedLineCount = modified.getLineCount(); - if (originalLineCount !== modifiedLineCount) { - return false; - } - for (var line = 1; line <= originalLineCount; line++) { - var originalLine = original.getLineContent(line); - var modifiedLine = modified.getLineContent(line); - if (originalLine !== modifiedLine) { - return false; - } - } - return true; - }; - BaseEditorSimpleWorker.prototype.computeMoreMinimalEdits = function (modelUrl, edits) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(edits); - } - var result = []; - var lastEol = undefined; - edits = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["mergeSort"])(edits, function (a, b) { - if (a.range && b.range) { - return _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].compareRangesUsingStarts(a.range, b.range); - } - // eol only changes should go to the end - var aRng = a.range ? 0 : 1; - var bRng = b.range ? 0 : 1; - return aRng - bRng; - }); - for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { - var _a = edits_1[_i], range = _a.range, text = _a.text, eol = _a.eol; - if (typeof eol === 'number') { - lastEol = eol; - } - if (_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].isEmpty(range) && !text) { - // empty change - continue; - } - var original = model.getValueInRange(range); - text = text.replace(/\r\n|\n|\r/g, model.eol); - if (original === text) { - // noop - continue; - } - // make sure diff won't take too long - if (Math.max(text.length, original.length) > BaseEditorSimpleWorker._diffLimit) { - result.push({ range: range, text: text }); - continue; - } - // compute diff between original and edit.text - var changes = Object(_base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__["stringDiff"])(original, text, false); - var editOffset = model.offsetAt(_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].lift(range).getStartPosition()); - for (var _b = 0, changes_1 = changes; _b < changes_1.length; _b++) { - var change = changes_1[_b]; - var start = model.positionAt(editOffset + change.originalStart); - var end = model.positionAt(editOffset + change.originalStart + change.originalLength); - var newEdit = { - text: text.substr(change.modifiedStart, change.modifiedLength), - range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column } - }; - if (model.getValueInRange(newEdit.range) !== newEdit.text) { - result.push(newEdit); - } - } - } - if (typeof lastEol === 'number') { - result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }); - } - return Promise.resolve(result); - }; - // ---- END minimal edits --------------------------------------------------------------- - BaseEditorSimpleWorker.prototype.computeLinks = function (modelUrl) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(null); - } - return Promise.resolve(Object(_modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_10__["computeLinks"])(model)); - }; - BaseEditorSimpleWorker.prototype.textualSuggest = function (modelUrl, position, wordDef, wordDefFlags) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(null); - } - var seen = Object.create(null); - var suggestions = []; - var wordDefRegExp = new RegExp(wordDef, wordDefFlags); - var wordUntil = model.getWordUntilPosition(position, wordDefRegExp); - var wordAt = model.getWordAtPosition(position, wordDefRegExp); - if (wordAt) { - seen[model.getValueInRange(wordAt)] = true; - } - for (var iter = model.createWordIterator(wordDefRegExp), e = iter.next(); !e.done && suggestions.length <= BaseEditorSimpleWorker._suggestionsLimit; e = iter.next()) { - var word = e.value; - if (seen[word]) { - continue; - } - seen[word] = true; - if (!isNaN(Number(word))) { - continue; - } - suggestions.push({ - kind: 18 /* Text */, - label: word, - insertText: word, - range: { startLineNumber: position.lineNumber, startColumn: wordUntil.startColumn, endLineNumber: position.lineNumber, endColumn: wordUntil.endColumn } - }); - } - return Promise.resolve({ suggestions: suggestions }); - }; - // ---- END suggest -------------------------------------------------------------------------- - //#region -- word ranges -- - BaseEditorSimpleWorker.prototype.computeWordRanges = function (modelUrl, range, wordDef, wordDefFlags) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(Object.create(null)); - } - var wordDefRegExp = new RegExp(wordDef, wordDefFlags); - var result = Object.create(null); - for (var line = range.startLineNumber; line < range.endLineNumber; line++) { - var words = model.getLineWords(line, wordDefRegExp); - for (var _i = 0, words_1 = words; _i < words_1.length; _i++) { - var word = words_1[_i]; - if (!isNaN(Number(word.word))) { - continue; - } - var array = result[word.word]; - if (!array) { - array = []; - result[word.word] = array; - } - array.push({ - startLineNumber: line, - startColumn: word.startColumn, - endLineNumber: line, - endColumn: word.endColumn - }); - } - } - return Promise.resolve(result); - }; - //#endregion - BaseEditorSimpleWorker.prototype.navigateValueSet = function (modelUrl, range, up, wordDef, wordDefFlags) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(null); - } - var wordDefRegExp = new RegExp(wordDef, wordDefFlags); - if (range.startColumn === range.endColumn) { - range = { - startLineNumber: range.startLineNumber, - startColumn: range.startColumn, - endLineNumber: range.endLineNumber, - endColumn: range.endColumn + 1 - }; - } - var selectionText = model.getValueInRange(range); - var wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp); - if (!wordRange) { - return Promise.resolve(null); - } - var word = model.getValueInRange(wordRange); - var result = _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_11__["BasicInplaceReplace"].INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up); - return Promise.resolve(result); - }; - // ---- BEGIN foreign module support -------------------------------------------------------------------------- - BaseEditorSimpleWorker.prototype.loadForeignModule = function (moduleId, createData) { - var _this = this; - var ctx = { - getMirrorModels: function () { - return _this._getModels(); - } + ChainableEvent.prototype.map = function (fn) { + return new ChainableEvent(map(this.event, fn)); }; - if (this._foreignModuleFactory) { - this._foreignModule = this._foreignModuleFactory(ctx, createData); - // static foreing module - var methods = []; - for (var _i = 0, _a = Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_13__["getAllPropertyNames"])(this._foreignModule); _i < _a.length; _i++) { - var prop = _a[_i]; - if (typeof this._foreignModule[prop] === 'function') { - methods.push(prop); + ChainableEvent.prototype.forEach = function (fn) { + return new ChainableEvent(forEach(this.event, fn)); + }; + ChainableEvent.prototype.filter = function (fn) { + return new ChainableEvent(filter(this.event, fn)); + }; + ChainableEvent.prototype.reduce = function (merge, initial) { + return new ChainableEvent(reduce(this.event, merge, initial)); + }; + ChainableEvent.prototype.latch = function () { + return new ChainableEvent(latch(this.event)); + }; + ChainableEvent.prototype.on = function (listener, thisArgs, disposables) { + return this.event(listener, thisArgs, disposables); + }; + ChainableEvent.prototype.once = function (listener, thisArgs, disposables) { + return once(this.event)(listener, thisArgs, disposables); + }; + return ChainableEvent; + }()); + function chain(event) { + return new ChainableEvent(event); + } + Event.chain = chain; + function fromNodeEventEmitter(emitter, eventName, map) { + if (map === void 0) { map = function (id) { return id; }; } + var fn = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return result.fire(map.apply(void 0, args)); + }; + var onFirstListenerAdd = function () { return emitter.on(eventName, fn); }; + var onLastListenerRemove = function () { return emitter.removeListener(eventName, fn); }; + var result = new event_Emitter({ onFirstListenerAdd: onFirstListenerAdd, onLastListenerRemove: onLastListenerRemove }); + return result.event; + } + Event.fromNodeEventEmitter = fromNodeEventEmitter; + function fromPromise(promise) { + var emitter = new event_Emitter(); + var shouldEmit = false; + promise + .then(undefined, function () { return null; }) + .then(function () { + if (!shouldEmit) { + setTimeout(function () { return emitter.fire(undefined); }, 0); + } + else { + emitter.fire(undefined); + } + }); + shouldEmit = true; + return emitter.event; + } + Event.fromPromise = fromPromise; + function toPromise(event) { + return new Promise(function (c) { return once(event)(c); }); + } + Event.toPromise = toPromise; +})(event_Event || (event_Event = {})); +var _globalLeakWarningThreshold = -1; +var LeakageMonitor = /** @class */ (function () { + function LeakageMonitor(customThreshold, name) { + if (name === void 0) { name = Math.random().toString(18).slice(2, 5); } + this.customThreshold = customThreshold; + this.name = name; + this._warnCountdown = 0; + } + LeakageMonitor.prototype.dispose = function () { + if (this._stacks) { + this._stacks.clear(); + } + }; + LeakageMonitor.prototype.check = function (listenerCount) { + var _this = this; + var threshold = _globalLeakWarningThreshold; + if (typeof this.customThreshold === 'number') { + threshold = this.customThreshold; + } + if (threshold <= 0 || listenerCount < threshold) { + return undefined; + } + if (!this._stacks) { + this._stacks = new Map(); + } + var stack = new Error().stack.split('\n').slice(3).join('\n'); + var count = (this._stacks.get(stack) || 0); + this._stacks.set(stack, count + 1); + this._warnCountdown -= 1; + if (this._warnCountdown <= 0) { + // only warn on first exceed and then every time the limit + // is exceeded by 50% again + this._warnCountdown = threshold * 0.5; + // find most frequent listener and print warning + var topStack_1; + var topCount_1 = 0; + this._stacks.forEach(function (count, stack) { + if (!topStack_1 || topCount_1 < count) { + topStack_1 = stack; + topCount_1 = count; + } + }); + console.warn("[" + this.name + "] potential listener LEAK detected, having " + listenerCount + " listeners already. MOST frequent listener (" + topCount_1 + "):"); + console.warn(topStack_1); + } + return function () { + var count = (_this._stacks.get(stack) || 0); + _this._stacks.set(stack, count - 1); + }; + }; + return LeakageMonitor; +}()); +/** + * The Emitter can be used to expose an Event to the public + * to fire it from the insides. + * Sample: + class Document { + + private _onDidChange = new Emitter<(value:string)=>any>(); + + public onDidChange = this._onDidChange.event; + + // getter-style + // get onDidChange(): Event<(value:string)=>any> { + // return this._onDidChange.event; + // } + + private _doIt() { + //... + this._onDidChange.fire(value); + } + } + */ +var event_Emitter = /** @class */ (function () { + function Emitter(options) { + this._disposed = false; + this._options = options; + this._leakageMon = _globalLeakWarningThreshold > 0 + ? new LeakageMonitor(this._options && this._options.leakWarningThreshold) + : undefined; + } + Object.defineProperty(Emitter.prototype, "event", { + /** + * For the public to allow to subscribe + * to events from this Emitter + */ + get: function () { + var _this = this; + if (!this._event) { + this._event = function (listener, thisArgs, disposables) { + if (!_this._listeners) { + _this._listeners = new linkedList_LinkedList(); + } + var firstListener = _this._listeners.isEmpty(); + if (firstListener && _this._options && _this._options.onFirstListenerAdd) { + _this._options.onFirstListenerAdd(_this); + } + var remove = _this._listeners.push(!thisArgs ? listener : [listener, thisArgs]); + if (firstListener && _this._options && _this._options.onFirstListenerDidAdd) { + _this._options.onFirstListenerDidAdd(_this); + } + if (_this._options && _this._options.onListenerDidAdd) { + _this._options.onListenerDidAdd(_this, listener, thisArgs); + } + // check and record this emitter for potential leakage + var removeMonitor; + if (_this._leakageMon) { + removeMonitor = _this._leakageMon.check(_this._listeners.size); + } + var result; + result = { + dispose: function () { + if (removeMonitor) { + removeMonitor(); + } + result.dispose = Emitter._noop; + if (!_this._disposed) { + remove(); + if (_this._options && _this._options.onLastListenerRemove) { + var hasListeners = (_this._listeners && !_this._listeners.isEmpty()); + if (!hasListeners) { + _this._options.onLastListenerRemove(_this); + } + } + } + } + }; + if (Array.isArray(disposables)) { + disposables.push(result); + } + return result; + }; + } + return this._event; + }, + enumerable: true, + configurable: true + }); + /** + * To be kept private to fire an event to + * subscribers + */ + Emitter.prototype.fire = function (event) { + if (this._listeners) { + // put all [listener,event]-pairs into delivery queue + // then emit all event. an inner/nested event might be + // the driver of this + if (!this._deliveryQueue) { + this._deliveryQueue = new linkedList_LinkedList(); + } + for (var iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) { + this._deliveryQueue.push([e.value, event]); + } + while (this._deliveryQueue.size > 0) { + var _a = this._deliveryQueue.shift(), listener = _a[0], event_1 = _a[1]; + try { + if (typeof listener === 'function') { + listener.call(undefined, event_1); + } + else { + listener[0].call(listener[1], event_1); + } + } + catch (e) { + onUnexpectedError(e); } } - return Promise.resolve(methods); - } - // ESM-comment-begin - // return new Promise((resolve, reject) => { - // require([moduleId], (foreignModule: { create: IForeignModuleFactory }) => { - // this._foreignModule = foreignModule.create(ctx, createData); - // - // let methods: string[] = []; - // for (const prop of getAllPropertyNames(this._foreignModule)) { - // if (typeof this._foreignModule[prop] === 'function') { - // methods.push(prop); - // } - // } - // - // resolve(methods); - // - // }, reject); - // }); - // ESM-comment-end - // ESM-uncomment-begin - return Promise.reject(new Error("Unexpected usage")); - // ESM-uncomment-end - }; - // foreign method request - BaseEditorSimpleWorker.prototype.fmr = function (method, args) { - if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') { - return Promise.reject(new Error('Missing requestHandler or method: ' + method)); - } - try { - return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args)); - } - catch (e) { - return Promise.reject(e); } }; - // ---- END diff -------------------------------------------------------------------------- - // ---- BEGIN minimal edits --------------------------------------------------------------- - BaseEditorSimpleWorker._diffLimit = 100000; - // ---- BEGIN suggest -------------------------------------------------------------------------- - BaseEditorSimpleWorker._suggestionsLimit = 10000; - return BaseEditorSimpleWorker; + Emitter.prototype.dispose = function () { + if (this._listeners) { + this._listeners.clear(); + } + if (this._deliveryQueue) { + this._deliveryQueue.clear(); + } + if (this._leakageMon) { + this._leakageMon.dispose(); + } + this._disposed = true; + }; + Emitter._noop = function () { }; + return Emitter; +}()); + +var event_PauseableEmitter = /** @class */ (function (_super) { + event_extends(PauseableEmitter, _super); + function PauseableEmitter(options) { + var _this = _super.call(this, options) || this; + _this._isPaused = 0; + _this._eventQueue = new linkedList_LinkedList(); + _this._mergeFn = options && options.merge; + return _this; + } + PauseableEmitter.prototype.pause = function () { + this._isPaused++; + }; + PauseableEmitter.prototype.resume = function () { + if (this._isPaused !== 0 && --this._isPaused === 0) { + if (this._mergeFn) { + // use the merge function to create a single composite + // event. make a copy in case firing pauses this emitter + var events = this._eventQueue.toArray(); + this._eventQueue.clear(); + _super.prototype.fire.call(this, this._mergeFn(events)); + } + else { + // no merging, fire each event individually and test + // that this emitter isn't paused halfway through + while (!this._isPaused && this._eventQueue.size !== 0) { + _super.prototype.fire.call(this, this._eventQueue.shift()); + } + } + } + }; + PauseableEmitter.prototype.fire = function (event) { + if (this._listeners) { + if (this._isPaused !== 0) { + this._eventQueue.push(event); + } + else { + _super.prototype.fire.call(this, event); + } + } + }; + return PauseableEmitter; +}(event_Emitter)); + +var event_EventMultiplexer = /** @class */ (function () { + function EventMultiplexer() { + var _this = this; + this.hasListeners = false; + this.events = []; + this.emitter = new event_Emitter({ + onFirstListenerAdd: function () { return _this.onFirstListenerAdd(); }, + onLastListenerRemove: function () { return _this.onLastListenerRemove(); } + }); + } + Object.defineProperty(EventMultiplexer.prototype, "event", { + get: function () { + return this.emitter.event; + }, + enumerable: true, + configurable: true + }); + EventMultiplexer.prototype.add = function (event) { + var _this = this; + var e = { event: event, listener: null }; + this.events.push(e); + if (this.hasListeners) { + this.hook(e); + } + var dispose = function () { + if (_this.hasListeners) { + _this.unhook(e); + } + var idx = _this.events.indexOf(e); + _this.events.splice(idx, 1); + }; + return toDisposable(functional_once(dispose)); + }; + EventMultiplexer.prototype.onFirstListenerAdd = function () { + var _this = this; + this.hasListeners = true; + this.events.forEach(function (e) { return _this.hook(e); }); + }; + EventMultiplexer.prototype.onLastListenerRemove = function () { + var _this = this; + this.hasListeners = false; + this.events.forEach(function (e) { return _this.unhook(e); }); + }; + EventMultiplexer.prototype.hook = function (e) { + var _this = this; + e.listener = e.event(function (r) { return _this.emitter.fire(r); }); + }; + EventMultiplexer.prototype.unhook = function (e) { + if (e.listener) { + e.listener.dispose(); + } + e.listener = null; + }; + EventMultiplexer.prototype.dispose = function () { + this.emitter.dispose(); + }; + return EventMultiplexer; }()); /** - * @internal + * The EventBufferer is useful in situations in which you want + * to delay firing your events during some code. + * You can wrap that code and be sure that the event will not + * be fired during that wrap. + * + * ``` + * const emitter: Emitter; + * const delayer = new EventDelayer(); + * const delayedEvent = delayer.wrapEvent(emitter.event); + * + * delayedEvent(console.log); + * + * delayer.bufferEvents(() => { + * emitter.fire(); // event will not be fired yet + * }); + * + * // event will only be fired at this point + * ``` */ -var EditorSimpleWorkerImpl = /** @class */ (function (_super) { - __extends(EditorSimpleWorkerImpl, _super); - function EditorSimpleWorkerImpl(foreignModuleFactory) { - var _this = _super.call(this, foreignModuleFactory) || this; - _this._models = Object.create(null); - return _this; +var EventBufferer = /** @class */ (function () { + function EventBufferer() { + this.buffers = []; } - EditorSimpleWorkerImpl.prototype.dispose = function () { - this._models = Object.create(null); - }; - EditorSimpleWorkerImpl.prototype._getModel = function (uri) { - return this._models[uri]; - }; - EditorSimpleWorkerImpl.prototype._getModels = function () { + EventBufferer.prototype.wrapEvent = function (event) { var _this = this; - var all = []; - Object.keys(this._models).forEach(function (key) { return all.push(_this._models[key]); }); - return all; + return function (listener, thisArgs, disposables) { + return event(function (i) { + var buffer = _this.buffers[_this.buffers.length - 1]; + if (buffer) { + buffer.push(function () { return listener.call(thisArgs, i); }); + } + else { + listener.call(thisArgs, i); + } + }, undefined, disposables); + }; }; - EditorSimpleWorkerImpl.prototype.acceptNewModel = function (data) { - this._models[data.url] = new MirrorModel(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"].parse(data.url), data.lines, data.EOL, data.versionId); + EventBufferer.prototype.bufferEvents = function (fn) { + var buffer = []; + this.buffers.push(buffer); + var r = fn(); + this.buffers.pop(); + buffer.forEach(function (flush) { return flush(); }); + return r; }; - EditorSimpleWorkerImpl.prototype.acceptModelChanged = function (strURL, e) { - if (!this._models[strURL]) { - return; - } - var model = this._models[strURL]; - model.onEvents(e); - }; - EditorSimpleWorkerImpl.prototype.acceptRemovedModel = function (strURL) { - if (!this._models[strURL]) { - return; - } - delete this._models[strURL]; - }; - return EditorSimpleWorkerImpl; -}(BaseEditorSimpleWorker)); + return EventBufferer; +}()); /** - * Called on the worker side - * @internal + * A Relay is an event forwarder which functions as a replugabble event pipe. + * Once created, you can connect an input event to it and it will simply forward + * events from that input event through its own `event` property. The `input` + * can be changed at any point in time. */ -function create() { - return new EditorSimpleWorkerImpl(null); -} -if (typeof importScripts === 'function') { - // Running in a web worker - _base_common_platform_js__WEBPACK_IMPORTED_MODULE_3__["globals"].monaco = Object(_standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_12__["createMonacoBaseAPI"])(); -} +var event_Relay = /** @class */ (function () { + function Relay() { + var _this = this; + this.listening = false; + this.inputEvent = event_Event.None; + this.inputEventListener = Disposable.None; + this.emitter = new event_Emitter({ + onFirstListenerDidAdd: function () { + _this.listening = true; + _this.inputEventListener = _this.inputEvent(_this.emitter.fire, _this.emitter); + }, + onLastListenerRemove: function () { + _this.listening = false; + _this.inputEventListener.dispose(); + } + }); + this.event = this.emitter.event; + } + Object.defineProperty(Relay.prototype, "input", { + set: function (event) { + this.inputEvent = event; + if (this.listening) { + this.inputEventListener.dispose(); + this.inputEventListener = event(this.emitter.fire, this.emitter); + } + }, + enumerable: true, + configurable: true + }); + Relay.prototype.dispose = function () { + this.inputEventListener.dispose(); + this.emitter.dispose(); + }; + return Relay; +}()); -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js ***! - \*************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/*! -Copyright (c) 2014 Taylor Hakes -Copyright (c) 2014 Forbes Lindesay - */ -(function (global, factory) { - true ? factory() : - undefined; -}(this, (function () { - 'use strict'; - - /** - * @this {Promise} - */ - function finallyConstructor(callback) { - var constructor = this.constructor; - return this.then( - function (value) { - return constructor.resolve(callback()).then(function () { - return value; - }); - }, - function (reason) { - return constructor.resolve(callback()).then(function () { - return constructor.reject(reason); - }); - } - ); - } - - // Store setTimeout reference so promise-polyfill will be unaffected by - // other code modifying setTimeout (like sinon.useFakeTimers()) - var setTimeoutFunc = setTimeout; - - function noop() { } - - // Polyfill for Function.prototype.bind - function bind(fn, thisArg) { - return function () { - fn.apply(thisArg, arguments); - }; - } - - /** - * @constructor - * @param {Function} fn - */ - function Promise(fn) { - if (!(this instanceof Promise)) - throw new TypeError('Promises must be constructed via new'); - if (typeof fn !== 'function') throw new TypeError('not a function'); - /** @type {!number} */ - this._state = 0; - /** @type {!boolean} */ - this._handled = false; - /** @type {Promise|undefined} */ - this._value = undefined; - /** @type {!Array} */ - this._deferreds = []; - - doResolve(fn, this); - } - - function handle(self, deferred) { - while (self._state === 3) { - self = self._value; - } - if (self._state === 0) { - self._deferreds.push(deferred); - return; - } - self._handled = true; - Promise._immediateFn(function () { - var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; - if (cb === null) { - (self._state === 1 ? resolve : reject)(deferred.promise, self._value); - return; - } - var ret; - try { - ret = cb(self._value); - } catch (e) { - reject(deferred.promise, e); - return; - } - resolve(deferred.promise, ret); - }); - } - - function resolve(self, newValue) { - try { - // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure - if (newValue === self) - throw new TypeError('A promise cannot be resolved with itself.'); - if ( - newValue && - (typeof newValue === 'object' || typeof newValue === 'function') - ) { - var then = newValue.then; - if (newValue instanceof Promise) { - self._state = 3; - self._value = newValue; - finale(self); - return; - } else if (typeof then === 'function') { - doResolve(bind(then, newValue), self); - return; - } - } - self._state = 1; - self._value = newValue; - finale(self); - } catch (e) { - reject(self, e); - } - } - - function reject(self, newValue) { - self._state = 2; - self._value = newValue; - finale(self); - } - - function finale(self) { - if (self._state === 2 && self._deferreds.length === 0) { - Promise._immediateFn(function () { - if (!self._handled) { - Promise._unhandledRejectionFn(self._value); - } - }); - } - - for (var i = 0, len = self._deferreds.length; i < len; i++) { - handle(self, self._deferreds[i]); - } - self._deferreds = null; - } - - /** - * @constructor - */ - function Handler(onFulfilled, onRejected, promise) { - this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; - this.onRejected = typeof onRejected === 'function' ? onRejected : null; - this.promise = promise; - } - - /** - * Take a potentially misbehaving resolver function and make sure - * onFulfilled and onRejected are only called once. - * - * Makes no guarantees about asynchrony. - */ - function doResolve(fn, self) { - var done = false; - try { - fn( - function (value) { - if (done) return; - done = true; - resolve(self, value); - }, - function (reason) { - if (done) return; - done = true; - reject(self, reason); - } - ); - } catch (ex) { - if (done) return; - done = true; - reject(self, ex); - } - } - - Promise.prototype['catch'] = function (onRejected) { - return this.then(null, onRejected); - }; - - Promise.prototype.then = function (onFulfilled, onRejected) { - // @ts-ignore - var prom = new this.constructor(noop); - - handle(this, new Handler(onFulfilled, onRejected, prom)); - return prom; - }; - - Promise.prototype['finally'] = finallyConstructor; - - Promise.all = function (arr) { - return new Promise(function (resolve, reject) { - if (!arr || typeof arr.length === 'undefined') - throw new TypeError('Promise.all accepts an array'); - var args = Array.prototype.slice.call(arr); - if (args.length === 0) return resolve([]); - var remaining = args.length; - - function res(i, val) { - try { - if (val && (typeof val === 'object' || typeof val === 'function')) { - var then = val.then; - if (typeof then === 'function') { - then.call( - val, - function (val) { - res(i, val); - }, - reject - ); - return; - } - } - args[i] = val; - if (--remaining === 0) { - resolve(args); - } - } catch (ex) { - reject(ex); - } - } - - for (var i = 0; i < args.length; i++) { - res(i, args[i]); - } - }); - }; - - Promise.resolve = function (value) { - if (value && typeof value === 'object' && value.constructor === Promise) { - return value; - } - - return new Promise(function (resolve) { - resolve(value); - }); - }; - - Promise.reject = function (value) { - return new Promise(function (resolve, reject) { - reject(value); - }); - }; - - Promise.race = function (values) { - return new Promise(function (resolve, reject) { - for (var i = 0, len = values.length; i < len; i++) { - values[i].then(resolve, reject); - } - }); - }; - - // Use polyfill for setImmediate for performance gains - Promise._immediateFn = - (typeof setImmediate === 'function' && - function (fn) { - setImmediate(fn); - }) || - function (fn) { - setTimeoutFunc(fn, 0); - }; - - Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { - if (typeof console !== 'undefined' && console) { - console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console - } - }; - - /** @suppress {undefinedVars} */ - var globalNS = (function () { - // the only reliable means to get the global object is - // `Function('return this')()` - // However, this causes CSP violations in Chrome apps. - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('unable to locate global object'); - })(); - - if (!('Promise' in globalNS)) { - globalNS['Promise'] = Promise; - } else if (!globalNS.Promise.prototype['finally']) { - globalNS.Promise.prototype['finally'] = finallyConstructor; - } - -}))); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js ***! - \**************************************************************************************/ -/*! exports provided: KeyMod, createMonacoBaseAPI */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyMod", function() { return KeyMod; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMonacoBaseAPI", function() { return createMonacoBaseAPI; }); -/* harmony import */ var _promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./promise-polyfill/polyfill.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js"); -/* harmony import */ var _promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _core_token_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../core/token.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js"); -/* harmony import */ var _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./standaloneEnums.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/cancellation.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - - - - - - - - - -var KeyMod = /** @class */ (function () { - function KeyMod() { +var shortcutEvent = Object.freeze(function (callback, context) { + var handle = setTimeout(callback.bind(context), 0); + return { dispose: function () { clearTimeout(handle); } }; +}); +var cancellation_CancellationToken; +(function (CancellationToken) { + function isCancellationToken(thing) { + if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) { + return true; + } + if (thing instanceof cancellation_MutableToken) { + return true; + } + if (!thing || typeof thing !== 'object') { + return false; + } + return typeof thing.isCancellationRequested === 'boolean' + && typeof thing.onCancellationRequested === 'function'; } - KeyMod.chord = function (firstPart, secondPart) { - return Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_3__["KeyChord"])(firstPart, secondPart); + CancellationToken.isCancellationToken = isCancellationToken; + CancellationToken.None = Object.freeze({ + isCancellationRequested: false, + onCancellationRequested: event_Event.None + }); + CancellationToken.Cancelled = Object.freeze({ + isCancellationRequested: true, + onCancellationRequested: shortcutEvent + }); +})(cancellation_CancellationToken || (cancellation_CancellationToken = {})); +var cancellation_MutableToken = /** @class */ (function () { + function MutableToken() { + this._isCancelled = false; + this._emitter = null; + } + MutableToken.prototype.cancel = function () { + if (!this._isCancelled) { + this._isCancelled = true; + if (this._emitter) { + this._emitter.fire(undefined); + this.dispose(); + } + } }; - KeyMod.CtrlCmd = 2048 /* CtrlCmd */; - KeyMod.Shift = 1024 /* Shift */; - KeyMod.Alt = 512 /* Alt */; - KeyMod.WinCtrl = 256 /* WinCtrl */; - return KeyMod; + Object.defineProperty(MutableToken.prototype, "isCancellationRequested", { + get: function () { + return this._isCancelled; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MutableToken.prototype, "onCancellationRequested", { + get: function () { + if (this._isCancelled) { + return shortcutEvent; + } + if (!this._emitter) { + this._emitter = new event_Emitter(); + } + return this._emitter.event; + }, + enumerable: true, + configurable: true + }); + MutableToken.prototype.dispose = function () { + if (this._emitter) { + this._emitter.dispose(); + this._emitter = null; + } + }; + return MutableToken; +}()); +var CancellationTokenSource = /** @class */ (function () { + function CancellationTokenSource(parent) { + this._token = undefined; + this._parentListener = undefined; + this._parentListener = parent && parent.onCancellationRequested(this.cancel, this); + } + Object.defineProperty(CancellationTokenSource.prototype, "token", { + get: function () { + if (!this._token) { + // be lazy and create the token only when + // actually needed + this._token = new cancellation_MutableToken(); + } + return this._token; + }, + enumerable: true, + configurable: true + }); + CancellationTokenSource.prototype.cancel = function () { + if (!this._token) { + // save an object by returning the default + // cancelled token when cancellation happens + // before someone asks for the token + this._token = cancellation_CancellationToken.Cancelled; + } + else if (this._token instanceof cancellation_MutableToken) { + // actually cancel + this._token.cancel(); + } + }; + CancellationTokenSource.prototype.dispose = function () { + if (this._parentListener) { + this._parentListener.dispose(); + } + if (!this._token) { + // ensure to initialize with an empty token if we had none + this._token = cancellation_CancellationToken.None; + } + else if (this._token instanceof cancellation_MutableToken) { + // actually dispose + this._token.dispose(); + } + }; + return CancellationTokenSource; }()); -function createMonacoBaseAPI() { - return { - editor: undefined, - languages: undefined, - CancellationTokenSource: _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationTokenSource"], - Emitter: _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"], - KeyCode: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["KeyCode"], - KeyMod: KeyMod, - Position: _core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"], - Range: _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"], - Selection: _core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"], - SelectionDirection: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["SelectionDirection"], - MarkerSeverity: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["MarkerSeverity"], - MarkerTag: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["MarkerTag"], - Uri: _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"], - Token: _core_token_js__WEBPACK_IMPORTED_MODULE_8__["Token"] + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var KeyCodeStrMap = /** @class */ (function () { + function KeyCodeStrMap() { + this._keyCodeToStr = []; + this._strToKeyCode = Object.create(null); + } + KeyCodeStrMap.prototype.define = function (keyCode, str) { + this._keyCodeToStr[keyCode] = str; + this._strToKeyCode[str.toLowerCase()] = keyCode; }; + KeyCodeStrMap.prototype.keyCodeToStr = function (keyCode) { + return this._keyCodeToStr[keyCode]; + }; + KeyCodeStrMap.prototype.strToKeyCode = function (str) { + return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */; + }; + return KeyCodeStrMap; +}()); +var uiMap = new KeyCodeStrMap(); +var userSettingsUSMap = new KeyCodeStrMap(); +var userSettingsGeneralMap = new KeyCodeStrMap(); +(function () { + function define(keyCode, uiLabel, usUserSettingsLabel, generalUserSettingsLabel) { + if (usUserSettingsLabel === void 0) { usUserSettingsLabel = uiLabel; } + if (generalUserSettingsLabel === void 0) { generalUserSettingsLabel = usUserSettingsLabel; } + uiMap.define(keyCode, uiLabel); + userSettingsUSMap.define(keyCode, usUserSettingsLabel); + userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel); + } + define(0 /* Unknown */, 'unknown'); + define(1 /* Backspace */, 'Backspace'); + define(2 /* Tab */, 'Tab'); + define(3 /* Enter */, 'Enter'); + define(4 /* Shift */, 'Shift'); + define(5 /* Ctrl */, 'Ctrl'); + define(6 /* Alt */, 'Alt'); + define(7 /* PauseBreak */, 'PauseBreak'); + define(8 /* CapsLock */, 'CapsLock'); + define(9 /* Escape */, 'Escape'); + define(10 /* Space */, 'Space'); + define(11 /* PageUp */, 'PageUp'); + define(12 /* PageDown */, 'PageDown'); + define(13 /* End */, 'End'); + define(14 /* Home */, 'Home'); + define(15 /* LeftArrow */, 'LeftArrow', 'Left'); + define(16 /* UpArrow */, 'UpArrow', 'Up'); + define(17 /* RightArrow */, 'RightArrow', 'Right'); + define(18 /* DownArrow */, 'DownArrow', 'Down'); + define(19 /* Insert */, 'Insert'); + define(20 /* Delete */, 'Delete'); + define(21 /* KEY_0 */, '0'); + define(22 /* KEY_1 */, '1'); + define(23 /* KEY_2 */, '2'); + define(24 /* KEY_3 */, '3'); + define(25 /* KEY_4 */, '4'); + define(26 /* KEY_5 */, '5'); + define(27 /* KEY_6 */, '6'); + define(28 /* KEY_7 */, '7'); + define(29 /* KEY_8 */, '8'); + define(30 /* KEY_9 */, '9'); + define(31 /* KEY_A */, 'A'); + define(32 /* KEY_B */, 'B'); + define(33 /* KEY_C */, 'C'); + define(34 /* KEY_D */, 'D'); + define(35 /* KEY_E */, 'E'); + define(36 /* KEY_F */, 'F'); + define(37 /* KEY_G */, 'G'); + define(38 /* KEY_H */, 'H'); + define(39 /* KEY_I */, 'I'); + define(40 /* KEY_J */, 'J'); + define(41 /* KEY_K */, 'K'); + define(42 /* KEY_L */, 'L'); + define(43 /* KEY_M */, 'M'); + define(44 /* KEY_N */, 'N'); + define(45 /* KEY_O */, 'O'); + define(46 /* KEY_P */, 'P'); + define(47 /* KEY_Q */, 'Q'); + define(48 /* KEY_R */, 'R'); + define(49 /* KEY_S */, 'S'); + define(50 /* KEY_T */, 'T'); + define(51 /* KEY_U */, 'U'); + define(52 /* KEY_V */, 'V'); + define(53 /* KEY_W */, 'W'); + define(54 /* KEY_X */, 'X'); + define(55 /* KEY_Y */, 'Y'); + define(56 /* KEY_Z */, 'Z'); + define(57 /* Meta */, 'Meta'); + define(58 /* ContextMenu */, 'ContextMenu'); + define(59 /* F1 */, 'F1'); + define(60 /* F2 */, 'F2'); + define(61 /* F3 */, 'F3'); + define(62 /* F4 */, 'F4'); + define(63 /* F5 */, 'F5'); + define(64 /* F6 */, 'F6'); + define(65 /* F7 */, 'F7'); + define(66 /* F8 */, 'F8'); + define(67 /* F9 */, 'F9'); + define(68 /* F10 */, 'F10'); + define(69 /* F11 */, 'F11'); + define(70 /* F12 */, 'F12'); + define(71 /* F13 */, 'F13'); + define(72 /* F14 */, 'F14'); + define(73 /* F15 */, 'F15'); + define(74 /* F16 */, 'F16'); + define(75 /* F17 */, 'F17'); + define(76 /* F18 */, 'F18'); + define(77 /* F19 */, 'F19'); + define(78 /* NumLock */, 'NumLock'); + define(79 /* ScrollLock */, 'ScrollLock'); + define(80 /* US_SEMICOLON */, ';', ';', 'OEM_1'); + define(81 /* US_EQUAL */, '=', '=', 'OEM_PLUS'); + define(82 /* US_COMMA */, ',', ',', 'OEM_COMMA'); + define(83 /* US_MINUS */, '-', '-', 'OEM_MINUS'); + define(84 /* US_DOT */, '.', '.', 'OEM_PERIOD'); + define(85 /* US_SLASH */, '/', '/', 'OEM_2'); + define(86 /* US_BACKTICK */, '`', '`', 'OEM_3'); + define(110 /* ABNT_C1 */, 'ABNT_C1'); + define(111 /* ABNT_C2 */, 'ABNT_C2'); + define(87 /* US_OPEN_SQUARE_BRACKET */, '[', '[', 'OEM_4'); + define(88 /* US_BACKSLASH */, '\\', '\\', 'OEM_5'); + define(89 /* US_CLOSE_SQUARE_BRACKET */, ']', ']', 'OEM_6'); + define(90 /* US_QUOTE */, '\'', '\'', 'OEM_7'); + define(91 /* OEM_8 */, 'OEM_8'); + define(92 /* OEM_102 */, 'OEM_102'); + define(93 /* NUMPAD_0 */, 'NumPad0'); + define(94 /* NUMPAD_1 */, 'NumPad1'); + define(95 /* NUMPAD_2 */, 'NumPad2'); + define(96 /* NUMPAD_3 */, 'NumPad3'); + define(97 /* NUMPAD_4 */, 'NumPad4'); + define(98 /* NUMPAD_5 */, 'NumPad5'); + define(99 /* NUMPAD_6 */, 'NumPad6'); + define(100 /* NUMPAD_7 */, 'NumPad7'); + define(101 /* NUMPAD_8 */, 'NumPad8'); + define(102 /* NUMPAD_9 */, 'NumPad9'); + define(103 /* NUMPAD_MULTIPLY */, 'NumPad_Multiply'); + define(104 /* NUMPAD_ADD */, 'NumPad_Add'); + define(105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator'); + define(106 /* NUMPAD_SUBTRACT */, 'NumPad_Subtract'); + define(107 /* NUMPAD_DECIMAL */, 'NumPad_Decimal'); + define(108 /* NUMPAD_DIVIDE */, 'NumPad_Divide'); +})(); +var KeyCodeUtils; +(function (KeyCodeUtils) { + function toString(keyCode) { + return uiMap.keyCodeToStr(keyCode); + } + KeyCodeUtils.toString = toString; + function fromString(key) { + return uiMap.strToKeyCode(key); + } + KeyCodeUtils.fromString = fromString; + function toUserSettingsUS(keyCode) { + return userSettingsUSMap.keyCodeToStr(keyCode); + } + KeyCodeUtils.toUserSettingsUS = toUserSettingsUS; + function toUserSettingsGeneral(keyCode) { + return userSettingsGeneralMap.keyCodeToStr(keyCode); + } + KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral; + function fromUserSettings(key) { + return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); + } + KeyCodeUtils.fromUserSettings = fromUserSettings; +})(KeyCodeUtils || (KeyCodeUtils = {})); +function KeyChord(firstPart, secondPart) { + var chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0; + return (firstPart | chordPart) >>> 0; } +function createKeybinding(keybinding, OS) { + if (keybinding === 0) { + return null; + } + var firstPart = (keybinding & 0x0000FFFF) >>> 0; + var chordPart = (keybinding & 0xFFFF0000) >>> 16; + if (chordPart !== 0) { + return new keyCodes_ChordKeybinding([ + createSimpleKeybinding(firstPart, OS), + createSimpleKeybinding(chordPart, OS) + ]); + } + return new keyCodes_ChordKeybinding([createSimpleKeybinding(firstPart, OS)]); +} +function createSimpleKeybinding(keybinding, OS) { + var ctrlCmd = (keybinding & 2048 /* CtrlCmd */ ? true : false); + var winCtrl = (keybinding & 256 /* WinCtrl */ ? true : false); + var ctrlKey = (OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd); + var shiftKey = (keybinding & 1024 /* Shift */ ? true : false); + var altKey = (keybinding & 512 /* Alt */ ? true : false); + var metaKey = (OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl); + var keyCode = (keybinding & 255 /* KeyCode */); + return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode); +} +var SimpleKeybinding = /** @class */ (function () { + function SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode) { + this.ctrlKey = ctrlKey; + this.shiftKey = shiftKey; + this.altKey = altKey; + this.metaKey = metaKey; + this.keyCode = keyCode; + } + SimpleKeybinding.prototype.equals = function (other) { + return (this.ctrlKey === other.ctrlKey + && this.shiftKey === other.shiftKey + && this.altKey === other.altKey + && this.metaKey === other.metaKey + && this.keyCode === other.keyCode); + }; + SimpleKeybinding.prototype.isModifierKey = function () { + return (this.keyCode === 0 /* Unknown */ + || this.keyCode === 5 /* Ctrl */ + || this.keyCode === 57 /* Meta */ + || this.keyCode === 6 /* Alt */ + || this.keyCode === 4 /* Shift */); + }; + SimpleKeybinding.prototype.toChord = function () { + return new keyCodes_ChordKeybinding([this]); + }; + /** + * Does this keybinding refer to the key code of a modifier and it also has the modifier flag? + */ + SimpleKeybinding.prototype.isDuplicateModifierCase = function () { + return ((this.ctrlKey && this.keyCode === 5 /* Ctrl */) + || (this.shiftKey && this.keyCode === 4 /* Shift */) + || (this.altKey && this.keyCode === 6 /* Alt */) + || (this.metaKey && this.keyCode === 57 /* Meta */)); + }; + return SimpleKeybinding; +}()); + +var keyCodes_ChordKeybinding = /** @class */ (function () { + function ChordKeybinding(parts) { + if (parts.length === 0) { + throw illegalArgument("parts"); + } + this.parts = parts; + } + ChordKeybinding.prototype.equals = function (other) { + if (other === null) { + return false; + } + if (this.parts.length !== other.parts.length) { + return false; + } + for (var i = 0; i < this.parts.length; i++) { + if (!this.parts[i].equals(other.parts[i])) { + return false; + } + } + return true; + }; + return ChordKeybinding; +}()); + +var ResolvedKeybindingPart = /** @class */ (function () { + function ResolvedKeybindingPart(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) { + this.ctrlKey = ctrlKey; + this.shiftKey = shiftKey; + this.altKey = altKey; + this.metaKey = metaKey; + this.keyLabel = kbLabel; + this.keyAriaLabel = kbAriaLabel; + } + return ResolvedKeybindingPart; +}()); + +/** + * A resolved keybinding. Can be a simple keybinding or a chord keybinding. + */ +var ResolvedKeybinding = /** @class */ (function () { + function ResolvedKeybinding() { + } + return ResolvedKeybinding; +}()); -/***/ }), +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var selection_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js ***! - \***************************************************************************************/ -/*! exports provided: MarkerTag, MarkerSeverity, KeyCode, SelectionDirection, ScrollbarVisibility, OverviewRulerLane, EndOfLinePreference, DefaultEndOfLine, EndOfLineSequence, TrackedRangeStickiness, ScrollType, CursorChangeReason, RenderMinimap, WrappingIndent, TextEditorCursorBlinkingStyle, TextEditorCursorStyle, RenderLineNumbersType, ContentWidgetPositionPreference, OverlayWidgetPositionPreference, MouseTargetType, IndentAction, CompletionItemKind, CompletionItemInsertTextRule, CompletionTriggerKind, SignatureHelpTriggerKind, DocumentHighlightKind, SymbolKind */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerTag", function() { return MarkerTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerSeverity", function() { return MarkerSeverity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCode", function() { return KeyCode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionDirection", function() { return SelectionDirection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollbarVisibility", function() { return ScrollbarVisibility; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverviewRulerLane", function() { return OverviewRulerLane; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLinePreference", function() { return EndOfLinePreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultEndOfLine", function() { return DefaultEndOfLine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLineSequence", function() { return EndOfLineSequence; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackedRangeStickiness", function() { return TrackedRangeStickiness; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollType", function() { return ScrollType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorChangeReason", function() { return CursorChangeReason; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderMinimap", function() { return RenderMinimap; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WrappingIndent", function() { return WrappingIndent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorBlinkingStyle", function() { return TextEditorCursorBlinkingStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorStyle", function() { return TextEditorCursorStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderLineNumbersType", function() { return RenderLineNumbersType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentWidgetPositionPreference", function() { return ContentWidgetPositionPreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverlayWidgetPositionPreference", function() { return OverlayWidgetPositionPreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MouseTargetType", function() { return MouseTargetType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentAction", function() { return IndentAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemInsertTextRule", function() { return CompletionItemInsertTextRule; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionTriggerKind", function() { return CompletionTriggerKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureHelpTriggerKind", function() { return SignatureHelpTriggerKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; }); +/** + * A selection in the editor. + * The selection is a range that has an orientation. + */ +var selection_Selection = /** @class */ (function (_super) { + selection_extends(Selection, _super); + function Selection(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) { + var _this = _super.call(this, selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) || this; + _this.selectionStartLineNumber = selectionStartLineNumber; + _this.selectionStartColumn = selectionStartColumn; + _this.positionLineNumber = positionLineNumber; + _this.positionColumn = positionColumn; + return _this; + } + /** + * Clone this selection. + */ + Selection.prototype.clone = function () { + return new Selection(this.selectionStartLineNumber, this.selectionStartColumn, this.positionLineNumber, this.positionColumn); + }; + /** + * Transform to a human-readable representation. + */ + Selection.prototype.toString = function () { + return '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']'; + }; + /** + * Test if equals other selection. + */ + Selection.prototype.equalsSelection = function (other) { + return (Selection.selectionsEqual(this, other)); + }; + /** + * Test if the two selections are equal. + */ + Selection.selectionsEqual = function (a, b) { + return (a.selectionStartLineNumber === b.selectionStartLineNumber && + a.selectionStartColumn === b.selectionStartColumn && + a.positionLineNumber === b.positionLineNumber && + a.positionColumn === b.positionColumn); + }; + /** + * Get directions (LTR or RTL). + */ + Selection.prototype.getDirection = function () { + if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) { + return 0 /* LTR */; + } + return 1 /* RTL */; + }; + /** + * Create a new selection with a different `positionLineNumber` and `positionColumn`. + */ + Selection.prototype.setEndPosition = function (endLineNumber, endColumn) { + if (this.getDirection() === 0 /* LTR */) { + return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn); + } + return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn); + }; + /** + * Get the position at `positionLineNumber` and `positionColumn`. + */ + Selection.prototype.getPosition = function () { + return new Position(this.positionLineNumber, this.positionColumn); + }; + /** + * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. + */ + Selection.prototype.setStartPosition = function (startLineNumber, startColumn) { + if (this.getDirection() === 0 /* LTR */) { + return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn); + } + return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn); + }; + // ---- + /** + * Create a `Selection` from one or two positions + */ + Selection.fromPositions = function (start, end) { + if (end === void 0) { end = start; } + return new Selection(start.lineNumber, start.column, end.lineNumber, end.column); + }; + /** + * Create a `Selection` from an `ISelection`. + */ + Selection.liftSelection = function (sel) { + return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn); + }; + /** + * `a` equals `b`. + */ + Selection.selectionsArrEqual = function (a, b) { + if (a && !b || !a && b) { + return false; + } + if (!a && !b) { + return true; + } + if (a.length !== b.length) { + return false; + } + for (var i = 0, len = a.length; i < len; i++) { + if (!this.selectionsEqual(a[i], b[i])) { + return false; + } + } + return true; + }; + /** + * Test if `obj` is an `ISelection`. + */ + Selection.isISelection = function (obj) { + return (obj + && (typeof obj.selectionStartLineNumber === 'number') + && (typeof obj.selectionStartColumn === 'number') + && (typeof obj.positionLineNumber === 'number') + && (typeof obj.positionColumn === 'number')); + }; + /** + * Create with a direction. + */ + Selection.createWithDirection = function (startLineNumber, startColumn, endLineNumber, endColumn, direction) { + if (direction === 0 /* LTR */) { + return new Selection(startLineNumber, startColumn, endLineNumber, endColumn); + } + return new Selection(endLineNumber, endColumn, startLineNumber, startColumn); + }; + return Selection; +}(range_Range)); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/token.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var Token = /** @class */ (function () { + function Token(offset, type, language) { + this.offset = offset | 0; // @perf + this.type = type; + this.language = language; + } + Token.prototype.toString = function () { + return '(' + this.offset + ', ' + this.type + ')'; + }; + return Token; +}()); + +var TokenizationResult = /** @class */ (function () { + function TokenizationResult(tokens, endState) { + this.tokens = tokens; + this.endState = endState; + } + return TokenizationResult; +}()); + +var TokenizationResult2 = /** @class */ (function () { + function TokenizationResult2(tokens, endState) { + this.tokens = tokens; + this.endState = endState; + } + return TokenizationResult2; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -8151,238 +7206,603 @@ var SymbolKind; SymbolKind[SymbolKind["TypeParameter"] = 25] = "TypeParameter"; })(SymbolKind || (SymbolKind = {})); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js ***! - \****************************************************************************************/ -/*! exports provided: PrefixSumIndexOfResult, PrefixSumComputer, PrefixSumComputerWithCache */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumIndexOfResult", function() { return PrefixSumIndexOfResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumComputer", function() { return PrefixSumComputer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumComputerWithCache", function() { return PrefixSumComputerWithCache; }); -/* harmony import */ var _core_uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/uint.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var PrefixSumIndexOfResult = /** @class */ (function () { - function PrefixSumIndexOfResult(index, remainder) { - this.index = index; - this.remainder = remainder; + + + + + + + + + +var standaloneBase_KeyMod = /** @class */ (function () { + function KeyMod() { } - return PrefixSumIndexOfResult; + KeyMod.chord = function (firstPart, secondPart) { + return KeyChord(firstPart, secondPart); + }; + KeyMod.CtrlCmd = 2048 /* CtrlCmd */; + KeyMod.Shift = 1024 /* Shift */; + KeyMod.Alt = 512 /* Alt */; + KeyMod.WinCtrl = 256 /* WinCtrl */; + return KeyMod; }()); -var PrefixSumComputer = /** @class */ (function () { - function PrefixSumComputer(values) { - this.values = values; - this.prefixSum = new Uint32Array(values.length); - this.prefixSumValidIndex = new Int32Array(1); - this.prefixSumValidIndex[0] = -1; +function createMonacoBaseAPI() { + return { + editor: undefined, + languages: undefined, + CancellationTokenSource: CancellationTokenSource, + Emitter: event_Emitter, + KeyCode: KeyCode, + KeyMod: standaloneBase_KeyMod, + Position: Position, + Range: range_Range, + Selection: selection_Selection, + SelectionDirection: SelectionDirection, + MarkerSeverity: MarkerSeverity, + MarkerTag: MarkerTag, + Uri: uri_URI, + Token: Token + }; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var editorSimpleWorker_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + + + + + + + + + + + +/** + * @internal + */ +var editorSimpleWorker_MirrorModel = /** @class */ (function (_super) { + editorSimpleWorker_extends(MirrorModel, _super); + function MirrorModel() { + return _super !== null && _super.apply(this, arguments) || this; } - PrefixSumComputer.prototype.getCount = function () { - return this.values.length; + Object.defineProperty(MirrorModel.prototype, "uri", { + get: function () { + return this._uri; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MirrorModel.prototype, "version", { + get: function () { + return this._versionId; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MirrorModel.prototype, "eol", { + get: function () { + return this._eol; + }, + enumerable: true, + configurable: true + }); + MirrorModel.prototype.getValue = function () { + return this.getText(); }; - PrefixSumComputer.prototype.insertValues = function (insertIndex, insertValues) { - insertIndex = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(insertIndex); - var oldValues = this.values; - var oldPrefixSum = this.prefixSum; - var insertValuesLen = insertValues.length; - if (insertValuesLen === 0) { - return false; - } - this.values = new Uint32Array(oldValues.length + insertValuesLen); - this.values.set(oldValues.subarray(0, insertIndex), 0); - this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen); - this.values.set(insertValues, insertIndex); - if (insertIndex - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = insertIndex - 1; - } - this.prefixSum = new Uint32Array(this.values.length); - if (this.prefixSumValidIndex[0] >= 0) { - this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); - } - return true; + MirrorModel.prototype.getLinesContent = function () { + return this._lines.slice(0); }; - PrefixSumComputer.prototype.changeValue = function (index, value) { - index = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index); - value = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(value); - if (this.values[index] === value) { - return false; - } - this.values[index] = value; - if (index - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = index - 1; - } - return true; + MirrorModel.prototype.getLineCount = function () { + return this._lines.length; }; - PrefixSumComputer.prototype.removeValues = function (startIndex, cnt) { - startIndex = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(startIndex); - cnt = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(cnt); - var oldValues = this.values; - var oldPrefixSum = this.prefixSum; - if (startIndex >= oldValues.length) { - return false; - } - var maxCnt = oldValues.length - startIndex; - if (cnt >= maxCnt) { - cnt = maxCnt; - } - if (cnt === 0) { - return false; - } - this.values = new Uint32Array(oldValues.length - cnt); - this.values.set(oldValues.subarray(0, startIndex), 0); - this.values.set(oldValues.subarray(startIndex + cnt), startIndex); - this.prefixSum = new Uint32Array(this.values.length); - if (startIndex - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = startIndex - 1; - } - if (this.prefixSumValidIndex[0] >= 0) { - this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); - } - return true; + MirrorModel.prototype.getLineContent = function (lineNumber) { + return this._lines[lineNumber - 1]; }; - PrefixSumComputer.prototype.getTotalValue = function () { - if (this.values.length === 0) { - return 0; + MirrorModel.prototype.getWordAtPosition = function (position, wordDefinition) { + var wordAtText = getWordAtText(position.column, ensureValidWordDefinition(wordDefinition), this._lines[position.lineNumber - 1], 0); + if (wordAtText) { + return new range_Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn); } - return this._getAccumulatedValue(this.values.length - 1); + return null; }; - PrefixSumComputer.prototype.getAccumulatedValue = function (index) { - if (index < 0) { - return 0; + MirrorModel.prototype.getWordUntilPosition = function (position, wordDefinition) { + var wordAtPosition = this.getWordAtPosition(position, wordDefinition); + if (!wordAtPosition) { + return { + word: '', + startColumn: position.column, + endColumn: position.column + }; } - index = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index); - return this._getAccumulatedValue(index); + return { + word: this._lines[position.lineNumber - 1].substring(wordAtPosition.startColumn - 1, position.column - 1), + startColumn: wordAtPosition.startColumn, + endColumn: position.column + }; }; - PrefixSumComputer.prototype._getAccumulatedValue = function (index) { - if (index <= this.prefixSumValidIndex[0]) { - return this.prefixSum[index]; - } - var startIndex = this.prefixSumValidIndex[0] + 1; - if (startIndex === 0) { - this.prefixSum[0] = this.values[0]; - startIndex++; - } - if (index >= this.values.length) { - index = this.values.length - 1; - } - for (var i = startIndex; i <= index; i++) { - this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i]; - } - this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index); - return this.prefixSum[index]; - }; - PrefixSumComputer.prototype.getIndexOf = function (accumulatedValue) { - accumulatedValue = Math.floor(accumulatedValue); //@perf - // Compute all sums (to get a fully valid prefixSum) - this.getTotalValue(); - var low = 0; - var high = this.values.length - 1; - var mid = 0; - var midStop = 0; - var midStart = 0; - while (low <= high) { - mid = low + ((high - low) / 2) | 0; - midStop = this.prefixSum[mid]; - midStart = midStop - this.values[mid]; - if (accumulatedValue < midStart) { - high = mid - 1; + MirrorModel.prototype.createWordIterator = function (wordDefinition) { + var _this = this; + var obj; + var lineNumber = 0; + var lineText; + var wordRangesIdx = 0; + var wordRanges = []; + var next = function () { + if (wordRangesIdx < wordRanges.length) { + var value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end); + wordRangesIdx += 1; + if (!obj) { + obj = { done: false, value: value }; + } + else { + obj.value = value; + } + return obj; } - else if (accumulatedValue >= midStop) { - low = mid + 1; + else if (lineNumber >= _this._lines.length) { + return FIN; } else { + lineText = _this._lines[lineNumber]; + wordRanges = _this._wordenize(lineText, wordDefinition); + wordRangesIdx = 0; + lineNumber += 1; + return next(); + } + }; + return { next: next }; + }; + MirrorModel.prototype.getLineWords = function (lineNumber, wordDefinition) { + var content = this._lines[lineNumber - 1]; + var ranges = this._wordenize(content, wordDefinition); + var words = []; + for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { + var range = ranges_1[_i]; + words.push({ + word: content.substring(range.start, range.end), + startColumn: range.start + 1, + endColumn: range.end + 1 + }); + } + return words; + }; + MirrorModel.prototype._wordenize = function (content, wordDefinition) { + var result = []; + var match; + wordDefinition.lastIndex = 0; // reset lastIndex just to be sure + while (match = wordDefinition.exec(content)) { + if (match[0].length === 0) { + // it did match the empty string break; } + result.push({ start: match.index, end: match.index + match[0].length }); } - return new PrefixSumIndexOfResult(mid, accumulatedValue - midStart); + return result; }; - return PrefixSumComputer; -}()); - -var PrefixSumComputerWithCache = /** @class */ (function () { - function PrefixSumComputerWithCache(values) { - this._cacheAccumulatedValueStart = 0; - this._cache = null; - this._actual = new PrefixSumComputer(values); - this._bustCache(); - } - PrefixSumComputerWithCache.prototype._bustCache = function () { - this._cacheAccumulatedValueStart = 0; - this._cache = null; - }; - PrefixSumComputerWithCache.prototype.insertValues = function (insertIndex, insertValues) { - if (this._actual.insertValues(insertIndex, insertValues)) { - this._bustCache(); + MirrorModel.prototype.getValueInRange = function (range) { + range = this._validateRange(range); + if (range.startLineNumber === range.endLineNumber) { + return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); } - }; - PrefixSumComputerWithCache.prototype.changeValue = function (index, value) { - if (this._actual.changeValue(index, value)) { - this._bustCache(); + var lineEnding = this._eol; + var startLineIndex = range.startLineNumber - 1; + var endLineIndex = range.endLineNumber - 1; + var resultLines = []; + resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); + for (var i = startLineIndex + 1; i < endLineIndex; i++) { + resultLines.push(this._lines[i]); } + resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); + return resultLines.join(lineEnding); }; - PrefixSumComputerWithCache.prototype.removeValues = function (startIndex, cnt) { - if (this._actual.removeValues(startIndex, cnt)) { - this._bustCache(); + MirrorModel.prototype.offsetAt = function (position) { + position = this._validatePosition(position); + this._ensureLineStarts(); + return this._lineStarts.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1); + }; + MirrorModel.prototype.positionAt = function (offset) { + offset = Math.floor(offset); + offset = Math.max(0, offset); + this._ensureLineStarts(); + var out = this._lineStarts.getIndexOf(offset); + var lineLength = this._lines[out.index].length; + // Ensure we return a valid position + return { + lineNumber: 1 + out.index, + column: 1 + Math.min(out.remainder, lineLength) + }; + }; + MirrorModel.prototype._validateRange = function (range) { + var start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn }); + var end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn }); + if (start.lineNumber !== range.startLineNumber + || start.column !== range.startColumn + || end.lineNumber !== range.endLineNumber + || end.column !== range.endColumn) { + return { + startLineNumber: start.lineNumber, + startColumn: start.column, + endLineNumber: end.lineNumber, + endColumn: end.column + }; } + return range; }; - PrefixSumComputerWithCache.prototype.getTotalValue = function () { - return this._actual.getTotalValue(); - }; - PrefixSumComputerWithCache.prototype.getAccumulatedValue = function (index) { - return this._actual.getAccumulatedValue(index); - }; - PrefixSumComputerWithCache.prototype.getIndexOf = function (accumulatedValue) { - accumulatedValue = Math.floor(accumulatedValue); //@perf - if (this._cache !== null) { - var cacheIndex = accumulatedValue - this._cacheAccumulatedValueStart; - if (cacheIndex >= 0 && cacheIndex < this._cache.length) { - // Cache hit! - return this._cache[cacheIndex]; + MirrorModel.prototype._validatePosition = function (position) { + if (!Position.isIPosition(position)) { + throw new Error('bad position'); + } + var lineNumber = position.lineNumber, column = position.column; + var hasChanged = false; + if (lineNumber < 1) { + lineNumber = 1; + column = 1; + hasChanged = true; + } + else if (lineNumber > this._lines.length) { + lineNumber = this._lines.length; + column = this._lines[lineNumber - 1].length + 1; + hasChanged = true; + } + else { + var maxCharacter = this._lines[lineNumber - 1].length + 1; + if (column < 1) { + column = 1; + hasChanged = true; + } + else if (column > maxCharacter) { + column = maxCharacter; + hasChanged = true; } } - // Cache miss! - return this._actual.getIndexOf(accumulatedValue); - }; - /** - * Gives a hint that a lot of requests are about to come in for these accumulated values. - */ - PrefixSumComputerWithCache.prototype.warmUpCache = function (accumulatedValueStart, accumulatedValueEnd) { - var newCache = []; - for (var accumulatedValue = accumulatedValueStart; accumulatedValue <= accumulatedValueEnd; accumulatedValue++) { - newCache[accumulatedValue - accumulatedValueStart] = this.getIndexOf(accumulatedValue); + if (!hasChanged) { + return position; + } + else { + return { lineNumber: lineNumber, column: column }; } - this._cache = newCache; - this._cacheAccumulatedValueStart = accumulatedValueStart; }; - return PrefixSumComputerWithCache; + return MirrorModel; +}(mirrorTextModel_MirrorTextModel)); +/** + * @internal + */ +var editorSimpleWorker_BaseEditorSimpleWorker = /** @class */ (function () { + function BaseEditorSimpleWorker(foreignModuleFactory) { + this._foreignModuleFactory = foreignModuleFactory; + this._foreignModule = null; + } + // ---- BEGIN diff -------------------------------------------------------------------------- + BaseEditorSimpleWorker.prototype.computeDiff = function (originalUrl, modifiedUrl, ignoreTrimWhitespace) { + var original = this._getModel(originalUrl); + var modified = this._getModel(modifiedUrl); + if (!original || !modified) { + return Promise.resolve(null); + } + var originalLines = original.getLinesContent(); + var modifiedLines = modified.getLinesContent(); + var diffComputer = new DiffComputer(originalLines, modifiedLines, { + shouldComputeCharChanges: true, + shouldPostProcessCharChanges: true, + shouldIgnoreTrimWhitespace: ignoreTrimWhitespace, + shouldMakePrettyDiff: true + }); + var changes = diffComputer.computeDiff(); + var identical = (changes.length > 0 ? false : this._modelsAreIdentical(original, modified)); + return Promise.resolve({ + identical: identical, + changes: changes + }); + }; + BaseEditorSimpleWorker.prototype._modelsAreIdentical = function (original, modified) { + var originalLineCount = original.getLineCount(); + var modifiedLineCount = modified.getLineCount(); + if (originalLineCount !== modifiedLineCount) { + return false; + } + for (var line = 1; line <= originalLineCount; line++) { + var originalLine = original.getLineContent(line); + var modifiedLine = modified.getLineContent(line); + if (originalLine !== modifiedLine) { + return false; + } + } + return true; + }; + BaseEditorSimpleWorker.prototype.computeMoreMinimalEdits = function (modelUrl, edits) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(edits); + } + var result = []; + var lastEol = undefined; + edits = mergeSort(edits, function (a, b) { + if (a.range && b.range) { + return range_Range.compareRangesUsingStarts(a.range, b.range); + } + // eol only changes should go to the end + var aRng = a.range ? 0 : 1; + var bRng = b.range ? 0 : 1; + return aRng - bRng; + }); + for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { + var _a = edits_1[_i], range = _a.range, text = _a.text, eol = _a.eol; + if (typeof eol === 'number') { + lastEol = eol; + } + if (range_Range.isEmpty(range) && !text) { + // empty change + continue; + } + var original = model.getValueInRange(range); + text = text.replace(/\r\n|\n|\r/g, model.eol); + if (original === text) { + // noop + continue; + } + // make sure diff won't take too long + if (Math.max(text.length, original.length) > BaseEditorSimpleWorker._diffLimit) { + result.push({ range: range, text: text }); + continue; + } + // compute diff between original and edit.text + var changes = stringDiff(original, text, false); + var editOffset = model.offsetAt(range_Range.lift(range).getStartPosition()); + for (var _b = 0, changes_1 = changes; _b < changes_1.length; _b++) { + var change = changes_1[_b]; + var start = model.positionAt(editOffset + change.originalStart); + var end = model.positionAt(editOffset + change.originalStart + change.originalLength); + var newEdit = { + text: text.substr(change.modifiedStart, change.modifiedLength), + range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column } + }; + if (model.getValueInRange(newEdit.range) !== newEdit.text) { + result.push(newEdit); + } + } + } + if (typeof lastEol === 'number') { + result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }); + } + return Promise.resolve(result); + }; + // ---- END minimal edits --------------------------------------------------------------- + BaseEditorSimpleWorker.prototype.computeLinks = function (modelUrl) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(null); + } + return Promise.resolve(computeLinks(model)); + }; + BaseEditorSimpleWorker.prototype.textualSuggest = function (modelUrl, position, wordDef, wordDefFlags) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(null); + } + var seen = Object.create(null); + var suggestions = []; + var wordDefRegExp = new RegExp(wordDef, wordDefFlags); + var wordUntil = model.getWordUntilPosition(position, wordDefRegExp); + var wordAt = model.getWordAtPosition(position, wordDefRegExp); + if (wordAt) { + seen[model.getValueInRange(wordAt)] = true; + } + for (var iter = model.createWordIterator(wordDefRegExp), e = iter.next(); !e.done && suggestions.length <= BaseEditorSimpleWorker._suggestionsLimit; e = iter.next()) { + var word = e.value; + if (seen[word]) { + continue; + } + seen[word] = true; + if (!isNaN(Number(word))) { + continue; + } + suggestions.push({ + kind: 18 /* Text */, + label: word, + insertText: word, + range: { startLineNumber: position.lineNumber, startColumn: wordUntil.startColumn, endLineNumber: position.lineNumber, endColumn: wordUntil.endColumn } + }); + } + return Promise.resolve({ suggestions: suggestions }); + }; + // ---- END suggest -------------------------------------------------------------------------- + //#region -- word ranges -- + BaseEditorSimpleWorker.prototype.computeWordRanges = function (modelUrl, range, wordDef, wordDefFlags) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(Object.create(null)); + } + var wordDefRegExp = new RegExp(wordDef, wordDefFlags); + var result = Object.create(null); + for (var line = range.startLineNumber; line < range.endLineNumber; line++) { + var words = model.getLineWords(line, wordDefRegExp); + for (var _i = 0, words_1 = words; _i < words_1.length; _i++) { + var word = words_1[_i]; + if (!isNaN(Number(word.word))) { + continue; + } + var array = result[word.word]; + if (!array) { + array = []; + result[word.word] = array; + } + array.push({ + startLineNumber: line, + startColumn: word.startColumn, + endLineNumber: line, + endColumn: word.endColumn + }); + } + } + return Promise.resolve(result); + }; + //#endregion + BaseEditorSimpleWorker.prototype.navigateValueSet = function (modelUrl, range, up, wordDef, wordDefFlags) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(null); + } + var wordDefRegExp = new RegExp(wordDef, wordDefFlags); + if (range.startColumn === range.endColumn) { + range = { + startLineNumber: range.startLineNumber, + startColumn: range.startColumn, + endLineNumber: range.endLineNumber, + endColumn: range.endColumn + 1 + }; + } + var selectionText = model.getValueInRange(range); + var wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp); + if (!wordRange) { + return Promise.resolve(null); + } + var word = model.getValueInRange(wordRange); + var result = BasicInplaceReplace.INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up); + return Promise.resolve(result); + }; + // ---- BEGIN foreign module support -------------------------------------------------------------------------- + BaseEditorSimpleWorker.prototype.loadForeignModule = function (moduleId, createData) { + var _this = this; + var ctx = { + getMirrorModels: function () { + return _this._getModels(); + } + }; + if (this._foreignModuleFactory) { + this._foreignModule = this._foreignModuleFactory(ctx, createData); + // static foreing module + var methods = []; + for (var _i = 0, _a = getAllPropertyNames(this._foreignModule); _i < _a.length; _i++) { + var prop = _a[_i]; + if (typeof this._foreignModule[prop] === 'function') { + methods.push(prop); + } + } + return Promise.resolve(methods); + } + // ESM-comment-begin + // return new Promise((resolve, reject) => { + // require([moduleId], (foreignModule: { create: IForeignModuleFactory }) => { + // this._foreignModule = foreignModule.create(ctx, createData); + // + // let methods: string[] = []; + // for (const prop of getAllPropertyNames(this._foreignModule)) { + // if (typeof this._foreignModule[prop] === 'function') { + // methods.push(prop); + // } + // } + // + // resolve(methods); + // + // }, reject); + // }); + // ESM-comment-end + // ESM-uncomment-begin + return Promise.reject(new Error("Unexpected usage")); + // ESM-uncomment-end + }; + // foreign method request + BaseEditorSimpleWorker.prototype.fmr = function (method, args) { + if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') { + return Promise.reject(new Error('Missing requestHandler or method: ' + method)); + } + try { + return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args)); + } + catch (e) { + return Promise.reject(e); + } + }; + // ---- END diff -------------------------------------------------------------------------- + // ---- BEGIN minimal edits --------------------------------------------------------------- + BaseEditorSimpleWorker._diffLimit = 100000; + // ---- BEGIN suggest -------------------------------------------------------------------------- + BaseEditorSimpleWorker._suggestionsLimit = 10000; + return BaseEditorSimpleWorker; }()); +/** + * @internal + */ +var editorSimpleWorker_EditorSimpleWorkerImpl = /** @class */ (function (_super) { + editorSimpleWorker_extends(EditorSimpleWorkerImpl, _super); + function EditorSimpleWorkerImpl(foreignModuleFactory) { + var _this = _super.call(this, foreignModuleFactory) || this; + _this._models = Object.create(null); + return _this; + } + EditorSimpleWorkerImpl.prototype.dispose = function () { + this._models = Object.create(null); + }; + EditorSimpleWorkerImpl.prototype._getModel = function (uri) { + return this._models[uri]; + }; + EditorSimpleWorkerImpl.prototype._getModels = function () { + var _this = this; + var all = []; + Object.keys(this._models).forEach(function (key) { return all.push(_this._models[key]); }); + return all; + }; + EditorSimpleWorkerImpl.prototype.acceptNewModel = function (data) { + this._models[data.url] = new editorSimpleWorker_MirrorModel(uri_URI.parse(data.url), data.lines, data.EOL, data.versionId); + }; + EditorSimpleWorkerImpl.prototype.acceptModelChanged = function (strURL, e) { + if (!this._models[strURL]) { + return; + } + var model = this._models[strURL]; + model.onEvents(e); + }; + EditorSimpleWorkerImpl.prototype.acceptRemovedModel = function (strURL) { + if (!this._models[strURL]) { + return; + } + delete this._models[strURL]; + }; + return EditorSimpleWorkerImpl; +}(editorSimpleWorker_BaseEditorSimpleWorker)); +/** + * Called on the worker side + * @internal + */ +function editorSimpleWorker_create() { + return new editorSimpleWorker_EditorSimpleWorkerImpl(null); +} +if (typeof importScripts === 'function') { + // Running in a web worker + globals.monaco = createMonacoBaseAPI(); +} -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/editor.worker.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/editor.worker.js ***! - \*******************************************************************/ -/*! exports provided: initialize */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initialize", function() { return initialize; }); -/* harmony import */ var _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/common/worker/simpleWorker.js */ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js"); -/* harmony import */ var _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/services/editorSimpleWorker.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/editor.worker.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -8395,8 +7815,8 @@ function initialize(foreignModule) { return; } initialized = true; - var editorWorker = new _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__["EditorSimpleWorkerImpl"](foreignModule); - var simpleWorker = new _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__["SimpleWorkerServer"](function (msg) { + var editorWorker = new editorSimpleWorker_EditorSimpleWorkerImpl(foreignModule); + var simpleWorker = new simpleWorker_SimpleWorkerServer(function (msg) { self.postMessage(msg); }, editorWorker); self.onmessage = function (e) { @@ -8410,19 +7830,8778 @@ self.onmessage = function (e) { } }; +// 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 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 config(opt) { + return loadMessageBundle; +} -/***/ }), +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/htmlLanguageTypes.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// #region Proposed types, remove once added to vscode-languageserver-types +/** + * Enum of known selection range kinds + */ +var SelectionRangeKind; +(function (SelectionRangeKind) { + /** + * Empty Kind. + */ + SelectionRangeKind["Empty"] = ""; + /** + * The statment kind, its value is `statement`, possible extensions can be + * `statement.if` etc + */ + SelectionRangeKind["Statement"] = "statement"; + /** + * The declaration kind, its value is `declaration`, possible extensions can be + * `declaration.function`, `declaration.class` etc. + */ + SelectionRangeKind["Declaration"] = "declaration"; +})(SelectionRangeKind || (SelectionRangeKind = {})); +var TokenType; +(function (TokenType) { + TokenType[TokenType["StartCommentTag"] = 0] = "StartCommentTag"; + TokenType[TokenType["Comment"] = 1] = "Comment"; + TokenType[TokenType["EndCommentTag"] = 2] = "EndCommentTag"; + TokenType[TokenType["StartTagOpen"] = 3] = "StartTagOpen"; + TokenType[TokenType["StartTagClose"] = 4] = "StartTagClose"; + TokenType[TokenType["StartTagSelfClose"] = 5] = "StartTagSelfClose"; + TokenType[TokenType["StartTag"] = 6] = "StartTag"; + TokenType[TokenType["EndTagOpen"] = 7] = "EndTagOpen"; + TokenType[TokenType["EndTagClose"] = 8] = "EndTagClose"; + TokenType[TokenType["EndTag"] = 9] = "EndTag"; + TokenType[TokenType["DelimiterAssign"] = 10] = "DelimiterAssign"; + TokenType[TokenType["AttributeName"] = 11] = "AttributeName"; + TokenType[TokenType["AttributeValue"] = 12] = "AttributeValue"; + TokenType[TokenType["StartDoctypeTag"] = 13] = "StartDoctypeTag"; + TokenType[TokenType["Doctype"] = 14] = "Doctype"; + TokenType[TokenType["EndDoctypeTag"] = 15] = "EndDoctypeTag"; + TokenType[TokenType["Content"] = 16] = "Content"; + TokenType[TokenType["Whitespace"] = 17] = "Whitespace"; + TokenType[TokenType["Unknown"] = 18] = "Unknown"; + TokenType[TokenType["Script"] = 19] = "Script"; + TokenType[TokenType["Styles"] = 20] = "Styles"; + TokenType[TokenType["EOS"] = 21] = "EOS"; +})(TokenType || (TokenType = {})); +var ScannerState; +(function (ScannerState) { + ScannerState[ScannerState["WithinContent"] = 0] = "WithinContent"; + ScannerState[ScannerState["AfterOpeningStartTag"] = 1] = "AfterOpeningStartTag"; + ScannerState[ScannerState["AfterOpeningEndTag"] = 2] = "AfterOpeningEndTag"; + ScannerState[ScannerState["WithinDoctype"] = 3] = "WithinDoctype"; + ScannerState[ScannerState["WithinTag"] = 4] = "WithinTag"; + ScannerState[ScannerState["WithinEndTag"] = 5] = "WithinEndTag"; + ScannerState[ScannerState["WithinComment"] = 6] = "WithinComment"; + ScannerState[ScannerState["WithinScriptContent"] = 7] = "WithinScriptContent"; + ScannerState[ScannerState["WithinStyleContent"] = 8] = "WithinStyleContent"; + ScannerState[ScannerState["AfterAttributeName"] = 9] = "AfterAttributeName"; + ScannerState[ScannerState["BeforeAttributeValue"] = 10] = "BeforeAttributeValue"; +})(ScannerState || (ScannerState = {})); +//# sourceMappingURL=htmlLanguageTypes.js.map +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/parser/htmlScanner.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ -/***/ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/beautify/beautify-css.js": -/*!********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/beautify/beautify-css.js ***! - \********************************************************************************************************************/ -/*! exports provided: css_beautify */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "css_beautify", function() { return css_beautify; }); +var htmlScanner_localize = loadMessageBundle(); +var MultiLineStream = /** @class */ (function () { + function MultiLineStream(source, position) { + this.source = source; + this.len = source.length; + this.position = position; + } + MultiLineStream.prototype.eos = function () { + return this.len <= this.position; + }; + MultiLineStream.prototype.getSource = function () { + return this.source; + }; + MultiLineStream.prototype.pos = function () { + return this.position; + }; + MultiLineStream.prototype.goBackTo = function (pos) { + this.position = pos; + }; + MultiLineStream.prototype.goBack = function (n) { + this.position -= n; + }; + MultiLineStream.prototype.advance = function (n) { + this.position += n; + }; + MultiLineStream.prototype.goToEnd = function () { + this.position = this.source.length; + }; + MultiLineStream.prototype.nextChar = function () { + return this.source.charCodeAt(this.position++) || 0; + }; + MultiLineStream.prototype.peekChar = function (n) { + if (n === void 0) { n = 0; } + return this.source.charCodeAt(this.position + n) || 0; + }; + MultiLineStream.prototype.advanceIfChar = function (ch) { + if (ch === this.source.charCodeAt(this.position)) { + this.position++; + return true; + } + return false; + }; + MultiLineStream.prototype.advanceIfChars = function (ch) { + var i; + if (this.position + ch.length > this.source.length) { + return false; + } + for (i = 0; i < ch.length; i++) { + if (this.source.charCodeAt(this.position + i) !== ch[i]) { + return false; + } + } + this.advance(i); + return true; + }; + MultiLineStream.prototype.advanceIfRegExp = function (regex) { + var str = this.source.substr(this.position); + var match = str.match(regex); + if (match) { + this.position = this.position + match.index + match[0].length; + return match[0]; + } + return ''; + }; + MultiLineStream.prototype.advanceUntilRegExp = function (regex) { + var str = this.source.substr(this.position); + var match = str.match(regex); + if (match) { + this.position = this.position + match.index; + return match[0]; + } + else { + this.goToEnd(); + } + return ''; + }; + MultiLineStream.prototype.advanceUntilChar = function (ch) { + while (this.position < this.source.length) { + if (this.source.charCodeAt(this.position) === ch) { + return true; + } + this.advance(1); + } + return false; + }; + MultiLineStream.prototype.advanceUntilChars = function (ch) { + while (this.position + ch.length <= this.source.length) { + var i = 0; + for (; i < ch.length && this.source.charCodeAt(this.position + i) === ch[i]; i++) { + } + if (i === ch.length) { + return true; + } + this.advance(1); + } + this.goToEnd(); + return false; + }; + MultiLineStream.prototype.skipWhitespace = function () { + var n = this.advanceWhileChar(function (ch) { + return ch === _WSP || ch === _TAB || ch === _NWL || ch === _LFD || ch === _CAR; + }); + return n > 0; + }; + MultiLineStream.prototype.advanceWhileChar = function (condition) { + var posNow = this.position; + while (this.position < this.len && condition(this.source.charCodeAt(this.position))) { + this.position++; + } + return this.position - posNow; + }; + return MultiLineStream; +}()); +var _BNG = '!'.charCodeAt(0); +var _MIN = '-'.charCodeAt(0); +var _LAN = '<'.charCodeAt(0); +var _RAN = '>'.charCodeAt(0); +var _FSL = '/'.charCodeAt(0); +var _EQS = '='.charCodeAt(0); +var _DQO = '"'.charCodeAt(0); +var _SQO = '\''.charCodeAt(0); +var _NWL = '\n'.charCodeAt(0); +var _CAR = '\r'.charCodeAt(0); +var _LFD = '\f'.charCodeAt(0); +var _WSP = ' '.charCodeAt(0); +var _TAB = '\t'.charCodeAt(0); +var htmlScriptContents = { + 'text/x-handlebars-template': true +}; +function createScanner(input, initialOffset, initialState) { + if (initialOffset === void 0) { initialOffset = 0; } + if (initialState === void 0) { initialState = ScannerState.WithinContent; } + var stream = new MultiLineStream(input, initialOffset); + var state = initialState; + var tokenOffset = 0; + var tokenType = TokenType.Unknown; + var tokenError; + var hasSpaceAfterTag; + var lastTag; + var lastAttributeName; + var lastTypeValue; + function nextElementName() { + return stream.advanceIfRegExp(/^[_:\w][_:\w-.\d]*/).toLowerCase(); + } + function nextAttributeName() { + return stream.advanceIfRegExp(/^[^\s"'>/=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase(); + } + function finishToken(offset, type, errorMessage) { + tokenType = type; + tokenOffset = offset; + tokenError = errorMessage; + return type; + } + function scan() { + var offset = stream.pos(); + var oldState = state; + var token = internalScan(); + if (token !== TokenType.EOS && offset === stream.pos()) { + console.log('Scanner.scan has not advanced at offset ' + offset + ', state before: ' + oldState + ' after: ' + state); + stream.advance(1); + return finishToken(offset, TokenType.Unknown); + } + return token; + } + function internalScan() { + var offset = stream.pos(); + if (stream.eos()) { + return finishToken(offset, TokenType.EOS); + } + var errorMessage; + switch (state) { + case ScannerState.WithinComment: + if (stream.advanceIfChars([_MIN, _MIN, _RAN])) { // --> + state = ScannerState.WithinContent; + return finishToken(offset, TokenType.EndCommentTag); + } + stream.advanceUntilChars([_MIN, _MIN, _RAN]); // --> + return finishToken(offset, TokenType.Comment); + case ScannerState.WithinDoctype: + if (stream.advanceIfChar(_RAN)) { + state = ScannerState.WithinContent; + return finishToken(offset, TokenType.EndDoctypeTag); + } + stream.advanceUntilChar(_RAN); // > + return finishToken(offset, TokenType.Doctype); + case ScannerState.WithinContent: + if (stream.advanceIfChar(_LAN)) { // < + if (!stream.eos() && stream.peekChar() === _BNG) { // ! + if (stream.advanceIfChars([_BNG, _MIN, _MIN])) { // |<\/?script\s*\/?>?/i); + if (match.length === 0) { + stream.goToEnd(); + return finishToken(offset, TokenType.Script); + } + else if (match === '') { + sciptState = 1; + } + else if (match[1] !== '/') { // 0) { + var indent = options.insertSpaces ? strings_repeat(' ', tabSize * initialIndentLevel) : strings_repeat('\t', initialIndentLevel); + result = result.split('\n').join('\n' + indent); + if (range.start.character === 0) { + result = indent + result; // keep the indent + } + } + return [{ + range: range, + newText: result + }]; } -//# sourceMappingURL=htmlScanner.js.map +function trimLeft(str) { + return str.replace(/^\s+/, ''); +} +function getFormatOption(options, key, dflt) { + if (options && options.hasOwnProperty(key)) { + var value = options[key]; + if (value !== null) { + return value; + } + } + return dflt; +} +function getTagsFormatOption(options, key, dflt) { + var list = getFormatOption(options, key, null); + if (typeof list === 'string') { + if (list.length > 0) { + return list.split(',').map(function (t) { return t.trim().toLowerCase(); }); + } + return []; + } + return dflt; +} +function computeIndentLevel(content, offset, options) { + var i = offset; + var nChars = 0; + var tabSize = options.tabSize || 4; + while (i < content.length) { + var ch = content.charAt(i); + if (ch === ' ') { + nChars++; + } + else if (ch === '\t') { + nChars += tabSize; + } + else { + break; + } + i++; + } + return Math.floor(nChars / tabSize); +} +function getEOL(document) { + var text = document.getText(); + if (document.lineCount > 1) { + var to = document.offsetAt(main_Position.create(1, 0)); + var from = to; + while (from > 0 && isEOL(text, from - 1)) { + from--; + } + return text.substr(from, to - from); + } + return '\n'; +} +function isEOL(text, offset) { + return '\r\n'.indexOf(text.charAt(offset)) !== -1; +} +function isWhitespace(text, offset) { + return ' \t'.indexOf(text.charAt(offset)) !== -1; +} +//# sourceMappingURL=htmlFormatter.js.map +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-uri/index.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ -/***/ }), +var vscode_uri_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var vscode_uri_isWindows; +if (typeof process === 'object') { + vscode_uri_isWindows = process.platform === 'win32'; +} +else if (typeof navigator === 'object') { + var vscode_uri_userAgent = navigator.userAgent; + vscode_uri_isWindows = vscode_uri_userAgent.indexOf('Windows') >= 0; +} +//#endregion +var vscode_uri_schemePattern = /^\w[\w\d+.-]*$/; +var vscode_uri_singleSlashStart = /^\//; +var vscode_uri_doubleSlashStart = /^\/\//; +function vscode_uri_validateUri(ret) { + // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 + // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) + if (ret.scheme && !vscode_uri_schemePattern.test(ret.scheme)) { + throw new Error('[UriError]: Scheme contains illegal characters.'); + } + // path, http://tools.ietf.org/html/rfc3986#section-3.3 + // If a URI contains an authority component, then the path component + // must either be empty or begin with a slash ("/") character. If a URI + // does not contain an authority component, then the path cannot begin + // with two slash characters ("//"). + if (ret.path) { + if (ret.authority) { + if (!vscode_uri_singleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); + } + } + else { + if (vscode_uri_doubleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); + } + } + } +} +// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 +function vscode_uri_referenceResolution(scheme, path) { + // the slash-character is our 'default base' as we don't + // support constructing URIs relative to other URIs. This + // also means that we alter and potentially break paths. + // see https://tools.ietf.org/html/rfc3986#section-5.1.4 + switch (scheme) { + case 'https': + case 'http': + case 'file': + if (!path) { + path = vscode_uri_slash; + } + else if (path[0] !== vscode_uri_slash) { + path = vscode_uri_slash + path; + } + break; + } + return path; +} +var vscode_uri_empty = ''; +var vscode_uri_slash = '/'; +var vscode_uri_regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; +/** + * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. + * This class is a simple parser which creates the basic component parts + * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation + * and encoding. + * + * foo://example.com:8042/over/there?name=ferret#nose + * \_/ \______________/\_________/ \_________/ \__/ + * | | | | | + * scheme authority path query fragment + * | _____________________|__ + * / \ / \ + * urn:example:animal:ferret:nose + */ +var vscode_uri_URI = (function () { + /** + * @internal + */ + function URI(schemeOrData, authority, path, query, fragment) { + if (typeof schemeOrData === 'object') { + this.scheme = schemeOrData.scheme || vscode_uri_empty; + this.authority = schemeOrData.authority || vscode_uri_empty; + this.path = schemeOrData.path || vscode_uri_empty; + this.query = schemeOrData.query || vscode_uri_empty; + this.fragment = schemeOrData.fragment || vscode_uri_empty; + // no validation because it's this URI + // that creates uri components. + // _validateUri(this); + } + else { + this.scheme = schemeOrData || vscode_uri_empty; + this.authority = authority || vscode_uri_empty; + this.path = vscode_uri_referenceResolution(this.scheme, path || vscode_uri_empty); + this.query = query || vscode_uri_empty; + this.fragment = fragment || vscode_uri_empty; + vscode_uri_validateUri(this); + } + } + URI.isUri = function (thing) { + if (thing instanceof URI) { + return true; + } + if (!thing) { + return false; + } + return typeof thing.authority === 'string' + && typeof thing.fragment === 'string' + && typeof thing.path === 'string' + && typeof thing.query === 'string' + && typeof thing.scheme === 'string'; + }; + Object.defineProperty(URI.prototype, "fsPath", { + // ---- filesystem path ----------------------- + /** + * Returns a string representing the corresponding file system path of this URI. + * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the + * platform specific path separator. + * + * * Will *not* validate the path for invalid characters and semantics. + * * Will *not* look at the scheme of this URI. + * * The result shall *not* be used for display purposes but for accessing a file on disk. + * + * + * The *difference* to `URI#path` is the use of the platform specific separator and the handling + * of UNC paths. See the below sample of a file-uri with an authority (UNC path). + * + * ```ts + const u = URI.parse('file://server/c$/folder/file.txt') + u.authority === 'server' + u.path === '/shares/c$/file.txt' + u.fsPath === '\\server\c$\folder\file.txt' + ``` + * + * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, + * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working + * with URIs that represent files on disk (`file` scheme). + */ + get: function () { + // if (this.scheme !== 'file') { + // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); + // } + return vscode_uri_makeFsPath(this); + }, + enumerable: true, + configurable: true + }); + // ---- modify to new ------------------------- + URI.prototype.with = function (change) { + if (!change) { + return this; + } + var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment; + if (scheme === void 0) { + scheme = this.scheme; + } + else if (scheme === null) { + scheme = vscode_uri_empty; + } + if (authority === void 0) { + authority = this.authority; + } + else if (authority === null) { + authority = vscode_uri_empty; + } + if (path === void 0) { + path = this.path; + } + else if (path === null) { + path = vscode_uri_empty; + } + if (query === void 0) { + query = this.query; + } + else if (query === null) { + query = vscode_uri_empty; + } + if (fragment === void 0) { + fragment = this.fragment; + } + else if (fragment === null) { + fragment = vscode_uri_empty; + } + if (scheme === this.scheme + && authority === this.authority + && path === this.path + && query === this.query + && fragment === this.fragment) { + return this; + } + return new _deps_vscode_uri_URI(scheme, authority, path, query, fragment); + }; + // ---- parse & validate ------------------------ + /** + * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, + * `file:///usr/home`, or `scheme:with/path`. + * + * @param value A string which represents an URI (see `URI#toString`). + */ + URI.parse = function (value) { + var match = vscode_uri_regexp.exec(value); + if (!match) { + return new _deps_vscode_uri_URI(vscode_uri_empty, vscode_uri_empty, vscode_uri_empty, vscode_uri_empty, vscode_uri_empty); + } + return new _deps_vscode_uri_URI(match[2] || vscode_uri_empty, decodeURIComponent(match[4] || vscode_uri_empty), decodeURIComponent(match[5] || vscode_uri_empty), decodeURIComponent(match[7] || vscode_uri_empty), decodeURIComponent(match[9] || vscode_uri_empty)); + }; + /** + * Creates a new URI from a file system path, e.g. `c:\my\files`, + * `/usr/home`, or `\\server\share\some\path`. + * + * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument + * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** + * `URI.parse('file://' + path)` because the path might contain characters that are + * interpreted (# and ?). See the following sample: + * ```ts + const good = URI.file('/coding/c#/project1'); + good.scheme === 'file'; + good.path === '/coding/c#/project1'; + good.fragment === ''; -/***/ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlCompletion.js": -/*!**********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlCompletion.js ***! - \**********************************************************************************************************************/ -/*! exports provided: HTMLCompletion */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + const bad = URI.parse('file://' + '/coding/c#/project1'); + bad.scheme === 'file'; + bad.path === '/coding/c'; // path is now broken + bad.fragment === '/project1'; + ``` + * + * @param path A file system path (see `URI#fsPath`) + */ + URI.file = function (path) { + var authority = vscode_uri_empty; + // normalize to fwd-slashes on windows, + // on other systems bwd-slashes are valid + // filename character, eg /f\oo/ba\r.txt + if (vscode_uri_isWindows) { + path = path.replace(/\\/g, vscode_uri_slash); + } + // check for authority as used in UNC shares + // or use the path as given + if (path[0] === vscode_uri_slash && path[1] === vscode_uri_slash) { + var idx = path.indexOf(vscode_uri_slash, 2); + if (idx === -1) { + authority = path.substring(2); + path = vscode_uri_slash; + } + else { + authority = path.substring(2, idx); + path = path.substring(idx) || vscode_uri_slash; + } + } + return new _deps_vscode_uri_URI('file', authority, path, vscode_uri_empty, vscode_uri_empty); + }; + URI.from = function (components) { + return new _deps_vscode_uri_URI(components.scheme, components.authority, components.path, components.query, components.fragment); + }; + // ---- printing/externalize --------------------------- + /** + * Creates a string presentation for this URI. It's guardeed that calling + * `URI.parse` with the result of this function creates an URI which is equal + * to this URI. + * + * * The result shall *not* be used for display purposes but for externalization or transport. + * * The result will be encoded using the percentage encoding and encoding happens mostly + * ignore the scheme-specific encoding rules. + * + * @param skipEncoding Do not encode the result, default is `false` + */ + URI.prototype.toString = function (skipEncoding) { + if (skipEncoding === void 0) { skipEncoding = false; } + return vscode_uri_asFormatted(this, skipEncoding); + }; + URI.prototype.toJSON = function () { + return this; + }; + URI.revive = function (data) { + if (!data) { + return data; + } + else if (data instanceof URI) { + return data; + } + else { + var result = new _deps_vscode_uri_URI(data); + result._fsPath = data.fsPath; + result._formatted = data.external; + return result; + } + }; + return URI; +}()); +/* harmony default export */ var vscode_uri = (vscode_uri_URI); +// tslint:disable-next-line:class-name +var _deps_vscode_uri_URI = (function (_super) { + vscode_uri_extends(_URI, _super); + function _URI() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._formatted = null; + _this._fsPath = null; + return _this; + } + Object.defineProperty(_URI.prototype, "fsPath", { + get: function () { + if (!this._fsPath) { + this._fsPath = vscode_uri_makeFsPath(this); + } + return this._fsPath; + }, + enumerable: true, + configurable: true + }); + _URI.prototype.toString = function (skipEncoding) { + if (skipEncoding === void 0) { skipEncoding = false; } + if (!skipEncoding) { + if (!this._formatted) { + this._formatted = vscode_uri_asFormatted(this, false); + } + return this._formatted; + } + else { + // we don't cache that + return vscode_uri_asFormatted(this, true); + } + }; + _URI.prototype.toJSON = function () { + var res = { + $mid: 1 + }; + // cached state + if (this._fsPath) { + res.fsPath = this._fsPath; + } + if (this._formatted) { + res.external = this._formatted; + } + // uri components + if (this.path) { + res.path = this.path; + } + if (this.scheme) { + res.scheme = this.scheme; + } + if (this.authority) { + res.authority = this.authority; + } + if (this.query) { + res.query = this.query; + } + if (this.fragment) { + res.fragment = this.fragment; + } + return res; + }; + return _URI; +}(vscode_uri_URI)); +// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 +var vscode_uri_encodeTable = (vscode_uri_a = {}, + vscode_uri_a[58 /* Colon */] = '%3A', + vscode_uri_a[47 /* Slash */] = '%2F', + vscode_uri_a[63 /* QuestionMark */] = '%3F', + vscode_uri_a[35 /* Hash */] = '%23', + vscode_uri_a[91 /* OpenSquareBracket */] = '%5B', + vscode_uri_a[93 /* CloseSquareBracket */] = '%5D', + vscode_uri_a[64 /* AtSign */] = '%40', + vscode_uri_a[33 /* ExclamationMark */] = '%21', + vscode_uri_a[36 /* DollarSign */] = '%24', + vscode_uri_a[38 /* Ampersand */] = '%26', + vscode_uri_a[39 /* SingleQuote */] = '%27', + vscode_uri_a[40 /* OpenParen */] = '%28', + vscode_uri_a[41 /* CloseParen */] = '%29', + vscode_uri_a[42 /* Asterisk */] = '%2A', + vscode_uri_a[43 /* Plus */] = '%2B', + vscode_uri_a[44 /* Comma */] = '%2C', + vscode_uri_a[59 /* Semicolon */] = '%3B', + vscode_uri_a[61 /* Equals */] = '%3D', + vscode_uri_a[32 /* Space */] = '%20', + vscode_uri_a); +function vscode_uri_encodeURIComponentFast(uriComponent, allowSlash) { + var res = undefined; + var nativeEncodePos = -1; + for (var pos = 0; pos < uriComponent.length; pos++) { + var code = uriComponent.charCodeAt(pos); + // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 + if ((code >= 97 /* a */ && code <= 122 /* z */) + || (code >= 65 /* A */ && code <= 90 /* Z */) + || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) + || code === 45 /* Dash */ + || code === 46 /* Period */ + || code === 95 /* Underline */ + || code === 126 /* Tilde */ + || (allowSlash && code === 47 /* Slash */)) { + // check if we are delaying native encode + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + // check if we write into a new string (by default we try to return the param) + if (res !== undefined) { + res += uriComponent.charAt(pos); + } + } + else { + // encoding needed, we need to allocate a new string + if (res === undefined) { + res = uriComponent.substr(0, pos); + } + // check with default table first + var escaped = vscode_uri_encodeTable[code]; + if (escaped !== undefined) { + // check if we are delaying native encode + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + // append escaped variant to result + res += escaped; + } + else if (nativeEncodePos === -1) { + // use native encode only when needed + nativeEncodePos = pos; + } + } + } + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); + } + return res !== undefined ? res : uriComponent; +} +function vscode_uri_encodeURIComponentMinimal(path) { + var res = undefined; + for (var pos = 0; pos < path.length; pos++) { + var code = path.charCodeAt(pos); + if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { + if (res === undefined) { + res = path.substr(0, pos); + } + res += vscode_uri_encodeTable[code]; + } + else { + if (res !== undefined) { + res += path[pos]; + } + } + } + return res !== undefined ? res : path; +} +/** + * Compute `fsPath` for the given uri + * @param uri + */ +function vscode_uri_makeFsPath(uri) { + var value; + if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { + // unc path: file://shares/c$/far/boo + value = "//" + uri.authority + uri.path; + } + else if (uri.path.charCodeAt(0) === 47 /* Slash */ + && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) + && uri.path.charCodeAt(2) === 58 /* Colon */) { + // windows drive letter: file:///c:/far/boo + value = uri.path[1].toLowerCase() + uri.path.substr(2); + } + else { + // other path + value = uri.path; + } + if (vscode_uri_isWindows) { + value = value.replace(/\//g, '\\'); + } + return value; +} +/** + * Create the external version of a uri + */ +function vscode_uri_asFormatted(uri, skipEncoding) { + var encoder = !skipEncoding + ? vscode_uri_encodeURIComponentFast + : vscode_uri_encodeURIComponentMinimal; + var res = ''; + var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment; + if (scheme) { + res += scheme; + res += ':'; + } + if (authority || scheme === 'file') { + res += vscode_uri_slash; + res += vscode_uri_slash; + } + if (authority) { + var idx = authority.indexOf('@'); + if (idx !== -1) { + // @ + var userinfo = authority.substr(0, idx); + authority = authority.substr(idx + 1); + idx = userinfo.indexOf(':'); + if (idx === -1) { + res += encoder(userinfo, false); + } + else { + // :@ + res += encoder(userinfo.substr(0, idx), false); + res += ':'; + res += encoder(userinfo.substr(idx + 1), false); + } + res += '@'; + } + authority = authority.toLowerCase(); + idx = authority.indexOf(':'); + if (idx === -1) { + res += encoder(authority, false); + } + else { + // : + res += encoder(authority.substr(0, idx), false); + res += authority.substr(idx); + } + } + if (path) { + // lower-case windows drive letters in /C:/fff or C:/fff + if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { + var code = path.charCodeAt(1); + if (code >= 65 /* A */ && code <= 90 /* Z */) { + path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3 + } + } + else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { + var code = path.charCodeAt(0); + if (code >= 65 /* A */ && code <= 90 /* Z */) { + path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3 + } + } + // encode the rest of the path + res += encoder(path, true); + } + if (query) { + res += '?'; + res += encoder(query, false); + } + if (fragment) { + res += '#'; + res += !skipEncoding ? vscode_uri_encodeURIComponentFast(fragment, false) : fragment; + } + return res; +} +var vscode_uri_a; -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HTMLCompletion", function() { return HTMLCompletion; }); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _parser_htmlScanner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../parser/htmlScanner.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/parser/htmlScanner.js"); -/* harmony import */ var _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../htmlLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/htmlLanguageTypes.js"); -/* harmony import */ var _parser_htmlEntities_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../parser/htmlEntities.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/parser/htmlEntities.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./node_modules/monaco-editor/esm/vs/language/html/fillers/vscode-nls.js"); -/* harmony import */ var _utils_strings_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/strings.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/utils/strings.js"); -/* harmony import */ var _languageFacts_builtinDataProviders_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../languageFacts/builtinDataProviders.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/languageFacts/builtinDataProviders.js"); -/* harmony import */ var _languageFacts_fact_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../languageFacts/fact.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/languageFacts/fact.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlLinks.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -20033,484 +21942,207 @@ __webpack_require__.r(__webpack_exports__); - - - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_4__["loadMessageBundle"](); -var HTMLCompletion = /** @class */ (function () { - function HTMLCompletion() { - this.completionParticipants = []; +function normalizeRef(url, languageId) { + var first = url[0]; + var last = url[url.length - 1]; + if (first === last && (first === '\'' || first === '\"')) { + url = url.substr(1, url.length - 2); } - HTMLCompletion.prototype.setCompletionParticipants = function (registeredCompletionParticipants) { - this.completionParticipants = registeredCompletionParticipants || []; - }; - HTMLCompletion.prototype.doComplete = function (document, position, htmlDocument, settings) { - var result = { - isIncomplete: false, - items: [] - }; - var completionParticipants = this.completionParticipants; - var dataProviders = Object(_languageFacts_builtinDataProviders_js__WEBPACK_IMPORTED_MODULE_6__["getAllDataProviders"])().filter(function (p) { return p.isApplicable(document.languageId) && (!settings || settings[p.getId()] !== false); }); - var text = document.getText(); - var offset = document.offsetAt(position); - var node = htmlDocument.findNodeBefore(offset); - if (!node) { - return result; - } - var scanner = Object(_parser_htmlScanner_js__WEBPACK_IMPORTED_MODULE_1__["createScanner"])(text, node.start); - var currentTag = ''; - var currentAttributeName; - function getReplaceRange(replaceStart, replaceEnd) { - if (replaceEnd === void 0) { replaceEnd = offset; } - if (replaceStart > offset) { - replaceStart = offset; - } - return { start: document.positionAt(replaceStart), end: document.positionAt(replaceEnd) }; - } - function collectOpenTagSuggestions(afterOpenBracket, tagNameEnd) { - var range = getReplaceRange(afterOpenBracket, tagNameEnd); - dataProviders.forEach(function (provider) { - provider.provideTags().forEach(function (tag) { - result.items.push({ - label: tag.name, - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["CompletionItemKind"].Property, - documentation: tag.description, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextEdit"].replace(range, tag.name), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["InsertTextFormat"].PlainText - }); - }); - }); - return result; - } - function getLineIndent(offset) { - var start = offset; - while (start > 0) { - var ch = text.charAt(start - 1); - if ("\n\r".indexOf(ch) >= 0) { - return text.substring(start, offset); - } - if (!isWhiteSpace(ch)) { - return null; - } - start--; - } - return text.substring(0, offset); - } - function collectCloseTagSuggestions(afterOpenBracket, inOpenTag, tagNameEnd) { - if (tagNameEnd === void 0) { tagNameEnd = offset; } - var range = getReplaceRange(afterOpenBracket, tagNameEnd); - var closeTag = isFollowedBy(text, tagNameEnd, _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ScannerState"].WithinEndTag, _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].EndTagClose) ? '' : '>'; - var curr = node; - if (inOpenTag) { - curr = curr.parent; // don't suggest the own tag, it's not yet open - } - while (curr) { - var tag = curr.tag; - if (tag && (!curr.closed || curr.endTagStart && (curr.endTagStart > offset))) { - var item = { - label: '/' + tag, - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["CompletionItemKind"].Property, - filterText: '/' + tag + closeTag, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextEdit"].replace(range, '/' + tag + closeTag), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["InsertTextFormat"].PlainText - }; - var startIndent = getLineIndent(curr.start); - var endIndent = getLineIndent(afterOpenBracket - 1); - if (startIndent !== null && endIndent !== null && startIndent !== endIndent) { - var insertText = startIndent + '', - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["CompletionItemKind"].Property, - filterText: '', - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextEdit"].insert(pos, '$0'), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["InsertTextFormat"].Snippet - }); - } - return result; - } - function collectTagSuggestions(tagStart, tagEnd) { - collectOpenTagSuggestions(tagStart, tagEnd); - collectCloseTagSuggestions(tagStart, true, tagEnd); - return result; - } - function collectAttributeNameSuggestions(nameStart, nameEnd) { - if (nameEnd === void 0) { nameEnd = offset; } - var replaceEnd = offset; - while (replaceEnd < nameEnd && text[replaceEnd] !== '<') { // < is a valid attribute name character, but we rather assume the attribute name ends. See #23236. - replaceEnd++; - } - var range = getReplaceRange(nameStart, replaceEnd); - var value = isFollowedBy(text, nameEnd, _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ScannerState"].AfterAttributeName, _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].DelimiterAssign) ? '' : '="$1"'; - var tag = currentTag.toLowerCase(); - var seenAttributes = Object.create(null); - dataProviders.forEach(function (provider) { - provider.provideAttributes(tag).forEach(function (attr) { - if (seenAttributes[attr.name]) { - return; - } - seenAttributes[attr.name] = true; - var codeSnippet = attr.name; - var command; - if (attr.valueSet !== 'v' && value.length) { - codeSnippet = codeSnippet + value; - if (attr.valueSet) { - command = { - title: 'Suggest', - command: 'editor.action.triggerSuggest' - }; - } - } - result.items.push({ - label: attr.name, - kind: attr.valueSet === 'handler' ? _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["CompletionItemKind"].Function : _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["CompletionItemKind"].Value, - documentation: attr.description, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextEdit"].replace(range, codeSnippet), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["InsertTextFormat"].Snippet, - command: command - }); - }); - }); - collectDataAttributesSuggestions(range, seenAttributes); - return result; - } - function collectDataAttributesSuggestions(range, seenAttributes) { - var dataAttr = 'data-'; - var dataAttributes = {}; - dataAttributes[dataAttr] = dataAttr + "$1=\"$2\""; - function addNodeDataAttributes(node) { - node.attributeNames.forEach(function (attr) { - if (Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_5__["startsWith"])(attr, dataAttr) && !dataAttributes[attr] && !seenAttributes[attr]) { - dataAttributes[attr] = attr + '="$1"'; - } - }); - node.children.forEach(function (child) { return addNodeDataAttributes(child); }); - } - if (htmlDocument) { - htmlDocument.roots.forEach(function (root) { return addNodeDataAttributes(root); }); - } - Object.keys(dataAttributes).forEach(function (attr) { return result.items.push({ - label: attr, - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["CompletionItemKind"].Value, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextEdit"].replace(range, dataAttributes[attr]), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["InsertTextFormat"].Snippet - }); }); - } - function collectAttributeValueSuggestions(valueStart, valueEnd) { - if (valueEnd === void 0) { valueEnd = offset; } - var range; - var addQuotes; - var valuePrefix; - if (offset > valueStart && offset <= valueEnd && isQuote(text[valueStart])) { - // inside quoted attribute - var valueContentStart = valueStart + 1; - var valueContentEnd = valueEnd; - // valueEnd points to the char after quote, which encloses the replace range - if (valueEnd > valueStart && text[valueEnd - 1] === text[valueStart]) { - valueContentEnd--; - } - var wsBefore = getWordStart(text, offset, valueContentStart); - var wsAfter = getWordEnd(text, offset, valueContentEnd); - range = getReplaceRange(wsBefore, wsAfter); - valuePrefix = offset >= valueContentStart && offset <= valueContentEnd ? text.substring(valueContentStart, offset) : ''; - addQuotes = false; - } - else { - range = getReplaceRange(valueStart, valueEnd); - valuePrefix = text.substring(valueStart, offset); - addQuotes = true; - } - var tag = currentTag.toLowerCase(); - var attribute = currentAttributeName.toLowerCase(); - if (completionParticipants.length > 0) { - var fullRange = getReplaceRange(valueStart, valueEnd); - for (var _i = 0, completionParticipants_1 = completionParticipants; _i < completionParticipants_1.length; _i++) { - var participant = completionParticipants_1[_i]; - if (participant.onHtmlAttributeValue) { - participant.onHtmlAttributeValue({ document: document, position: position, tag: tag, attribute: attribute, value: valuePrefix, range: fullRange }); - } - } - } - dataProviders.forEach(function (provider) { - provider.provideValues(tag, attribute).forEach(function (value) { - var insertText = addQuotes ? '"' + value.name + '"' : value.name; - result.items.push({ - label: value.name, - filterText: insertText, - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["CompletionItemKind"].Unit, - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextEdit"].replace(range, insertText), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["InsertTextFormat"].PlainText - }); - }); - }); - collectCharacterEntityProposals(); - return result; - } - function scanNextForEndPos(nextToken) { - if (offset === scanner.getTokenEnd()) { - token = scanner.scan(); - if (token === nextToken && scanner.getTokenOffset() === offset) { - return scanner.getTokenEnd(); - } - } - return offset; - } - function collectInsideContent() { - for (var _i = 0, completionParticipants_2 = completionParticipants; _i < completionParticipants_2.length; _i++) { - var participant = completionParticipants_2[_i]; - if (participant.onHtmlContent) { - participant.onHtmlContent({ document: document, position: position }); - } - } - return collectCharacterEntityProposals(); - } - function collectCharacterEntityProposals() { - // character entities - var k = offset - 1; - var characterStart = position.character; - while (k >= 0 && Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_5__["isLetterOrDigit"])(text, k)) { - k--; - characterStart--; - } - if (k >= 0 && text[k] === '&') { - var range = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Range"].create(_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Position"].create(position.line, characterStart - 1), position); - for (var entity in _parser_htmlEntities_js__WEBPACK_IMPORTED_MODULE_3__["entities"]) { - if (Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_5__["endsWith"])(entity, ';')) { - var label = '&' + entity; - result.items.push({ - label: label, - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["CompletionItemKind"].Keyword, - documentation: localize('entity.propose', "Character entity representing '" + _parser_htmlEntities_js__WEBPACK_IMPORTED_MODULE_3__["entities"][entity] + "'"), - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextEdit"].replace(range, label), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["InsertTextFormat"].PlainText - }); - } - } - } - return result; - } - function suggestDoctype(replaceStart, replaceEnd) { - var range = getReplaceRange(replaceStart, replaceEnd); - result.items.push({ - label: '!DOCTYPE', - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["CompletionItemKind"].Property, - documentation: 'A preamble for an HTML document.', - textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextEdit"].replace(range, '!DOCTYPE html>'), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["InsertTextFormat"].PlainText - }); - } - var token = scanner.scan(); - while (token !== _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].EOS && scanner.getTokenOffset() <= offset) { - switch (token) { - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].StartTagOpen: - if (scanner.getTokenEnd() === offset) { - var endPos = scanNextForEndPos(_htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].StartTag); - if (position.line === 0) { - suggestDoctype(offset, endPos); - } - return collectTagSuggestions(offset, endPos); - } - break; - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].StartTag: - if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { - return collectOpenTagSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); - } - currentTag = scanner.getTokenText(); - break; - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].AttributeName: - if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { - return collectAttributeNameSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); - } - currentAttributeName = scanner.getTokenText(); - break; - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].DelimiterAssign: - if (scanner.getTokenEnd() === offset) { - var endPos = scanNextForEndPos(_htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].AttributeValue); - return collectAttributeValueSuggestions(offset, endPos); - } - break; - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].AttributeValue: - if (scanner.getTokenOffset() <= offset && offset <= scanner.getTokenEnd()) { - return collectAttributeValueSuggestions(scanner.getTokenOffset(), scanner.getTokenEnd()); - } - break; - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].Whitespace: - if (offset <= scanner.getTokenEnd()) { - switch (scanner.getScannerState()) { - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ScannerState"].AfterOpeningStartTag: - var startPos = scanner.getTokenOffset(); - var endTagPos = scanNextForEndPos(_htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].StartTag); - return collectTagSuggestions(startPos, endTagPos); - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ScannerState"].WithinTag: - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ScannerState"].AfterAttributeName: - return collectAttributeNameSuggestions(scanner.getTokenEnd()); - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ScannerState"].BeforeAttributeValue: - return collectAttributeValueSuggestions(scanner.getTokenEnd()); - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ScannerState"].AfterOpeningEndTag: - return collectCloseTagSuggestions(scanner.getTokenOffset() - 1, false); - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ScannerState"].WithinContent: - return collectInsideContent(); - } - } - break; - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].EndTagOpen: - if (offset <= scanner.getTokenEnd()) { - var afterOpenBracket = scanner.getTokenOffset() + 1; - var endOffset = scanNextForEndPos(_htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].EndTag); - return collectCloseTagSuggestions(afterOpenBracket, false, endOffset); - } - break; - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].EndTag: - if (offset <= scanner.getTokenEnd()) { - var start = scanner.getTokenOffset() - 1; - while (start >= 0) { - var ch = text.charAt(start); - if (ch === '/') { - return collectCloseTagSuggestions(start, false, scanner.getTokenEnd()); - } - else if (!isWhiteSpace(ch)) { - break; - } - start--; - } - } - break; - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].StartTagClose: - if (offset <= scanner.getTokenEnd()) { - if (currentTag) { - return collectAutoCloseTagSuggestion(scanner.getTokenEnd(), currentTag); - } - } - break; - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].Content: - if (offset <= scanner.getTokenEnd()) { - return collectInsideContent(); - } - break; - default: - if (offset <= scanner.getTokenEnd()) { - return result; - } - break; - } - token = scanner.scan(); - } - return result; - }; - HTMLCompletion.prototype.doTagComplete = function (document, position, htmlDocument) { - var offset = document.offsetAt(position); - if (offset <= 0) { - return null; - } - var char = document.getText().charAt(offset - 1); - if (char === '>') { - var node = htmlDocument.findNodeBefore(offset); - if (node && node.tag && !Object(_languageFacts_fact_js__WEBPACK_IMPORTED_MODULE_7__["isVoidElement"])(node.tag) && node.start < offset && (!node.endTagStart || node.endTagStart > offset)) { - var scanner = Object(_parser_htmlScanner_js__WEBPACK_IMPORTED_MODULE_1__["createScanner"])(document.getText(), node.start); - var token = scanner.scan(); - while (token !== _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].EOS && scanner.getTokenEnd() <= offset) { - if (token === _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].StartTagClose && scanner.getTokenEnd() === offset) { - return "$0"; - } - token = scanner.scan(); - } - } - } - else if (char === '/') { - var node = htmlDocument.findNodeBefore(offset); - while (node && node.closed) { - node = node.parent; - } - if (node && node.tag) { - var scanner = Object(_parser_htmlScanner_js__WEBPACK_IMPORTED_MODULE_1__["createScanner"])(document.getText(), node.start); - var token = scanner.scan(); - while (token !== _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].EOS && scanner.getTokenEnd() <= offset) { - if (token === _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].EndTagOpen && scanner.getTokenEnd() === offset) { - return node.tag + ">"; - } - token = scanner.scan(); - } - } - } + return url; +} +function validateRef(url, languageId) { + if (!url.length) { + return false; + } + if (languageId === 'handlebars' && /{{.*}}/.test(url)) { + return false; + } + try { + return !!vscode_uri.parse(url); + } + catch (e) { + return false; + } +} +function getWorkspaceUrl(documentUri, tokenContent, documentContext, base) { + if (/^\s*javascript\:/i.test(tokenContent) || /^\s*\#/i.test(tokenContent) || /[\n\r]/.test(tokenContent)) { return null; + } + tokenContent = tokenContent.replace(/^\s*/g, ''); + if (/^https?:\/\//i.test(tokenContent) || /^file:\/\//i.test(tokenContent)) { + // Absolute link that needs no treatment + return tokenContent; + } + if (/^\/\//i.test(tokenContent)) { + // Absolute link (that does not name the protocol) + var pickedScheme = strings_startsWith(documentUri, 'https://') ? 'https' : 'http'; + return pickedScheme + ':' + tokenContent.replace(/^\s*/g, ''); + } + if (documentContext) { + return documentContext.resolveReference(tokenContent, base || documentUri); + } + return tokenContent; +} +function createLink(document, documentContext, attributeValue, startOffset, endOffset, base) { + var tokenContent = normalizeRef(attributeValue, document.languageId); + if (!validateRef(tokenContent, document.languageId)) { + return null; + } + if (tokenContent.length < attributeValue.length) { + startOffset++; + endOffset--; + } + var workspaceUrl = getWorkspaceUrl(document.uri, tokenContent, documentContext, base); + if (!workspaceUrl || !isValidURI(workspaceUrl)) { + return null; + } + return { + range: main_Range.create(document.positionAt(startOffset), document.positionAt(endOffset)), + target: workspaceUrl }; - return HTMLCompletion; -}()); - -function isQuote(s) { - return /^["']*$/.test(s); } -function isWhiteSpace(s) { - return /^\s*$/.test(s); +function isValidURI(uri) { + try { + vscode_uri.parse(uri); + return true; + } + catch (e) { + return false; + } } -function isFollowedBy(s, offset, intialState, expectedToken) { - var scanner = Object(_parser_htmlScanner_js__WEBPACK_IMPORTED_MODULE_1__["createScanner"])(s, offset, intialState); +function findDocumentLinks(document, documentContext) { + var newLinks = []; + var rootAbsoluteUrl = null; + var scanner = createScanner(document.getText(), 0); var token = scanner.scan(); - while (token === _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].Whitespace) { + var afterHrefOrSrc = false; + var afterBase = false; + var base = void 0; + while (token !== TokenType.EOS) { + switch (token) { + case TokenType.StartTag: + if (!base) { + var tagName = scanner.getTokenText().toLowerCase(); + afterBase = tagName === 'base'; + } + break; + case TokenType.AttributeName: + var attributeName = scanner.getTokenText().toLowerCase(); + afterHrefOrSrc = attributeName === 'src' || attributeName === 'href'; + break; + case TokenType.AttributeValue: + if (afterHrefOrSrc) { + var attributeValue = scanner.getTokenText(); + if (!afterBase) { // don't highlight the base link itself + var link = createLink(document, documentContext, attributeValue, scanner.getTokenOffset(), scanner.getTokenEnd(), base); + if (link) { + newLinks.push(link); + } + } + if (afterBase && typeof base === 'undefined') { + base = normalizeRef(attributeValue, document.languageId); + if (base && documentContext) { + base = documentContext.resolveReference(base, document.uri); + } + } + afterBase = false; + afterHrefOrSrc = false; + } + break; + } token = scanner.scan(); } - return token === expectedToken; + return newLinks; } -function getWordStart(s, offset, limit) { - while (offset > limit && !isWhiteSpace(s[offset - 1])) { - offset--; +//# sourceMappingURL=htmlLinks.js.map +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlHighlighting.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + +function findDocumentHighlights(document, position, htmlDocument) { + var offset = document.offsetAt(position); + var node = htmlDocument.findNodeAt(offset); + if (!node.tag) { + return []; } - return offset; -} -function getWordEnd(s, offset, limit) { - while (offset < limit && !isWhiteSpace(s[offset])) { - offset++; + var result = []; + var startTagRange = htmlHighlighting_getTagNameRange(TokenType.StartTag, document, node.start); + var endTagRange = typeof node.endTagStart === 'number' && htmlHighlighting_getTagNameRange(TokenType.EndTag, document, node.endTagStart); + if (startTagRange && covers(startTagRange, position) || endTagRange && covers(endTagRange, position)) { + if (startTagRange) { + result.push({ kind: main_DocumentHighlightKind.Read, range: startTagRange }); + } + if (endTagRange) { + result.push({ kind: main_DocumentHighlightKind.Read, range: endTagRange }); + } } - return offset; + return result; } -//# sourceMappingURL=htmlCompletion.js.map +function isBeforeOrEqual(pos1, pos2) { + return pos1.line < pos2.line || (pos1.line === pos2.line && pos1.character <= pos2.character); +} +function covers(range, position) { + return isBeforeOrEqual(range.start, position) && isBeforeOrEqual(position, range.end); +} +function htmlHighlighting_getTagNameRange(tokenType, document, startOffset) { + var scanner = createScanner(document.getText(), startOffset); + var token = scanner.scan(); + while (token !== TokenType.EOS && token !== tokenType) { + token = scanner.scan(); + } + if (token !== TokenType.EOS) { + return { start: document.positionAt(scanner.getTokenOffset()), end: document.positionAt(scanner.getTokenEnd()) }; + } + return null; +} +//# sourceMappingURL=htmlHighlighting.js.map +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlSymbolsProvider.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlFolding.js": -/*!*******************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlFolding.js ***! - \*******************************************************************************************************************/ -/*! exports provided: getFoldingRanges */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFoldingRanges", function() { return getFoldingRanges; }); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../htmlLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/htmlLanguageTypes.js"); -/* harmony import */ var _parser_htmlScanner_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../parser/htmlScanner.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/parser/htmlScanner.js"); -/* harmony import */ var _languageFacts_fact_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../languageFacts/fact.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/languageFacts/fact.js"); +function findDocumentSymbols(document, htmlDocument) { + var symbols = []; + htmlDocument.roots.forEach(function (node) { + provideFileSymbolsInternal(document, node, '', symbols); + }); + return symbols; +} +function provideFileSymbolsInternal(document, node, container, symbols) { + var name = nodeToName(node); + var location = Location.create(document.uri, main_Range.create(document.positionAt(node.start), document.positionAt(node.end))); + var symbol = { + name: name, + location: location, + containerName: container, + kind: main_SymbolKind.Field + }; + symbols.push(symbol); + node.children.forEach(function (child) { + provideFileSymbolsInternal(document, child, name, symbols); + }); +} +function nodeToName(node) { + var name = node.tag; + if (node.attributes) { + var id = node.attributes['id']; + var classes = node.attributes['class']; + if (id) { + name += "#" + id.replace(/[\"\']/g, ''); + } + if (classes) { + name += classes.replace(/[\"\']/g, '').split(/\s+/).map(function (className) { return "." + className; }).join(''); + } + } + return name || '?'; +} +//# sourceMappingURL=htmlSymbolsProvider.js.map +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlFolding.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -20590,7 +22222,7 @@ function limitRanges(ranges, rangeLimit) { return result; } function getFoldingRanges(document, context) { - var scanner = Object(_parser_htmlScanner_js__WEBPACK_IMPORTED_MODULE_2__["createScanner"])(document.getText()); + var scanner = createScanner(document.getText()); var token = scanner.scan(); var ranges = []; var stack = []; @@ -20600,26 +22232,26 @@ function getFoldingRanges(document, context) { ranges.push(range); prevStart = range.startLine; } - while (token !== _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].EOS) { + while (token !== TokenType.EOS) { switch (token) { - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].StartTag: { + case TokenType.StartTag: { var tagName = scanner.getTokenText(); var startLine = document.positionAt(scanner.getTokenOffset()).line; stack.push({ startLine: startLine, tagName: tagName }); lastTagName = tagName; break; } - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].EndTag: { + case TokenType.EndTag: { lastTagName = scanner.getTokenText(); break; } - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].StartTagClose: - if (!lastTagName || !Object(_languageFacts_fact_js__WEBPACK_IMPORTED_MODULE_3__["isVoidElement"])(lastTagName)) { + case TokenType.StartTagClose: + if (!lastTagName || !isVoidElement(lastTagName)) { break; } // fallthrough - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].EndTagClose: - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].StartTagSelfClose: { + case TokenType.EndTagClose: + case TokenType.StartTagSelfClose: { var i = stack.length - 1; while (i >= 0 && stack[i].tagName !== lastTagName) { i--; @@ -20636,7 +22268,7 @@ function getFoldingRanges(document, context) { } break; } - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_1__["TokenType"].Comment: { + case TokenType.Comment: { var startLine = document.positionAt(scanner.getTokenOffset()).line; var text = scanner.getTokenText(); var m = text.match(/^\s*#(region\b)|(endregion\b)/); @@ -20655,7 +22287,7 @@ function getFoldingRanges(document, context) { var endLine = startLine; startLine = stackElement.startLine; if (endLine > startLine && prevStart !== startLine) { - addRange({ startLine: startLine, endLine: endLine, kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["FoldingRangeKind"].Region }); + addRange({ startLine: startLine, endLine: endLine, kind: FoldingRangeKind.Region }); } } } @@ -20663,7 +22295,7 @@ function getFoldingRanges(document, context) { else { var endLine = document.positionAt(scanner.getTokenOffset() + scanner.getTokenLength()).line; if (startLine < endLine) { - addRange({ startLine: startLine, endLine: endLine, kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["FoldingRangeKind"].Comment }); + addRange({ startLine: startLine, endLine: endLine, kind: FoldingRangeKind.Comment }); } } break; @@ -20678,467 +22310,7 @@ function getFoldingRanges(document, context) { return ranges; } //# sourceMappingURL=htmlFolding.js.map - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlFormatter.js": -/*!*********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlFormatter.js ***! - \*********************************************************************************************************************/ -/*! exports provided: format */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "format", function() { return format; }); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _beautify_beautify_html_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../beautify/beautify-html.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/beautify/beautify-html.js"); -/* harmony import */ var _utils_strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/strings.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/utils/strings.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(document, range, options) { - var value = document.getText(); - var includesEnd = true; - var initialIndentLevel = 0; - var tabSize = options.tabSize || 4; - if (range) { - var startOffset = document.offsetAt(range.start); - // include all leading whitespace iff at the beginning of the line - var extendedStart = startOffset; - while (extendedStart > 0 && isWhitespace(value, extendedStart - 1)) { - extendedStart--; - } - if (extendedStart === 0 || isEOL(value, extendedStart - 1)) { - startOffset = extendedStart; - } - else { - // else keep at least one whitespace - if (extendedStart < startOffset) { - startOffset = extendedStart + 1; - } - } - // include all following whitespace until the end of the line - var endOffset = document.offsetAt(range.end); - var extendedEnd = endOffset; - while (extendedEnd < value.length && isWhitespace(value, extendedEnd)) { - extendedEnd++; - } - if (extendedEnd === value.length || isEOL(value, extendedEnd)) { - endOffset = extendedEnd; - } - range = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Range"].create(document.positionAt(startOffset), document.positionAt(endOffset)); - // Do not modify if substring starts in inside an element - // Ending inside an element is fine as it doesn't cause formatting errors - var firstHalf = value.substring(0, startOffset); - if (new RegExp(/.*[<][^>]*$/).test(firstHalf)) { - //return without modification - value = value.substring(startOffset, endOffset); - return [{ - range: range, - newText: value - }]; - } - includesEnd = endOffset === value.length; - value = value.substring(startOffset, endOffset); - if (startOffset !== 0) { - var startOfLineOffset = document.offsetAt(_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Position"].create(range.start.line, 0)); - initialIndentLevel = computeIndentLevel(document.getText(), startOfLineOffset, options); - } - } - else { - range = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Range"].create(_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Position"].create(0, 0), document.positionAt(value.length)); - } - var htmlOptions = { - indent_size: tabSize, - indent_char: options.insertSpaces ? ' ' : '\t', - wrap_line_length: getFormatOption(options, 'wrapLineLength', 120), - unformatted: getTagsFormatOption(options, 'unformatted', void 0), - content_unformatted: getTagsFormatOption(options, 'contentUnformatted', void 0), - indent_inner_html: getFormatOption(options, 'indentInnerHtml', false), - preserve_newlines: getFormatOption(options, 'preserveNewLines', true), - max_preserve_newlines: getFormatOption(options, 'maxPreserveNewLines', 32786), - indent_handlebars: getFormatOption(options, 'indentHandlebars', false), - end_with_newline: includesEnd && getFormatOption(options, 'endWithNewline', false), - extra_liners: getTagsFormatOption(options, 'extraLiners', void 0), - wrap_attributes: getFormatOption(options, 'wrapAttributes', 'auto'), - wrap_attributes_indent_size: getFormatOption(options, 'wrapAttributesIndentSize', void 0), - eol: '\n' - }; - var result = Object(_beautify_beautify_html_js__WEBPACK_IMPORTED_MODULE_1__["html_beautify"])(trimLeft(value), htmlOptions); - if (initialIndentLevel > 0) { - var indent = options.insertSpaces ? Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_2__["repeat"])(' ', tabSize * initialIndentLevel) : Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_2__["repeat"])('\t', initialIndentLevel); - result = result.split('\n').join('\n' + indent); - if (range.start.character === 0) { - result = indent + result; // keep the indent - } - } - return [{ - range: range, - newText: result - }]; -} -function trimLeft(str) { - return str.replace(/^\s+/, ''); -} -function getFormatOption(options, key, dflt) { - if (options && options.hasOwnProperty(key)) { - var value = options[key]; - if (value !== null) { - return value; - } - } - return dflt; -} -function getTagsFormatOption(options, key, dflt) { - var list = getFormatOption(options, key, null); - if (typeof list === 'string') { - if (list.length > 0) { - return list.split(',').map(function (t) { return t.trim().toLowerCase(); }); - } - return []; - } - return dflt; -} -function computeIndentLevel(content, offset, options) { - var i = offset; - var nChars = 0; - var tabSize = options.tabSize || 4; - while (i < content.length) { - var ch = content.charAt(i); - if (ch === ' ') { - nChars++; - } - else if (ch === '\t') { - nChars += tabSize; - } - else { - break; - } - i++; - } - return Math.floor(nChars / tabSize); -} -function getEOL(document) { - var text = document.getText(); - if (document.lineCount > 1) { - var to = document.offsetAt(_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Position"].create(1, 0)); - var from = to; - while (from > 0 && isEOL(text, from - 1)) { - from--; - } - return text.substr(from, to - from); - } - return '\n'; -} -function isEOL(text, offset) { - return '\r\n'.indexOf(text.charAt(offset)) !== -1; -} -function isWhitespace(text, offset) { - return ' \t'.indexOf(text.charAt(offset)) !== -1; -} -//# sourceMappingURL=htmlFormatter.js.map - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlHighlighting.js": -/*!************************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlHighlighting.js ***! - \************************************************************************************************************************/ -/*! exports provided: findDocumentHighlights */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findDocumentHighlights", function() { return findDocumentHighlights; }); -/* harmony import */ var _parser_htmlScanner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/htmlScanner.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/parser/htmlScanner.js"); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../htmlLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/htmlLanguageTypes.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -function findDocumentHighlights(document, position, htmlDocument) { - var offset = document.offsetAt(position); - var node = htmlDocument.findNodeAt(offset); - if (!node.tag) { - return []; - } - var result = []; - var startTagRange = getTagNameRange(_htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].StartTag, document, node.start); - var endTagRange = typeof node.endTagStart === 'number' && getTagNameRange(_htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].EndTag, document, node.endTagStart); - if (startTagRange && covers(startTagRange, position) || endTagRange && covers(endTagRange, position)) { - if (startTagRange) { - result.push({ kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["DocumentHighlightKind"].Read, range: startTagRange }); - } - if (endTagRange) { - result.push({ kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["DocumentHighlightKind"].Read, range: endTagRange }); - } - } - return result; -} -function isBeforeOrEqual(pos1, pos2) { - return pos1.line < pos2.line || (pos1.line === pos2.line && pos1.character <= pos2.character); -} -function covers(range, position) { - return isBeforeOrEqual(range.start, position) && isBeforeOrEqual(position, range.end); -} -function getTagNameRange(tokenType, document, startOffset) { - var scanner = Object(_parser_htmlScanner_js__WEBPACK_IMPORTED_MODULE_0__["createScanner"])(document.getText(), startOffset); - var token = scanner.scan(); - while (token !== _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].EOS && token !== tokenType) { - token = scanner.scan(); - } - if (token !== _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].EOS) { - return { start: document.positionAt(scanner.getTokenOffset()), end: document.positionAt(scanner.getTokenEnd()) }; - } - return null; -} -//# sourceMappingURL=htmlHighlighting.js.map - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlHover.js": -/*!*****************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlHover.js ***! - \*****************************************************************************************************************/ -/*! exports provided: doHover */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doHover", function() { return doHover; }); -/* harmony import */ var _parser_htmlScanner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/htmlScanner.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/parser/htmlScanner.js"); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../htmlLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/htmlLanguageTypes.js"); -/* harmony import */ var _languageFacts_builtinDataProviders_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../languageFacts/builtinDataProviders.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/languageFacts/builtinDataProviders.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - -function doHover(document, position, htmlDocument) { - var offset = document.offsetAt(position); - var node = htmlDocument.findNodeAt(offset); - if (!node || !node.tag) { - return null; - } - var dataProviders = Object(_languageFacts_builtinDataProviders_js__WEBPACK_IMPORTED_MODULE_3__["getAllDataProviders"])().filter(function (p) { return p.isApplicable(document.languageId); }); - function getTagHover(currTag, range, open) { - currTag = currTag.toLowerCase(); - var _loop_1 = function (provider) { - var hover = null; - provider.provideTags().forEach(function (tag) { - if (tag.name.toLowerCase() === currTag.toLowerCase()) { - var tagLabel = open ? '<' + currTag + '>' : ''; - var tagDescription = tag.description || ''; - hover = { contents: [{ language: 'html', value: tagLabel }, _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["MarkedString"].fromPlainText(tagDescription)], range: range }; - } - }); - if (hover) { - return { value: hover }; - } - }; - for (var _i = 0, dataProviders_1 = dataProviders; _i < dataProviders_1.length; _i++) { - var provider = dataProviders_1[_i]; - var state_1 = _loop_1(provider); - if (typeof state_1 === "object") - return state_1.value; - } - return null; - } - function getTagNameRange(tokenType, startOffset) { - var scanner = Object(_parser_htmlScanner_js__WEBPACK_IMPORTED_MODULE_0__["createScanner"])(document.getText(), startOffset); - var token = scanner.scan(); - while (token !== _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].EOS && (scanner.getTokenEnd() < offset || scanner.getTokenEnd() === offset && token !== tokenType)) { - token = scanner.scan(); - } - if (token === tokenType && offset <= scanner.getTokenEnd()) { - return { start: document.positionAt(scanner.getTokenOffset()), end: document.positionAt(scanner.getTokenEnd()) }; - } - return null; - } - if (node.endTagStart && offset >= node.endTagStart) { - var tagRange_1 = getTagNameRange(_htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].EndTag, node.endTagStart); - if (tagRange_1) { - return getTagHover(node.tag, tagRange_1, false); - } - return null; - } - var tagRange = getTagNameRange(_htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["TokenType"].StartTag, node.start); - if (tagRange) { - return getTagHover(node.tag, tagRange, true); - } - return null; -} -//# sourceMappingURL=htmlHover.js.map - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlLinks.js": -/*!*****************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlLinks.js ***! - \*****************************************************************************************************************/ -/*! exports provided: findDocumentLinks */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findDocumentLinks", function() { return findDocumentLinks; }); -/* harmony import */ var _parser_htmlScanner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/htmlScanner.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/parser/htmlScanner.js"); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _utils_strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/strings.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/utils/strings.js"); -/* harmony import */ var _vscode_uri_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../vscode-uri/index.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-uri/index.js"); -/* harmony import */ var _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../htmlLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/htmlLanguageTypes.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - -function normalizeRef(url, languageId) { - var first = url[0]; - var last = url[url.length - 1]; - if (first === last && (first === '\'' || first === '\"')) { - url = url.substr(1, url.length - 2); - } - return url; -} -function validateRef(url, languageId) { - if (!url.length) { - return false; - } - if (languageId === 'handlebars' && /{{.*}}/.test(url)) { - return false; - } - try { - return !!_vscode_uri_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].parse(url); - } - catch (e) { - return false; - } -} -function getWorkspaceUrl(documentUri, tokenContent, documentContext, base) { - if (/^\s*javascript\:/i.test(tokenContent) || /^\s*\#/i.test(tokenContent) || /[\n\r]/.test(tokenContent)) { - return null; - } - tokenContent = tokenContent.replace(/^\s*/g, ''); - if (/^https?:\/\//i.test(tokenContent) || /^file:\/\//i.test(tokenContent)) { - // Absolute link that needs no treatment - return tokenContent; - } - if (/^\/\//i.test(tokenContent)) { - // Absolute link (that does not name the protocol) - var pickedScheme = _utils_strings_js__WEBPACK_IMPORTED_MODULE_2__["startsWith"](documentUri, 'https://') ? 'https' : 'http'; - return pickedScheme + ':' + tokenContent.replace(/^\s*/g, ''); - } - if (documentContext) { - return documentContext.resolveReference(tokenContent, base || documentUri); - } - return tokenContent; -} -function createLink(document, documentContext, attributeValue, startOffset, endOffset, base) { - var tokenContent = normalizeRef(attributeValue, document.languageId); - if (!validateRef(tokenContent, document.languageId)) { - return null; - } - if (tokenContent.length < attributeValue.length) { - startOffset++; - endOffset--; - } - var workspaceUrl = getWorkspaceUrl(document.uri, tokenContent, documentContext, base); - if (!workspaceUrl || !isValidURI(workspaceUrl)) { - return null; - } - return { - range: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["Range"].create(document.positionAt(startOffset), document.positionAt(endOffset)), - target: workspaceUrl - }; -} -function isValidURI(uri) { - try { - _vscode_uri_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].parse(uri); - return true; - } - catch (e) { - return false; - } -} -function findDocumentLinks(document, documentContext) { - var newLinks = []; - var rootAbsoluteUrl = null; - var scanner = Object(_parser_htmlScanner_js__WEBPACK_IMPORTED_MODULE_0__["createScanner"])(document.getText(), 0); - var token = scanner.scan(); - var afterHrefOrSrc = false; - var afterBase = false; - var base = void 0; - while (token !== _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_4__["TokenType"].EOS) { - switch (token) { - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_4__["TokenType"].StartTag: - if (!base) { - var tagName = scanner.getTokenText().toLowerCase(); - afterBase = tagName === 'base'; - } - break; - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_4__["TokenType"].AttributeName: - var attributeName = scanner.getTokenText().toLowerCase(); - afterHrefOrSrc = attributeName === 'src' || attributeName === 'href'; - break; - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_4__["TokenType"].AttributeValue: - if (afterHrefOrSrc) { - var attributeValue = scanner.getTokenText(); - if (!afterBase) { // don't highlight the base link itself - var link = createLink(document, documentContext, attributeValue, scanner.getTokenOffset(), scanner.getTokenEnd(), base); - if (link) { - newLinks.push(link); - } - } - if (afterBase && typeof base === 'undefined') { - base = normalizeRef(attributeValue, document.languageId); - if (base && documentContext) { - base = documentContext.resolveReference(base, document.uri); - } - } - afterBase = false; - afterHrefOrSrc = false; - } - break; - } - token = scanner.scan(); - } - return newLinks; -} -//# sourceMappingURL=htmlLinks.js.map - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlSelectionRange.js": -/*!**************************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlSelectionRange.js ***! - \**************************************************************************************************************************/ -/*! exports provided: getSelectionRanges */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectionRanges", function() { return getSelectionRanges; }); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _parser_htmlScanner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../parser/htmlScanner.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/parser/htmlScanner.js"); -/* harmony import */ var _parser_htmlParser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../parser/htmlParser.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/parser/htmlParser.js"); -/* harmony import */ var _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../htmlLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/htmlLanguageTypes.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlSelectionRange.js /** * Until SelectionRange lands in LSP, we'll return Range from server and convert it to * SelectionRange on client side @@ -21166,8 +22338,8 @@ function getSelectionRanges(document, positions) { }) .map(function (pair) { return { - range: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Range"].create(document.positionAt(pair[0]), document.positionAt(pair[1])), - kind: _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__["SelectionRangeKind"].Declaration + range: main_Range.create(document.positionAt(pair[0]), document.positionAt(pair[1])), + kind: SelectionRangeKind.Declaration }; }); return ranges; @@ -21175,13 +22347,13 @@ function getSelectionRanges(document, positions) { return positions.map(getSelectionRange); } function getApplicableRanges(document, position) { - var htmlDoc = Object(_parser_htmlParser_js__WEBPACK_IMPORTED_MODULE_2__["parse"])(document.getText()); + var htmlDoc = parse(document.getText()); var currOffset = document.offsetAt(position); var currNode = htmlDoc.findNodeAt(currOffset); var result = getAllParentTagRanges(currNode); // Self-closing or void elements if (currNode.startTagEnd && !currNode.endTagStart) { - var closeRange = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Range"].create(document.positionAt(currNode.startTagEnd - 2), document.positionAt(currNode.startTagEnd)); + var closeRange = main_Range.create(document.positionAt(currNode.startTagEnd - 2), document.positionAt(currNode.startTagEnd)); var closeText = document.getText(closeRange); // Self-closing element if (closeText === '/>') { @@ -21251,13 +22423,13 @@ function getAllParentTagRanges(initialNode) { return result; } function getAttributeLevelRanges(document, currNode, currOffset) { - var currNodeRange = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Range"].create(document.positionAt(currNode.start), document.positionAt(currNode.end)); + var currNodeRange = main_Range.create(document.positionAt(currNode.start), document.positionAt(currNode.end)); var currNodeText = document.getText(currNodeRange); var relativeOffset = currOffset - currNode.start; /** * Tag level semantic selection */ - var scanner = Object(_parser_htmlScanner_js__WEBPACK_IMPORTED_MODULE_1__["createScanner"])(currNodeText); + var scanner = createScanner(currNodeText); var token = scanner.scan(); /** * For text like @@ -21267,9 +22439,9 @@ function getAttributeLevelRanges(document, currNode, currOffset) { var result = []; var isInsideAttribute = false; var attrStart = -1; - while (token !== _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__["TokenType"].EOS) { + while (token !== TokenType.EOS) { switch (token) { - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__["TokenType"].AttributeName: { + case TokenType.AttributeName: { if (relativeOffset < scanner.getTokenOffset()) { isInsideAttribute = false; break; @@ -21282,7 +22454,7 @@ function getAttributeLevelRanges(document, currNode, currOffset) { attrStart = scanner.getTokenOffset(); break; } - case _htmlLanguageTypes_js__WEBPACK_IMPORTED_MODULE_3__["TokenType"].AttributeValue: { + case TokenType.AttributeValue: { if (!isInsideAttribute) { break; } @@ -21314,2330 +22486,55 @@ function getAttributeLevelRanges(document, currNode, currOffset) { }); } //# sourceMappingURL=htmlSelectionRange.js.map - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlSymbolsProvider.js": -/*!***************************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/services/htmlSymbolsProvider.js ***! - \***************************************************************************************************************************/ -/*! exports provided: findDocumentSymbols */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findDocumentSymbols", function() { return findDocumentSymbols; }); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-languageserver-types/main.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/htmlLanguageService.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -function findDocumentSymbols(document, htmlDocument) { - var symbols = []; - htmlDocument.roots.forEach(function (node) { - provideFileSymbolsInternal(document, node, '', symbols); - }); - return symbols; -} -function provideFileSymbolsInternal(document, node, container, symbols) { - var name = nodeToName(node); - var location = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Location"].create(document.uri, _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Range"].create(document.positionAt(node.start), document.positionAt(node.end))); - var symbol = { - name: name, - location: location, - containerName: container, - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["SymbolKind"].Field - }; - symbols.push(symbol); - node.children.forEach(function (child) { - provideFileSymbolsInternal(document, child, name, symbols); - }); -} -function nodeToName(node) { - var name = node.tag; - if (node.attributes) { - var id = node.attributes['id']; - var classes = node.attributes['class']; - if (id) { - name += "#" + id.replace(/[\"\']/g, ''); - } - if (classes) { - name += classes.replace(/[\"\']/g, '').split(/\s+/).map(function (className) { return "." + className; }).join(''); - } + + + + + + + + + + + + + +function getLanguageService(options) { + var htmlCompletion = new htmlCompletion_HTMLCompletion(); + if (options && options.customDataProviders) { + handleCustomDataProviders(options.customDataProviders); } - return name || '?'; + return { + createScanner: createScanner, + parseHTMLDocument: function (document) { return parse(document.getText()); }, + doComplete: htmlCompletion.doComplete.bind(htmlCompletion), + setCompletionParticipants: htmlCompletion.setCompletionParticipants.bind(htmlCompletion), + doHover: doHover, + format: htmlFormatter_format, + findDocumentHighlights: findDocumentHighlights, + findDocumentLinks: findDocumentLinks, + findDocumentSymbols: findDocumentSymbols, + getFoldingRanges: getFoldingRanges, + getSelectionRanges: getSelectionRanges, + doTagComplete: htmlCompletion.doTagComplete.bind(htmlCompletion), + }; } -//# sourceMappingURL=htmlSymbolsProvider.js.map - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/utils/arrays.js": -/*!***********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/utils/arrays.js ***! - \***********************************************************************************************************/ -/*! exports provided: findFirst, binarySearch */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findFirst", function() { return findFirst; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "binarySearch", function() { return binarySearch; }); +function newHTMLDataProvider(id, customData) { + return new HTMLDataProvider(id, customData); +} +//# sourceMappingURL=htmlLanguageService.js.map +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/fillers/polyfills.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -/** - * Takes a sorted array and a function p. The array is sorted in such a way that all elements where p(x) is false - * are located before all elements where p(x) is true. - * @returns the least x for which p(x) is true or array.length if no element fullfills the given function. - */ -function findFirst(array, p) { - var low = 0, high = array.length; - if (high === 0) { - return 0; // no children - } - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (p(array[mid])) { - high = mid; - } - else { - low = mid + 1; - } - } - return low; -} -function binarySearch(array, key, comparator) { - var low = 0, high = array.length - 1; - while (low <= high) { - var mid = ((low + high) / 2) | 0; - var comp = comparator(array[mid], key); - if (comp < 0) { - low = mid + 1; - } - else if (comp > 0) { - high = mid - 1; - } - else { - return mid; - } - } - return -(low + 1); -} -//# sourceMappingURL=arrays.js.map - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/utils/strings.js": -/*!************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/utils/strings.js ***! - \************************************************************************************************************/ -/*! exports provided: startsWith, endsWith, commonPrefixLength, repeat, isLetterOrDigit */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return startsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return endsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonPrefixLength", function() { return commonPrefixLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return repeat; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLetterOrDigit", function() { return isLetterOrDigit; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function startsWith(haystack, needle) { - if (haystack.length < needle.length) { - return false; - } - for (var i = 0; i < needle.length; i++) { - if (haystack[i] !== needle[i]) { - return false; - } - } - return true; -} -/** - * Determines if haystack ends with needle. - */ -function endsWith(haystack, needle) { - var diff = haystack.length - needle.length; - if (diff > 0) { - return haystack.lastIndexOf(needle) === diff; - } - else if (diff === 0) { - return haystack === needle; - } - else { - return false; - } -} -/** - * @returns the length of the common prefix of the two strings. - */ -function commonPrefixLength(a, b) { - var i; - var len = Math.min(a.length, b.length); - for (i = 0; i < len; i++) { - if (a.charCodeAt(i) !== b.charCodeAt(i)) { - return i; - } - } - return len; -} -function repeat(value, count) { - var s = ''; - while (count > 0) { - if ((count & 1) === 1) { - s += value; - } - value += value; - count = count >>> 1; - } - return s; -} -var _a = 'a'.charCodeAt(0); -var _z = 'z'.charCodeAt(0); -var _A = 'A'.charCodeAt(0); -var _Z = 'Z'.charCodeAt(0); -var _0 = '0'.charCodeAt(0); -var _9 = '9'.charCodeAt(0); -function isLetterOrDigit(text, index) { - var c = text.charCodeAt(index); - return (_a <= c && c <= _z) || (_A <= c && c <= _Z) || (_0 <= c && c <= _9); -} -//# sourceMappingURL=strings.js.map - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-languageserver-types/main.js": -/*!***************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-languageserver-types/main.js ***! - \***************************************************************************************************/ -/*! exports provided: Position, Range, Location, LocationLink, Color, ColorInformation, ColorPresentation, FoldingRangeKind, FoldingRange, DiagnosticRelatedInformation, DiagnosticSeverity, Diagnostic, Command, TextEdit, TextDocumentEdit, CreateFile, RenameFile, DeleteFile, WorkspaceEdit, WorkspaceChange, TextDocumentIdentifier, VersionedTextDocumentIdentifier, TextDocumentItem, MarkupKind, MarkupContent, CompletionItemKind, InsertTextFormat, CompletionItem, CompletionList, MarkedString, Hover, ParameterInformation, SignatureInformation, DocumentHighlightKind, DocumentHighlight, SymbolKind, SymbolInformation, DocumentSymbol, CodeActionKind, CodeActionContext, CodeAction, CodeLens, FormattingOptions, DocumentLink, EOL, TextDocument, TextDocumentSaveReason */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Location", function() { return Location; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocationLink", function() { return LocationLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorInformation", function() { return ColorInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPresentation", function() { return ColorPresentation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRangeKind", function() { return FoldingRangeKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRange", function() { return FoldingRange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticRelatedInformation", function() { return DiagnosticRelatedInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticSeverity", function() { return DiagnosticSeverity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Diagnostic", function() { return Diagnostic; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEdit", function() { return TextEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentEdit", function() { return TextDocumentEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CreateFile", function() { return CreateFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenameFile", function() { return RenameFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteFile", function() { return DeleteFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceEdit", function() { return WorkspaceEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceChange", function() { return WorkspaceChange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentIdentifier", function() { return TextDocumentIdentifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VersionedTextDocumentIdentifier", function() { return VersionedTextDocumentIdentifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentItem", function() { return TextDocumentItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupKind", function() { return MarkupKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupContent", function() { return MarkupContent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InsertTextFormat", function() { return InsertTextFormat; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItem", function() { return CompletionItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionList", function() { return CompletionList; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkedString", function() { return MarkedString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hover", function() { return Hover; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParameterInformation", function() { return ParameterInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureInformation", function() { return SignatureInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlight", function() { return DocumentHighlight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolInformation", function() { return SymbolInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentSymbol", function() { return DocumentSymbol; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionKind", function() { return CodeActionKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionContext", function() { return CodeActionContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeAction", function() { return CodeAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeLens", function() { return CodeLens; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattingOptions", function() { return FormattingOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentLink", function() { return DocumentLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EOL", function() { return EOL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocument", function() { return TextDocument; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentSaveReason", function() { return TextDocumentSaveReason; }); -/* -------------------------------------------------------------------------------------------- - * 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 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 = {})); -/** - * 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 = {})); -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 = {})); -/** - * Represents programming constructs like variables, classes, interfaces etc. - * that appear in a document. Document symbols can be hierarchical and they - * have two ranges: one that encloses its definition and one that points to - * its most interesting range, e.g. the range of an identifier. - */ -var DocumentSymbol = /** @class */ (function () { - function DocumentSymbol() { - } - return DocumentSymbol; -}()); - -(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) { - /** - * 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'; -})(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 null) { - 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.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 = {})); -/** - * A document link is a range in a text document that links to an internal or external resource, like another - * text document or a web site. - */ -var DocumentLink = /** @class */ (function () { - function DocumentLink() { - } - return DocumentLink; -}()); - -/** - * The DocumentLink namespace provides helper functions to work with - * [DocumentLink](#DocumentLink) literals. - */ -(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 = {})); -var EOL = ['\n', '\r\n', '\r']; -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 = {})); -/** - * Represents reasons why a text document is saved. - */ -var TextDocumentSaveReason; -(function (TextDocumentSaveReason) { - /** - * Manually triggered, e.g. by the user pressing save, by starting debugging, - * or by an API call. - */ - TextDocumentSaveReason.Manual = 1; - /** - * Automatic after a delay. - */ - TextDocumentSaveReason.AfterDelay = 2; - /** - * When the editor lost focus. - */ - TextDocumentSaveReason.FocusOut = 3; -})(TextDocumentSaveReason || (TextDocumentSaveReason = {})); -var FullTextDocument = /** @class */ (function () { - function FullTextDocument(uri, languageId, version, content) { - this._uri = uri; - this._languageId = languageId; - this._version = version; - this._content = content; - this._lineOffsets = null; - } - 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 = null; - }; - FullTextDocument.prototype.getLineOffsets = function () { - if (this._lineOffsets === null) { - 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 = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-uri/index.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-uri/index.js ***! - \***********************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var isWindows; -if (typeof process === 'object') { - isWindows = process.platform === 'win32'; -} -else if (typeof navigator === 'object') { - var userAgent = navigator.userAgent; - isWindows = userAgent.indexOf('Windows') >= 0; -} -//#endregion -var _schemePattern = /^\w[\w\d+.-]*$/; -var _singleSlashStart = /^\//; -var _doubleSlashStart = /^\/\//; -function _validateUri(ret) { - // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 - // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - if (ret.scheme && !_schemePattern.test(ret.scheme)) { - throw new Error('[UriError]: Scheme contains illegal characters.'); - } - // path, http://tools.ietf.org/html/rfc3986#section-3.3 - // If a URI contains an authority component, then the path component - // must either be empty or begin with a slash ("/") character. If a URI - // does not contain an authority component, then the path cannot begin - // with two slash characters ("//"). - if (ret.path) { - if (ret.authority) { - if (!_singleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); - } - } - else { - if (_doubleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); - } - } - } -} -// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 -function _referenceResolution(scheme, path) { - // the slash-character is our 'default base' as we don't - // support constructing URIs relative to other URIs. This - // also means that we alter and potentially break paths. - // see https://tools.ietf.org/html/rfc3986#section-5.1.4 - switch (scheme) { - case 'https': - case 'http': - case 'file': - if (!path) { - path = _slash; - } - else if (path[0] !== _slash) { - path = _slash + path; - } - break; - } - return path; -} -var _empty = ''; -var _slash = '/'; -var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; -/** - * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. - * This class is a simple parser which creates the basic component parts - * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation - * and encoding. - * - * foo://example.com:8042/over/there?name=ferret#nose - * \_/ \______________/\_________/ \_________/ \__/ - * | | | | | - * scheme authority path query fragment - * | _____________________|__ - * / \ / \ - * urn:example:animal:ferret:nose - */ -var URI = (function () { - /** - * @internal - */ - function URI(schemeOrData, authority, path, query, fragment) { - if (typeof schemeOrData === 'object') { - this.scheme = schemeOrData.scheme || _empty; - this.authority = schemeOrData.authority || _empty; - this.path = schemeOrData.path || _empty; - this.query = schemeOrData.query || _empty; - this.fragment = schemeOrData.fragment || _empty; - // no validation because it's this URI - // that creates uri components. - // _validateUri(this); - } - else { - this.scheme = schemeOrData || _empty; - this.authority = authority || _empty; - this.path = _referenceResolution(this.scheme, path || _empty); - this.query = query || _empty; - this.fragment = fragment || _empty; - _validateUri(this); - } - } - URI.isUri = function (thing) { - if (thing instanceof URI) { - return true; - } - if (!thing) { - return false; - } - return typeof thing.authority === 'string' - && typeof thing.fragment === 'string' - && typeof thing.path === 'string' - && typeof thing.query === 'string' - && typeof thing.scheme === 'string'; - }; - Object.defineProperty(URI.prototype, "fsPath", { - // ---- filesystem path ----------------------- - /** - * Returns a string representing the corresponding file system path of this URI. - * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the - * platform specific path separator. - * - * * Will *not* validate the path for invalid characters and semantics. - * * Will *not* look at the scheme of this URI. - * * The result shall *not* be used for display purposes but for accessing a file on disk. - * - * - * The *difference* to `URI#path` is the use of the platform specific separator and the handling - * of UNC paths. See the below sample of a file-uri with an authority (UNC path). - * - * ```ts - const u = URI.parse('file://server/c$/folder/file.txt') - u.authority === 'server' - u.path === '/shares/c$/file.txt' - u.fsPath === '\\server\c$\folder\file.txt' - ``` - * - * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, - * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working - * with URIs that represent files on disk (`file` scheme). - */ - get: function () { - // if (this.scheme !== 'file') { - // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); - // } - return _makeFsPath(this); - }, - enumerable: true, - configurable: true - }); - // ---- modify to new ------------------------- - URI.prototype.with = function (change) { - if (!change) { - return this; - } - var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment; - if (scheme === void 0) { - scheme = this.scheme; - } - else if (scheme === null) { - scheme = _empty; - } - if (authority === void 0) { - authority = this.authority; - } - else if (authority === null) { - authority = _empty; - } - if (path === void 0) { - path = this.path; - } - else if (path === null) { - path = _empty; - } - if (query === void 0) { - query = this.query; - } - else if (query === null) { - query = _empty; - } - if (fragment === void 0) { - fragment = this.fragment; - } - else if (fragment === null) { - fragment = _empty; - } - if (scheme === this.scheme - && authority === this.authority - && path === this.path - && query === this.query - && fragment === this.fragment) { - return this; - } - return new _URI(scheme, authority, path, query, fragment); - }; - // ---- parse & validate ------------------------ - /** - * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, - * `file:///usr/home`, or `scheme:with/path`. - * - * @param value A string which represents an URI (see `URI#toString`). - */ - URI.parse = function (value) { - var match = _regexp.exec(value); - if (!match) { - return new _URI(_empty, _empty, _empty, _empty, _empty); - } - return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty)); - }; - /** - * Creates a new URI from a file system path, e.g. `c:\my\files`, - * `/usr/home`, or `\\server\share\some\path`. - * - * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument - * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** - * `URI.parse('file://' + path)` because the path might contain characters that are - * interpreted (# and ?). See the following sample: - * ```ts - const good = URI.file('/coding/c#/project1'); - good.scheme === 'file'; - good.path === '/coding/c#/project1'; - good.fragment === ''; - - const bad = URI.parse('file://' + '/coding/c#/project1'); - bad.scheme === 'file'; - bad.path === '/coding/c'; // path is now broken - bad.fragment === '/project1'; - ``` - * - * @param path A file system path (see `URI#fsPath`) - */ - URI.file = function (path) { - var authority = _empty; - // normalize to fwd-slashes on windows, - // on other systems bwd-slashes are valid - // filename character, eg /f\oo/ba\r.txt - if (isWindows) { - path = path.replace(/\\/g, _slash); - } - // check for authority as used in UNC shares - // or use the path as given - if (path[0] === _slash && path[1] === _slash) { - var idx = path.indexOf(_slash, 2); - if (idx === -1) { - authority = path.substring(2); - path = _slash; - } - else { - authority = path.substring(2, idx); - path = path.substring(idx) || _slash; - } - } - return new _URI('file', authority, path, _empty, _empty); - }; - URI.from = function (components) { - return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment); - }; - // ---- printing/externalize --------------------------- - /** - * Creates a string presentation for this URI. It's guardeed that calling - * `URI.parse` with the result of this function creates an URI which is equal - * to this URI. - * - * * The result shall *not* be used for display purposes but for externalization or transport. - * * The result will be encoded using the percentage encoding and encoding happens mostly - * ignore the scheme-specific encoding rules. - * - * @param skipEncoding Do not encode the result, default is `false` - */ - URI.prototype.toString = function (skipEncoding) { - if (skipEncoding === void 0) { skipEncoding = false; } - return _asFormatted(this, skipEncoding); - }; - URI.prototype.toJSON = function () { - return this; - }; - URI.revive = function (data) { - if (!data) { - return data; - } - else if (data instanceof URI) { - return data; - } - else { - var result = new _URI(data); - result._fsPath = data.fsPath; - result._formatted = data.external; - return result; - } - }; - return URI; -}()); -/* harmony default export */ __webpack_exports__["default"] = (URI); -// tslint:disable-next-line:class-name -var _URI = (function (_super) { - __extends(_URI, _super); - function _URI() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._formatted = null; - _this._fsPath = null; - return _this; - } - Object.defineProperty(_URI.prototype, "fsPath", { - get: function () { - if (!this._fsPath) { - this._fsPath = _makeFsPath(this); - } - return this._fsPath; - }, - enumerable: true, - configurable: true - }); - _URI.prototype.toString = function (skipEncoding) { - if (skipEncoding === void 0) { skipEncoding = false; } - if (!skipEncoding) { - if (!this._formatted) { - this._formatted = _asFormatted(this, false); - } - return this._formatted; - } - else { - // we don't cache that - return _asFormatted(this, true); - } - }; - _URI.prototype.toJSON = function () { - var res = { - $mid: 1 - }; - // cached state - if (this._fsPath) { - res.fsPath = this._fsPath; - } - if (this._formatted) { - res.external = this._formatted; - } - // uri components - if (this.path) { - res.path = this.path; - } - if (this.scheme) { - res.scheme = this.scheme; - } - if (this.authority) { - res.authority = this.authority; - } - if (this.query) { - res.query = this.query; - } - if (this.fragment) { - res.fragment = this.fragment; - } - return res; - }; - return _URI; -}(URI)); -// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 -var encodeTable = (_a = {}, - _a[58 /* Colon */] = '%3A', - _a[47 /* Slash */] = '%2F', - _a[63 /* QuestionMark */] = '%3F', - _a[35 /* Hash */] = '%23', - _a[91 /* OpenSquareBracket */] = '%5B', - _a[93 /* CloseSquareBracket */] = '%5D', - _a[64 /* AtSign */] = '%40', - _a[33 /* ExclamationMark */] = '%21', - _a[36 /* DollarSign */] = '%24', - _a[38 /* Ampersand */] = '%26', - _a[39 /* SingleQuote */] = '%27', - _a[40 /* OpenParen */] = '%28', - _a[41 /* CloseParen */] = '%29', - _a[42 /* Asterisk */] = '%2A', - _a[43 /* Plus */] = '%2B', - _a[44 /* Comma */] = '%2C', - _a[59 /* Semicolon */] = '%3B', - _a[61 /* Equals */] = '%3D', - _a[32 /* Space */] = '%20', - _a); -function encodeURIComponentFast(uriComponent, allowSlash) { - var res = undefined; - var nativeEncodePos = -1; - for (var pos = 0; pos < uriComponent.length; pos++) { - var code = uriComponent.charCodeAt(pos); - // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 - if ((code >= 97 /* a */ && code <= 122 /* z */) - || (code >= 65 /* A */ && code <= 90 /* Z */) - || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) - || code === 45 /* Dash */ - || code === 46 /* Period */ - || code === 95 /* Underline */ - || code === 126 /* Tilde */ - || (allowSlash && code === 47 /* Slash */)) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // check if we write into a new string (by default we try to return the param) - if (res !== undefined) { - res += uriComponent.charAt(pos); - } - } - else { - // encoding needed, we need to allocate a new string - if (res === undefined) { - res = uriComponent.substr(0, pos); - } - // check with default table first - var escaped = encodeTable[code]; - if (escaped !== undefined) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // append escaped variant to result - res += escaped; - } - else if (nativeEncodePos === -1) { - // use native encode only when needed - nativeEncodePos = pos; - } - } - } - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); - } - return res !== undefined ? res : uriComponent; -} -function encodeURIComponentMinimal(path) { - var res = undefined; - for (var pos = 0; pos < path.length; pos++) { - var code = path.charCodeAt(pos); - if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { - if (res === undefined) { - res = path.substr(0, pos); - } - res += encodeTable[code]; - } - else { - if (res !== undefined) { - res += path[pos]; - } - } - } - return res !== undefined ? res : path; -} -/** - * Compute `fsPath` for the given uri - * @param uri - */ -function _makeFsPath(uri) { - var value; - if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { - // unc path: file://shares/c$/far/boo - value = "//" + uri.authority + uri.path; - } - else if (uri.path.charCodeAt(0) === 47 /* Slash */ - && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) - && uri.path.charCodeAt(2) === 58 /* Colon */) { - // windows drive letter: file:///c:/far/boo - value = uri.path[1].toLowerCase() + uri.path.substr(2); - } - else { - // other path - value = uri.path; - } - if (isWindows) { - value = value.replace(/\//g, '\\'); - } - return value; -} -/** - * Create the external version of a uri - */ -function _asFormatted(uri, skipEncoding) { - var encoder = !skipEncoding - ? encodeURIComponentFast - : encodeURIComponentMinimal; - var res = ''; - var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment; - if (scheme) { - res += scheme; - res += ':'; - } - if (authority || scheme === 'file') { - res += _slash; - res += _slash; - } - if (authority) { - var idx = authority.indexOf('@'); - if (idx !== -1) { - // @ - var userinfo = authority.substr(0, idx); - authority = authority.substr(idx + 1); - idx = userinfo.indexOf(':'); - if (idx === -1) { - res += encoder(userinfo, false); - } - else { - // :@ - res += encoder(userinfo.substr(0, idx), false); - res += ':'; - res += encoder(userinfo.substr(idx + 1), false); - } - res += '@'; - } - authority = authority.toLowerCase(); - idx = authority.indexOf(':'); - if (idx === -1) { - res += encoder(authority, false); - } - else { - // : - res += encoder(authority.substr(0, idx), false); - res += authority.substr(idx); - } - } - if (path) { - // lower-case windows drive letters in /C:/fff or C:/fff - if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { - var code = path.charCodeAt(1); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3 - } - } - else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { - var code = path.charCodeAt(0); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3 - } - } - // encode the rest of the path - res += encoder(path, true); - } - if (query) { - res += '?'; - res += encoder(query, false); - } - if (fragment) { - res += '#'; - res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; - } - return res; -} -var _a; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/fillers/polyfills.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/fillers/polyfills.js ***! - \******************************************************************************/ -/*! exports provided: polyfill */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "polyfill", function() { return polyfill; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function polyfill() { +function polyfills_polyfill() { // Object.assign, for IE11 if (typeof Object['assign'] != 'function') { Object.defineProperty(Object, "assign", { @@ -23664,96 +22561,7 @@ function polyfill() { } } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/fillers/vscode-nls.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/fillers/vscode-nls.js ***! - \*******************************************************************************/ -/*! exports provided: loadMessageBundle, config */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadMessageBundle", function() { return loadMessageBundle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "config", function() { return config; }); -/*--------------------------------------------------------------------------------------------- - * 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; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/html.worker.js": -/*!************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/html.worker.js ***! - \************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _editor_editor_worker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editor/editor.worker.js */ "./node_modules/monaco-editor/esm/vs/editor/editor.worker.js"); -/* harmony import */ var _htmlWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./htmlWorker.js */ "./node_modules/monaco-editor/esm/vs/language/html/htmlWorker.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -self.onmessage = function () { - // ignore the first message - _editor_editor_worker_js__WEBPACK_IMPORTED_MODULE_0__["initialize"](function (ctx, createData) { - return new _htmlWorker_js__WEBPACK_IMPORTED_MODULE_1__["HTMLWorker"](ctx, createData); - }); -}; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/html/htmlWorker.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/html/htmlWorker.js ***! - \***********************************************************************/ -/*! exports provided: HTMLWorker, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HTMLWorker", function() { return HTMLWorker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _deps_vscode_html_languageservice_htmlLanguageService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_deps/vscode-html-languageservice/htmlLanguageService.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-html-languageservice/htmlLanguageService.js"); -/* harmony import */ var _deps_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_deps/vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/html/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _fillers_polyfills_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fillers/polyfills.js */ "./node_modules/monaco-editor/esm/vs/language/html/fillers/polyfills.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/htmlWorker.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -23762,13 +22570,13 @@ __webpack_require__.r(__webpack_exports__); -_fillers_polyfills_js__WEBPACK_IMPORTED_MODULE_2__["polyfill"](); -var HTMLWorker = /** @class */ (function () { +polyfills_polyfill(); +var htmlWorker_HTMLWorker = /** @class */ (function () { function HTMLWorker(ctx, createData) { this._ctx = ctx; this._languageSettings = createData.languageSettings; this._languageId = createData.languageId; - this._languageService = _deps_vscode_html_languageservice_htmlLanguageService_js__WEBPACK_IMPORTED_MODULE_0__["getLanguageService"](); + this._languageService = getLanguageService(); } HTMLWorker.prototype.doValidation = function (uri) { // not yet suported @@ -23817,7 +22625,7 @@ var HTMLWorker = /** @class */ (function () { for (var _i = 0, models_1 = models; _i < models_1.length; _i++) { var model = models_1[_i]; if (model.uri.toString() === uri) { - return _deps_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["TextDocument"].create(uri, this._languageId, model.version, model.getValue()); + return TextDocument.create(uri, this._languageId, model.version, model.getValue()); } } return null; @@ -23825,12 +22633,26 @@ var HTMLWorker = /** @class */ (function () { return HTMLWorker; }()); -function create(ctx, createData) { - return new HTMLWorker(ctx, createData); +function htmlWorker_create(ctx, createData) { + return new htmlWorker_HTMLWorker(ctx, createData); } +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/html/html.worker.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + +self.onmessage = function () { + // ignore the first message + initialize(function (ctx, createData) { + return new htmlWorker_HTMLWorker(ctx, createData); + }); +}; + /***/ }) -/******/ }); -//# sourceMappingURL=html.worker.js.map \ No newline at end of file +/******/ }); \ No newline at end of file diff --git a/public/static/monaco/json.worker.js b/public/static/monaco/json.worker.js index 21753ed..31aeca2 100644 --- a/public/static/monaco/json.worker.js +++ b/public/static/monaco/json.worker.js @@ -87,40 +87,721 @@ /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./node_modules/monaco-editor/esm/vs/language/json/json.worker.js"); +/******/ return __webpack_require__(__webpack_require__.s = "8Z8O"); /******/ }) /************************************************************************/ /******/ ({ -/***/ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/arrays.js ***! - \*****************************************************************/ -/*! exports provided: tail, tail2, equals, binarySearch, findFirstInSorted, mergeSort, groupBy, coalesce, isFalsyOrEmpty, isNonEmptyArray, distinct, distinctES6, firstIndex, first, flatten, range, arrayInsert, pushToStart, pushToEnd, asArray */ +/***/ "8Z8O": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return tail; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tail2", function() { return tail2; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "binarySearch", function() { return binarySearch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findFirstInSorted", function() { return findFirstInSorted; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeSort", function() { return mergeSort; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return groupBy; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "coalesce", function() { return coalesce; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFalsyOrEmpty", function() { return isFalsyOrEmpty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNonEmptyArray", function() { return isNonEmptyArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return distinct; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctES6", function() { return distinctES6; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstIndex", function() { return firstIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return first; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return flatten; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayInsert", function() { return arrayInsert; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushToStart", function() { return pushToStart; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushToEnd", function() { return pushToEnd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asArray", function() { return asArray; }); + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/errors.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Avoid circular dependency on EventEmitter by implementing a subset of the interface. +var ErrorHandler = /** @class */ (function () { + function ErrorHandler() { + this.listeners = []; + this.unexpectedErrorHandler = function (e) { + setTimeout(function () { + if (e.stack) { + throw new Error(e.message + '\n\n' + e.stack); + } + throw e; + }, 0); + }; + } + ErrorHandler.prototype.emit = function (e) { + this.listeners.forEach(function (listener) { + listener(e); + }); + }; + ErrorHandler.prototype.onUnexpectedError = function (e) { + this.unexpectedErrorHandler(e); + this.emit(e); + }; + // For external errors, we don't want the listeners to be called + ErrorHandler.prototype.onUnexpectedExternalError = function (e) { + this.unexpectedErrorHandler(e); + }; + return ErrorHandler; +}()); + +var errorHandler = new ErrorHandler(); +function onUnexpectedError(e) { + // ignore errors from cancelled promises + if (!isPromiseCanceledError(e)) { + errorHandler.onUnexpectedError(e); + } + return undefined; +} +function onUnexpectedExternalError(e) { + // ignore errors from cancelled promises + if (!isPromiseCanceledError(e)) { + errorHandler.onUnexpectedExternalError(e); + } + return undefined; +} +function transformErrorForSerialization(error) { + if (error instanceof Error) { + var name_1 = error.name, message = error.message; + var stack = error.stacktrace || error.stack; + return { + $isError: true, + name: name_1, + message: message, + stack: stack + }; + } + // return as is + return error; +} +var canceledName = 'Canceled'; +/** + * Checks if the given error is a promise in canceled state + */ +function isPromiseCanceledError(error) { + return error instanceof Error && error.name === canceledName && error.message === canceledName; +} +/** + * Returns an error that signals cancellation. + */ +function canceled() { + var error = new Error(canceledName); + error.name = error.message; + return error; +} +function illegalArgument(name) { + if (name) { + return new Error("Illegal argument: " + name); + } + else { + return new Error('Illegal argument'); + } +} +function illegalState(name) { + if (name) { + return new Error("Illegal state: " + name); + } + else { + return new Error('Illegal state'); + } +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js +function isDisposable(thing) { + return typeof thing.dispose === 'function' + && thing.dispose.length === 0; +} +function lifecycle_dispose(first) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + if (Array.isArray(first)) { + first.forEach(function (d) { return d && d.dispose(); }); + return []; + } + else if (rest.length === 0) { + if (first) { + first.dispose(); + return first; + } + return undefined; + } + else { + lifecycle_dispose(first); + lifecycle_dispose(rest); + return []; + } +} +function combinedDisposable(disposables) { + return { dispose: function () { return lifecycle_dispose(disposables); } }; +} +function toDisposable(fn) { + return { dispose: function () { fn(); } }; +} +var Disposable = /** @class */ (function () { + function Disposable() { + this._toDispose = []; + this._lifecycle_disposable_isDisposed = false; + } + Disposable.prototype.dispose = function () { + this._lifecycle_disposable_isDisposed = true; + this._toDispose = lifecycle_dispose(this._toDispose); + }; + Disposable.prototype._register = function (t) { + if (this._lifecycle_disposable_isDisposed) { + console.warn('Registering disposable on object that has already been disposed.'); + t.dispose(); + } + else { + this._toDispose.push(t); + } + return t; + }; + Disposable.None = Object.freeze({ dispose: function () { } }); + return Disposable; +}()); + +var ImmortalReference = /** @class */ (function () { + function ImmortalReference(object) { + this.object = object; + } + ImmortalReference.prototype.dispose = function () { }; + return ImmortalReference; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/platform.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var LANGUAGE_DEFAULT = 'en'; +var _isWindows = false; +var _isMacintosh = false; +var _isLinux = false; +var _isNative = false; +var _isWeb = false; +var _locale = undefined; +var _language = LANGUAGE_DEFAULT; +var _translationsConfigFile = undefined; +var isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer'); +// OS detection +if (typeof navigator === 'object' && !isElectronRenderer) { + var userAgent = navigator.userAgent; + _isWindows = userAgent.indexOf('Windows') >= 0; + _isMacintosh = userAgent.indexOf('Macintosh') >= 0; + _isLinux = userAgent.indexOf('Linux') >= 0; + _isWeb = true; + _locale = navigator.language; + _language = _locale; +} +else if (typeof process === 'object') { + _isWindows = (process.platform === 'win32'); + _isMacintosh = (process.platform === 'darwin'); + _isLinux = (process.platform === 'linux'); + _locale = LANGUAGE_DEFAULT; + _language = LANGUAGE_DEFAULT; + var rawNlsConfig = process.env['VSCODE_NLS_CONFIG']; + if (rawNlsConfig) { + try { + var nlsConfig = JSON.parse(rawNlsConfig); + var resolved = nlsConfig.availableLanguages['*']; + _locale = nlsConfig.locale; + // VSCode's default language is 'en' + _language = resolved ? resolved : LANGUAGE_DEFAULT; + _translationsConfigFile = nlsConfig._translationsConfigFile; + } + catch (e) { + } + } + _isNative = true; +} +var _platform = 0 /* Web */; +if (_isNative) { + if (_isMacintosh) { + _platform = 1 /* Mac */; + } + else if (_isWindows) { + _platform = 3 /* Windows */; + } + else if (_isLinux) { + _platform = 2 /* Linux */; + } +} +var isWindows = _isWindows; +var isMacintosh = _isMacintosh; +var isLinux = _isLinux; +var isNative = _isNative; +var isWeb = _isWeb; +var _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {}); +var globals = _globals; +var _setImmediate = null; +function setImmediate(callback) { + if (_setImmediate === null) { + if (globals.setImmediate) { + _setImmediate = globals.setImmediate.bind(globals); + } + else if (typeof process !== 'undefined' && typeof process.nextTick === 'function') { + _setImmediate = process.nextTick.bind(process); + } + else { + _setImmediate = globals.setTimeout.bind(globals); + } + } + return _setImmediate(callback); +} +var OS = (_isMacintosh ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */)); + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/types.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var _typeof = { + number: 'number', + string: 'string', + undefined: 'undefined', + object: 'object', + function: 'function' +}; +/** + * @returns whether the provided parameter is a JavaScript Array or not. + */ +function isArray(array) { + if (Array.isArray) { + return Array.isArray(array); + } + if (array && typeof (array.length) === _typeof.number && array.constructor === Array) { + return true; + } + return false; +} +/** + * @returns whether the provided parameter is a JavaScript String or not. + */ +function isString(str) { + if (typeof (str) === _typeof.string || str instanceof String) { + return true; + } + return false; +} +/** + * + * @returns whether the provided parameter is of type `object` but **not** + * `null`, an `array`, a `regexp`, nor a `date`. + */ +function isObject(obj) { + // The method can't do a type cast since there are type (like strings) which + // are subclasses of any put not positvely matched by the function. Hence type + // narrowing results in wrong results. + return typeof obj === _typeof.object + && obj !== null + && !Array.isArray(obj) + && !(obj instanceof RegExp) + && !(obj instanceof Date); +} +/** + * In **contrast** to just checking `typeof` this will return `false` for `NaN`. + * @returns whether the provided parameter is a JavaScript Number or not. + */ +function isNumber(obj) { + if ((typeof (obj) === _typeof.number || obj instanceof Number) && !isNaN(obj)) { + return true; + } + return false; +} +/** + * @returns whether the provided parameter is a JavaScript Boolean or not. + */ +function isBoolean(obj) { + return obj === true || obj === false; +} +/** + * @returns whether the provided parameter is undefined. + */ +function isUndefined(obj) { + return typeof (obj) === _typeof.undefined; +} +/** + * @returns whether the provided parameter is undefined or null. + */ +function isUndefinedOrNull(obj) { + return isUndefined(obj) || obj === null; +} +var types_hasOwnProperty = Object.prototype.hasOwnProperty; +/** + * @returns whether the provided parameter is an empty JavaScript Object or not. + */ +function isEmptyObject(obj) { + if (!isObject(obj)) { + return false; + } + for (var key in obj) { + if (types_hasOwnProperty.call(obj, key)) { + return false; + } + } + return true; +} +/** + * @returns whether the provided parameter is a JavaScript Function or not. + */ +function isFunction(obj) { + return typeof obj === _typeof.function; +} +function validateConstraints(args, constraints) { + var len = Math.min(args.length, constraints.length); + for (var i = 0; i < len; i++) { + validateConstraint(args[i], constraints[i]); + } +} +function validateConstraint(arg, constraint) { + if (isString(constraint)) { + if (typeof arg !== constraint) { + throw new Error("argument does not match constraint: typeof " + constraint); + } + } + else if (isFunction(constraint)) { + try { + if (arg instanceof constraint) { + return; + } + } + catch (_a) { + // ignore + } + if (!isUndefinedOrNull(arg) && arg.constructor === constraint) { + return; + } + if (constraint.length === 1 && constraint.call(undefined, arg) === true) { + return; + } + throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true"); + } +} +function getAllPropertyNames(obj) { + var res = []; + var proto = Object.getPrototypeOf(obj); + while (Object.prototype !== proto) { + res = res.concat(Object.getOwnPropertyNames(proto)); + proto = Object.getPrototypeOf(proto); + } + return res; +} +/** + * Converts null to undefined, passes all other values through. + */ +function withNullAsUndefined(x) { + return x === null ? undefined : x; +} +/** + * Converts undefined to null, passes all other values through. + */ +function withUndefinedAsNull(x) { + return typeof x === 'undefined' ? null : x; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var __extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + +var INITIALIZE = '$initialize'; +var webWorkerWarningLogged = false; +function logOnceWebWorkerWarning(err) { + if (!isWeb) { + // running tests + return; + } + if (!webWorkerWarningLogged) { + webWorkerWarningLogged = true; + console.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq'); + } + console.warn(err.message); +} +var simpleWorker_SimpleWorkerProtocol = /** @class */ (function () { + function SimpleWorkerProtocol(handler) { + this._workerId = -1; + this._handler = handler; + this._lastSentReq = 0; + this._pendingReplies = Object.create(null); + } + SimpleWorkerProtocol.prototype.setWorkerId = function (workerId) { + this._workerId = workerId; + }; + SimpleWorkerProtocol.prototype.sendMessage = function (method, args) { + var _this = this; + var req = String(++this._lastSentReq); + return new Promise(function (resolve, reject) { + _this._pendingReplies[req] = { + resolve: resolve, + reject: reject + }; + _this._send({ + vsWorker: _this._workerId, + req: req, + method: method, + args: args + }); + }); + }; + SimpleWorkerProtocol.prototype.handleMessage = function (serializedMessage) { + var message; + try { + message = JSON.parse(serializedMessage); + } + catch (e) { + // nothing + return; + } + if (!message || !message.vsWorker) { + return; + } + if (this._workerId !== -1 && message.vsWorker !== this._workerId) { + return; + } + this._handleMessage(message); + }; + SimpleWorkerProtocol.prototype._handleMessage = function (msg) { + var _this = this; + if (msg.seq) { + var replyMessage = msg; + if (!this._pendingReplies[replyMessage.seq]) { + console.warn('Got reply to unknown seq'); + return; + } + var reply = this._pendingReplies[replyMessage.seq]; + delete this._pendingReplies[replyMessage.seq]; + if (replyMessage.err) { + var err = replyMessage.err; + if (replyMessage.err.$isError) { + err = new Error(); + err.name = replyMessage.err.name; + err.message = replyMessage.err.message; + err.stack = replyMessage.err.stack; + } + reply.reject(err); + return; + } + reply.resolve(replyMessage.res); + return; + } + var requestMessage = msg; + var req = requestMessage.req; + var result = this._handler.handleMessage(requestMessage.method, requestMessage.args); + result.then(function (r) { + _this._send({ + vsWorker: _this._workerId, + seq: req, + res: r, + err: undefined + }); + }, function (e) { + if (e.detail instanceof Error) { + // Loading errors have a detail property that points to the actual error + e.detail = transformErrorForSerialization(e.detail); + } + _this._send({ + vsWorker: _this._workerId, + seq: req, + res: undefined, + err: transformErrorForSerialization(e) + }); + }); + }; + SimpleWorkerProtocol.prototype._send = function (msg) { + var strMsg = JSON.stringify(msg); + // console.log('SENDING: ' + strMsg); + this._handler.sendMessage(strMsg); + }; + return SimpleWorkerProtocol; +}()); +/** + * Main thread side + */ +var SimpleWorkerClient = /** @class */ (function (_super) { + __extends(SimpleWorkerClient, _super); + function SimpleWorkerClient(workerFactory, moduleId) { + var _this = _super.call(this) || this; + var lazyProxyReject = null; + _this._worker = _this._register(workerFactory.create('vs/base/common/worker/simpleWorker', function (msg) { + _this._protocol.handleMessage(msg); + }, function (err) { + // in Firefox, web workers fail lazily :( + // we will reject the proxy + if (lazyProxyReject) { + lazyProxyReject(err); + } + })); + _this._protocol = new simpleWorker_SimpleWorkerProtocol({ + sendMessage: function (msg) { + _this._worker.postMessage(msg); + }, + handleMessage: function (method, args) { + // Intentionally not supporting worker -> main requests + return Promise.resolve(null); + } + }); + _this._protocol.setWorkerId(_this._worker.getId()); + // Gather loader configuration + var loaderConfiguration = null; + if (typeof self.require !== 'undefined' && typeof self.require.getConfig === 'function') { + // Get the configuration from the Monaco AMD Loader + loaderConfiguration = self.require.getConfig(); + } + else if (typeof self.requirejs !== 'undefined') { + // Get the configuration from requirejs + loaderConfiguration = self.requirejs.s.contexts._.config; + } + // Send initialize message + _this._onModuleLoaded = _this._protocol.sendMessage(INITIALIZE, [ + _this._worker.getId(), + moduleId, + loaderConfiguration + ]); + _this._lazyProxy = new Promise(function (resolve, reject) { + lazyProxyReject = reject; + _this._onModuleLoaded.then(function (availableMethods) { + var proxy = {}; + for (var _i = 0, availableMethods_1 = availableMethods; _i < availableMethods_1.length; _i++) { + var methodName = availableMethods_1[_i]; + proxy[methodName] = createProxyMethod(methodName, proxyMethodRequest); + } + resolve(proxy); + }, function (e) { + reject(e); + _this._onError('Worker failed to load ' + moduleId, e); + }); + }); + // Create proxy to loaded code + var proxyMethodRequest = function (method, args) { + return _this._request(method, args); + }; + var createProxyMethod = function (method, proxyMethodRequest) { + return function () { + var args = Array.prototype.slice.call(arguments, 0); + return proxyMethodRequest(method, args); + }; + }; + return _this; + } + SimpleWorkerClient.prototype.getProxyObject = function () { + return this._lazyProxy; + }; + SimpleWorkerClient.prototype._request = function (method, args) { + var _this = this; + return new Promise(function (resolve, reject) { + _this._onModuleLoaded.then(function () { + _this._protocol.sendMessage(method, args).then(resolve, reject); + }, reject); + }); + }; + SimpleWorkerClient.prototype._onError = function (message, error) { + console.error(message); + console.info(error); + }; + return SimpleWorkerClient; +}(Disposable)); + +/** + * Worker side + */ +var simpleWorker_SimpleWorkerServer = /** @class */ (function () { + function SimpleWorkerServer(postSerializedMessage, requestHandler) { + var _this = this; + this._requestHandler = requestHandler; + this._protocol = new simpleWorker_SimpleWorkerProtocol({ + sendMessage: function (msg) { + postSerializedMessage(msg); + }, + handleMessage: function (method, args) { return _this._handleMessage(method, args); } + }); + } + SimpleWorkerServer.prototype.onmessage = function (msg) { + this._protocol.handleMessage(msg); + }; + SimpleWorkerServer.prototype._handleMessage = function (method, args) { + if (method === INITIALIZE) { + return this.initialize(args[0], args[1], args[2]); + } + if (!this._requestHandler || typeof this._requestHandler[method] !== 'function') { + return Promise.reject(new Error('Missing requestHandler or method: ' + method)); + } + try { + return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args)); + } + catch (e) { + return Promise.reject(e); + } + }; + SimpleWorkerServer.prototype.initialize = function (workerId, moduleId, loaderConfig) { + var _this = this; + this._protocol.setWorkerId(workerId); + if (this._requestHandler) { + // static request handler + var methods = []; + for (var _i = 0, _a = getAllPropertyNames(this._requestHandler); _i < _a.length; _i++) { + var prop = _a[_i]; + if (typeof this._requestHandler[prop] === 'function') { + methods.push(prop); + } + } + return Promise.resolve(methods); + } + if (loaderConfig) { + // Remove 'baseUrl', handling it is beyond scope for now + if (typeof loaderConfig.baseUrl !== 'undefined') { + delete loaderConfig['baseUrl']; + } + if (typeof loaderConfig.paths !== 'undefined') { + if (typeof loaderConfig.paths.vs !== 'undefined') { + delete loaderConfig.paths['vs']; + } + } + // Since this is in a web worker, enable catching errors + loaderConfig.catchError = true; + self.require.config(loaderConfig); + } + return new Promise(function (resolve, reject) { + // Use the global require to be sure to get the global config + self.require([moduleId], function () { + var result = []; + for (var _i = 0; _i < arguments.length; _i++) { + result[_i] = arguments[_i]; + } + var handlerModule = result[0]; + _this._requestHandler = handlerModule.create(); + if (!_this._requestHandler) { + reject(new Error("No RequestHandler!")); + return; + } + var methods = []; + for (var _a = 0, _b = getAllPropertyNames(_this._requestHandler); _a < _b.length; _a++) { + var prop = _b[_a]; + if (typeof _this._requestHandler[prop] === 'function') { + methods.push(prop); + } + } + resolve(methods); + }, reject); + }); + }; + return SimpleWorkerServer; +}()); + +/** + * Called on the worker side + */ +function create(postMessage) { + return new simpleWorker_SimpleWorkerServer(postMessage, null); +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/arrays.js /** * Returns the last element of an array. * @param array The array. @@ -323,7 +1004,7 @@ function flatten(arr) { var _a; return (_a = []).concat.apply(_a, arr); } -function range(arg, to) { +function arrays_range(arg, to) { var from = typeof to === 'number' ? arg : 0; if (typeof to === 'number') { from = arg; @@ -378,161 +1059,43 @@ function asArray(x) { return Array.isArray(x) ? x : [x]; } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/cancellation.js ***! - \***********************************************************************/ -/*! exports provided: CancellationToken, CancellationTokenSource */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationToken", function() { return CancellationToken; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationTokenSource", function() { return CancellationTokenSource; }); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -var shortcutEvent = Object.freeze(function (callback, context) { - var handle = setTimeout(callback.bind(context), 0); - return { dispose: function () { clearTimeout(handle); } }; -}); -var CancellationToken; -(function (CancellationToken) { - function isCancellationToken(thing) { - if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) { - return true; - } - if (thing instanceof MutableToken) { - return true; - } - if (!thing || typeof thing !== 'object') { - return false; - } - return typeof thing.isCancellationRequested === 'boolean' - && typeof thing.onCancellationRequested === 'function'; +/** + * Represents information about a specific difference between two sequences. + */ +var DiffChange = /** @class */ (function () { + /** + * Constructs a new DiffChange with the given sequence information + * and content. + */ + function DiffChange(originalStart, originalLength, modifiedStart, modifiedLength) { + //Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0"); + this.originalStart = originalStart; + this.originalLength = originalLength; + this.modifiedStart = modifiedStart; + this.modifiedLength = modifiedLength; } - CancellationToken.isCancellationToken = isCancellationToken; - CancellationToken.None = Object.freeze({ - isCancellationRequested: false, - onCancellationRequested: _event_js__WEBPACK_IMPORTED_MODULE_0__["Event"].None - }); - CancellationToken.Cancelled = Object.freeze({ - isCancellationRequested: true, - onCancellationRequested: shortcutEvent - }); -})(CancellationToken || (CancellationToken = {})); -var MutableToken = /** @class */ (function () { - function MutableToken() { - this._isCancelled = false; - this._emitter = null; - } - MutableToken.prototype.cancel = function () { - if (!this._isCancelled) { - this._isCancelled = true; - if (this._emitter) { - this._emitter.fire(undefined); - this.dispose(); - } - } + /** + * The end point (exclusive) of the change in the original sequence. + */ + DiffChange.prototype.getOriginalEnd = function () { + return this.originalStart + this.originalLength; }; - Object.defineProperty(MutableToken.prototype, "isCancellationRequested", { - get: function () { - return this._isCancelled; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(MutableToken.prototype, "onCancellationRequested", { - get: function () { - if (this._isCancelled) { - return shortcutEvent; - } - if (!this._emitter) { - this._emitter = new _event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - } - return this._emitter.event; - }, - enumerable: true, - configurable: true - }); - MutableToken.prototype.dispose = function () { - if (this._emitter) { - this._emitter.dispose(); - this._emitter = null; - } + /** + * The end point (exclusive) of the change in the modified sequence. + */ + DiffChange.prototype.getModifiedEnd = function () { + return this.modifiedStart + this.modifiedLength; }; - return MutableToken; -}()); -var CancellationTokenSource = /** @class */ (function () { - function CancellationTokenSource(parent) { - this._token = undefined; - this._parentListener = undefined; - this._parentListener = parent && parent.onCancellationRequested(this.cancel, this); - } - Object.defineProperty(CancellationTokenSource.prototype, "token", { - get: function () { - if (!this._token) { - // be lazy and create the token only when - // actually needed - this._token = new MutableToken(); - } - return this._token; - }, - enumerable: true, - configurable: true - }); - CancellationTokenSource.prototype.cancel = function () { - if (!this._token) { - // save an object by returning the default - // cancelled token when cancellation happens - // before someone asks for the token - this._token = CancellationToken.Cancelled; - } - else if (this._token instanceof MutableToken) { - // actually cancel - this._token.cancel(); - } - }; - CancellationTokenSource.prototype.dispose = function () { - if (this._parentListener) { - this._parentListener.dispose(); - } - if (!this._token) { - // ensure to initialize with an empty token if we had none - this._token = CancellationToken.None; - } - else if (this._token instanceof MutableToken) { - // actually dispose - this._token.dispose(); - } - }; - return CancellationTokenSource; + return DiffChange; }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js ***! - \********************************************************************/ -/*! exports provided: stringDiff, Debug, MyArray, LcsDiff */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringDiff", function() { return stringDiff; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Debug", function() { return Debug; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MyArray", function() { return MyArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LcsDiff", function() { return LcsDiff; }); -/* harmony import */ var _diffChange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diffChange.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -545,7 +1108,7 @@ function createStringSequence(a) { }; } function stringDiff(original, modified, pretty) { - return new LcsDiff(createStringSequence(original), createStringSequence(modified)).ComputeDiff(pretty); + return new diff_LcsDiff(createStringSequence(original), createStringSequence(modified)).ComputeDiff(pretty); } // // The code below has been ported from a C# implementation in VS @@ -608,7 +1171,7 @@ var MaxDifferencesHistory = 1447; * distinct changes. At the end, the Changes property can be called to retrieve * the constructed changes. */ -var DiffChangeHelper = /** @class */ (function () { +var diff_DiffChangeHelper = /** @class */ (function () { /** * Constructs a new DiffChangeHelper for the given DiffSequences. */ @@ -626,7 +1189,7 @@ var DiffChangeHelper = /** @class */ (function () { // Only add to the list if there is something to add if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { // Add the new change to our list - this.m_changes.push(new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)); + this.m_changes.push(new DiffChange(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)); } // Reset for the next change this.m_originalCount = 0; @@ -687,7 +1250,7 @@ var DiffChangeHelper = /** @class */ (function () { * An implementation of the difference algorithm described in * "An O(ND) Difference Algorithm and its variations" by Eugene W. Myers */ -var LcsDiff = /** @class */ (function () { +var diff_LcsDiff = /** @class */ (function () { /** * Constructs the DiffFinder */ @@ -751,14 +1314,14 @@ var LcsDiff = /** @class */ (function () { Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd'); // All insertions changes = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1) + new DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1) ]; } else if (originalStart <= originalEnd) { Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd'); // All deletions changes = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, 0) + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0) ]; } else { @@ -793,20 +1356,20 @@ var LcsDiff = /** @class */ (function () { // We did't have time to finish the first half, so we don't have time to compute this half. // Consider the entire rest of the sequence different. rightChanges = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1) + new DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1) ]; } return this.ConcatenateChanges(leftChanges, rightChanges); } // If we hit here, we quit early, and so can't return anything meaningful return [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) ]; }; LcsDiff.prototype.WALKTRACE = function (diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) { var forwardChanges = null, reverseChanges = null; // First, walk backward through the forward diagonals history - var changeHelper = new DiffChangeHelper(); + var changeHelper = new diff_DiffChangeHelper(); var diagonalMin = diagonalForwardStart; var diagonalMax = diagonalForwardEnd; var diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalForwardOffset; @@ -860,12 +1423,12 @@ var LcsDiff = /** @class */ (function () { modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd()); } reverseChanges = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1) + new DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1) ]; } else { // Now walk backward through the reverse diagonals history - changeHelper = new DiffChangeHelper(); + changeHelper = new diff_DiffChangeHelper(); diagonalMin = diagonalReverseStart; diagonalMax = diagonalReverseEnd; diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalReverseOffset; @@ -1048,7 +1611,7 @@ var LcsDiff = /** @class */ (function () { originalStart++; modifiedStart++; return [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) ]; } } @@ -1279,7 +1842,7 @@ var LcsDiff = /** @class */ (function () { if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) { modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart; } - mergedChangeArr[0] = new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalLength, modifiedStart, modifiedLength); + mergedChangeArr[0] = new DiffChange(originalStart, originalLength, modifiedStart, modifiedLength); return true; } else { @@ -1322,952 +1885,12 @@ var LcsDiff = /** @class */ (function () { }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js ***! - \**************************************************************************/ -/*! exports provided: DiffChange */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffChange", function() { return DiffChange; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/iterator.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -/** - * Represents information about a specific difference between two sequences. - */ -var DiffChange = /** @class */ (function () { - /** - * Constructs a new DiffChange with the given sequence information - * and content. - */ - function DiffChange(originalStart, originalLength, modifiedStart, modifiedLength) { - //Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0"); - this.originalStart = originalStart; - this.originalLength = originalLength; - this.modifiedStart = modifiedStart; - this.modifiedLength = modifiedLength; - } - /** - * The end point (exclusive) of the change in the original sequence. - */ - DiffChange.prototype.getOriginalEnd = function () { - return this.originalStart + this.originalLength; - }; - /** - * The end point (exclusive) of the change in the modified sequence. - */ - DiffChange.prototype.getModifiedEnd = function () { - return this.modifiedStart + this.modifiedLength; - }; - return DiffChange; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/errors.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/errors.js ***! - \*****************************************************************/ -/*! exports provided: ErrorHandler, errorHandler, onUnexpectedError, onUnexpectedExternalError, transformErrorForSerialization, isPromiseCanceledError, canceled, illegalArgument, illegalState */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorHandler", function() { return ErrorHandler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "errorHandler", function() { return errorHandler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedError", function() { return onUnexpectedError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedExternalError", function() { return onUnexpectedExternalError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformErrorForSerialization", function() { return transformErrorForSerialization; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPromiseCanceledError", function() { return isPromiseCanceledError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canceled", function() { return canceled; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalArgument", function() { return illegalArgument; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalState", function() { return illegalState; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -// Avoid circular dependency on EventEmitter by implementing a subset of the interface. -var ErrorHandler = /** @class */ (function () { - function ErrorHandler() { - this.listeners = []; - this.unexpectedErrorHandler = function (e) { - setTimeout(function () { - if (e.stack) { - throw new Error(e.message + '\n\n' + e.stack); - } - throw e; - }, 0); - }; - } - ErrorHandler.prototype.emit = function (e) { - this.listeners.forEach(function (listener) { - listener(e); - }); - }; - ErrorHandler.prototype.onUnexpectedError = function (e) { - this.unexpectedErrorHandler(e); - this.emit(e); - }; - // For external errors, we don't want the listeners to be called - ErrorHandler.prototype.onUnexpectedExternalError = function (e) { - this.unexpectedErrorHandler(e); - }; - return ErrorHandler; -}()); - -var errorHandler = new ErrorHandler(); -function onUnexpectedError(e) { - // ignore errors from cancelled promises - if (!isPromiseCanceledError(e)) { - errorHandler.onUnexpectedError(e); - } - return undefined; -} -function onUnexpectedExternalError(e) { - // ignore errors from cancelled promises - if (!isPromiseCanceledError(e)) { - errorHandler.onUnexpectedExternalError(e); - } - return undefined; -} -function transformErrorForSerialization(error) { - if (error instanceof Error) { - var name_1 = error.name, message = error.message; - var stack = error.stacktrace || error.stack; - return { - $isError: true, - name: name_1, - message: message, - stack: stack - }; - } - // return as is - return error; -} -var canceledName = 'Canceled'; -/** - * Checks if the given error is a promise in canceled state - */ -function isPromiseCanceledError(error) { - return error instanceof Error && error.name === canceledName && error.message === canceledName; -} -/** - * Returns an error that signals cancellation. - */ -function canceled() { - var error = new Error(canceledName); - error.name = error.message; - return error; -} -function illegalArgument(name) { - if (name) { - return new Error("Illegal argument: " + name); - } - else { - return new Error('Illegal argument'); - } -} -function illegalState(name) { - if (name) { - return new Error("Illegal state: " + name); - } - else { - return new Error('Illegal state'); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/event.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/event.js ***! - \****************************************************************/ -/*! exports provided: Event, Emitter, PauseableEmitter, EventMultiplexer, EventBufferer, Relay */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Event", function() { return Event; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Emitter", function() { return Emitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PauseableEmitter", function() { return PauseableEmitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventMultiplexer", function() { return EventMultiplexer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventBufferer", function() { return EventBufferer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Relay", function() { return Relay; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _functional_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functional.js */ "./node_modules/monaco-editor/esm/vs/base/common/functional.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _linkedList_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./linkedList.js */ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -var Event; -(function (Event) { - var _disposable = { dispose: function () { } }; - Event.None = function () { return _disposable; }; - /** - * Given an event, returns another event which only fires once. - */ - function once(event) { - return function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - // we need this, in case the event fires during the listener call - var didFire = false; - var result; - result = event(function (e) { - if (didFire) { - return; - } - else if (result) { - result.dispose(); - } - else { - didFire = true; - } - return listener.call(thisArgs, e); - }, null, disposables); - if (didFire) { - result.dispose(); - } - return result; - }; - } - Event.once = once; - /** - * Given an event and a `map` function, returns another event which maps each element - * throught the mapping function. - */ - function map(event, map) { - return snapshot(function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return event(function (i) { return listener.call(thisArgs, map(i)); }, null, disposables); - }); - } - Event.map = map; - /** - * Given an event and an `each` function, returns another identical event and calls - * the `each` function per each element. - */ - function forEach(event, each) { - return snapshot(function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return event(function (i) { each(i); listener.call(thisArgs, i); }, null, disposables); - }); - } - Event.forEach = forEach; - function filter(event, filter) { - return snapshot(function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return event(function (e) { return filter(e) && listener.call(thisArgs, e); }, null, disposables); - }); - } - Event.filter = filter; - /** - * Given an event, returns the same event but typed as `Event`. - */ - function signal(event) { - return event; - } - Event.signal = signal; - /** - * Given a collection of events, returns a single event which emits - * whenever any of the provided events emit. - */ - function any() { - var events = []; - for (var _i = 0; _i < arguments.length; _i++) { - events[_i] = arguments[_i]; - } - return function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return Object(_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["combinedDisposable"])(events.map(function (event) { return event(function (e) { return listener.call(thisArgs, e); }, null, disposables); })); - }; - } - Event.any = any; - /** - * Given an event and a `merge` function, returns another event which maps each element - * and the cummulative result throught the `merge` function. Similar to `map`, but with memory. - */ - function reduce(event, merge, initial) { - var output = initial; - return map(event, function (e) { - output = merge(output, e); - return output; - }); - } - Event.reduce = reduce; - /** - * Given a chain of event processing functions (filter, map, etc), each - * function will be invoked per event & per listener. Snapshotting an event - * chain allows each function to be invoked just once per event. - */ - function snapshot(event) { - var listener; - var emitter = new Emitter({ - onFirstListenerAdd: function () { - listener = event(emitter.fire, emitter); - }, - onLastListenerRemove: function () { - listener.dispose(); - } - }); - return emitter.event; - } - Event.snapshot = snapshot; - function debounce(event, merge, delay, leading, leakWarningThreshold) { - if (delay === void 0) { delay = 100; } - if (leading === void 0) { leading = false; } - var subscription; - var output = undefined; - var handle = undefined; - var numDebouncedCalls = 0; - var emitter = new Emitter({ - leakWarningThreshold: leakWarningThreshold, - onFirstListenerAdd: function () { - subscription = event(function (cur) { - numDebouncedCalls++; - output = merge(output, cur); - if (leading && !handle) { - emitter.fire(output); - } - clearTimeout(handle); - handle = setTimeout(function () { - var _output = output; - output = undefined; - handle = undefined; - if (!leading || numDebouncedCalls > 1) { - emitter.fire(_output); - } - numDebouncedCalls = 0; - }, delay); - }); - }, - onLastListenerRemove: function () { - subscription.dispose(); - } - }); - return emitter.event; - } - Event.debounce = debounce; - /** - * Given an event, it returns another event which fires only once and as soon as - * the input event emits. The event data is the number of millis it took for the - * event to fire. - */ - function stopwatch(event) { - var start = new Date().getTime(); - return map(once(event), function (_) { return new Date().getTime() - start; }); - } - Event.stopwatch = stopwatch; - /** - * Given an event, it returns another event which fires only when the event - * element changes. - */ - function latch(event) { - var firstCall = true; - var cache; - return filter(event, function (value) { - var shouldEmit = firstCall || value !== cache; - firstCall = false; - cache = value; - return shouldEmit; - }); - } - Event.latch = latch; - /** - * Buffers the provided event until a first listener comes - * along, at which point fire all the events at once and - * pipe the event from then on. - * - * ```typescript - * const emitter = new Emitter(); - * const event = emitter.event; - * const bufferedEvent = buffer(event); - * - * emitter.fire(1); - * emitter.fire(2); - * emitter.fire(3); - * // nothing... - * - * const listener = bufferedEvent(num => console.log(num)); - * // 1, 2, 3 - * - * emitter.fire(4); - * // 4 - * ``` - */ - function buffer(event, nextTick, _buffer) { - if (nextTick === void 0) { nextTick = false; } - if (_buffer === void 0) { _buffer = []; } - var buffer = _buffer.slice(); - var listener = event(function (e) { - if (buffer) { - buffer.push(e); - } - else { - emitter.fire(e); - } - }); - var flush = function () { - if (buffer) { - buffer.forEach(function (e) { return emitter.fire(e); }); - } - buffer = null; - }; - var emitter = new Emitter({ - onFirstListenerAdd: function () { - if (!listener) { - listener = event(function (e) { return emitter.fire(e); }); - } - }, - onFirstListenerDidAdd: function () { - if (buffer) { - if (nextTick) { - setTimeout(flush); - } - else { - flush(); - } - } - }, - onLastListenerRemove: function () { - if (listener) { - listener.dispose(); - } - listener = null; - } - }); - return emitter.event; - } - Event.buffer = buffer; - var ChainableEvent = /** @class */ (function () { - function ChainableEvent(event) { - this.event = event; - } - ChainableEvent.prototype.map = function (fn) { - return new ChainableEvent(map(this.event, fn)); - }; - ChainableEvent.prototype.forEach = function (fn) { - return new ChainableEvent(forEach(this.event, fn)); - }; - ChainableEvent.prototype.filter = function (fn) { - return new ChainableEvent(filter(this.event, fn)); - }; - ChainableEvent.prototype.reduce = function (merge, initial) { - return new ChainableEvent(reduce(this.event, merge, initial)); - }; - ChainableEvent.prototype.latch = function () { - return new ChainableEvent(latch(this.event)); - }; - ChainableEvent.prototype.on = function (listener, thisArgs, disposables) { - return this.event(listener, thisArgs, disposables); - }; - ChainableEvent.prototype.once = function (listener, thisArgs, disposables) { - return once(this.event)(listener, thisArgs, disposables); - }; - return ChainableEvent; - }()); - function chain(event) { - return new ChainableEvent(event); - } - Event.chain = chain; - function fromNodeEventEmitter(emitter, eventName, map) { - if (map === void 0) { map = function (id) { return id; }; } - var fn = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return result.fire(map.apply(void 0, args)); - }; - var onFirstListenerAdd = function () { return emitter.on(eventName, fn); }; - var onLastListenerRemove = function () { return emitter.removeListener(eventName, fn); }; - var result = new Emitter({ onFirstListenerAdd: onFirstListenerAdd, onLastListenerRemove: onLastListenerRemove }); - return result.event; - } - Event.fromNodeEventEmitter = fromNodeEventEmitter; - function fromPromise(promise) { - var emitter = new Emitter(); - var shouldEmit = false; - promise - .then(undefined, function () { return null; }) - .then(function () { - if (!shouldEmit) { - setTimeout(function () { return emitter.fire(undefined); }, 0); - } - else { - emitter.fire(undefined); - } - }); - shouldEmit = true; - return emitter.event; - } - Event.fromPromise = fromPromise; - function toPromise(event) { - return new Promise(function (c) { return once(event)(c); }); - } - Event.toPromise = toPromise; -})(Event || (Event = {})); -var _globalLeakWarningThreshold = -1; -var LeakageMonitor = /** @class */ (function () { - function LeakageMonitor(customThreshold, name) { - if (name === void 0) { name = Math.random().toString(18).slice(2, 5); } - this.customThreshold = customThreshold; - this.name = name; - this._warnCountdown = 0; - } - LeakageMonitor.prototype.dispose = function () { - if (this._stacks) { - this._stacks.clear(); - } - }; - LeakageMonitor.prototype.check = function (listenerCount) { - var _this = this; - var threshold = _globalLeakWarningThreshold; - if (typeof this.customThreshold === 'number') { - threshold = this.customThreshold; - } - if (threshold <= 0 || listenerCount < threshold) { - return undefined; - } - if (!this._stacks) { - this._stacks = new Map(); - } - var stack = new Error().stack.split('\n').slice(3).join('\n'); - var count = (this._stacks.get(stack) || 0); - this._stacks.set(stack, count + 1); - this._warnCountdown -= 1; - if (this._warnCountdown <= 0) { - // only warn on first exceed and then every time the limit - // is exceeded by 50% again - this._warnCountdown = threshold * 0.5; - // find most frequent listener and print warning - var topStack_1; - var topCount_1 = 0; - this._stacks.forEach(function (count, stack) { - if (!topStack_1 || topCount_1 < count) { - topStack_1 = stack; - topCount_1 = count; - } - }); - console.warn("[" + this.name + "] potential listener LEAK detected, having " + listenerCount + " listeners already. MOST frequent listener (" + topCount_1 + "):"); - console.warn(topStack_1); - } - return function () { - var count = (_this._stacks.get(stack) || 0); - _this._stacks.set(stack, count - 1); - }; - }; - return LeakageMonitor; -}()); -/** - * The Emitter can be used to expose an Event to the public - * to fire it from the insides. - * Sample: - class Document { - - private _onDidChange = new Emitter<(value:string)=>any>(); - - public onDidChange = this._onDidChange.event; - - // getter-style - // get onDidChange(): Event<(value:string)=>any> { - // return this._onDidChange.event; - // } - - private _doIt() { - //... - this._onDidChange.fire(value); - } - } - */ -var Emitter = /** @class */ (function () { - function Emitter(options) { - this._disposed = false; - this._options = options; - this._leakageMon = _globalLeakWarningThreshold > 0 - ? new LeakageMonitor(this._options && this._options.leakWarningThreshold) - : undefined; - } - Object.defineProperty(Emitter.prototype, "event", { - /** - * For the public to allow to subscribe - * to events from this Emitter - */ - get: function () { - var _this = this; - if (!this._event) { - this._event = function (listener, thisArgs, disposables) { - if (!_this._listeners) { - _this._listeners = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"](); - } - var firstListener = _this._listeners.isEmpty(); - if (firstListener && _this._options && _this._options.onFirstListenerAdd) { - _this._options.onFirstListenerAdd(_this); - } - var remove = _this._listeners.push(!thisArgs ? listener : [listener, thisArgs]); - if (firstListener && _this._options && _this._options.onFirstListenerDidAdd) { - _this._options.onFirstListenerDidAdd(_this); - } - if (_this._options && _this._options.onListenerDidAdd) { - _this._options.onListenerDidAdd(_this, listener, thisArgs); - } - // check and record this emitter for potential leakage - var removeMonitor; - if (_this._leakageMon) { - removeMonitor = _this._leakageMon.check(_this._listeners.size); - } - var result; - result = { - dispose: function () { - if (removeMonitor) { - removeMonitor(); - } - result.dispose = Emitter._noop; - if (!_this._disposed) { - remove(); - if (_this._options && _this._options.onLastListenerRemove) { - var hasListeners = (_this._listeners && !_this._listeners.isEmpty()); - if (!hasListeners) { - _this._options.onLastListenerRemove(_this); - } - } - } - } - }; - if (Array.isArray(disposables)) { - disposables.push(result); - } - return result; - }; - } - return this._event; - }, - enumerable: true, - configurable: true - }); - /** - * To be kept private to fire an event to - * subscribers - */ - Emitter.prototype.fire = function (event) { - if (this._listeners) { - // put all [listener,event]-pairs into delivery queue - // then emit all event. an inner/nested event might be - // the driver of this - if (!this._deliveryQueue) { - this._deliveryQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"](); - } - for (var iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) { - this._deliveryQueue.push([e.value, event]); - } - while (this._deliveryQueue.size > 0) { - var _a = this._deliveryQueue.shift(), listener = _a[0], event_1 = _a[1]; - try { - if (typeof listener === 'function') { - listener.call(undefined, event_1); - } - else { - listener[0].call(listener[1], event_1); - } - } - catch (e) { - Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e); - } - } - } - }; - Emitter.prototype.dispose = function () { - if (this._listeners) { - this._listeners.clear(); - } - if (this._deliveryQueue) { - this._deliveryQueue.clear(); - } - if (this._leakageMon) { - this._leakageMon.dispose(); - } - this._disposed = true; - }; - Emitter._noop = function () { }; - return Emitter; -}()); - -var PauseableEmitter = /** @class */ (function (_super) { - __extends(PauseableEmitter, _super); - function PauseableEmitter(options) { - var _this = _super.call(this, options) || this; - _this._isPaused = 0; - _this._eventQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"](); - _this._mergeFn = options && options.merge; - return _this; - } - PauseableEmitter.prototype.pause = function () { - this._isPaused++; - }; - PauseableEmitter.prototype.resume = function () { - if (this._isPaused !== 0 && --this._isPaused === 0) { - if (this._mergeFn) { - // use the merge function to create a single composite - // event. make a copy in case firing pauses this emitter - var events = this._eventQueue.toArray(); - this._eventQueue.clear(); - _super.prototype.fire.call(this, this._mergeFn(events)); - } - else { - // no merging, fire each event individually and test - // that this emitter isn't paused halfway through - while (!this._isPaused && this._eventQueue.size !== 0) { - _super.prototype.fire.call(this, this._eventQueue.shift()); - } - } - } - }; - PauseableEmitter.prototype.fire = function (event) { - if (this._listeners) { - if (this._isPaused !== 0) { - this._eventQueue.push(event); - } - else { - _super.prototype.fire.call(this, event); - } - } - }; - return PauseableEmitter; -}(Emitter)); - -var EventMultiplexer = /** @class */ (function () { - function EventMultiplexer() { - var _this = this; - this.hasListeners = false; - this.events = []; - this.emitter = new Emitter({ - onFirstListenerAdd: function () { return _this.onFirstListenerAdd(); }, - onLastListenerRemove: function () { return _this.onLastListenerRemove(); } - }); - } - Object.defineProperty(EventMultiplexer.prototype, "event", { - get: function () { - return this.emitter.event; - }, - enumerable: true, - configurable: true - }); - EventMultiplexer.prototype.add = function (event) { - var _this = this; - var e = { event: event, listener: null }; - this.events.push(e); - if (this.hasListeners) { - this.hook(e); - } - var dispose = function () { - if (_this.hasListeners) { - _this.unhook(e); - } - var idx = _this.events.indexOf(e); - _this.events.splice(idx, 1); - }; - return Object(_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["toDisposable"])(Object(_functional_js__WEBPACK_IMPORTED_MODULE_1__["once"])(dispose)); - }; - EventMultiplexer.prototype.onFirstListenerAdd = function () { - var _this = this; - this.hasListeners = true; - this.events.forEach(function (e) { return _this.hook(e); }); - }; - EventMultiplexer.prototype.onLastListenerRemove = function () { - var _this = this; - this.hasListeners = false; - this.events.forEach(function (e) { return _this.unhook(e); }); - }; - EventMultiplexer.prototype.hook = function (e) { - var _this = this; - e.listener = e.event(function (r) { return _this.emitter.fire(r); }); - }; - EventMultiplexer.prototype.unhook = function (e) { - if (e.listener) { - e.listener.dispose(); - } - e.listener = null; - }; - EventMultiplexer.prototype.dispose = function () { - this.emitter.dispose(); - }; - return EventMultiplexer; -}()); - -/** - * The EventBufferer is useful in situations in which you want - * to delay firing your events during some code. - * You can wrap that code and be sure that the event will not - * be fired during that wrap. - * - * ``` - * const emitter: Emitter; - * const delayer = new EventDelayer(); - * const delayedEvent = delayer.wrapEvent(emitter.event); - * - * delayedEvent(console.log); - * - * delayer.bufferEvents(() => { - * emitter.fire(); // event will not be fired yet - * }); - * - * // event will only be fired at this point - * ``` - */ -var EventBufferer = /** @class */ (function () { - function EventBufferer() { - this.buffers = []; - } - EventBufferer.prototype.wrapEvent = function (event) { - var _this = this; - return function (listener, thisArgs, disposables) { - return event(function (i) { - var buffer = _this.buffers[_this.buffers.length - 1]; - if (buffer) { - buffer.push(function () { return listener.call(thisArgs, i); }); - } - else { - listener.call(thisArgs, i); - } - }, undefined, disposables); - }; - }; - EventBufferer.prototype.bufferEvents = function (fn) { - var buffer = []; - this.buffers.push(buffer); - var r = fn(); - this.buffers.pop(); - buffer.forEach(function (flush) { return flush(); }); - return r; - }; - return EventBufferer; -}()); - -/** - * A Relay is an event forwarder which functions as a replugabble event pipe. - * Once created, you can connect an input event to it and it will simply forward - * events from that input event through its own `event` property. The `input` - * can be changed at any point in time. - */ -var Relay = /** @class */ (function () { - function Relay() { - var _this = this; - this.listening = false; - this.inputEvent = Event.None; - this.inputEventListener = _lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"].None; - this.emitter = new Emitter({ - onFirstListenerDidAdd: function () { - _this.listening = true; - _this.inputEventListener = _this.inputEvent(_this.emitter.fire, _this.emitter); - }, - onLastListenerRemove: function () { - _this.listening = false; - _this.inputEventListener.dispose(); - } - }); - this.event = this.emitter.event; - } - Object.defineProperty(Relay.prototype, "input", { - set: function (event) { - this.inputEvent = event; - if (this.listening) { - this.inputEventListener.dispose(); - this.inputEventListener = event(this.emitter.fire, this.emitter); - } - }, - enumerable: true, - configurable: true - }); - Relay.prototype.dispose = function () { - this.inputEventListener.dispose(); - this.emitter.dispose(); - }; - return Relay; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/functional.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/functional.js ***! - \*********************************************************************/ -/*! exports provided: once */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "once", function() { return once; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function once(fn) { - var _this = this; - var didCall = false; - var result; - return function () { - if (didCall) { - return result; - } - didCall = true; - result = fn.apply(_this, arguments); - return result; - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/iterator.js ***! - \*******************************************************************/ -/*! exports provided: FIN, Iterator, getSequenceIterator, ArrayIterator, ArrayNavigator, MappedIterator */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FIN", function() { return FIN; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Iterator", function() { return Iterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSequenceIterator", function() { return getSequenceIterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayIterator", function() { return ArrayIterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayNavigator", function() { return ArrayNavigator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MappedIterator", function() { return MappedIterator; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { +var iterator_extends = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || @@ -2392,7 +2015,7 @@ var ArrayIterator = /** @class */ (function () { }()); var ArrayNavigator = /** @class */ (function (_super) { - __extends(ArrayNavigator, _super); + iterator_extends(ArrayNavigator, _super); function ArrayNavigator(items, start, end, index) { if (start === void 0) { start = 0; } if (end === void 0) { end = items.length; } @@ -2431,687 +2054,1057 @@ var MappedIterator = /** @class */ (function () { }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js ***! - \*******************************************************************/ -/*! exports provided: KeyCodeUtils, KeyChord, createKeybinding, createSimpleKeybinding, SimpleKeybinding, ChordKeybinding, ResolvedKeybindingPart, ResolvedKeybinding */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCodeUtils", function() { return KeyCodeUtils; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyChord", function() { return KeyChord; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createKeybinding", function() { return createKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSimpleKeybinding", function() { return createSimpleKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleKeybinding", function() { return SimpleKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChordKeybinding", function() { return ChordKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybindingPart", function() { return ResolvedKeybindingPart; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybinding", function() { return ResolvedKeybinding; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/uri.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -var KeyCodeStrMap = /** @class */ (function () { - function KeyCodeStrMap() { - this._keyCodeToStr = []; - this._strToKeyCode = Object.create(null); - } - KeyCodeStrMap.prototype.define = function (keyCode, str) { - this._keyCodeToStr[keyCode] = str; - this._strToKeyCode[str.toLowerCase()] = keyCode; +var uri_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); }; - KeyCodeStrMap.prototype.keyCodeToStr = function (keyCode) { - return this._keyCodeToStr[keyCode]; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; - KeyCodeStrMap.prototype.strToKeyCode = function (str) { - return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */; - }; - return KeyCodeStrMap; -}()); -var uiMap = new KeyCodeStrMap(); -var userSettingsUSMap = new KeyCodeStrMap(); -var userSettingsGeneralMap = new KeyCodeStrMap(); -(function () { - function define(keyCode, uiLabel, usUserSettingsLabel, generalUserSettingsLabel) { - if (usUserSettingsLabel === void 0) { usUserSettingsLabel = uiLabel; } - if (generalUserSettingsLabel === void 0) { generalUserSettingsLabel = usUserSettingsLabel; } - uiMap.define(keyCode, uiLabel); - userSettingsUSMap.define(keyCode, usUserSettingsLabel); - userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel); - } - define(0 /* Unknown */, 'unknown'); - define(1 /* Backspace */, 'Backspace'); - define(2 /* Tab */, 'Tab'); - define(3 /* Enter */, 'Enter'); - define(4 /* Shift */, 'Shift'); - define(5 /* Ctrl */, 'Ctrl'); - define(6 /* Alt */, 'Alt'); - define(7 /* PauseBreak */, 'PauseBreak'); - define(8 /* CapsLock */, 'CapsLock'); - define(9 /* Escape */, 'Escape'); - define(10 /* Space */, 'Space'); - define(11 /* PageUp */, 'PageUp'); - define(12 /* PageDown */, 'PageDown'); - define(13 /* End */, 'End'); - define(14 /* Home */, 'Home'); - define(15 /* LeftArrow */, 'LeftArrow', 'Left'); - define(16 /* UpArrow */, 'UpArrow', 'Up'); - define(17 /* RightArrow */, 'RightArrow', 'Right'); - define(18 /* DownArrow */, 'DownArrow', 'Down'); - define(19 /* Insert */, 'Insert'); - define(20 /* Delete */, 'Delete'); - define(21 /* KEY_0 */, '0'); - define(22 /* KEY_1 */, '1'); - define(23 /* KEY_2 */, '2'); - define(24 /* KEY_3 */, '3'); - define(25 /* KEY_4 */, '4'); - define(26 /* KEY_5 */, '5'); - define(27 /* KEY_6 */, '6'); - define(28 /* KEY_7 */, '7'); - define(29 /* KEY_8 */, '8'); - define(30 /* KEY_9 */, '9'); - define(31 /* KEY_A */, 'A'); - define(32 /* KEY_B */, 'B'); - define(33 /* KEY_C */, 'C'); - define(34 /* KEY_D */, 'D'); - define(35 /* KEY_E */, 'E'); - define(36 /* KEY_F */, 'F'); - define(37 /* KEY_G */, 'G'); - define(38 /* KEY_H */, 'H'); - define(39 /* KEY_I */, 'I'); - define(40 /* KEY_J */, 'J'); - define(41 /* KEY_K */, 'K'); - define(42 /* KEY_L */, 'L'); - define(43 /* KEY_M */, 'M'); - define(44 /* KEY_N */, 'N'); - define(45 /* KEY_O */, 'O'); - define(46 /* KEY_P */, 'P'); - define(47 /* KEY_Q */, 'Q'); - define(48 /* KEY_R */, 'R'); - define(49 /* KEY_S */, 'S'); - define(50 /* KEY_T */, 'T'); - define(51 /* KEY_U */, 'U'); - define(52 /* KEY_V */, 'V'); - define(53 /* KEY_W */, 'W'); - define(54 /* KEY_X */, 'X'); - define(55 /* KEY_Y */, 'Y'); - define(56 /* KEY_Z */, 'Z'); - define(57 /* Meta */, 'Meta'); - define(58 /* ContextMenu */, 'ContextMenu'); - define(59 /* F1 */, 'F1'); - define(60 /* F2 */, 'F2'); - define(61 /* F3 */, 'F3'); - define(62 /* F4 */, 'F4'); - define(63 /* F5 */, 'F5'); - define(64 /* F6 */, 'F6'); - define(65 /* F7 */, 'F7'); - define(66 /* F8 */, 'F8'); - define(67 /* F9 */, 'F9'); - define(68 /* F10 */, 'F10'); - define(69 /* F11 */, 'F11'); - define(70 /* F12 */, 'F12'); - define(71 /* F13 */, 'F13'); - define(72 /* F14 */, 'F14'); - define(73 /* F15 */, 'F15'); - define(74 /* F16 */, 'F16'); - define(75 /* F17 */, 'F17'); - define(76 /* F18 */, 'F18'); - define(77 /* F19 */, 'F19'); - define(78 /* NumLock */, 'NumLock'); - define(79 /* ScrollLock */, 'ScrollLock'); - define(80 /* US_SEMICOLON */, ';', ';', 'OEM_1'); - define(81 /* US_EQUAL */, '=', '=', 'OEM_PLUS'); - define(82 /* US_COMMA */, ',', ',', 'OEM_COMMA'); - define(83 /* US_MINUS */, '-', '-', 'OEM_MINUS'); - define(84 /* US_DOT */, '.', '.', 'OEM_PERIOD'); - define(85 /* US_SLASH */, '/', '/', 'OEM_2'); - define(86 /* US_BACKTICK */, '`', '`', 'OEM_3'); - define(110 /* ABNT_C1 */, 'ABNT_C1'); - define(111 /* ABNT_C2 */, 'ABNT_C2'); - define(87 /* US_OPEN_SQUARE_BRACKET */, '[', '[', 'OEM_4'); - define(88 /* US_BACKSLASH */, '\\', '\\', 'OEM_5'); - define(89 /* US_CLOSE_SQUARE_BRACKET */, ']', ']', 'OEM_6'); - define(90 /* US_QUOTE */, '\'', '\'', 'OEM_7'); - define(91 /* OEM_8 */, 'OEM_8'); - define(92 /* OEM_102 */, 'OEM_102'); - define(93 /* NUMPAD_0 */, 'NumPad0'); - define(94 /* NUMPAD_1 */, 'NumPad1'); - define(95 /* NUMPAD_2 */, 'NumPad2'); - define(96 /* NUMPAD_3 */, 'NumPad3'); - define(97 /* NUMPAD_4 */, 'NumPad4'); - define(98 /* NUMPAD_5 */, 'NumPad5'); - define(99 /* NUMPAD_6 */, 'NumPad6'); - define(100 /* NUMPAD_7 */, 'NumPad7'); - define(101 /* NUMPAD_8 */, 'NumPad8'); - define(102 /* NUMPAD_9 */, 'NumPad9'); - define(103 /* NUMPAD_MULTIPLY */, 'NumPad_Multiply'); - define(104 /* NUMPAD_ADD */, 'NumPad_Add'); - define(105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator'); - define(106 /* NUMPAD_SUBTRACT */, 'NumPad_Subtract'); - define(107 /* NUMPAD_DECIMAL */, 'NumPad_Decimal'); - define(108 /* NUMPAD_DIVIDE */, 'NumPad_Divide'); })(); -var KeyCodeUtils; -(function (KeyCodeUtils) { - function toString(keyCode) { - return uiMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toString = toString; - function fromString(key) { - return uiMap.strToKeyCode(key); - } - KeyCodeUtils.fromString = fromString; - function toUserSettingsUS(keyCode) { - return userSettingsUSMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toUserSettingsUS = toUserSettingsUS; - function toUserSettingsGeneral(keyCode) { - return userSettingsGeneralMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral; - function fromUserSettings(key) { - return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); - } - KeyCodeUtils.fromUserSettings = fromUserSettings; -})(KeyCodeUtils || (KeyCodeUtils = {})); -function KeyChord(firstPart, secondPart) { - var chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0; - return (firstPart | chordPart) >>> 0; -} -function createKeybinding(keybinding, OS) { - if (keybinding === 0) { - return null; - } - var firstPart = (keybinding & 0x0000FFFF) >>> 0; - var chordPart = (keybinding & 0xFFFF0000) >>> 16; - if (chordPart !== 0) { - return new ChordKeybinding([ - createSimpleKeybinding(firstPart, OS), - createSimpleKeybinding(chordPart, OS) - ]); - } - return new ChordKeybinding([createSimpleKeybinding(firstPart, OS)]); -} -function createSimpleKeybinding(keybinding, OS) { - var ctrlCmd = (keybinding & 2048 /* CtrlCmd */ ? true : false); - var winCtrl = (keybinding & 256 /* WinCtrl */ ? true : false); - var ctrlKey = (OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd); - var shiftKey = (keybinding & 1024 /* Shift */ ? true : false); - var altKey = (keybinding & 512 /* Alt */ ? true : false); - var metaKey = (OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl); - var keyCode = (keybinding & 255 /* KeyCode */); - return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode); -} -var SimpleKeybinding = /** @class */ (function () { - function SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode) { - this.ctrlKey = ctrlKey; - this.shiftKey = shiftKey; - this.altKey = altKey; - this.metaKey = metaKey; - this.keyCode = keyCode; - } - SimpleKeybinding.prototype.equals = function (other) { - return (this.ctrlKey === other.ctrlKey - && this.shiftKey === other.shiftKey - && this.altKey === other.altKey - && this.metaKey === other.metaKey - && this.keyCode === other.keyCode); - }; - SimpleKeybinding.prototype.isModifierKey = function () { - return (this.keyCode === 0 /* Unknown */ - || this.keyCode === 5 /* Ctrl */ - || this.keyCode === 57 /* Meta */ - || this.keyCode === 6 /* Alt */ - || this.keyCode === 4 /* Shift */); - }; - SimpleKeybinding.prototype.toChord = function () { - return new ChordKeybinding([this]); - }; - /** - * Does this keybinding refer to the key code of a modifier and it also has the modifier flag? - */ - SimpleKeybinding.prototype.isDuplicateModifierCase = function () { - return ((this.ctrlKey && this.keyCode === 5 /* Ctrl */) - || (this.shiftKey && this.keyCode === 4 /* Shift */) - || (this.altKey && this.keyCode === 6 /* Alt */) - || (this.metaKey && this.keyCode === 57 /* Meta */)); - }; - return SimpleKeybinding; -}()); +var uri_a; -var ChordKeybinding = /** @class */ (function () { - function ChordKeybinding(parts) { - if (parts.length === 0) { - throw Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["illegalArgument"])("parts"); - } - this.parts = parts; - } - ChordKeybinding.prototype.equals = function (other) { - if (other === null) { - return false; - } - if (this.parts.length !== other.parts.length) { - return false; - } - for (var i = 0; i < this.parts.length; i++) { - if (!this.parts[i].equals(other.parts[i])) { - return false; - } - } - return true; - }; - return ChordKeybinding; -}()); - -var ResolvedKeybindingPart = /** @class */ (function () { - function ResolvedKeybindingPart(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) { - this.ctrlKey = ctrlKey; - this.shiftKey = shiftKey; - this.altKey = altKey; - this.metaKey = metaKey; - this.keyLabel = kbLabel; - this.keyAriaLabel = kbAriaLabel; - } - return ResolvedKeybindingPart; -}()); - -/** - * A resolved keybinding. Can be a simple keybinding or a chord keybinding. - */ -var ResolvedKeybinding = /** @class */ (function () { - function ResolvedKeybinding() { - } - return ResolvedKeybinding; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js ***! - \********************************************************************/ -/*! exports provided: isDisposable, dispose, combinedDisposable, toDisposable, Disposable, ImmortalReference */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDisposable", function() { return isDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispose", function() { return dispose; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combinedDisposable", function() { return combinedDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toDisposable", function() { return toDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Disposable", function() { return Disposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImmortalReference", function() { return ImmortalReference; }); -function isDisposable(thing) { - return typeof thing.dispose === 'function' - && thing.dispose.length === 0; -} -function dispose(first) { - var rest = []; - for (var _i = 1; _i < arguments.length; _i++) { - rest[_i - 1] = arguments[_i]; - } - if (Array.isArray(first)) { - first.forEach(function (d) { return d && d.dispose(); }); - return []; - } - else if (rest.length === 0) { - if (first) { - first.dispose(); - return first; - } - return undefined; - } - else { - dispose(first); - dispose(rest); - return []; - } -} -function combinedDisposable(disposables) { - return { dispose: function () { return dispose(disposables); } }; -} -function toDisposable(fn) { - return { dispose: function () { fn(); } }; -} -var Disposable = /** @class */ (function () { - function Disposable() { - this._toDispose = []; - this._lifecycle_disposable_isDisposed = false; - } - Disposable.prototype.dispose = function () { - this._lifecycle_disposable_isDisposed = true; - this._toDispose = dispose(this._toDispose); - }; - Disposable.prototype._register = function (t) { - if (this._lifecycle_disposable_isDisposed) { - console.warn('Registering disposable on object that has already been disposed.'); - t.dispose(); +var _schemePattern = /^\w[\w\d+.-]*$/; +var _singleSlashStart = /^\//; +var _doubleSlashStart = /^\/\//; +var _throwOnMissingSchema = true; +function _validateUri(ret, _strict) { + // scheme, must be set + if (!ret.scheme) { + if (_strict || _throwOnMissingSchema) { + throw new Error("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); } else { - this._toDispose.push(t); + console.warn("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); } - return t; + } + // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 + // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) + if (ret.scheme && !_schemePattern.test(ret.scheme)) { + throw new Error('[UriError]: Scheme contains illegal characters.'); + } + // path, http://tools.ietf.org/html/rfc3986#section-3.3 + // If a URI contains an authority component, then the path component + // must either be empty or begin with a slash ("/") character. If a URI + // does not contain an authority component, then the path cannot begin + // with two slash characters ("//"). + if (ret.path) { + if (ret.authority) { + if (!_singleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); + } + } + else { + if (_doubleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); + } + } + } +} +// for a while we allowed uris *without* schemes and this is the migration +// for them, e.g. an uri without scheme and without strict-mode warns and falls +// back to the file-scheme. that should cause the least carnage and still be a +// clear warning +function _schemeFix(scheme, _strict) { + if (_strict || _throwOnMissingSchema) { + return scheme || _empty; + } + if (!scheme) { + console.trace('BAD uri lacks scheme, falling back to file-scheme.'); + scheme = 'file'; + } + return scheme; +} +// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 +function _referenceResolution(scheme, path) { + // the slash-character is our 'default base' as we don't + // support constructing URIs relative to other URIs. This + // also means that we alter and potentially break paths. + // see https://tools.ietf.org/html/rfc3986#section-5.1.4 + switch (scheme) { + case 'https': + case 'http': + case 'file': + if (!path) { + path = _slash; + } + else if (path[0] !== _slash) { + path = _slash + path; + } + break; + } + return path; +} +var _empty = ''; +var _slash = '/'; +var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; +/** + * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. + * This class is a simple parser which creates the basic component parts + * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation + * and encoding. + * + * foo://example.com:8042/over/there?name=ferret#nose + * \_/ \______________/\_________/ \_________/ \__/ + * | | | | | + * scheme authority path query fragment + * | _____________________|__ + * / \ / \ + * urn:example:animal:ferret:nose + */ +var uri_URI = /** @class */ (function () { + /** + * @internal + */ + function URI(schemeOrData, authority, path, query, fragment, _strict) { + if (_strict === void 0) { _strict = false; } + if (typeof schemeOrData === 'object') { + this.scheme = schemeOrData.scheme || _empty; + this.authority = schemeOrData.authority || _empty; + this.path = schemeOrData.path || _empty; + this.query = schemeOrData.query || _empty; + this.fragment = schemeOrData.fragment || _empty; + // no validation because it's this URI + // that creates uri components. + // _validateUri(this); + } + else { + this.scheme = _schemeFix(schemeOrData, _strict); + this.authority = authority || _empty; + this.path = _referenceResolution(this.scheme, path || _empty); + this.query = query || _empty; + this.fragment = fragment || _empty; + _validateUri(this, _strict); + } + } + URI.isUri = function (thing) { + if (thing instanceof URI) { + return true; + } + if (!thing) { + return false; + } + return typeof thing.authority === 'string' + && typeof thing.fragment === 'string' + && typeof thing.path === 'string' + && typeof thing.query === 'string' + && typeof thing.scheme === 'string' + && typeof thing.fsPath === 'function' + && typeof thing.with === 'function' + && typeof thing.toString === 'function'; }; - Disposable.None = Object.freeze({ dispose: function () { } }); - return Disposable; -}()); - -var ImmortalReference = /** @class */ (function () { - function ImmortalReference(object) { - this.object = object; - } - ImmortalReference.prototype.dispose = function () { }; - return ImmortalReference; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/linkedList.js ***! - \*********************************************************************/ -/*! exports provided: LinkedList */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkedList", function() { return LinkedList; }); -/* harmony import */ var _iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var Node = /** @class */ (function () { - function Node(element) { - this.element = element; - this.next = Node.Undefined; - this.prev = Node.Undefined; - } - Node.Undefined = new Node(undefined); - return Node; -}()); -var LinkedList = /** @class */ (function () { - function LinkedList() { - this._first = Node.Undefined; - this._last = Node.Undefined; - this._size = 0; - } - Object.defineProperty(LinkedList.prototype, "size", { + Object.defineProperty(URI.prototype, "fsPath", { + // ---- filesystem path ----------------------- + /** + * Returns a string representing the corresponding file system path of this URI. + * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the + * platform specific path separator. + * + * * Will *not* validate the path for invalid characters and semantics. + * * Will *not* look at the scheme of this URI. + * * The result shall *not* be used for display purposes but for accessing a file on disk. + * + * + * The *difference* to `URI#path` is the use of the platform specific separator and the handling + * of UNC paths. See the below sample of a file-uri with an authority (UNC path). + * + * ```ts + const u = URI.parse('file://server/c$/folder/file.txt') + u.authority === 'server' + u.path === '/shares/c$/file.txt' + u.fsPath === '\\server\c$\folder\file.txt' + ``` + * + * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, + * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working + * with URIs that represent files on disk (`file` scheme). + */ get: function () { - return this._size; + // if (this.scheme !== 'file') { + // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); + // } + return _makeFsPath(this); }, enumerable: true, configurable: true }); - LinkedList.prototype.isEmpty = function () { - return this._first === Node.Undefined; - }; - LinkedList.prototype.clear = function () { - this._first = Node.Undefined; - this._last = Node.Undefined; - this._size = 0; - }; - LinkedList.prototype.unshift = function (element) { - return this._insert(element, false); - }; - LinkedList.prototype.push = function (element) { - return this._insert(element, true); - }; - LinkedList.prototype._insert = function (element, atTheEnd) { - var _this = this; - var newNode = new Node(element); - if (this._first === Node.Undefined) { - this._first = newNode; - this._last = newNode; + // ---- modify to new ------------------------- + URI.prototype.with = function (change) { + if (!change) { + return this; } - else if (atTheEnd) { - // push - var oldLast = this._last; - this._last = newNode; - newNode.prev = oldLast; - oldLast.next = newNode; + var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment; + if (scheme === undefined) { + scheme = this.scheme; + } + else if (scheme === null) { + scheme = _empty; + } + if (authority === undefined) { + authority = this.authority; + } + else if (authority === null) { + authority = _empty; + } + if (path === undefined) { + path = this.path; + } + else if (path === null) { + path = _empty; + } + if (query === undefined) { + query = this.query; + } + else if (query === null) { + query = _empty; + } + if (fragment === undefined) { + fragment = this.fragment; + } + else if (fragment === null) { + fragment = _empty; + } + if (scheme === this.scheme + && authority === this.authority + && path === this.path + && query === this.query + && fragment === this.fragment) { + return this; + } + return new _URI(scheme, authority, path, query, fragment); + }; + // ---- parse & validate ------------------------ + /** + * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, + * `file:///usr/home`, or `scheme:with/path`. + * + * @param value A string which represents an URI (see `URI#toString`). + */ + URI.parse = function (value, _strict) { + if (_strict === void 0) { _strict = false; } + var match = _regexp.exec(value); + if (!match) { + return new _URI(_empty, _empty, _empty, _empty, _empty); + } + return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty), _strict); + }; + /** + * Creates a new URI from a file system path, e.g. `c:\my\files`, + * `/usr/home`, or `\\server\share\some\path`. + * + * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument + * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** + * `URI.parse('file://' + path)` because the path might contain characters that are + * interpreted (# and ?). See the following sample: + * ```ts + const good = URI.file('/coding/c#/project1'); + good.scheme === 'file'; + good.path === '/coding/c#/project1'; + good.fragment === ''; + const bad = URI.parse('file://' + '/coding/c#/project1'); + bad.scheme === 'file'; + bad.path === '/coding/c'; // path is now broken + bad.fragment === '/project1'; + ``` + * + * @param path A file system path (see `URI#fsPath`) + */ + URI.file = function (path) { + var authority = _empty; + // normalize to fwd-slashes on windows, + // on other systems bwd-slashes are valid + // filename character, eg /f\oo/ba\r.txt + if (isWindows) { + path = path.replace(/\\/g, _slash); + } + // check for authority as used in UNC shares + // or use the path as given + if (path[0] === _slash && path[1] === _slash) { + var idx = path.indexOf(_slash, 2); + if (idx === -1) { + authority = path.substring(2); + path = _slash; + } + else { + authority = path.substring(2, idx); + path = path.substring(idx) || _slash; + } + } + return new _URI('file', authority, path, _empty, _empty); + }; + URI.from = function (components) { + return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment); + }; + // ---- printing/externalize --------------------------- + /** + * Creates a string representation for this URI. It's guaranteed that calling + * `URI.parse` with the result of this function creates an URI which is equal + * to this URI. + * + * * The result shall *not* be used for display purposes but for externalization or transport. + * * The result will be encoded using the percentage encoding and encoding happens mostly + * ignore the scheme-specific encoding rules. + * + * @param skipEncoding Do not encode the result, default is `false` + */ + URI.prototype.toString = function (skipEncoding) { + if (skipEncoding === void 0) { skipEncoding = false; } + return _asFormatted(this, skipEncoding); + }; + URI.prototype.toJSON = function () { + return this; + }; + URI.revive = function (data) { + if (!data) { + return data; + } + else if (data instanceof URI) { + return data; } else { - // unshift - var oldFirst = this._first; - this._first = newNode; - newNode.next = oldFirst; - oldFirst.prev = newNode; - } - this._size += 1; - var didRemove = false; - return function () { - if (!didRemove) { - didRemove = true; - _this._remove(newNode); - } - }; - }; - LinkedList.prototype.shift = function () { - if (this._first === Node.Undefined) { - return undefined; - } - else { - var res = this._first.element; - this._remove(this._first); - return res; + var result = new _URI(data); + result._fsPath = data.fsPath; + result._formatted = data.external; + return result; } }; - LinkedList.prototype._remove = function (node) { - if (node.prev !== Node.Undefined && node.next !== Node.Undefined) { - // middle - var anchor = node.prev; - anchor.next = node.next; - node.next.prev = anchor; - } - else if (node.prev === Node.Undefined && node.next === Node.Undefined) { - // only node - this._first = Node.Undefined; - this._last = Node.Undefined; - } - else if (node.next === Node.Undefined) { - // last - this._last = this._last.prev; - this._last.next = Node.Undefined; - } - else if (node.prev === Node.Undefined) { - // first - this._first = this._first.next; - this._first.prev = Node.Undefined; - } - // done - this._size -= 1; - }; - LinkedList.prototype.iterator = function () { - var element; - var node = this._first; - return { - next: function () { - if (node === Node.Undefined) { - return _iterator_js__WEBPACK_IMPORTED_MODULE_0__["FIN"]; - } - if (!element) { - element = { done: false, value: node.element }; - } - else { - element.value = node.element; - } - node = node.next; - return element; - } - }; - }; - LinkedList.prototype.toArray = function () { - var result = []; - for (var node = this._first; node !== Node.Undefined; node = node.next) { - result.push(node.element); - } - return result; - }; - return LinkedList; + return URI; }()); +// tslint:disable-next-line:class-name +var _URI = /** @class */ (function (_super) { + uri_extends(_URI, _super); + function _URI() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._formatted = null; + _this._fsPath = null; + return _this; + } + Object.defineProperty(_URI.prototype, "fsPath", { + get: function () { + if (!this._fsPath) { + this._fsPath = _makeFsPath(this); + } + return this._fsPath; + }, + enumerable: true, + configurable: true + }); + _URI.prototype.toString = function (skipEncoding) { + if (skipEncoding === void 0) { skipEncoding = false; } + if (!skipEncoding) { + if (!this._formatted) { + this._formatted = _asFormatted(this, false); + } + return this._formatted; + } + else { + // we don't cache that + return _asFormatted(this, true); + } + }; + _URI.prototype.toJSON = function () { + var res = { + $mid: 1 + }; + // cached state + if (this._fsPath) { + res.fsPath = this._fsPath; + } + if (this._formatted) { + res.external = this._formatted; + } + // uri components + if (this.path) { + res.path = this.path; + } + if (this.scheme) { + res.scheme = this.scheme; + } + if (this.authority) { + res.authority = this.authority; + } + if (this.query) { + res.query = this.query; + } + if (this.fragment) { + res.fragment = this.fragment; + } + return res; + }; + return _URI; +}(uri_URI)); +// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 +var encodeTable = (uri_a = {}, + uri_a[58 /* Colon */] = '%3A', + uri_a[47 /* Slash */] = '%2F', + uri_a[63 /* QuestionMark */] = '%3F', + uri_a[35 /* Hash */] = '%23', + uri_a[91 /* OpenSquareBracket */] = '%5B', + uri_a[93 /* CloseSquareBracket */] = '%5D', + uri_a[64 /* AtSign */] = '%40', + uri_a[33 /* ExclamationMark */] = '%21', + uri_a[36 /* DollarSign */] = '%24', + uri_a[38 /* Ampersand */] = '%26', + uri_a[39 /* SingleQuote */] = '%27', + uri_a[40 /* OpenParen */] = '%28', + uri_a[41 /* CloseParen */] = '%29', + uri_a[42 /* Asterisk */] = '%2A', + uri_a[43 /* Plus */] = '%2B', + uri_a[44 /* Comma */] = '%2C', + uri_a[59 /* Semicolon */] = '%3B', + uri_a[61 /* Equals */] = '%3D', + uri_a[32 /* Space */] = '%20', + uri_a); +function encodeURIComponentFast(uriComponent, allowSlash) { + var res = undefined; + var nativeEncodePos = -1; + for (var pos = 0; pos < uriComponent.length; pos++) { + var code = uriComponent.charCodeAt(pos); + // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 + if ((code >= 97 /* a */ && code <= 122 /* z */) + || (code >= 65 /* A */ && code <= 90 /* Z */) + || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) + || code === 45 /* Dash */ + || code === 46 /* Period */ + || code === 95 /* Underline */ + || code === 126 /* Tilde */ + || (allowSlash && code === 47 /* Slash */)) { + // check if we are delaying native encode + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + // check if we write into a new string (by default we try to return the param) + if (res !== undefined) { + res += uriComponent.charAt(pos); + } + } + else { + // encoding needed, we need to allocate a new string + if (res === undefined) { + res = uriComponent.substr(0, pos); + } + // check with default table first + var escaped = encodeTable[code]; + if (escaped !== undefined) { + // check if we are delaying native encode + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + // append escaped variant to result + res += escaped; + } + else if (nativeEncodePos === -1) { + // use native encode only when needed + nativeEncodePos = pos; + } + } + } + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); + } + return res !== undefined ? res : uriComponent; +} +function encodeURIComponentMinimal(path) { + var res = undefined; + for (var pos = 0; pos < path.length; pos++) { + var code = path.charCodeAt(pos); + if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { + if (res === undefined) { + res = path.substr(0, pos); + } + res += encodeTable[code]; + } + else { + if (res !== undefined) { + res += path[pos]; + } + } + } + return res !== undefined ? res : path; +} +/** + * Compute `fsPath` for the given uri + */ +function _makeFsPath(uri) { + var value; + if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { + // unc path: file://shares/c$/far/boo + value = "//" + uri.authority + uri.path; + } + else if (uri.path.charCodeAt(0) === 47 /* Slash */ + && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) + && uri.path.charCodeAt(2) === 58 /* Colon */) { + // windows drive letter: file:///c:/far/boo + value = uri.path[1].toLowerCase() + uri.path.substr(2); + } + else { + // other path + value = uri.path; + } + if (isWindows) { + value = value.replace(/\//g, '\\'); + } + return value; +} +/** + * Create the external version of a uri + */ +function _asFormatted(uri, skipEncoding) { + var encoder = !skipEncoding + ? encodeURIComponentFast + : encodeURIComponentMinimal; + var res = ''; + var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment; + if (scheme) { + res += scheme; + res += ':'; + } + if (authority || scheme === 'file') { + res += _slash; + res += _slash; + } + if (authority) { + var idx = authority.indexOf('@'); + if (idx !== -1) { + // @ + var userinfo = authority.substr(0, idx); + authority = authority.substr(idx + 1); + idx = userinfo.indexOf(':'); + if (idx === -1) { + res += encoder(userinfo, false); + } + else { + // :@ + res += encoder(userinfo.substr(0, idx), false); + res += ':'; + res += encoder(userinfo.substr(idx + 1), false); + } + res += '@'; + } + authority = authority.toLowerCase(); + idx = authority.indexOf(':'); + if (idx === -1) { + res += encoder(authority, false); + } + else { + // : + res += encoder(authority.substr(0, idx), false); + res += authority.substr(idx); + } + } + if (path) { + // lower-case windows drive letters in /C:/fff or C:/fff + if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { + var code = path.charCodeAt(1); + if (code >= 65 /* A */ && code <= 90 /* Z */) { + path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3 + } + } + else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { + var code = path.charCodeAt(0); + if (code >= 65 /* A */ && code <= 90 /* Z */) { + path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3 + } + } + // encode the rest of the path + res += encoder(path, true); + } + if (query) { + res += '?'; + res += encoder(query, false); + } + if (fragment) { + res += '#'; + res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; + } + return res; +} - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/platform.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/platform.js ***! - \*******************************************************************/ -/*! exports provided: isWindows, isMacintosh, isLinux, isNative, isWeb, globals, setImmediate, OS */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWindows", function() { return isWindows; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMacintosh", function() { return isMacintosh; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinux", function() { return isLinux; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNative", function() { return isNative; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWeb", function() { return isWeb; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "globals", function() { return globals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setImmediate", function() { return setImmediate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OS", function() { return OS; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/position.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var LANGUAGE_DEFAULT = 'en'; -var _isWindows = false; -var _isMacintosh = false; -var _isLinux = false; -var _isNative = false; -var _isWeb = false; -var _locale = undefined; -var _language = LANGUAGE_DEFAULT; -var _translationsConfigFile = undefined; -var isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer'); -// OS detection -if (typeof navigator === 'object' && !isElectronRenderer) { - var userAgent = navigator.userAgent; - _isWindows = userAgent.indexOf('Windows') >= 0; - _isMacintosh = userAgent.indexOf('Macintosh') >= 0; - _isLinux = userAgent.indexOf('Linux') >= 0; - _isWeb = true; - _locale = navigator.language; - _language = _locale; -} -else if (typeof process === 'object') { - _isWindows = (process.platform === 'win32'); - _isMacintosh = (process.platform === 'darwin'); - _isLinux = (process.platform === 'linux'); - _locale = LANGUAGE_DEFAULT; - _language = LANGUAGE_DEFAULT; - var rawNlsConfig = process.env['VSCODE_NLS_CONFIG']; - if (rawNlsConfig) { - try { - var nlsConfig = JSON.parse(rawNlsConfig); - var resolved = nlsConfig.availableLanguages['*']; - _locale = nlsConfig.locale; - // VSCode's default language is 'en' - _language = resolved ? resolved : LANGUAGE_DEFAULT; - _translationsConfigFile = nlsConfig._translationsConfigFile; - } - catch (e) { - } +/** + * A position in the editor. + */ +var Position = /** @class */ (function () { + function Position(lineNumber, column) { + this.lineNumber = lineNumber; + this.column = column; } - _isNative = true; -} -var _platform = 0 /* Web */; -if (_isNative) { - if (_isMacintosh) { - _platform = 1 /* Mac */; - } - else if (_isWindows) { - _platform = 3 /* Windows */; - } - else if (_isLinux) { - _platform = 2 /* Linux */; - } -} -var isWindows = _isWindows; -var isMacintosh = _isMacintosh; -var isLinux = _isLinux; -var isNative = _isNative; -var isWeb = _isWeb; -var _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {}); -var globals = _globals; -var _setImmediate = null; -function setImmediate(callback) { - if (_setImmediate === null) { - if (globals.setImmediate) { - _setImmediate = globals.setImmediate.bind(globals); - } - else if (typeof process !== 'undefined' && typeof process.nextTick === 'function') { - _setImmediate = process.nextTick.bind(process); + /** + * Create a new postion from this position. + * + * @param newLineNumber new line number + * @param newColumn new column + */ + Position.prototype.with = function (newLineNumber, newColumn) { + if (newLineNumber === void 0) { newLineNumber = this.lineNumber; } + if (newColumn === void 0) { newColumn = this.column; } + if (newLineNumber === this.lineNumber && newColumn === this.column) { + return this; } else { - _setImmediate = globals.setTimeout.bind(globals); + return new Position(newLineNumber, newColumn); + } + }; + /** + * Derive a new position from this position. + * + * @param deltaLineNumber line number delta + * @param deltaColumn column delta + */ + Position.prototype.delta = function (deltaLineNumber, deltaColumn) { + if (deltaLineNumber === void 0) { deltaLineNumber = 0; } + if (deltaColumn === void 0) { deltaColumn = 0; } + return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn); + }; + /** + * Test if this position equals other position + */ + Position.prototype.equals = function (other) { + return Position.equals(this, other); + }; + /** + * Test if position `a` equals position `b` + */ + Position.equals = function (a, b) { + if (!a && !b) { + return true; + } + return (!!a && + !!b && + a.lineNumber === b.lineNumber && + a.column === b.column); + }; + /** + * Test if this position is before other position. + * If the two positions are equal, the result will be false. + */ + Position.prototype.isBefore = function (other) { + return Position.isBefore(this, other); + }; + /** + * Test if position `a` is before position `b`. + * If the two positions are equal, the result will be false. + */ + Position.isBefore = function (a, b) { + if (a.lineNumber < b.lineNumber) { + return true; + } + if (b.lineNumber < a.lineNumber) { + return false; + } + return a.column < b.column; + }; + /** + * Test if this position is before other position. + * If the two positions are equal, the result will be true. + */ + Position.prototype.isBeforeOrEqual = function (other) { + return Position.isBeforeOrEqual(this, other); + }; + /** + * Test if position `a` is before position `b`. + * If the two positions are equal, the result will be true. + */ + Position.isBeforeOrEqual = function (a, b) { + if (a.lineNumber < b.lineNumber) { + return true; + } + if (b.lineNumber < a.lineNumber) { + return false; + } + return a.column <= b.column; + }; + /** + * A function that compares positions, useful for sorting + */ + Position.compare = function (a, b) { + var aLineNumber = a.lineNumber | 0; + var bLineNumber = b.lineNumber | 0; + if (aLineNumber === bLineNumber) { + var aColumn = a.column | 0; + var bColumn = b.column | 0; + return aColumn - bColumn; + } + return aLineNumber - bLineNumber; + }; + /** + * Clone this position. + */ + Position.prototype.clone = function () { + return new Position(this.lineNumber, this.column); + }; + /** + * Convert to a human-readable representation. + */ + Position.prototype.toString = function () { + return '(' + this.lineNumber + ',' + this.column + ')'; + }; + // --- + /** + * Create a `Position` from an `IPosition`. + */ + Position.lift = function (pos) { + return new Position(pos.lineNumber, pos.column); + }; + /** + * Test if `obj` is an `IPosition`. + */ + Position.isIPosition = function (obj) { + return (obj + && (typeof obj.lineNumber === 'number') + && (typeof obj.column === 'number')); + }; + return Position; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/range.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/** + * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn) + */ +var range_Range = /** @class */ (function () { + function Range(startLineNumber, startColumn, endLineNumber, endColumn) { + if ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) { + this.startLineNumber = endLineNumber; + this.startColumn = endColumn; + this.endLineNumber = startLineNumber; + this.endColumn = startColumn; + } + else { + this.startLineNumber = startLineNumber; + this.startColumn = startColumn; + this.endLineNumber = endLineNumber; + this.endColumn = endColumn; } } - return _setImmediate(callback); -} -var OS = (_isMacintosh ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */)); + /** + * Test if this range is empty. + */ + Range.prototype.isEmpty = function () { + return Range.isEmpty(this); + }; + /** + * Test if `range` is empty. + */ + Range.isEmpty = function (range) { + return (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn); + }; + /** + * Test if position is in this range. If the position is at the edges, will return true. + */ + Range.prototype.containsPosition = function (position) { + return Range.containsPosition(this, position); + }; + /** + * Test if `position` is in `range`. If the position is at the edges, will return true. + */ + Range.containsPosition = function (range, position) { + if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) { + return false; + } + if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) { + return false; + } + if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) { + return false; + } + return true; + }; + /** + * Test if range is in this range. If the range is equal to this range, will return true. + */ + Range.prototype.containsRange = function (range) { + return Range.containsRange(this, range); + }; + /** + * Test if `otherRange` is in `range`. If the ranges are equal, will return true. + */ + Range.containsRange = function (range, otherRange) { + if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { + return false; + } + if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { + return false; + } + if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) { + return false; + } + if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) { + return false; + } + return true; + }; + /** + * A reunion of the two ranges. + * The smallest position will be used as the start point, and the largest one as the end point. + */ + Range.prototype.plusRange = function (range) { + return Range.plusRange(this, range); + }; + /** + * A reunion of the two ranges. + * The smallest position will be used as the start point, and the largest one as the end point. + */ + Range.plusRange = function (a, b) { + var startLineNumber; + var startColumn; + var endLineNumber; + var endColumn; + if (b.startLineNumber < a.startLineNumber) { + startLineNumber = b.startLineNumber; + startColumn = b.startColumn; + } + else if (b.startLineNumber === a.startLineNumber) { + startLineNumber = b.startLineNumber; + startColumn = Math.min(b.startColumn, a.startColumn); + } + else { + startLineNumber = a.startLineNumber; + startColumn = a.startColumn; + } + if (b.endLineNumber > a.endLineNumber) { + endLineNumber = b.endLineNumber; + endColumn = b.endColumn; + } + else if (b.endLineNumber === a.endLineNumber) { + endLineNumber = b.endLineNumber; + endColumn = Math.max(b.endColumn, a.endColumn); + } + else { + endLineNumber = a.endLineNumber; + endColumn = a.endColumn; + } + return new Range(startLineNumber, startColumn, endLineNumber, endColumn); + }; + /** + * A intersection of the two ranges. + */ + Range.prototype.intersectRanges = function (range) { + return Range.intersectRanges(this, range); + }; + /** + * A intersection of the two ranges. + */ + Range.intersectRanges = function (a, b) { + var resultStartLineNumber = a.startLineNumber; + var resultStartColumn = a.startColumn; + var resultEndLineNumber = a.endLineNumber; + var resultEndColumn = a.endColumn; + var otherStartLineNumber = b.startLineNumber; + var otherStartColumn = b.startColumn; + var otherEndLineNumber = b.endLineNumber; + var otherEndColumn = b.endColumn; + if (resultStartLineNumber < otherStartLineNumber) { + resultStartLineNumber = otherStartLineNumber; + resultStartColumn = otherStartColumn; + } + else if (resultStartLineNumber === otherStartLineNumber) { + resultStartColumn = Math.max(resultStartColumn, otherStartColumn); + } + if (resultEndLineNumber > otherEndLineNumber) { + resultEndLineNumber = otherEndLineNumber; + resultEndColumn = otherEndColumn; + } + else if (resultEndLineNumber === otherEndLineNumber) { + resultEndColumn = Math.min(resultEndColumn, otherEndColumn); + } + // Check if selection is now empty + if (resultStartLineNumber > resultEndLineNumber) { + return null; + } + if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) { + return null; + } + return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn); + }; + /** + * Test if this range equals other. + */ + Range.prototype.equalsRange = function (other) { + return Range.equalsRange(this, other); + }; + /** + * Test if range `a` equals `b`. + */ + Range.equalsRange = function (a, b) { + return (!!a && + !!b && + a.startLineNumber === b.startLineNumber && + a.startColumn === b.startColumn && + a.endLineNumber === b.endLineNumber && + a.endColumn === b.endColumn); + }; + /** + * Return the end position (which will be after or equal to the start position) + */ + Range.prototype.getEndPosition = function () { + return new Position(this.endLineNumber, this.endColumn); + }; + /** + * Return the start position (which will be before or equal to the end position) + */ + Range.prototype.getStartPosition = function () { + return new Position(this.startLineNumber, this.startColumn); + }; + /** + * Transform to a user presentable string representation. + */ + Range.prototype.toString = function () { + return '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']'; + }; + /** + * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position. + */ + Range.prototype.setEndPosition = function (endLineNumber, endColumn) { + return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn); + }; + /** + * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position. + */ + Range.prototype.setStartPosition = function (startLineNumber, startColumn) { + return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn); + }; + /** + * Create a new empty range using this range's start position. + */ + Range.prototype.collapseToStart = function () { + return Range.collapseToStart(this); + }; + /** + * Create a new empty range using this range's start position. + */ + Range.collapseToStart = function (range) { + return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn); + }; + // --- + Range.fromPositions = function (start, end) { + if (end === void 0) { end = start; } + return new Range(start.lineNumber, start.column, end.lineNumber, end.column); + }; + Range.lift = function (range) { + if (!range) { + return null; + } + return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); + }; + /** + * Test if `obj` is an `IRange`. + */ + Range.isIRange = function (obj) { + return (obj + && (typeof obj.startLineNumber === 'number') + && (typeof obj.startColumn === 'number') + && (typeof obj.endLineNumber === 'number') + && (typeof obj.endColumn === 'number')); + }; + /** + * Test if the two ranges are touching in any way. + */ + Range.areIntersectingOrTouching = function (a, b) { + // Check if `a` is before `b` + if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) { + return false; + } + // Check if `b` is before `a` + if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) { + return false; + } + // These ranges must intersect + return true; + }; + /** + * Test if the two ranges are intersecting. If the ranges are touching it returns true. + */ + Range.areIntersecting = function (a, b) { + // Check if `a` is before `b` + if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) { + return false; + } + // Check if `b` is before `a` + if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) { + return false; + } + // These ranges must intersect + return true; + }; + /** + * A function that compares ranges, useful for sorting ranges + * It will first compare ranges on the startPosition and then on the endPosition + */ + Range.compareRangesUsingStarts = function (a, b) { + if (a && b) { + var aStartLineNumber = a.startLineNumber | 0; + var bStartLineNumber = b.startLineNumber | 0; + if (aStartLineNumber === bStartLineNumber) { + var aStartColumn = a.startColumn | 0; + var bStartColumn = b.startColumn | 0; + if (aStartColumn === bStartColumn) { + var aEndLineNumber = a.endLineNumber | 0; + var bEndLineNumber = b.endLineNumber | 0; + if (aEndLineNumber === bEndLineNumber) { + var aEndColumn = a.endColumn | 0; + var bEndColumn = b.endColumn | 0; + return aEndColumn - bEndColumn; + } + return aEndLineNumber - bEndLineNumber; + } + return aStartColumn - bStartColumn; + } + return aStartLineNumber - bStartLineNumber; + } + var aExists = (a ? 1 : 0); + var bExists = (b ? 1 : 0); + return aExists - bExists; + }; + /** + * A function that compares ranges, useful for sorting ranges + * It will first compare ranges on the endPosition and then on the startPosition + */ + Range.compareRangesUsingEnds = function (a, b) { + if (a.endLineNumber === b.endLineNumber) { + if (a.endColumn === b.endColumn) { + if (a.startLineNumber === b.startLineNumber) { + return a.startColumn - b.startColumn; + } + return a.startLineNumber - b.startLineNumber; + } + return a.endColumn - b.endColumn; + } + return a.endLineNumber - b.endLineNumber; + }; + /** + * Test if the range spans multiple lines. + */ + Range.spansMultipleLines = function (range) { + return range.endLineNumber > range.startLineNumber; + }; + return Range; +}()); -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/strings.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/strings.js ***! - \******************************************************************/ -/*! exports provided: empty, isFalsyOrWhitespace, pad, format, escape, escapeRegExpCharacters, trim, ltrim, rtrim, convertSimple2RegExpPattern, startsWith, endsWith, createRegExp, regExpLeadsToEndlessLoop, regExpFlags, firstNonWhitespaceIndex, getLeadingWhitespace, lastNonWhitespaceIndex, compare, isLowerAsciiLetter, isUpperAsciiLetter, equalsIgnoreCase, startsWithIgnoreCase, commonPrefixLength, commonSuffixLength, isHighSurrogate, isLowSurrogate, containsRTL, containsEmoji, isBasicASCII, containsFullWidthCharacter, isFullWidthCharacter, UTF8_BOM_CHARACTER, startsWithUTF8BOM, safeBtoa, repeat */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFalsyOrWhitespace", function() { return isFalsyOrWhitespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return pad; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "format", function() { return format; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return escape; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeRegExpCharacters", function() { return escapeRegExpCharacters; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trim", function() { return trim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ltrim", function() { return ltrim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rtrim", function() { return rtrim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertSimple2RegExpPattern", function() { return convertSimple2RegExpPattern; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return startsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return endsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRegExp", function() { return createRegExp; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpLeadsToEndlessLoop", function() { return regExpLeadsToEndlessLoop; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpFlags", function() { return regExpFlags; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstNonWhitespaceIndex", function() { return firstNonWhitespaceIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLeadingWhitespace", function() { return getLeadingWhitespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lastNonWhitespaceIndex", function() { return lastNonWhitespaceIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compare", function() { return compare; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowerAsciiLetter", function() { return isLowerAsciiLetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUpperAsciiLetter", function() { return isUpperAsciiLetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equalsIgnoreCase", function() { return equalsIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithIgnoreCase", function() { return startsWithIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonPrefixLength", function() { return commonPrefixLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonSuffixLength", function() { return commonSuffixLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHighSurrogate", function() { return isHighSurrogate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowSurrogate", function() { return isLowSurrogate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsRTL", function() { return containsRTL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsEmoji", function() { return containsEmoji; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBasicASCII", function() { return isBasicASCII; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsFullWidthCharacter", function() { return containsFullWidthCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFullWidthCharacter", function() { return isFullWidthCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UTF8_BOM_CHARACTER", function() { return UTF8_BOM_CHARACTER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithUTF8BOM", function() { return startsWithUTF8BOM; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeBtoa", function() { return safeBtoa; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return repeat; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/strings.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -3164,7 +3157,7 @@ function format(value) { * Converts HTML characters inside the string to use entities instead. Makes the string safe from * being used e.g. in HTMLElement.innerHTML. */ -function escape(html) { +function strings_escape(html) { return html.replace(/[<>&]/g, function (match) { switch (match) { case '<': return '<'; @@ -3561,1964 +3554,7 @@ function repeat(s, count) { return result; } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/types.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/types.js ***! - \****************************************************************/ -/*! exports provided: isArray, isString, isObject, isNumber, isBoolean, isUndefined, isUndefinedOrNull, isEmptyObject, isFunction, validateConstraints, validateConstraint, getAllPropertyNames, withNullAsUndefined, withUndefinedAsNull */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return isArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return isString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return isNumber; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return isBoolean; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return isUndefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefinedOrNull", function() { return isUndefinedOrNull; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmptyObject", function() { return isEmptyObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraints", function() { return validateConstraints; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraint", function() { return validateConstraint; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllPropertyNames", function() { return getAllPropertyNames; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withNullAsUndefined", function() { return withNullAsUndefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withUndefinedAsNull", function() { return withUndefinedAsNull; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var _typeof = { - number: 'number', - string: 'string', - undefined: 'undefined', - object: 'object', - function: 'function' -}; -/** - * @returns whether the provided parameter is a JavaScript Array or not. - */ -function isArray(array) { - if (Array.isArray) { - return Array.isArray(array); - } - if (array && typeof (array.length) === _typeof.number && array.constructor === Array) { - return true; - } - return false; -} -/** - * @returns whether the provided parameter is a JavaScript String or not. - */ -function isString(str) { - if (typeof (str) === _typeof.string || str instanceof String) { - return true; - } - return false; -} -/** - * - * @returns whether the provided parameter is of type `object` but **not** - * `null`, an `array`, a `regexp`, nor a `date`. - */ -function isObject(obj) { - // The method can't do a type cast since there are type (like strings) which - // are subclasses of any put not positvely matched by the function. Hence type - // narrowing results in wrong results. - return typeof obj === _typeof.object - && obj !== null - && !Array.isArray(obj) - && !(obj instanceof RegExp) - && !(obj instanceof Date); -} -/** - * In **contrast** to just checking `typeof` this will return `false` for `NaN`. - * @returns whether the provided parameter is a JavaScript Number or not. - */ -function isNumber(obj) { - if ((typeof (obj) === _typeof.number || obj instanceof Number) && !isNaN(obj)) { - return true; - } - return false; -} -/** - * @returns whether the provided parameter is a JavaScript Boolean or not. - */ -function isBoolean(obj) { - return obj === true || obj === false; -} -/** - * @returns whether the provided parameter is undefined. - */ -function isUndefined(obj) { - return typeof (obj) === _typeof.undefined; -} -/** - * @returns whether the provided parameter is undefined or null. - */ -function isUndefinedOrNull(obj) { - return isUndefined(obj) || obj === null; -} -var hasOwnProperty = Object.prototype.hasOwnProperty; -/** - * @returns whether the provided parameter is an empty JavaScript Object or not. - */ -function isEmptyObject(obj) { - if (!isObject(obj)) { - return false; - } - for (var key in obj) { - if (hasOwnProperty.call(obj, key)) { - return false; - } - } - return true; -} -/** - * @returns whether the provided parameter is a JavaScript Function or not. - */ -function isFunction(obj) { - return typeof obj === _typeof.function; -} -function validateConstraints(args, constraints) { - var len = Math.min(args.length, constraints.length); - for (var i = 0; i < len; i++) { - validateConstraint(args[i], constraints[i]); - } -} -function validateConstraint(arg, constraint) { - if (isString(constraint)) { - if (typeof arg !== constraint) { - throw new Error("argument does not match constraint: typeof " + constraint); - } - } - else if (isFunction(constraint)) { - try { - if (arg instanceof constraint) { - return; - } - } - catch (_a) { - // ignore - } - if (!isUndefinedOrNull(arg) && arg.constructor === constraint) { - return; - } - if (constraint.length === 1 && constraint.call(undefined, arg) === true) { - return; - } - throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true"); - } -} -function getAllPropertyNames(obj) { - var res = []; - var proto = Object.getPrototypeOf(obj); - while (Object.prototype !== proto) { - res = res.concat(Object.getOwnPropertyNames(proto)); - proto = Object.getPrototypeOf(proto); - } - return res; -} -/** - * Converts null to undefined, passes all other values through. - */ -function withNullAsUndefined(x) { - return x === null ? undefined : x; -} -/** - * Converts undefined to null, passes all other values through. - */ -function withUndefinedAsNull(x) { - return typeof x === 'undefined' ? null : x; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/uri.js": -/*!**************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/uri.js ***! - \**************************************************************/ -/*! exports provided: URI */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "URI", function() { return URI; }); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var _a; - -var _schemePattern = /^\w[\w\d+.-]*$/; -var _singleSlashStart = /^\//; -var _doubleSlashStart = /^\/\//; -var _throwOnMissingSchema = true; -function _validateUri(ret, _strict) { - // scheme, must be set - if (!ret.scheme) { - if (_strict || _throwOnMissingSchema) { - throw new Error("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); - } - else { - console.warn("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); - } - } - // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 - // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - if (ret.scheme && !_schemePattern.test(ret.scheme)) { - throw new Error('[UriError]: Scheme contains illegal characters.'); - } - // path, http://tools.ietf.org/html/rfc3986#section-3.3 - // If a URI contains an authority component, then the path component - // must either be empty or begin with a slash ("/") character. If a URI - // does not contain an authority component, then the path cannot begin - // with two slash characters ("//"). - if (ret.path) { - if (ret.authority) { - if (!_singleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); - } - } - else { - if (_doubleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); - } - } - } -} -// for a while we allowed uris *without* schemes and this is the migration -// for them, e.g. an uri without scheme and without strict-mode warns and falls -// back to the file-scheme. that should cause the least carnage and still be a -// clear warning -function _schemeFix(scheme, _strict) { - if (_strict || _throwOnMissingSchema) { - return scheme || _empty; - } - if (!scheme) { - console.trace('BAD uri lacks scheme, falling back to file-scheme.'); - scheme = 'file'; - } - return scheme; -} -// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 -function _referenceResolution(scheme, path) { - // the slash-character is our 'default base' as we don't - // support constructing URIs relative to other URIs. This - // also means that we alter and potentially break paths. - // see https://tools.ietf.org/html/rfc3986#section-5.1.4 - switch (scheme) { - case 'https': - case 'http': - case 'file': - if (!path) { - path = _slash; - } - else if (path[0] !== _slash) { - path = _slash + path; - } - break; - } - return path; -} -var _empty = ''; -var _slash = '/'; -var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; -/** - * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. - * This class is a simple parser which creates the basic component parts - * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation - * and encoding. - * - * foo://example.com:8042/over/there?name=ferret#nose - * \_/ \______________/\_________/ \_________/ \__/ - * | | | | | - * scheme authority path query fragment - * | _____________________|__ - * / \ / \ - * urn:example:animal:ferret:nose - */ -var URI = /** @class */ (function () { - /** - * @internal - */ - function URI(schemeOrData, authority, path, query, fragment, _strict) { - if (_strict === void 0) { _strict = false; } - if (typeof schemeOrData === 'object') { - this.scheme = schemeOrData.scheme || _empty; - this.authority = schemeOrData.authority || _empty; - this.path = schemeOrData.path || _empty; - this.query = schemeOrData.query || _empty; - this.fragment = schemeOrData.fragment || _empty; - // no validation because it's this URI - // that creates uri components. - // _validateUri(this); - } - else { - this.scheme = _schemeFix(schemeOrData, _strict); - this.authority = authority || _empty; - this.path = _referenceResolution(this.scheme, path || _empty); - this.query = query || _empty; - this.fragment = fragment || _empty; - _validateUri(this, _strict); - } - } - URI.isUri = function (thing) { - if (thing instanceof URI) { - return true; - } - if (!thing) { - return false; - } - return typeof thing.authority === 'string' - && typeof thing.fragment === 'string' - && typeof thing.path === 'string' - && typeof thing.query === 'string' - && typeof thing.scheme === 'string' - && typeof thing.fsPath === 'function' - && typeof thing.with === 'function' - && typeof thing.toString === 'function'; - }; - Object.defineProperty(URI.prototype, "fsPath", { - // ---- filesystem path ----------------------- - /** - * Returns a string representing the corresponding file system path of this URI. - * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the - * platform specific path separator. - * - * * Will *not* validate the path for invalid characters and semantics. - * * Will *not* look at the scheme of this URI. - * * The result shall *not* be used for display purposes but for accessing a file on disk. - * - * - * The *difference* to `URI#path` is the use of the platform specific separator and the handling - * of UNC paths. See the below sample of a file-uri with an authority (UNC path). - * - * ```ts - const u = URI.parse('file://server/c$/folder/file.txt') - u.authority === 'server' - u.path === '/shares/c$/file.txt' - u.fsPath === '\\server\c$\folder\file.txt' - ``` - * - * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, - * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working - * with URIs that represent files on disk (`file` scheme). - */ - get: function () { - // if (this.scheme !== 'file') { - // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); - // } - return _makeFsPath(this); - }, - enumerable: true, - configurable: true - }); - // ---- modify to new ------------------------- - URI.prototype.with = function (change) { - if (!change) { - return this; - } - var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment; - if (scheme === undefined) { - scheme = this.scheme; - } - else if (scheme === null) { - scheme = _empty; - } - if (authority === undefined) { - authority = this.authority; - } - else if (authority === null) { - authority = _empty; - } - if (path === undefined) { - path = this.path; - } - else if (path === null) { - path = _empty; - } - if (query === undefined) { - query = this.query; - } - else if (query === null) { - query = _empty; - } - if (fragment === undefined) { - fragment = this.fragment; - } - else if (fragment === null) { - fragment = _empty; - } - if (scheme === this.scheme - && authority === this.authority - && path === this.path - && query === this.query - && fragment === this.fragment) { - return this; - } - return new _URI(scheme, authority, path, query, fragment); - }; - // ---- parse & validate ------------------------ - /** - * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, - * `file:///usr/home`, or `scheme:with/path`. - * - * @param value A string which represents an URI (see `URI#toString`). - */ - URI.parse = function (value, _strict) { - if (_strict === void 0) { _strict = false; } - var match = _regexp.exec(value); - if (!match) { - return new _URI(_empty, _empty, _empty, _empty, _empty); - } - return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty), _strict); - }; - /** - * Creates a new URI from a file system path, e.g. `c:\my\files`, - * `/usr/home`, or `\\server\share\some\path`. - * - * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument - * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** - * `URI.parse('file://' + path)` because the path might contain characters that are - * interpreted (# and ?). See the following sample: - * ```ts - const good = URI.file('/coding/c#/project1'); - good.scheme === 'file'; - good.path === '/coding/c#/project1'; - good.fragment === ''; - const bad = URI.parse('file://' + '/coding/c#/project1'); - bad.scheme === 'file'; - bad.path === '/coding/c'; // path is now broken - bad.fragment === '/project1'; - ``` - * - * @param path A file system path (see `URI#fsPath`) - */ - URI.file = function (path) { - var authority = _empty; - // normalize to fwd-slashes on windows, - // on other systems bwd-slashes are valid - // filename character, eg /f\oo/ba\r.txt - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) { - path = path.replace(/\\/g, _slash); - } - // check for authority as used in UNC shares - // or use the path as given - if (path[0] === _slash && path[1] === _slash) { - var idx = path.indexOf(_slash, 2); - if (idx === -1) { - authority = path.substring(2); - path = _slash; - } - else { - authority = path.substring(2, idx); - path = path.substring(idx) || _slash; - } - } - return new _URI('file', authority, path, _empty, _empty); - }; - URI.from = function (components) { - return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment); - }; - // ---- printing/externalize --------------------------- - /** - * Creates a string representation for this URI. It's guaranteed that calling - * `URI.parse` with the result of this function creates an URI which is equal - * to this URI. - * - * * The result shall *not* be used for display purposes but for externalization or transport. - * * The result will be encoded using the percentage encoding and encoding happens mostly - * ignore the scheme-specific encoding rules. - * - * @param skipEncoding Do not encode the result, default is `false` - */ - URI.prototype.toString = function (skipEncoding) { - if (skipEncoding === void 0) { skipEncoding = false; } - return _asFormatted(this, skipEncoding); - }; - URI.prototype.toJSON = function () { - return this; - }; - URI.revive = function (data) { - if (!data) { - return data; - } - else if (data instanceof URI) { - return data; - } - else { - var result = new _URI(data); - result._fsPath = data.fsPath; - result._formatted = data.external; - return result; - } - }; - return URI; -}()); - -// tslint:disable-next-line:class-name -var _URI = /** @class */ (function (_super) { - __extends(_URI, _super); - function _URI() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._formatted = null; - _this._fsPath = null; - return _this; - } - Object.defineProperty(_URI.prototype, "fsPath", { - get: function () { - if (!this._fsPath) { - this._fsPath = _makeFsPath(this); - } - return this._fsPath; - }, - enumerable: true, - configurable: true - }); - _URI.prototype.toString = function (skipEncoding) { - if (skipEncoding === void 0) { skipEncoding = false; } - if (!skipEncoding) { - if (!this._formatted) { - this._formatted = _asFormatted(this, false); - } - return this._formatted; - } - else { - // we don't cache that - return _asFormatted(this, true); - } - }; - _URI.prototype.toJSON = function () { - var res = { - $mid: 1 - }; - // cached state - if (this._fsPath) { - res.fsPath = this._fsPath; - } - if (this._formatted) { - res.external = this._formatted; - } - // uri components - if (this.path) { - res.path = this.path; - } - if (this.scheme) { - res.scheme = this.scheme; - } - if (this.authority) { - res.authority = this.authority; - } - if (this.query) { - res.query = this.query; - } - if (this.fragment) { - res.fragment = this.fragment; - } - return res; - }; - return _URI; -}(URI)); -// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 -var encodeTable = (_a = {}, - _a[58 /* Colon */] = '%3A', - _a[47 /* Slash */] = '%2F', - _a[63 /* QuestionMark */] = '%3F', - _a[35 /* Hash */] = '%23', - _a[91 /* OpenSquareBracket */] = '%5B', - _a[93 /* CloseSquareBracket */] = '%5D', - _a[64 /* AtSign */] = '%40', - _a[33 /* ExclamationMark */] = '%21', - _a[36 /* DollarSign */] = '%24', - _a[38 /* Ampersand */] = '%26', - _a[39 /* SingleQuote */] = '%27', - _a[40 /* OpenParen */] = '%28', - _a[41 /* CloseParen */] = '%29', - _a[42 /* Asterisk */] = '%2A', - _a[43 /* Plus */] = '%2B', - _a[44 /* Comma */] = '%2C', - _a[59 /* Semicolon */] = '%3B', - _a[61 /* Equals */] = '%3D', - _a[32 /* Space */] = '%20', - _a); -function encodeURIComponentFast(uriComponent, allowSlash) { - var res = undefined; - var nativeEncodePos = -1; - for (var pos = 0; pos < uriComponent.length; pos++) { - var code = uriComponent.charCodeAt(pos); - // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 - if ((code >= 97 /* a */ && code <= 122 /* z */) - || (code >= 65 /* A */ && code <= 90 /* Z */) - || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) - || code === 45 /* Dash */ - || code === 46 /* Period */ - || code === 95 /* Underline */ - || code === 126 /* Tilde */ - || (allowSlash && code === 47 /* Slash */)) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // check if we write into a new string (by default we try to return the param) - if (res !== undefined) { - res += uriComponent.charAt(pos); - } - } - else { - // encoding needed, we need to allocate a new string - if (res === undefined) { - res = uriComponent.substr(0, pos); - } - // check with default table first - var escaped = encodeTable[code]; - if (escaped !== undefined) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // append escaped variant to result - res += escaped; - } - else if (nativeEncodePos === -1) { - // use native encode only when needed - nativeEncodePos = pos; - } - } - } - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); - } - return res !== undefined ? res : uriComponent; -} -function encodeURIComponentMinimal(path) { - var res = undefined; - for (var pos = 0; pos < path.length; pos++) { - var code = path.charCodeAt(pos); - if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { - if (res === undefined) { - res = path.substr(0, pos); - } - res += encodeTable[code]; - } - else { - if (res !== undefined) { - res += path[pos]; - } - } - } - return res !== undefined ? res : path; -} -/** - * Compute `fsPath` for the given uri - */ -function _makeFsPath(uri) { - var value; - if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { - // unc path: file://shares/c$/far/boo - value = "//" + uri.authority + uri.path; - } - else if (uri.path.charCodeAt(0) === 47 /* Slash */ - && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) - && uri.path.charCodeAt(2) === 58 /* Colon */) { - // windows drive letter: file:///c:/far/boo - value = uri.path[1].toLowerCase() + uri.path.substr(2); - } - else { - // other path - value = uri.path; - } - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) { - value = value.replace(/\//g, '\\'); - } - return value; -} -/** - * Create the external version of a uri - */ -function _asFormatted(uri, skipEncoding) { - var encoder = !skipEncoding - ? encodeURIComponentFast - : encodeURIComponentMinimal; - var res = ''; - var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment; - if (scheme) { - res += scheme; - res += ':'; - } - if (authority || scheme === 'file') { - res += _slash; - res += _slash; - } - if (authority) { - var idx = authority.indexOf('@'); - if (idx !== -1) { - // @ - var userinfo = authority.substr(0, idx); - authority = authority.substr(idx + 1); - idx = userinfo.indexOf(':'); - if (idx === -1) { - res += encoder(userinfo, false); - } - else { - // :@ - res += encoder(userinfo.substr(0, idx), false); - res += ':'; - res += encoder(userinfo.substr(idx + 1), false); - } - res += '@'; - } - authority = authority.toLowerCase(); - idx = authority.indexOf(':'); - if (idx === -1) { - res += encoder(authority, false); - } - else { - // : - res += encoder(authority.substr(0, idx), false); - res += authority.substr(idx); - } - } - if (path) { - // lower-case windows drive letters in /C:/fff or C:/fff - if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { - var code = path.charCodeAt(1); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3 - } - } - else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { - var code = path.charCodeAt(0); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3 - } - } - // encode the rest of the path - res += encoder(path, true); - } - if (query) { - res += '?'; - res += encoder(query, false); - } - if (fragment) { - res += '#'; - res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; - } - return res; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js ***! - \******************************************************************************/ -/*! exports provided: logOnceWebWorkerWarning, SimpleWorkerClient, SimpleWorkerServer, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logOnceWebWorkerWarning", function() { return logOnceWebWorkerWarning; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerClient", function() { return SimpleWorkerClient; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerServer", function() { return SimpleWorkerServer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -var INITIALIZE = '$initialize'; -var webWorkerWarningLogged = false; -function logOnceWebWorkerWarning(err) { - if (!_platform_js__WEBPACK_IMPORTED_MODULE_2__["isWeb"]) { - // running tests - return; - } - if (!webWorkerWarningLogged) { - webWorkerWarningLogged = true; - console.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq'); - } - console.warn(err.message); -} -var SimpleWorkerProtocol = /** @class */ (function () { - function SimpleWorkerProtocol(handler) { - this._workerId = -1; - this._handler = handler; - this._lastSentReq = 0; - this._pendingReplies = Object.create(null); - } - SimpleWorkerProtocol.prototype.setWorkerId = function (workerId) { - this._workerId = workerId; - }; - SimpleWorkerProtocol.prototype.sendMessage = function (method, args) { - var _this = this; - var req = String(++this._lastSentReq); - return new Promise(function (resolve, reject) { - _this._pendingReplies[req] = { - resolve: resolve, - reject: reject - }; - _this._send({ - vsWorker: _this._workerId, - req: req, - method: method, - args: args - }); - }); - }; - SimpleWorkerProtocol.prototype.handleMessage = function (serializedMessage) { - var message; - try { - message = JSON.parse(serializedMessage); - } - catch (e) { - // nothing - return; - } - if (!message || !message.vsWorker) { - return; - } - if (this._workerId !== -1 && message.vsWorker !== this._workerId) { - return; - } - this._handleMessage(message); - }; - SimpleWorkerProtocol.prototype._handleMessage = function (msg) { - var _this = this; - if (msg.seq) { - var replyMessage = msg; - if (!this._pendingReplies[replyMessage.seq]) { - console.warn('Got reply to unknown seq'); - return; - } - var reply = this._pendingReplies[replyMessage.seq]; - delete this._pendingReplies[replyMessage.seq]; - if (replyMessage.err) { - var err = replyMessage.err; - if (replyMessage.err.$isError) { - err = new Error(); - err.name = replyMessage.err.name; - err.message = replyMessage.err.message; - err.stack = replyMessage.err.stack; - } - reply.reject(err); - return; - } - reply.resolve(replyMessage.res); - return; - } - var requestMessage = msg; - var req = requestMessage.req; - var result = this._handler.handleMessage(requestMessage.method, requestMessage.args); - result.then(function (r) { - _this._send({ - vsWorker: _this._workerId, - seq: req, - res: r, - err: undefined - }); - }, function (e) { - if (e.detail instanceof Error) { - // Loading errors have a detail property that points to the actual error - e.detail = Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e.detail); - } - _this._send({ - vsWorker: _this._workerId, - seq: req, - res: undefined, - err: Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e) - }); - }); - }; - SimpleWorkerProtocol.prototype._send = function (msg) { - var strMsg = JSON.stringify(msg); - // console.log('SENDING: ' + strMsg); - this._handler.sendMessage(strMsg); - }; - return SimpleWorkerProtocol; -}()); -/** - * Main thread side - */ -var SimpleWorkerClient = /** @class */ (function (_super) { - __extends(SimpleWorkerClient, _super); - function SimpleWorkerClient(workerFactory, moduleId) { - var _this = _super.call(this) || this; - var lazyProxyReject = null; - _this._worker = _this._register(workerFactory.create('vs/base/common/worker/simpleWorker', function (msg) { - _this._protocol.handleMessage(msg); - }, function (err) { - // in Firefox, web workers fail lazily :( - // we will reject the proxy - if (lazyProxyReject) { - lazyProxyReject(err); - } - })); - _this._protocol = new SimpleWorkerProtocol({ - sendMessage: function (msg) { - _this._worker.postMessage(msg); - }, - handleMessage: function (method, args) { - // Intentionally not supporting worker -> main requests - return Promise.resolve(null); - } - }); - _this._protocol.setWorkerId(_this._worker.getId()); - // Gather loader configuration - var loaderConfiguration = null; - if (typeof self.require !== 'undefined' && typeof self.require.getConfig === 'function') { - // Get the configuration from the Monaco AMD Loader - loaderConfiguration = self.require.getConfig(); - } - else if (typeof self.requirejs !== 'undefined') { - // Get the configuration from requirejs - loaderConfiguration = self.requirejs.s.contexts._.config; - } - // Send initialize message - _this._onModuleLoaded = _this._protocol.sendMessage(INITIALIZE, [ - _this._worker.getId(), - moduleId, - loaderConfiguration - ]); - _this._lazyProxy = new Promise(function (resolve, reject) { - lazyProxyReject = reject; - _this._onModuleLoaded.then(function (availableMethods) { - var proxy = {}; - for (var _i = 0, availableMethods_1 = availableMethods; _i < availableMethods_1.length; _i++) { - var methodName = availableMethods_1[_i]; - proxy[methodName] = createProxyMethod(methodName, proxyMethodRequest); - } - resolve(proxy); - }, function (e) { - reject(e); - _this._onError('Worker failed to load ' + moduleId, e); - }); - }); - // Create proxy to loaded code - var proxyMethodRequest = function (method, args) { - return _this._request(method, args); - }; - var createProxyMethod = function (method, proxyMethodRequest) { - return function () { - var args = Array.prototype.slice.call(arguments, 0); - return proxyMethodRequest(method, args); - }; - }; - return _this; - } - SimpleWorkerClient.prototype.getProxyObject = function () { - return this._lazyProxy; - }; - SimpleWorkerClient.prototype._request = function (method, args) { - var _this = this; - return new Promise(function (resolve, reject) { - _this._onModuleLoaded.then(function () { - _this._protocol.sendMessage(method, args).then(resolve, reject); - }, reject); - }); - }; - SimpleWorkerClient.prototype._onError = function (message, error) { - console.error(message); - console.info(error); - }; - return SimpleWorkerClient; -}(_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"])); - -/** - * Worker side - */ -var SimpleWorkerServer = /** @class */ (function () { - function SimpleWorkerServer(postSerializedMessage, requestHandler) { - var _this = this; - this._requestHandler = requestHandler; - this._protocol = new SimpleWorkerProtocol({ - sendMessage: function (msg) { - postSerializedMessage(msg); - }, - handleMessage: function (method, args) { return _this._handleMessage(method, args); } - }); - } - SimpleWorkerServer.prototype.onmessage = function (msg) { - this._protocol.handleMessage(msg); - }; - SimpleWorkerServer.prototype._handleMessage = function (method, args) { - if (method === INITIALIZE) { - return this.initialize(args[0], args[1], args[2]); - } - if (!this._requestHandler || typeof this._requestHandler[method] !== 'function') { - return Promise.reject(new Error('Missing requestHandler or method: ' + method)); - } - try { - return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args)); - } - catch (e) { - return Promise.reject(e); - } - }; - SimpleWorkerServer.prototype.initialize = function (workerId, moduleId, loaderConfig) { - var _this = this; - this._protocol.setWorkerId(workerId); - if (this._requestHandler) { - // static request handler - var methods = []; - for (var _i = 0, _a = Object(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllPropertyNames"])(this._requestHandler); _i < _a.length; _i++) { - var prop = _a[_i]; - if (typeof this._requestHandler[prop] === 'function') { - methods.push(prop); - } - } - return Promise.resolve(methods); - } - if (loaderConfig) { - // Remove 'baseUrl', handling it is beyond scope for now - if (typeof loaderConfig.baseUrl !== 'undefined') { - delete loaderConfig['baseUrl']; - } - if (typeof loaderConfig.paths !== 'undefined') { - if (typeof loaderConfig.paths.vs !== 'undefined') { - delete loaderConfig.paths['vs']; - } - } - // Since this is in a web worker, enable catching errors - loaderConfig.catchError = true; - self.require.config(loaderConfig); - } - return new Promise(function (resolve, reject) { - // Use the global require to be sure to get the global config - self.require([moduleId], function () { - var result = []; - for (var _i = 0; _i < arguments.length; _i++) { - result[_i] = arguments[_i]; - } - var handlerModule = result[0]; - _this._requestHandler = handlerModule.create(); - if (!_this._requestHandler) { - reject(new Error("No RequestHandler!")); - return; - } - var methods = []; - for (var _a = 0, _b = Object(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllPropertyNames"])(_this._requestHandler); _a < _b.length; _a++) { - var prop = _b[_a]; - if (typeof _this._requestHandler[prop] === 'function') { - methods.push(prop); - } - } - resolve(methods); - }, reject); - }); - }; - return SimpleWorkerServer; -}()); - -/** - * Called on the worker side - */ -function create(postMessage) { - return new SimpleWorkerServer(postMessage, null); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js ***! - \*************************************************************************************/ -/*! exports provided: CharacterClassifier, CharacterSet */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterClassifier", function() { return CharacterClassifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterSet", function() { return CharacterSet; }); -/* harmony import */ var _uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uint.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * A fast character classifier that uses a compact array for ASCII values. - */ -var CharacterClassifier = /** @class */ (function () { - function CharacterClassifier(_defaultValue) { - var defaultValue = Object(_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_defaultValue); - this._defaultValue = defaultValue; - this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue); - this._map = new Map(); - } - CharacterClassifier._createAsciiMap = function (defaultValue) { - var asciiMap = new Uint8Array(256); - for (var i = 0; i < 256; i++) { - asciiMap[i] = defaultValue; - } - return asciiMap; - }; - CharacterClassifier.prototype.set = function (charCode, _value) { - var value = Object(_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_value); - if (charCode >= 0 && charCode < 256) { - this._asciiMap[charCode] = value; - } - else { - this._map.set(charCode, value); - } - }; - CharacterClassifier.prototype.get = function (charCode) { - if (charCode >= 0 && charCode < 256) { - return this._asciiMap[charCode]; - } - else { - return (this._map.get(charCode) || this._defaultValue); - } - }; - return CharacterClassifier; -}()); - -var CharacterSet = /** @class */ (function () { - function CharacterSet() { - this._actual = new CharacterClassifier(0 /* False */); - } - CharacterSet.prototype.add = function (charCode) { - this._actual.set(charCode, 1 /* True */); - }; - CharacterSet.prototype.has = function (charCode) { - return (this._actual.get(charCode) === 1 /* True */); - }; - return CharacterSet; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/position.js ***! - \**************************************************************************/ -/*! exports provided: Position */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -/** - * A position in the editor. - */ -var Position = /** @class */ (function () { - function Position(lineNumber, column) { - this.lineNumber = lineNumber; - this.column = column; - } - /** - * Create a new postion from this position. - * - * @param newLineNumber new line number - * @param newColumn new column - */ - Position.prototype.with = function (newLineNumber, newColumn) { - if (newLineNumber === void 0) { newLineNumber = this.lineNumber; } - if (newColumn === void 0) { newColumn = this.column; } - if (newLineNumber === this.lineNumber && newColumn === this.column) { - return this; - } - else { - return new Position(newLineNumber, newColumn); - } - }; - /** - * Derive a new position from this position. - * - * @param deltaLineNumber line number delta - * @param deltaColumn column delta - */ - Position.prototype.delta = function (deltaLineNumber, deltaColumn) { - if (deltaLineNumber === void 0) { deltaLineNumber = 0; } - if (deltaColumn === void 0) { deltaColumn = 0; } - return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn); - }; - /** - * Test if this position equals other position - */ - Position.prototype.equals = function (other) { - return Position.equals(this, other); - }; - /** - * Test if position `a` equals position `b` - */ - Position.equals = function (a, b) { - if (!a && !b) { - return true; - } - return (!!a && - !!b && - a.lineNumber === b.lineNumber && - a.column === b.column); - }; - /** - * Test if this position is before other position. - * If the two positions are equal, the result will be false. - */ - Position.prototype.isBefore = function (other) { - return Position.isBefore(this, other); - }; - /** - * Test if position `a` is before position `b`. - * If the two positions are equal, the result will be false. - */ - Position.isBefore = function (a, b) { - if (a.lineNumber < b.lineNumber) { - return true; - } - if (b.lineNumber < a.lineNumber) { - return false; - } - return a.column < b.column; - }; - /** - * Test if this position is before other position. - * If the two positions are equal, the result will be true. - */ - Position.prototype.isBeforeOrEqual = function (other) { - return Position.isBeforeOrEqual(this, other); - }; - /** - * Test if position `a` is before position `b`. - * If the two positions are equal, the result will be true. - */ - Position.isBeforeOrEqual = function (a, b) { - if (a.lineNumber < b.lineNumber) { - return true; - } - if (b.lineNumber < a.lineNumber) { - return false; - } - return a.column <= b.column; - }; - /** - * A function that compares positions, useful for sorting - */ - Position.compare = function (a, b) { - var aLineNumber = a.lineNumber | 0; - var bLineNumber = b.lineNumber | 0; - if (aLineNumber === bLineNumber) { - var aColumn = a.column | 0; - var bColumn = b.column | 0; - return aColumn - bColumn; - } - return aLineNumber - bLineNumber; - }; - /** - * Clone this position. - */ - Position.prototype.clone = function () { - return new Position(this.lineNumber, this.column); - }; - /** - * Convert to a human-readable representation. - */ - Position.prototype.toString = function () { - return '(' + this.lineNumber + ',' + this.column + ')'; - }; - // --- - /** - * Create a `Position` from an `IPosition`. - */ - Position.lift = function (pos) { - return new Position(pos.lineNumber, pos.column); - }; - /** - * Test if `obj` is an `IPosition`. - */ - Position.isIPosition = function (obj) { - return (obj - && (typeof obj.lineNumber === 'number') - && (typeof obj.column === 'number')); - }; - return Position; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/range.js ***! - \***********************************************************************/ -/*! exports provided: Range */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; }); -/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn) - */ -var Range = /** @class */ (function () { - function Range(startLineNumber, startColumn, endLineNumber, endColumn) { - if ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) { - this.startLineNumber = endLineNumber; - this.startColumn = endColumn; - this.endLineNumber = startLineNumber; - this.endColumn = startColumn; - } - else { - this.startLineNumber = startLineNumber; - this.startColumn = startColumn; - this.endLineNumber = endLineNumber; - this.endColumn = endColumn; - } - } - /** - * Test if this range is empty. - */ - Range.prototype.isEmpty = function () { - return Range.isEmpty(this); - }; - /** - * Test if `range` is empty. - */ - Range.isEmpty = function (range) { - return (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn); - }; - /** - * Test if position is in this range. If the position is at the edges, will return true. - */ - Range.prototype.containsPosition = function (position) { - return Range.containsPosition(this, position); - }; - /** - * Test if `position` is in `range`. If the position is at the edges, will return true. - */ - Range.containsPosition = function (range, position) { - if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) { - return false; - } - if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) { - return false; - } - if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) { - return false; - } - return true; - }; - /** - * Test if range is in this range. If the range is equal to this range, will return true. - */ - Range.prototype.containsRange = function (range) { - return Range.containsRange(this, range); - }; - /** - * Test if `otherRange` is in `range`. If the ranges are equal, will return true. - */ - Range.containsRange = function (range, otherRange) { - if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { - return false; - } - if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { - return false; - } - if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) { - return false; - } - if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) { - return false; - } - return true; - }; - /** - * A reunion of the two ranges. - * The smallest position will be used as the start point, and the largest one as the end point. - */ - Range.prototype.plusRange = function (range) { - return Range.plusRange(this, range); - }; - /** - * A reunion of the two ranges. - * The smallest position will be used as the start point, and the largest one as the end point. - */ - Range.plusRange = function (a, b) { - var startLineNumber; - var startColumn; - var endLineNumber; - var endColumn; - if (b.startLineNumber < a.startLineNumber) { - startLineNumber = b.startLineNumber; - startColumn = b.startColumn; - } - else if (b.startLineNumber === a.startLineNumber) { - startLineNumber = b.startLineNumber; - startColumn = Math.min(b.startColumn, a.startColumn); - } - else { - startLineNumber = a.startLineNumber; - startColumn = a.startColumn; - } - if (b.endLineNumber > a.endLineNumber) { - endLineNumber = b.endLineNumber; - endColumn = b.endColumn; - } - else if (b.endLineNumber === a.endLineNumber) { - endLineNumber = b.endLineNumber; - endColumn = Math.max(b.endColumn, a.endColumn); - } - else { - endLineNumber = a.endLineNumber; - endColumn = a.endColumn; - } - return new Range(startLineNumber, startColumn, endLineNumber, endColumn); - }; - /** - * A intersection of the two ranges. - */ - Range.prototype.intersectRanges = function (range) { - return Range.intersectRanges(this, range); - }; - /** - * A intersection of the two ranges. - */ - Range.intersectRanges = function (a, b) { - var resultStartLineNumber = a.startLineNumber; - var resultStartColumn = a.startColumn; - var resultEndLineNumber = a.endLineNumber; - var resultEndColumn = a.endColumn; - var otherStartLineNumber = b.startLineNumber; - var otherStartColumn = b.startColumn; - var otherEndLineNumber = b.endLineNumber; - var otherEndColumn = b.endColumn; - if (resultStartLineNumber < otherStartLineNumber) { - resultStartLineNumber = otherStartLineNumber; - resultStartColumn = otherStartColumn; - } - else if (resultStartLineNumber === otherStartLineNumber) { - resultStartColumn = Math.max(resultStartColumn, otherStartColumn); - } - if (resultEndLineNumber > otherEndLineNumber) { - resultEndLineNumber = otherEndLineNumber; - resultEndColumn = otherEndColumn; - } - else if (resultEndLineNumber === otherEndLineNumber) { - resultEndColumn = Math.min(resultEndColumn, otherEndColumn); - } - // Check if selection is now empty - if (resultStartLineNumber > resultEndLineNumber) { - return null; - } - if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) { - return null; - } - return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn); - }; - /** - * Test if this range equals other. - */ - Range.prototype.equalsRange = function (other) { - return Range.equalsRange(this, other); - }; - /** - * Test if range `a` equals `b`. - */ - Range.equalsRange = function (a, b) { - return (!!a && - !!b && - a.startLineNumber === b.startLineNumber && - a.startColumn === b.startColumn && - a.endLineNumber === b.endLineNumber && - a.endColumn === b.endColumn); - }; - /** - * Return the end position (which will be after or equal to the start position) - */ - Range.prototype.getEndPosition = function () { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.endLineNumber, this.endColumn); - }; - /** - * Return the start position (which will be before or equal to the end position) - */ - Range.prototype.getStartPosition = function () { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.startLineNumber, this.startColumn); - }; - /** - * Transform to a user presentable string representation. - */ - Range.prototype.toString = function () { - return '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']'; - }; - /** - * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position. - */ - Range.prototype.setEndPosition = function (endLineNumber, endColumn) { - return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn); - }; - /** - * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position. - */ - Range.prototype.setStartPosition = function (startLineNumber, startColumn) { - return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn); - }; - /** - * Create a new empty range using this range's start position. - */ - Range.prototype.collapseToStart = function () { - return Range.collapseToStart(this); - }; - /** - * Create a new empty range using this range's start position. - */ - Range.collapseToStart = function (range) { - return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn); - }; - // --- - Range.fromPositions = function (start, end) { - if (end === void 0) { end = start; } - return new Range(start.lineNumber, start.column, end.lineNumber, end.column); - }; - Range.lift = function (range) { - if (!range) { - return null; - } - return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); - }; - /** - * Test if `obj` is an `IRange`. - */ - Range.isIRange = function (obj) { - return (obj - && (typeof obj.startLineNumber === 'number') - && (typeof obj.startColumn === 'number') - && (typeof obj.endLineNumber === 'number') - && (typeof obj.endColumn === 'number')); - }; - /** - * Test if the two ranges are touching in any way. - */ - Range.areIntersectingOrTouching = function (a, b) { - // Check if `a` is before `b` - if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) { - return false; - } - // Check if `b` is before `a` - if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) { - return false; - } - // These ranges must intersect - return true; - }; - /** - * Test if the two ranges are intersecting. If the ranges are touching it returns true. - */ - Range.areIntersecting = function (a, b) { - // Check if `a` is before `b` - if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) { - return false; - } - // Check if `b` is before `a` - if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) { - return false; - } - // These ranges must intersect - return true; - }; - /** - * A function that compares ranges, useful for sorting ranges - * It will first compare ranges on the startPosition and then on the endPosition - */ - Range.compareRangesUsingStarts = function (a, b) { - if (a && b) { - var aStartLineNumber = a.startLineNumber | 0; - var bStartLineNumber = b.startLineNumber | 0; - if (aStartLineNumber === bStartLineNumber) { - var aStartColumn = a.startColumn | 0; - var bStartColumn = b.startColumn | 0; - if (aStartColumn === bStartColumn) { - var aEndLineNumber = a.endLineNumber | 0; - var bEndLineNumber = b.endLineNumber | 0; - if (aEndLineNumber === bEndLineNumber) { - var aEndColumn = a.endColumn | 0; - var bEndColumn = b.endColumn | 0; - return aEndColumn - bEndColumn; - } - return aEndLineNumber - bEndLineNumber; - } - return aStartColumn - bStartColumn; - } - return aStartLineNumber - bStartLineNumber; - } - var aExists = (a ? 1 : 0); - var bExists = (b ? 1 : 0); - return aExists - bExists; - }; - /** - * A function that compares ranges, useful for sorting ranges - * It will first compare ranges on the endPosition and then on the startPosition - */ - Range.compareRangesUsingEnds = function (a, b) { - if (a.endLineNumber === b.endLineNumber) { - if (a.endColumn === b.endColumn) { - if (a.startLineNumber === b.startLineNumber) { - return a.startColumn - b.startColumn; - } - return a.startLineNumber - b.startLineNumber; - } - return a.endColumn - b.endColumn; - } - return a.endLineNumber - b.endLineNumber; - }; - /** - * Test if the range spans multiple lines. - */ - Range.spansMultipleLines = function (range) { - return range.endLineNumber > range.startLineNumber; - }; - return Range; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js ***! - \***************************************************************************/ -/*! exports provided: Selection */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Selection", function() { return Selection; }); -/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -/** - * A selection in the editor. - * The selection is a range that has an orientation. - */ -var Selection = /** @class */ (function (_super) { - __extends(Selection, _super); - function Selection(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) { - var _this = _super.call(this, selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) || this; - _this.selectionStartLineNumber = selectionStartLineNumber; - _this.selectionStartColumn = selectionStartColumn; - _this.positionLineNumber = positionLineNumber; - _this.positionColumn = positionColumn; - return _this; - } - /** - * Clone this selection. - */ - Selection.prototype.clone = function () { - return new Selection(this.selectionStartLineNumber, this.selectionStartColumn, this.positionLineNumber, this.positionColumn); - }; - /** - * Transform to a human-readable representation. - */ - Selection.prototype.toString = function () { - return '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']'; - }; - /** - * Test if equals other selection. - */ - Selection.prototype.equalsSelection = function (other) { - return (Selection.selectionsEqual(this, other)); - }; - /** - * Test if the two selections are equal. - */ - Selection.selectionsEqual = function (a, b) { - return (a.selectionStartLineNumber === b.selectionStartLineNumber && - a.selectionStartColumn === b.selectionStartColumn && - a.positionLineNumber === b.positionLineNumber && - a.positionColumn === b.positionColumn); - }; - /** - * Get directions (LTR or RTL). - */ - Selection.prototype.getDirection = function () { - if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) { - return 0 /* LTR */; - } - return 1 /* RTL */; - }; - /** - * Create a new selection with a different `positionLineNumber` and `positionColumn`. - */ - Selection.prototype.setEndPosition = function (endLineNumber, endColumn) { - if (this.getDirection() === 0 /* LTR */) { - return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn); - } - return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn); - }; - /** - * Get the position at `positionLineNumber` and `positionColumn`. - */ - Selection.prototype.getPosition = function () { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.positionLineNumber, this.positionColumn); - }; - /** - * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. - */ - Selection.prototype.setStartPosition = function (startLineNumber, startColumn) { - if (this.getDirection() === 0 /* LTR */) { - return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn); - } - return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn); - }; - // ---- - /** - * Create a `Selection` from one or two positions - */ - Selection.fromPositions = function (start, end) { - if (end === void 0) { end = start; } - return new Selection(start.lineNumber, start.column, end.lineNumber, end.column); - }; - /** - * Create a `Selection` from an `ISelection`. - */ - Selection.liftSelection = function (sel) { - return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn); - }; - /** - * `a` equals `b`. - */ - Selection.selectionsArrEqual = function (a, b) { - if (a && !b || !a && b) { - return false; - } - if (!a && !b) { - return true; - } - if (a.length !== b.length) { - return false; - } - for (var i = 0, len = a.length; i < len; i++) { - if (!this.selectionsEqual(a[i], b[i])) { - return false; - } - } - return true; - }; - /** - * Test if `obj` is an `ISelection`. - */ - Selection.isISelection = function (obj) { - return (obj - && (typeof obj.selectionStartLineNumber === 'number') - && (typeof obj.selectionStartColumn === 'number') - && (typeof obj.positionLineNumber === 'number') - && (typeof obj.positionColumn === 'number')); - }; - /** - * Create with a direction. - */ - Selection.createWithDirection = function (startLineNumber, startColumn, endLineNumber, endColumn, direction) { - if (direction === 0 /* LTR */) { - return new Selection(startLineNumber, startColumn, endLineNumber, endColumn); - } - return new Selection(endLineNumber, endColumn, startLineNumber, startColumn); - }; - return Selection; -}(_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"])); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/token.js ***! - \***********************************************************************/ -/*! exports provided: Token, TokenizationResult, TokenizationResult2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Token", function() { return Token; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult", function() { return TokenizationResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult2", function() { return TokenizationResult2; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var Token = /** @class */ (function () { - function Token(offset, type, language) { - this.offset = offset | 0; // @perf - this.type = type; - this.language = language; - } - Token.prototype.toString = function () { - return '(' + this.offset + ', ' + this.type + ')'; - }; - return Token; -}()); - -var TokenizationResult = /** @class */ (function () { - function TokenizationResult(tokens, endState) { - this.tokens = tokens; - this.endState = endState; - } - return TokenizationResult; -}()); - -var TokenizationResult2 = /** @class */ (function () { - function TokenizationResult2(tokens, endState) { - this.tokens = tokens; - this.endState = endState; - } - return TokenizationResult2; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js ***! - \**********************************************************************/ -/*! exports provided: Uint8Matrix, toUint8, toUint32, toUint32Array */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uint8Matrix", function() { return Uint8Matrix; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint8", function() { return toUint8; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint32", function() { return toUint32; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint32Array", function() { return toUint32Array; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var Uint8Matrix = /** @class */ (function () { - function Uint8Matrix(rows, cols, defaultValue) { - var data = new Uint8Array(rows * cols); - for (var i = 0, len = rows * cols; i < len; i++) { - data[i] = defaultValue; - } - this._data = data; - this.rows = rows; - this.cols = cols; - } - Uint8Matrix.prototype.get = function (row, col) { - return this._data[row * this.cols + col]; - }; - Uint8Matrix.prototype.set = function (row, col, value) { - this._data[row * this.cols + col] = value; - }; - return Uint8Matrix; -}()); - -function toUint8(v) { - if (v < 0) { - return 0; - } - if (v > 255 /* MAX_UINT_8 */) { - return 255 /* MAX_UINT_8 */; - } - return v | 0; -} -function toUint32(v) { - if (v < 0) { - return 0; - } - if (v > 4294967295 /* MAX_UINT_32 */) { - return 4294967295 /* MAX_UINT_32 */; - } - return v | 0; -} -function toUint32Array(arr) { - var len = arr.length; - var r = new Uint32Array(len); - for (var i = 0; i < len; i++) { - r[i] = toUint32(arr[i]); - } - return r; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js ***! - \******************************************************************************/ -/*! exports provided: DiffComputer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffComputer", function() { return DiffComputer; }); -/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -5528,10 +3564,10 @@ __webpack_require__.r(__webpack_exports__); var MAXIMUM_RUN_TIME = 5000; // 5 seconds var MINIMUM_MATCHING_CHARACTER_LENGTH = 3; function computeDiff(originalSequence, modifiedSequence, continueProcessingPredicate, pretty) { - var diffAlgo = new _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__["LcsDiff"](originalSequence, modifiedSequence, continueProcessingPredicate); + var diffAlgo = new diff_LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate); return diffAlgo.ComputeDiff(pretty); } -var LineMarkerSequence = /** @class */ (function () { +var diffComputer_LineMarkerSequence = /** @class */ (function () { function LineMarkerSequence(lines) { var startColumns = []; var endColumns = []; @@ -5556,14 +3592,14 @@ var LineMarkerSequence = /** @class */ (function () { return i + 1; }; LineMarkerSequence._getFirstNonBlankColumn = function (txt, defaultValue) { - var r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["firstNonWhitespaceIndex"](txt); + var r = firstNonWhitespaceIndex(txt); if (r === -1) { return defaultValue; } return r + 1; }; LineMarkerSequence._getLastNonBlankColumn = function (txt, defaultValue) { - var r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["lastNonWhitespaceIndex"](txt); + var r = lastNonWhitespaceIndex(txt); if (r === -1) { return defaultValue; } @@ -5743,8 +3779,8 @@ var DiffComputer = /** @class */ (function () { this.maximumRunTimeMs = MAXIMUM_RUN_TIME; this.originalLines = originalLines; this.modifiedLines = modifiedLines; - this.original = new LineMarkerSequence(originalLines); - this.modified = new LineMarkerSequence(modifiedLines); + this.original = new diffComputer_LineMarkerSequence(originalLines); + this.modified = new diffComputer_LineMarkerSequence(modifiedLines); } DiffComputer.prototype.computeDiff = function () { if (this.original.getLength() === 1 && this.original.getElementAtIndex(0).length === 0) { @@ -5812,8 +3848,8 @@ var DiffComputer = /** @class */ (function () { // These lines differ only in trim whitespace // Check the leading whitespace { - var originalStartColumn = LineMarkerSequence._getFirstNonBlankColumn(originalLine, 1); - var modifiedStartColumn = LineMarkerSequence._getFirstNonBlankColumn(modifiedLine, 1); + var originalStartColumn = diffComputer_LineMarkerSequence._getFirstNonBlankColumn(originalLine, 1); + var modifiedStartColumn = diffComputer_LineMarkerSequence._getFirstNonBlankColumn(modifiedLine, 1); while (originalStartColumn > 1 && modifiedStartColumn > 1) { var originalChar = originalLine.charCodeAt(originalStartColumn - 2); var modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2); @@ -5829,8 +3865,8 @@ var DiffComputer = /** @class */ (function () { } // Check the trailing whitespace { - var originalEndColumn = LineMarkerSequence._getLastNonBlankColumn(originalLine, 1); - var modifiedEndColumn = LineMarkerSequence._getLastNonBlankColumn(modifiedLine, 1); + var originalEndColumn = diffComputer_LineMarkerSequence._getLastNonBlankColumn(originalLine, 1); + var modifiedEndColumn = diffComputer_LineMarkerSequence._getLastNonBlankColumn(modifiedLine, 1); var originalMaxColumn = originalLine.length + 1; var modifiedMaxColumn = modifiedLine.length + 1; while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) { @@ -5901,28 +3937,267 @@ var DiffComputer = /** @class */ (function () { }()); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var Uint8Matrix = /** @class */ (function () { + function Uint8Matrix(rows, cols, defaultValue) { + var data = new Uint8Array(rows * cols); + for (var i = 0, len = rows * cols; i < len; i++) { + data[i] = defaultValue; + } + this._data = data; + this.rows = rows; + this.cols = cols; + } + Uint8Matrix.prototype.get = function (row, col) { + return this._data[row * this.cols + col]; + }; + Uint8Matrix.prototype.set = function (row, col, value) { + this._data[row * this.cols + col] = value; + }; + return Uint8Matrix; +}()); -/***/ }), +function toUint8(v) { + if (v < 0) { + return 0; + } + if (v > 255 /* MAX_UINT_8 */) { + return 255 /* MAX_UINT_8 */; + } + return v | 0; +} +function toUint32(v) { + if (v < 0) { + return 0; + } + if (v > 4294967295 /* MAX_UINT_32 */) { + return 4294967295 /* MAX_UINT_32 */; + } + return v | 0; +} +function toUint32Array(arr) { + var len = arr.length; + var r = new Uint32Array(len); + for (var i = 0; i < len; i++) { + r[i] = toUint32(arr[i]); + } + return r; +} -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js ***! - \**********************************************************************************/ -/*! exports provided: MirrorTextModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MirrorTextModel", function() { return MirrorTextModel; }); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../viewModel/prefixSumComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js"); +var PrefixSumIndexOfResult = /** @class */ (function () { + function PrefixSumIndexOfResult(index, remainder) { + this.index = index; + this.remainder = remainder; + } + return PrefixSumIndexOfResult; +}()); + +var prefixSumComputer_PrefixSumComputer = /** @class */ (function () { + function PrefixSumComputer(values) { + this.values = values; + this.prefixSum = new Uint32Array(values.length); + this.prefixSumValidIndex = new Int32Array(1); + this.prefixSumValidIndex[0] = -1; + } + PrefixSumComputer.prototype.getCount = function () { + return this.values.length; + }; + PrefixSumComputer.prototype.insertValues = function (insertIndex, insertValues) { + insertIndex = toUint32(insertIndex); + var oldValues = this.values; + var oldPrefixSum = this.prefixSum; + var insertValuesLen = insertValues.length; + if (insertValuesLen === 0) { + return false; + } + this.values = new Uint32Array(oldValues.length + insertValuesLen); + this.values.set(oldValues.subarray(0, insertIndex), 0); + this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen); + this.values.set(insertValues, insertIndex); + if (insertIndex - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = insertIndex - 1; + } + this.prefixSum = new Uint32Array(this.values.length); + if (this.prefixSumValidIndex[0] >= 0) { + this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); + } + return true; + }; + PrefixSumComputer.prototype.changeValue = function (index, value) { + index = toUint32(index); + value = toUint32(value); + if (this.values[index] === value) { + return false; + } + this.values[index] = value; + if (index - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = index - 1; + } + return true; + }; + PrefixSumComputer.prototype.removeValues = function (startIndex, cnt) { + startIndex = toUint32(startIndex); + cnt = toUint32(cnt); + var oldValues = this.values; + var oldPrefixSum = this.prefixSum; + if (startIndex >= oldValues.length) { + return false; + } + var maxCnt = oldValues.length - startIndex; + if (cnt >= maxCnt) { + cnt = maxCnt; + } + if (cnt === 0) { + return false; + } + this.values = new Uint32Array(oldValues.length - cnt); + this.values.set(oldValues.subarray(0, startIndex), 0); + this.values.set(oldValues.subarray(startIndex + cnt), startIndex); + this.prefixSum = new Uint32Array(this.values.length); + if (startIndex - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = startIndex - 1; + } + if (this.prefixSumValidIndex[0] >= 0) { + this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); + } + return true; + }; + PrefixSumComputer.prototype.getTotalValue = function () { + if (this.values.length === 0) { + return 0; + } + return this._getAccumulatedValue(this.values.length - 1); + }; + PrefixSumComputer.prototype.getAccumulatedValue = function (index) { + if (index < 0) { + return 0; + } + index = toUint32(index); + return this._getAccumulatedValue(index); + }; + PrefixSumComputer.prototype._getAccumulatedValue = function (index) { + if (index <= this.prefixSumValidIndex[0]) { + return this.prefixSum[index]; + } + var startIndex = this.prefixSumValidIndex[0] + 1; + if (startIndex === 0) { + this.prefixSum[0] = this.values[0]; + startIndex++; + } + if (index >= this.values.length) { + index = this.values.length - 1; + } + for (var i = startIndex; i <= index; i++) { + this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i]; + } + this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index); + return this.prefixSum[index]; + }; + PrefixSumComputer.prototype.getIndexOf = function (accumulatedValue) { + accumulatedValue = Math.floor(accumulatedValue); //@perf + // Compute all sums (to get a fully valid prefixSum) + this.getTotalValue(); + var low = 0; + var high = this.values.length - 1; + var mid = 0; + var midStop = 0; + var midStart = 0; + while (low <= high) { + mid = low + ((high - low) / 2) | 0; + midStop = this.prefixSum[mid]; + midStart = midStop - this.values[mid]; + if (accumulatedValue < midStart) { + high = mid - 1; + } + else if (accumulatedValue >= midStop) { + low = mid + 1; + } + else { + break; + } + } + return new PrefixSumIndexOfResult(mid, accumulatedValue - midStart); + }; + return PrefixSumComputer; +}()); + +var PrefixSumComputerWithCache = /** @class */ (function () { + function PrefixSumComputerWithCache(values) { + this._cacheAccumulatedValueStart = 0; + this._cache = null; + this._actual = new prefixSumComputer_PrefixSumComputer(values); + this._bustCache(); + } + PrefixSumComputerWithCache.prototype._bustCache = function () { + this._cacheAccumulatedValueStart = 0; + this._cache = null; + }; + PrefixSumComputerWithCache.prototype.insertValues = function (insertIndex, insertValues) { + if (this._actual.insertValues(insertIndex, insertValues)) { + this._bustCache(); + } + }; + PrefixSumComputerWithCache.prototype.changeValue = function (index, value) { + if (this._actual.changeValue(index, value)) { + this._bustCache(); + } + }; + PrefixSumComputerWithCache.prototype.removeValues = function (startIndex, cnt) { + if (this._actual.removeValues(startIndex, cnt)) { + this._bustCache(); + } + }; + PrefixSumComputerWithCache.prototype.getTotalValue = function () { + return this._actual.getTotalValue(); + }; + PrefixSumComputerWithCache.prototype.getAccumulatedValue = function (index) { + return this._actual.getAccumulatedValue(index); + }; + PrefixSumComputerWithCache.prototype.getIndexOf = function (accumulatedValue) { + accumulatedValue = Math.floor(accumulatedValue); //@perf + if (this._cache !== null) { + var cacheIndex = accumulatedValue - this._cacheAccumulatedValueStart; + if (cacheIndex >= 0 && cacheIndex < this._cache.length) { + // Cache hit! + return this._cache[cacheIndex]; + } + } + // Cache miss! + return this._actual.getIndexOf(accumulatedValue); + }; + /** + * Gives a hint that a lot of requests are about to come in for these accumulated values. + */ + PrefixSumComputerWithCache.prototype.warmUpCache = function (accumulatedValueStart, accumulatedValueEnd) { + var newCache = []; + for (var accumulatedValue = accumulatedValueStart; accumulatedValue <= accumulatedValueEnd; accumulatedValue++) { + newCache[accumulatedValue - accumulatedValueStart] = this.getIndexOf(accumulatedValue); + } + this._cache = newCache; + this._cacheAccumulatedValueStart = accumulatedValueStart; + }; + return PrefixSumComputerWithCache; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var MirrorTextModel = /** @class */ (function () { +var mirrorTextModel_MirrorTextModel = /** @class */ (function () { function MirrorTextModel(uri, lines, eol, versionId) { this._uri = uri; this._lines = lines; @@ -5946,7 +4221,7 @@ var MirrorTextModel = /** @class */ (function () { for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) { var change = changes_1[_i]; this._acceptDeleteRange(change.range); - this._acceptInsertText(new _core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](change.range.startLineNumber, change.range.startColumn), change.text); + this._acceptInsertText(new Position(change.range.startLineNumber, change.range.startColumn), change.text); } this._versionId = e.versionId; }; @@ -5958,7 +4233,7 @@ var MirrorTextModel = /** @class */ (function () { for (var i = 0; i < linesLength; i++) { lineStartValues[i] = this._lines[i].length + eolLength; } - this._lineStarts = new _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__["PrefixSumComputer"](lineStartValues); + this._lineStarts = new prefixSumComputer_PrefixSumComputer(lineStartValues); } }; /** @@ -6025,22 +4300,7 @@ var MirrorTextModel = /** @class */ (function () { }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js ***! - \*****************************************************************************/ -/*! exports provided: USUAL_WORD_SEPARATORS, DEFAULT_WORD_REGEXP, ensureValidWordDefinition, getWordAtText */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USUAL_WORD_SEPARATORS", function() { return USUAL_WORD_SEPARATORS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_WORD_REGEXP", function() { return DEFAULT_WORD_REGEXP; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureValidWordDefinition", function() { return ensureValidWordDefinition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWordAtText", function() { return getWordAtText; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -6154,30 +4414,71 @@ function getWordAtText(column, wordDefinition, text, textOffset) { return ret; } +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ -/***/ }), +/** + * A fast character classifier that uses a compact array for ASCII values. + */ +var characterClassifier_CharacterClassifier = /** @class */ (function () { + function CharacterClassifier(_defaultValue) { + var defaultValue = toUint8(_defaultValue); + this._defaultValue = defaultValue; + this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue); + this._map = new Map(); + } + CharacterClassifier._createAsciiMap = function (defaultValue) { + var asciiMap = new Uint8Array(256); + for (var i = 0; i < 256; i++) { + asciiMap[i] = defaultValue; + } + return asciiMap; + }; + CharacterClassifier.prototype.set = function (charCode, _value) { + var value = toUint8(_value); + if (charCode >= 0 && charCode < 256) { + this._asciiMap[charCode] = value; + } + else { + this._map.set(charCode, value); + } + }; + CharacterClassifier.prototype.get = function (charCode) { + if (charCode >= 0 && charCode < 256) { + return this._asciiMap[charCode]; + } + else { + return (this._map.get(charCode) || this._defaultValue); + } + }; + return CharacterClassifier; +}()); -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js ***! - \*******************************************************************************/ -/*! exports provided: StateMachine, LinkComputer, computeLinks */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +var CharacterSet = /** @class */ (function () { + function CharacterSet() { + this._actual = new characterClassifier_CharacterClassifier(0 /* False */); + } + CharacterSet.prototype.add = function (charCode) { + this._actual.set(charCode, 1 /* True */); + }; + CharacterSet.prototype.has = function (charCode) { + return (this._actual.get(charCode) === 1 /* True */); + }; + return CharacterSet; +}()); -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StateMachine", function() { return StateMachine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkComputer", function() { return LinkComputer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeLinks", function() { return computeLinks; }); -/* harmony import */ var _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/characterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js"); -/* harmony import */ var _core_uint_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/uint.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js"); + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var StateMachine = /** @class */ (function () { +var linkComputer_StateMachine = /** @class */ (function () { function StateMachine(edges) { var maxCharCode = 0; var maxState = 0 /* Invalid */; @@ -6195,7 +4496,7 @@ var StateMachine = /** @class */ (function () { } maxCharCode++; maxState++; - var states = new _core_uint_js__WEBPACK_IMPORTED_MODULE_1__["Uint8Matrix"](maxState, maxCharCode, 0 /* Invalid */); + var states = new Uint8Matrix(maxState, maxCharCode, 0 /* Invalid */); for (var i = 0, len = edges.length; i < len; i++) { var _b = edges[i], from = _b[0], chCode = _b[1], to = _b[2]; states.set(from, chCode, to); @@ -6216,7 +4517,7 @@ var StateMachine = /** @class */ (function () { var _stateMachine = null; function getStateMachine() { if (_stateMachine === null) { - _stateMachine = new StateMachine([ + _stateMachine = new linkComputer_StateMachine([ [1 /* Start */, 104 /* h */, 2 /* H */], [1 /* Start */, 72 /* H */, 2 /* H */], [1 /* Start */, 102 /* f */, 6 /* F */], @@ -6246,7 +4547,7 @@ function getStateMachine() { var _classifier = null; function getClassifier() { if (_classifier === null) { - _classifier = new _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__["CharacterClassifier"](0 /* None */); + _classifier = new characterClassifier_CharacterClassifier(0 /* None */); var FORCE_TERMINATION_CHARACTERS = ' \t<>\'\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…'; for (var i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) { _classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), 1 /* ForceTermination */); @@ -6412,19 +4713,7 @@ function computeLinks(model) { return LinkComputer.computeLinks(model); } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js ***! - \*************************************************************************************************/ -/*! exports provided: BasicInplaceReplace */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BasicInplaceReplace", function() { return BasicInplaceReplace; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -6513,40 +4802,171 @@ var BasicInplaceReplace = /** @class */ (function () { }()); +// EXTERNAL MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js +var polyfill = __webpack_require__("URDS"); -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js ***! - \****************************************************************************************/ -/*! exports provided: BaseEditorSimpleWorker, EditorSimpleWorkerImpl, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseEditorSimpleWorker", function() { return BaseEditorSimpleWorker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorSimpleWorkerImpl", function() { return EditorSimpleWorkerImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js"); -/* harmony import */ var _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../diff/diffComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js"); -/* harmony import */ var _model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../model/mirrorTextModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js"); -/* harmony import */ var _model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../model/wordHelper.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js"); -/* harmony import */ var _modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../modes/linkComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js"); -/* harmony import */ var _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../modes/supports/inplaceReplaceSupport.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js"); -/* harmony import */ var _standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../standalone/standaloneBase.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/functional.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { +function functional_once(fn) { + var _this = this; + var didCall = false; + var result; + return function () { + if (didCall) { + return result; + } + didCall = true; + result = fn.apply(_this, arguments); + return result; + }; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/linkedList.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var Node = /** @class */ (function () { + function Node(element) { + this.element = element; + this.next = Node.Undefined; + this.prev = Node.Undefined; + } + Node.Undefined = new Node(undefined); + return Node; +}()); +var linkedList_LinkedList = /** @class */ (function () { + function LinkedList() { + this._first = Node.Undefined; + this._last = Node.Undefined; + this._size = 0; + } + Object.defineProperty(LinkedList.prototype, "size", { + get: function () { + return this._size; + }, + enumerable: true, + configurable: true + }); + LinkedList.prototype.isEmpty = function () { + return this._first === Node.Undefined; + }; + LinkedList.prototype.clear = function () { + this._first = Node.Undefined; + this._last = Node.Undefined; + this._size = 0; + }; + LinkedList.prototype.unshift = function (element) { + return this._insert(element, false); + }; + LinkedList.prototype.push = function (element) { + return this._insert(element, true); + }; + LinkedList.prototype._insert = function (element, atTheEnd) { + var _this = this; + var newNode = new Node(element); + if (this._first === Node.Undefined) { + this._first = newNode; + this._last = newNode; + } + else if (atTheEnd) { + // push + var oldLast = this._last; + this._last = newNode; + newNode.prev = oldLast; + oldLast.next = newNode; + } + else { + // unshift + var oldFirst = this._first; + this._first = newNode; + newNode.next = oldFirst; + oldFirst.prev = newNode; + } + this._size += 1; + var didRemove = false; + return function () { + if (!didRemove) { + didRemove = true; + _this._remove(newNode); + } + }; + }; + LinkedList.prototype.shift = function () { + if (this._first === Node.Undefined) { + return undefined; + } + else { + var res = this._first.element; + this._remove(this._first); + return res; + } + }; + LinkedList.prototype._remove = function (node) { + if (node.prev !== Node.Undefined && node.next !== Node.Undefined) { + // middle + var anchor = node.prev; + anchor.next = node.next; + node.next.prev = anchor; + } + else if (node.prev === Node.Undefined && node.next === Node.Undefined) { + // only node + this._first = Node.Undefined; + this._last = Node.Undefined; + } + else if (node.next === Node.Undefined) { + // last + this._last = this._last.prev; + this._last.next = Node.Undefined; + } + else if (node.prev === Node.Undefined) { + // first + this._first = this._first.next; + this._first.prev = Node.Undefined; + } + // done + this._size -= 1; + }; + LinkedList.prototype.iterator = function () { + var element; + var node = this._first; + return { + next: function () { + if (node === Node.Undefined) { + return FIN; + } + if (!element) { + element = { done: false, value: node.element }; + } + else { + element.value = node.element; + } + node = node.next; + return element; + } + }; + }; + LinkedList.prototype.toArray = function () { + var result = []; + for (var node = this._first; node !== Node.Undefined; node = node.next) { + result.push(node.element); + } + return result; + }; + return LinkedList; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/event.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var event_extends = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || @@ -6563,944 +4983,1282 @@ var __extends = (undefined && undefined.__extends) || (function () { - - - - - - - - - - -/** - * @internal - */ -var MirrorModel = /** @class */ (function (_super) { - __extends(MirrorModel, _super); - function MirrorModel() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(MirrorModel.prototype, "uri", { - get: function () { - return this._uri; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(MirrorModel.prototype, "version", { - get: function () { - return this._versionId; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(MirrorModel.prototype, "eol", { - get: function () { - return this._eol; - }, - enumerable: true, - configurable: true - }); - MirrorModel.prototype.getValue = function () { - return this.getText(); - }; - MirrorModel.prototype.getLinesContent = function () { - return this._lines.slice(0); - }; - MirrorModel.prototype.getLineCount = function () { - return this._lines.length; - }; - MirrorModel.prototype.getLineContent = function (lineNumber) { - return this._lines[lineNumber - 1]; - }; - MirrorModel.prototype.getWordAtPosition = function (position, wordDefinition) { - var wordAtText = Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__["getWordAtText"])(position.column, Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__["ensureValidWordDefinition"])(wordDefinition), this._lines[position.lineNumber - 1], 0); - if (wordAtText) { - return new _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn); - } - return null; - }; - MirrorModel.prototype.getWordUntilPosition = function (position, wordDefinition) { - var wordAtPosition = this.getWordAtPosition(position, wordDefinition); - if (!wordAtPosition) { - return { - word: '', - startColumn: position.column, - endColumn: position.column - }; - } - return { - word: this._lines[position.lineNumber - 1].substring(wordAtPosition.startColumn - 1, position.column - 1), - startColumn: wordAtPosition.startColumn, - endColumn: position.column - }; - }; - MirrorModel.prototype.createWordIterator = function (wordDefinition) { - var _this = this; - var obj; - var lineNumber = 0; - var lineText; - var wordRangesIdx = 0; - var wordRanges = []; - var next = function () { - if (wordRangesIdx < wordRanges.length) { - var value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end); - wordRangesIdx += 1; - if (!obj) { - obj = { done: false, value: value }; +var event_Event; +(function (Event) { + var _disposable = { dispose: function () { } }; + Event.None = function () { return _disposable; }; + /** + * Given an event, returns another event which only fires once. + */ + function once(event) { + return function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + // we need this, in case the event fires during the listener call + var didFire = false; + var result; + result = event(function (e) { + if (didFire) { + return; + } + else if (result) { + result.dispose(); } else { - obj.value = value; + didFire = true; } - return obj; + return listener.call(thisArgs, e); + }, null, disposables); + if (didFire) { + result.dispose(); } - else if (lineNumber >= _this._lines.length) { - return _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_2__["FIN"]; + return result; + }; + } + Event.once = once; + /** + * Given an event and a `map` function, returns another event which maps each element + * throught the mapping function. + */ + function map(event, map) { + return snapshot(function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return event(function (i) { return listener.call(thisArgs, map(i)); }, null, disposables); + }); + } + Event.map = map; + /** + * Given an event and an `each` function, returns another identical event and calls + * the `each` function per each element. + */ + function forEach(event, each) { + return snapshot(function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return event(function (i) { each(i); listener.call(thisArgs, i); }, null, disposables); + }); + } + Event.forEach = forEach; + function filter(event, filter) { + return snapshot(function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return event(function (e) { return filter(e) && listener.call(thisArgs, e); }, null, disposables); + }); + } + Event.filter = filter; + /** + * Given an event, returns the same event but typed as `Event`. + */ + function signal(event) { + return event; + } + Event.signal = signal; + /** + * Given a collection of events, returns a single event which emits + * whenever any of the provided events emit. + */ + function any() { + var events = []; + for (var _i = 0; _i < arguments.length; _i++) { + events[_i] = arguments[_i]; + } + return function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return combinedDisposable(events.map(function (event) { return event(function (e) { return listener.call(thisArgs, e); }, null, disposables); })); + }; + } + Event.any = any; + /** + * Given an event and a `merge` function, returns another event which maps each element + * and the cummulative result throught the `merge` function. Similar to `map`, but with memory. + */ + function reduce(event, merge, initial) { + var output = initial; + return map(event, function (e) { + output = merge(output, e); + return output; + }); + } + Event.reduce = reduce; + /** + * Given a chain of event processing functions (filter, map, etc), each + * function will be invoked per event & per listener. Snapshotting an event + * chain allows each function to be invoked just once per event. + */ + function snapshot(event) { + var listener; + var emitter = new event_Emitter({ + onFirstListenerAdd: function () { + listener = event(emitter.fire, emitter); + }, + onLastListenerRemove: function () { + listener.dispose(); + } + }); + return emitter.event; + } + Event.snapshot = snapshot; + function debounce(event, merge, delay, leading, leakWarningThreshold) { + if (delay === void 0) { delay = 100; } + if (leading === void 0) { leading = false; } + var subscription; + var output = undefined; + var handle = undefined; + var numDebouncedCalls = 0; + var emitter = new event_Emitter({ + leakWarningThreshold: leakWarningThreshold, + onFirstListenerAdd: function () { + subscription = event(function (cur) { + numDebouncedCalls++; + output = merge(output, cur); + if (leading && !handle) { + emitter.fire(output); + } + clearTimeout(handle); + handle = setTimeout(function () { + var _output = output; + output = undefined; + handle = undefined; + if (!leading || numDebouncedCalls > 1) { + emitter.fire(_output); + } + numDebouncedCalls = 0; + }, delay); + }); + }, + onLastListenerRemove: function () { + subscription.dispose(); + } + }); + return emitter.event; + } + Event.debounce = debounce; + /** + * Given an event, it returns another event which fires only once and as soon as + * the input event emits. The event data is the number of millis it took for the + * event to fire. + */ + function stopwatch(event) { + var start = new Date().getTime(); + return map(once(event), function (_) { return new Date().getTime() - start; }); + } + Event.stopwatch = stopwatch; + /** + * Given an event, it returns another event which fires only when the event + * element changes. + */ + function latch(event) { + var firstCall = true; + var cache; + return filter(event, function (value) { + var shouldEmit = firstCall || value !== cache; + firstCall = false; + cache = value; + return shouldEmit; + }); + } + Event.latch = latch; + /** + * Buffers the provided event until a first listener comes + * along, at which point fire all the events at once and + * pipe the event from then on. + * + * ```typescript + * const emitter = new Emitter(); + * const event = emitter.event; + * const bufferedEvent = buffer(event); + * + * emitter.fire(1); + * emitter.fire(2); + * emitter.fire(3); + * // nothing... + * + * const listener = bufferedEvent(num => console.log(num)); + * // 1, 2, 3 + * + * emitter.fire(4); + * // 4 + * ``` + */ + function buffer(event, nextTick, _buffer) { + if (nextTick === void 0) { nextTick = false; } + if (_buffer === void 0) { _buffer = []; } + var buffer = _buffer.slice(); + var listener = event(function (e) { + if (buffer) { + buffer.push(e); } else { - lineText = _this._lines[lineNumber]; - wordRanges = _this._wordenize(lineText, wordDefinition); - wordRangesIdx = 0; - lineNumber += 1; - return next(); + emitter.fire(e); } + }); + var flush = function () { + if (buffer) { + buffer.forEach(function (e) { return emitter.fire(e); }); + } + buffer = null; }; - return { next: next }; - }; - MirrorModel.prototype.getLineWords = function (lineNumber, wordDefinition) { - var content = this._lines[lineNumber - 1]; - var ranges = this._wordenize(content, wordDefinition); - var words = []; - for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { - var range = ranges_1[_i]; - words.push({ - word: content.substring(range.start, range.end), - startColumn: range.start + 1, - endColumn: range.end + 1 - }); - } - return words; - }; - MirrorModel.prototype._wordenize = function (content, wordDefinition) { - var result = []; - var match; - wordDefinition.lastIndex = 0; // reset lastIndex just to be sure - while (match = wordDefinition.exec(content)) { - if (match[0].length === 0) { - // it did match the empty string - break; + var emitter = new event_Emitter({ + onFirstListenerAdd: function () { + if (!listener) { + listener = event(function (e) { return emitter.fire(e); }); + } + }, + onFirstListenerDidAdd: function () { + if (buffer) { + if (nextTick) { + setTimeout(flush); + } + else { + flush(); + } + } + }, + onLastListenerRemove: function () { + if (listener) { + listener.dispose(); + } + listener = null; } - result.push({ start: match.index, end: match.index + match[0].length }); - } - return result; - }; - MirrorModel.prototype.getValueInRange = function (range) { - range = this._validateRange(range); - if (range.startLineNumber === range.endLineNumber) { - return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); - } - var lineEnding = this._eol; - var startLineIndex = range.startLineNumber - 1; - var endLineIndex = range.endLineNumber - 1; - var resultLines = []; - resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); - for (var i = startLineIndex + 1; i < endLineIndex; i++) { - resultLines.push(this._lines[i]); - } - resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); - return resultLines.join(lineEnding); - }; - MirrorModel.prototype.offsetAt = function (position) { - position = this._validatePosition(position); - this._ensureLineStarts(); - return this._lineStarts.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1); - }; - MirrorModel.prototype.positionAt = function (offset) { - offset = Math.floor(offset); - offset = Math.max(0, offset); - this._ensureLineStarts(); - var out = this._lineStarts.getIndexOf(offset); - var lineLength = this._lines[out.index].length; - // Ensure we return a valid position - return { - lineNumber: 1 + out.index, - column: 1 + Math.min(out.remainder, lineLength) - }; - }; - MirrorModel.prototype._validateRange = function (range) { - var start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn }); - var end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn }); - if (start.lineNumber !== range.startLineNumber - || start.column !== range.startColumn - || end.lineNumber !== range.endLineNumber - || end.column !== range.endColumn) { - return { - startLineNumber: start.lineNumber, - startColumn: start.column, - endLineNumber: end.lineNumber, - endColumn: end.column - }; - } - return range; - }; - MirrorModel.prototype._validatePosition = function (position) { - if (!_core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"].isIPosition(position)) { - throw new Error('bad position'); - } - var lineNumber = position.lineNumber, column = position.column; - var hasChanged = false; - if (lineNumber < 1) { - lineNumber = 1; - column = 1; - hasChanged = true; - } - else if (lineNumber > this._lines.length) { - lineNumber = this._lines.length; - column = this._lines[lineNumber - 1].length + 1; - hasChanged = true; - } - else { - var maxCharacter = this._lines[lineNumber - 1].length + 1; - if (column < 1) { - column = 1; - hasChanged = true; - } - else if (column > maxCharacter) { - column = maxCharacter; - hasChanged = true; - } - } - if (!hasChanged) { - return position; - } - else { - return { lineNumber: lineNumber, column: column }; - } - }; - return MirrorModel; -}(_model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_8__["MirrorTextModel"])); -/** - * @internal - */ -var BaseEditorSimpleWorker = /** @class */ (function () { - function BaseEditorSimpleWorker(foreignModuleFactory) { - this._foreignModuleFactory = foreignModuleFactory; - this._foreignModule = null; + }); + return emitter.event; } - // ---- BEGIN diff -------------------------------------------------------------------------- - BaseEditorSimpleWorker.prototype.computeDiff = function (originalUrl, modifiedUrl, ignoreTrimWhitespace) { - var original = this._getModel(originalUrl); - var modified = this._getModel(modifiedUrl); - if (!original || !modified) { - return Promise.resolve(null); + Event.buffer = buffer; + var ChainableEvent = /** @class */ (function () { + function ChainableEvent(event) { + this.event = event; } - var originalLines = original.getLinesContent(); - var modifiedLines = modified.getLinesContent(); - var diffComputer = new _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_7__["DiffComputer"](originalLines, modifiedLines, { - shouldComputeCharChanges: true, - shouldPostProcessCharChanges: true, - shouldIgnoreTrimWhitespace: ignoreTrimWhitespace, - shouldMakePrettyDiff: true - }); - var changes = diffComputer.computeDiff(); - var identical = (changes.length > 0 ? false : this._modelsAreIdentical(original, modified)); - return Promise.resolve({ - identical: identical, - changes: changes - }); - }; - BaseEditorSimpleWorker.prototype._modelsAreIdentical = function (original, modified) { - var originalLineCount = original.getLineCount(); - var modifiedLineCount = modified.getLineCount(); - if (originalLineCount !== modifiedLineCount) { - return false; - } - for (var line = 1; line <= originalLineCount; line++) { - var originalLine = original.getLineContent(line); - var modifiedLine = modified.getLineContent(line); - if (originalLine !== modifiedLine) { - return false; - } - } - return true; - }; - BaseEditorSimpleWorker.prototype.computeMoreMinimalEdits = function (modelUrl, edits) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(edits); - } - var result = []; - var lastEol = undefined; - edits = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["mergeSort"])(edits, function (a, b) { - if (a.range && b.range) { - return _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].compareRangesUsingStarts(a.range, b.range); - } - // eol only changes should go to the end - var aRng = a.range ? 0 : 1; - var bRng = b.range ? 0 : 1; - return aRng - bRng; - }); - for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { - var _a = edits_1[_i], range = _a.range, text = _a.text, eol = _a.eol; - if (typeof eol === 'number') { - lastEol = eol; - } - if (_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].isEmpty(range) && !text) { - // empty change - continue; - } - var original = model.getValueInRange(range); - text = text.replace(/\r\n|\n|\r/g, model.eol); - if (original === text) { - // noop - continue; - } - // make sure diff won't take too long - if (Math.max(text.length, original.length) > BaseEditorSimpleWorker._diffLimit) { - result.push({ range: range, text: text }); - continue; - } - // compute diff between original and edit.text - var changes = Object(_base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__["stringDiff"])(original, text, false); - var editOffset = model.offsetAt(_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].lift(range).getStartPosition()); - for (var _b = 0, changes_1 = changes; _b < changes_1.length; _b++) { - var change = changes_1[_b]; - var start = model.positionAt(editOffset + change.originalStart); - var end = model.positionAt(editOffset + change.originalStart + change.originalLength); - var newEdit = { - text: text.substr(change.modifiedStart, change.modifiedLength), - range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column } - }; - if (model.getValueInRange(newEdit.range) !== newEdit.text) { - result.push(newEdit); - } - } - } - if (typeof lastEol === 'number') { - result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }); - } - return Promise.resolve(result); - }; - // ---- END minimal edits --------------------------------------------------------------- - BaseEditorSimpleWorker.prototype.computeLinks = function (modelUrl) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(null); - } - return Promise.resolve(Object(_modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_10__["computeLinks"])(model)); - }; - BaseEditorSimpleWorker.prototype.textualSuggest = function (modelUrl, position, wordDef, wordDefFlags) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(null); - } - var seen = Object.create(null); - var suggestions = []; - var wordDefRegExp = new RegExp(wordDef, wordDefFlags); - var wordUntil = model.getWordUntilPosition(position, wordDefRegExp); - var wordAt = model.getWordAtPosition(position, wordDefRegExp); - if (wordAt) { - seen[model.getValueInRange(wordAt)] = true; - } - for (var iter = model.createWordIterator(wordDefRegExp), e = iter.next(); !e.done && suggestions.length <= BaseEditorSimpleWorker._suggestionsLimit; e = iter.next()) { - var word = e.value; - if (seen[word]) { - continue; - } - seen[word] = true; - if (!isNaN(Number(word))) { - continue; - } - suggestions.push({ - kind: 18 /* Text */, - label: word, - insertText: word, - range: { startLineNumber: position.lineNumber, startColumn: wordUntil.startColumn, endLineNumber: position.lineNumber, endColumn: wordUntil.endColumn } - }); - } - return Promise.resolve({ suggestions: suggestions }); - }; - // ---- END suggest -------------------------------------------------------------------------- - //#region -- word ranges -- - BaseEditorSimpleWorker.prototype.computeWordRanges = function (modelUrl, range, wordDef, wordDefFlags) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(Object.create(null)); - } - var wordDefRegExp = new RegExp(wordDef, wordDefFlags); - var result = Object.create(null); - for (var line = range.startLineNumber; line < range.endLineNumber; line++) { - var words = model.getLineWords(line, wordDefRegExp); - for (var _i = 0, words_1 = words; _i < words_1.length; _i++) { - var word = words_1[_i]; - if (!isNaN(Number(word.word))) { - continue; - } - var array = result[word.word]; - if (!array) { - array = []; - result[word.word] = array; - } - array.push({ - startLineNumber: line, - startColumn: word.startColumn, - endLineNumber: line, - endColumn: word.endColumn - }); - } - } - return Promise.resolve(result); - }; - //#endregion - BaseEditorSimpleWorker.prototype.navigateValueSet = function (modelUrl, range, up, wordDef, wordDefFlags) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(null); - } - var wordDefRegExp = new RegExp(wordDef, wordDefFlags); - if (range.startColumn === range.endColumn) { - range = { - startLineNumber: range.startLineNumber, - startColumn: range.startColumn, - endLineNumber: range.endLineNumber, - endColumn: range.endColumn + 1 - }; - } - var selectionText = model.getValueInRange(range); - var wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp); - if (!wordRange) { - return Promise.resolve(null); - } - var word = model.getValueInRange(wordRange); - var result = _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_11__["BasicInplaceReplace"].INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up); - return Promise.resolve(result); - }; - // ---- BEGIN foreign module support -------------------------------------------------------------------------- - BaseEditorSimpleWorker.prototype.loadForeignModule = function (moduleId, createData) { - var _this = this; - var ctx = { - getMirrorModels: function () { - return _this._getModels(); - } + ChainableEvent.prototype.map = function (fn) { + return new ChainableEvent(map(this.event, fn)); }; - if (this._foreignModuleFactory) { - this._foreignModule = this._foreignModuleFactory(ctx, createData); - // static foreing module - var methods = []; - for (var _i = 0, _a = Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_13__["getAllPropertyNames"])(this._foreignModule); _i < _a.length; _i++) { - var prop = _a[_i]; - if (typeof this._foreignModule[prop] === 'function') { - methods.push(prop); + ChainableEvent.prototype.forEach = function (fn) { + return new ChainableEvent(forEach(this.event, fn)); + }; + ChainableEvent.prototype.filter = function (fn) { + return new ChainableEvent(filter(this.event, fn)); + }; + ChainableEvent.prototype.reduce = function (merge, initial) { + return new ChainableEvent(reduce(this.event, merge, initial)); + }; + ChainableEvent.prototype.latch = function () { + return new ChainableEvent(latch(this.event)); + }; + ChainableEvent.prototype.on = function (listener, thisArgs, disposables) { + return this.event(listener, thisArgs, disposables); + }; + ChainableEvent.prototype.once = function (listener, thisArgs, disposables) { + return once(this.event)(listener, thisArgs, disposables); + }; + return ChainableEvent; + }()); + function chain(event) { + return new ChainableEvent(event); + } + Event.chain = chain; + function fromNodeEventEmitter(emitter, eventName, map) { + if (map === void 0) { map = function (id) { return id; }; } + var fn = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return result.fire(map.apply(void 0, args)); + }; + var onFirstListenerAdd = function () { return emitter.on(eventName, fn); }; + var onLastListenerRemove = function () { return emitter.removeListener(eventName, fn); }; + var result = new event_Emitter({ onFirstListenerAdd: onFirstListenerAdd, onLastListenerRemove: onLastListenerRemove }); + return result.event; + } + Event.fromNodeEventEmitter = fromNodeEventEmitter; + function fromPromise(promise) { + var emitter = new event_Emitter(); + var shouldEmit = false; + promise + .then(undefined, function () { return null; }) + .then(function () { + if (!shouldEmit) { + setTimeout(function () { return emitter.fire(undefined); }, 0); + } + else { + emitter.fire(undefined); + } + }); + shouldEmit = true; + return emitter.event; + } + Event.fromPromise = fromPromise; + function toPromise(event) { + return new Promise(function (c) { return once(event)(c); }); + } + Event.toPromise = toPromise; +})(event_Event || (event_Event = {})); +var _globalLeakWarningThreshold = -1; +var LeakageMonitor = /** @class */ (function () { + function LeakageMonitor(customThreshold, name) { + if (name === void 0) { name = Math.random().toString(18).slice(2, 5); } + this.customThreshold = customThreshold; + this.name = name; + this._warnCountdown = 0; + } + LeakageMonitor.prototype.dispose = function () { + if (this._stacks) { + this._stacks.clear(); + } + }; + LeakageMonitor.prototype.check = function (listenerCount) { + var _this = this; + var threshold = _globalLeakWarningThreshold; + if (typeof this.customThreshold === 'number') { + threshold = this.customThreshold; + } + if (threshold <= 0 || listenerCount < threshold) { + return undefined; + } + if (!this._stacks) { + this._stacks = new Map(); + } + var stack = new Error().stack.split('\n').slice(3).join('\n'); + var count = (this._stacks.get(stack) || 0); + this._stacks.set(stack, count + 1); + this._warnCountdown -= 1; + if (this._warnCountdown <= 0) { + // only warn on first exceed and then every time the limit + // is exceeded by 50% again + this._warnCountdown = threshold * 0.5; + // find most frequent listener and print warning + var topStack_1; + var topCount_1 = 0; + this._stacks.forEach(function (count, stack) { + if (!topStack_1 || topCount_1 < count) { + topStack_1 = stack; + topCount_1 = count; + } + }); + console.warn("[" + this.name + "] potential listener LEAK detected, having " + listenerCount + " listeners already. MOST frequent listener (" + topCount_1 + "):"); + console.warn(topStack_1); + } + return function () { + var count = (_this._stacks.get(stack) || 0); + _this._stacks.set(stack, count - 1); + }; + }; + return LeakageMonitor; +}()); +/** + * The Emitter can be used to expose an Event to the public + * to fire it from the insides. + * Sample: + class Document { + + private _onDidChange = new Emitter<(value:string)=>any>(); + + public onDidChange = this._onDidChange.event; + + // getter-style + // get onDidChange(): Event<(value:string)=>any> { + // return this._onDidChange.event; + // } + + private _doIt() { + //... + this._onDidChange.fire(value); + } + } + */ +var event_Emitter = /** @class */ (function () { + function Emitter(options) { + this._disposed = false; + this._options = options; + this._leakageMon = _globalLeakWarningThreshold > 0 + ? new LeakageMonitor(this._options && this._options.leakWarningThreshold) + : undefined; + } + Object.defineProperty(Emitter.prototype, "event", { + /** + * For the public to allow to subscribe + * to events from this Emitter + */ + get: function () { + var _this = this; + if (!this._event) { + this._event = function (listener, thisArgs, disposables) { + if (!_this._listeners) { + _this._listeners = new linkedList_LinkedList(); + } + var firstListener = _this._listeners.isEmpty(); + if (firstListener && _this._options && _this._options.onFirstListenerAdd) { + _this._options.onFirstListenerAdd(_this); + } + var remove = _this._listeners.push(!thisArgs ? listener : [listener, thisArgs]); + if (firstListener && _this._options && _this._options.onFirstListenerDidAdd) { + _this._options.onFirstListenerDidAdd(_this); + } + if (_this._options && _this._options.onListenerDidAdd) { + _this._options.onListenerDidAdd(_this, listener, thisArgs); + } + // check and record this emitter for potential leakage + var removeMonitor; + if (_this._leakageMon) { + removeMonitor = _this._leakageMon.check(_this._listeners.size); + } + var result; + result = { + dispose: function () { + if (removeMonitor) { + removeMonitor(); + } + result.dispose = Emitter._noop; + if (!_this._disposed) { + remove(); + if (_this._options && _this._options.onLastListenerRemove) { + var hasListeners = (_this._listeners && !_this._listeners.isEmpty()); + if (!hasListeners) { + _this._options.onLastListenerRemove(_this); + } + } + } + } + }; + if (Array.isArray(disposables)) { + disposables.push(result); + } + return result; + }; + } + return this._event; + }, + enumerable: true, + configurable: true + }); + /** + * To be kept private to fire an event to + * subscribers + */ + Emitter.prototype.fire = function (event) { + if (this._listeners) { + // put all [listener,event]-pairs into delivery queue + // then emit all event. an inner/nested event might be + // the driver of this + if (!this._deliveryQueue) { + this._deliveryQueue = new linkedList_LinkedList(); + } + for (var iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) { + this._deliveryQueue.push([e.value, event]); + } + while (this._deliveryQueue.size > 0) { + var _a = this._deliveryQueue.shift(), listener = _a[0], event_1 = _a[1]; + try { + if (typeof listener === 'function') { + listener.call(undefined, event_1); + } + else { + listener[0].call(listener[1], event_1); + } + } + catch (e) { + onUnexpectedError(e); } } - return Promise.resolve(methods); - } - // ESM-comment-begin - // return new Promise((resolve, reject) => { - // require([moduleId], (foreignModule: { create: IForeignModuleFactory }) => { - // this._foreignModule = foreignModule.create(ctx, createData); - // - // let methods: string[] = []; - // for (const prop of getAllPropertyNames(this._foreignModule)) { - // if (typeof this._foreignModule[prop] === 'function') { - // methods.push(prop); - // } - // } - // - // resolve(methods); - // - // }, reject); - // }); - // ESM-comment-end - // ESM-uncomment-begin - return Promise.reject(new Error("Unexpected usage")); - // ESM-uncomment-end - }; - // foreign method request - BaseEditorSimpleWorker.prototype.fmr = function (method, args) { - if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') { - return Promise.reject(new Error('Missing requestHandler or method: ' + method)); - } - try { - return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args)); - } - catch (e) { - return Promise.reject(e); } }; - // ---- END diff -------------------------------------------------------------------------- - // ---- BEGIN minimal edits --------------------------------------------------------------- - BaseEditorSimpleWorker._diffLimit = 100000; - // ---- BEGIN suggest -------------------------------------------------------------------------- - BaseEditorSimpleWorker._suggestionsLimit = 10000; - return BaseEditorSimpleWorker; + Emitter.prototype.dispose = function () { + if (this._listeners) { + this._listeners.clear(); + } + if (this._deliveryQueue) { + this._deliveryQueue.clear(); + } + if (this._leakageMon) { + this._leakageMon.dispose(); + } + this._disposed = true; + }; + Emitter._noop = function () { }; + return Emitter; +}()); + +var event_PauseableEmitter = /** @class */ (function (_super) { + event_extends(PauseableEmitter, _super); + function PauseableEmitter(options) { + var _this = _super.call(this, options) || this; + _this._isPaused = 0; + _this._eventQueue = new linkedList_LinkedList(); + _this._mergeFn = options && options.merge; + return _this; + } + PauseableEmitter.prototype.pause = function () { + this._isPaused++; + }; + PauseableEmitter.prototype.resume = function () { + if (this._isPaused !== 0 && --this._isPaused === 0) { + if (this._mergeFn) { + // use the merge function to create a single composite + // event. make a copy in case firing pauses this emitter + var events = this._eventQueue.toArray(); + this._eventQueue.clear(); + _super.prototype.fire.call(this, this._mergeFn(events)); + } + else { + // no merging, fire each event individually and test + // that this emitter isn't paused halfway through + while (!this._isPaused && this._eventQueue.size !== 0) { + _super.prototype.fire.call(this, this._eventQueue.shift()); + } + } + } + }; + PauseableEmitter.prototype.fire = function (event) { + if (this._listeners) { + if (this._isPaused !== 0) { + this._eventQueue.push(event); + } + else { + _super.prototype.fire.call(this, event); + } + } + }; + return PauseableEmitter; +}(event_Emitter)); + +var event_EventMultiplexer = /** @class */ (function () { + function EventMultiplexer() { + var _this = this; + this.hasListeners = false; + this.events = []; + this.emitter = new event_Emitter({ + onFirstListenerAdd: function () { return _this.onFirstListenerAdd(); }, + onLastListenerRemove: function () { return _this.onLastListenerRemove(); } + }); + } + Object.defineProperty(EventMultiplexer.prototype, "event", { + get: function () { + return this.emitter.event; + }, + enumerable: true, + configurable: true + }); + EventMultiplexer.prototype.add = function (event) { + var _this = this; + var e = { event: event, listener: null }; + this.events.push(e); + if (this.hasListeners) { + this.hook(e); + } + var dispose = function () { + if (_this.hasListeners) { + _this.unhook(e); + } + var idx = _this.events.indexOf(e); + _this.events.splice(idx, 1); + }; + return toDisposable(functional_once(dispose)); + }; + EventMultiplexer.prototype.onFirstListenerAdd = function () { + var _this = this; + this.hasListeners = true; + this.events.forEach(function (e) { return _this.hook(e); }); + }; + EventMultiplexer.prototype.onLastListenerRemove = function () { + var _this = this; + this.hasListeners = false; + this.events.forEach(function (e) { return _this.unhook(e); }); + }; + EventMultiplexer.prototype.hook = function (e) { + var _this = this; + e.listener = e.event(function (r) { return _this.emitter.fire(r); }); + }; + EventMultiplexer.prototype.unhook = function (e) { + if (e.listener) { + e.listener.dispose(); + } + e.listener = null; + }; + EventMultiplexer.prototype.dispose = function () { + this.emitter.dispose(); + }; + return EventMultiplexer; }()); /** - * @internal + * The EventBufferer is useful in situations in which you want + * to delay firing your events during some code. + * You can wrap that code and be sure that the event will not + * be fired during that wrap. + * + * ``` + * const emitter: Emitter; + * const delayer = new EventDelayer(); + * const delayedEvent = delayer.wrapEvent(emitter.event); + * + * delayedEvent(console.log); + * + * delayer.bufferEvents(() => { + * emitter.fire(); // event will not be fired yet + * }); + * + * // event will only be fired at this point + * ``` */ -var EditorSimpleWorkerImpl = /** @class */ (function (_super) { - __extends(EditorSimpleWorkerImpl, _super); - function EditorSimpleWorkerImpl(foreignModuleFactory) { - var _this = _super.call(this, foreignModuleFactory) || this; - _this._models = Object.create(null); - return _this; +var EventBufferer = /** @class */ (function () { + function EventBufferer() { + this.buffers = []; } - EditorSimpleWorkerImpl.prototype.dispose = function () { - this._models = Object.create(null); - }; - EditorSimpleWorkerImpl.prototype._getModel = function (uri) { - return this._models[uri]; - }; - EditorSimpleWorkerImpl.prototype._getModels = function () { + EventBufferer.prototype.wrapEvent = function (event) { var _this = this; - var all = []; - Object.keys(this._models).forEach(function (key) { return all.push(_this._models[key]); }); - return all; + return function (listener, thisArgs, disposables) { + return event(function (i) { + var buffer = _this.buffers[_this.buffers.length - 1]; + if (buffer) { + buffer.push(function () { return listener.call(thisArgs, i); }); + } + else { + listener.call(thisArgs, i); + } + }, undefined, disposables); + }; }; - EditorSimpleWorkerImpl.prototype.acceptNewModel = function (data) { - this._models[data.url] = new MirrorModel(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"].parse(data.url), data.lines, data.EOL, data.versionId); + EventBufferer.prototype.bufferEvents = function (fn) { + var buffer = []; + this.buffers.push(buffer); + var r = fn(); + this.buffers.pop(); + buffer.forEach(function (flush) { return flush(); }); + return r; }; - EditorSimpleWorkerImpl.prototype.acceptModelChanged = function (strURL, e) { - if (!this._models[strURL]) { - return; - } - var model = this._models[strURL]; - model.onEvents(e); - }; - EditorSimpleWorkerImpl.prototype.acceptRemovedModel = function (strURL) { - if (!this._models[strURL]) { - return; - } - delete this._models[strURL]; - }; - return EditorSimpleWorkerImpl; -}(BaseEditorSimpleWorker)); + return EventBufferer; +}()); /** - * Called on the worker side - * @internal + * A Relay is an event forwarder which functions as a replugabble event pipe. + * Once created, you can connect an input event to it and it will simply forward + * events from that input event through its own `event` property. The `input` + * can be changed at any point in time. */ -function create() { - return new EditorSimpleWorkerImpl(null); -} -if (typeof importScripts === 'function') { - // Running in a web worker - _base_common_platform_js__WEBPACK_IMPORTED_MODULE_3__["globals"].monaco = Object(_standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_12__["createMonacoBaseAPI"])(); -} +var event_Relay = /** @class */ (function () { + function Relay() { + var _this = this; + this.listening = false; + this.inputEvent = event_Event.None; + this.inputEventListener = Disposable.None; + this.emitter = new event_Emitter({ + onFirstListenerDidAdd: function () { + _this.listening = true; + _this.inputEventListener = _this.inputEvent(_this.emitter.fire, _this.emitter); + }, + onLastListenerRemove: function () { + _this.listening = false; + _this.inputEventListener.dispose(); + } + }); + this.event = this.emitter.event; + } + Object.defineProperty(Relay.prototype, "input", { + set: function (event) { + this.inputEvent = event; + if (this.listening) { + this.inputEventListener.dispose(); + this.inputEventListener = event(this.emitter.fire, this.emitter); + } + }, + enumerable: true, + configurable: true + }); + Relay.prototype.dispose = function () { + this.inputEventListener.dispose(); + this.emitter.dispose(); + }; + return Relay; +}()); -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js ***! - \*************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/*! -Copyright (c) 2014 Taylor Hakes -Copyright (c) 2014 Forbes Lindesay - */ -(function (global, factory) { - true ? factory() : - undefined; -}(this, (function () { - 'use strict'; - - /** - * @this {Promise} - */ - function finallyConstructor(callback) { - var constructor = this.constructor; - return this.then( - function (value) { - return constructor.resolve(callback()).then(function () { - return value; - }); - }, - function (reason) { - return constructor.resolve(callback()).then(function () { - return constructor.reject(reason); - }); - } - ); - } - - // Store setTimeout reference so promise-polyfill will be unaffected by - // other code modifying setTimeout (like sinon.useFakeTimers()) - var setTimeoutFunc = setTimeout; - - function noop() { } - - // Polyfill for Function.prototype.bind - function bind(fn, thisArg) { - return function () { - fn.apply(thisArg, arguments); - }; - } - - /** - * @constructor - * @param {Function} fn - */ - function Promise(fn) { - if (!(this instanceof Promise)) - throw new TypeError('Promises must be constructed via new'); - if (typeof fn !== 'function') throw new TypeError('not a function'); - /** @type {!number} */ - this._state = 0; - /** @type {!boolean} */ - this._handled = false; - /** @type {Promise|undefined} */ - this._value = undefined; - /** @type {!Array} */ - this._deferreds = []; - - doResolve(fn, this); - } - - function handle(self, deferred) { - while (self._state === 3) { - self = self._value; - } - if (self._state === 0) { - self._deferreds.push(deferred); - return; - } - self._handled = true; - Promise._immediateFn(function () { - var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; - if (cb === null) { - (self._state === 1 ? resolve : reject)(deferred.promise, self._value); - return; - } - var ret; - try { - ret = cb(self._value); - } catch (e) { - reject(deferred.promise, e); - return; - } - resolve(deferred.promise, ret); - }); - } - - function resolve(self, newValue) { - try { - // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure - if (newValue === self) - throw new TypeError('A promise cannot be resolved with itself.'); - if ( - newValue && - (typeof newValue === 'object' || typeof newValue === 'function') - ) { - var then = newValue.then; - if (newValue instanceof Promise) { - self._state = 3; - self._value = newValue; - finale(self); - return; - } else if (typeof then === 'function') { - doResolve(bind(then, newValue), self); - return; - } - } - self._state = 1; - self._value = newValue; - finale(self); - } catch (e) { - reject(self, e); - } - } - - function reject(self, newValue) { - self._state = 2; - self._value = newValue; - finale(self); - } - - function finale(self) { - if (self._state === 2 && self._deferreds.length === 0) { - Promise._immediateFn(function () { - if (!self._handled) { - Promise._unhandledRejectionFn(self._value); - } - }); - } - - for (var i = 0, len = self._deferreds.length; i < len; i++) { - handle(self, self._deferreds[i]); - } - self._deferreds = null; - } - - /** - * @constructor - */ - function Handler(onFulfilled, onRejected, promise) { - this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; - this.onRejected = typeof onRejected === 'function' ? onRejected : null; - this.promise = promise; - } - - /** - * Take a potentially misbehaving resolver function and make sure - * onFulfilled and onRejected are only called once. - * - * Makes no guarantees about asynchrony. - */ - function doResolve(fn, self) { - var done = false; - try { - fn( - function (value) { - if (done) return; - done = true; - resolve(self, value); - }, - function (reason) { - if (done) return; - done = true; - reject(self, reason); - } - ); - } catch (ex) { - if (done) return; - done = true; - reject(self, ex); - } - } - - Promise.prototype['catch'] = function (onRejected) { - return this.then(null, onRejected); - }; - - Promise.prototype.then = function (onFulfilled, onRejected) { - // @ts-ignore - var prom = new this.constructor(noop); - - handle(this, new Handler(onFulfilled, onRejected, prom)); - return prom; - }; - - Promise.prototype['finally'] = finallyConstructor; - - Promise.all = function (arr) { - return new Promise(function (resolve, reject) { - if (!arr || typeof arr.length === 'undefined') - throw new TypeError('Promise.all accepts an array'); - var args = Array.prototype.slice.call(arr); - if (args.length === 0) return resolve([]); - var remaining = args.length; - - function res(i, val) { - try { - if (val && (typeof val === 'object' || typeof val === 'function')) { - var then = val.then; - if (typeof then === 'function') { - then.call( - val, - function (val) { - res(i, val); - }, - reject - ); - return; - } - } - args[i] = val; - if (--remaining === 0) { - resolve(args); - } - } catch (ex) { - reject(ex); - } - } - - for (var i = 0; i < args.length; i++) { - res(i, args[i]); - } - }); - }; - - Promise.resolve = function (value) { - if (value && typeof value === 'object' && value.constructor === Promise) { - return value; - } - - return new Promise(function (resolve) { - resolve(value); - }); - }; - - Promise.reject = function (value) { - return new Promise(function (resolve, reject) { - reject(value); - }); - }; - - Promise.race = function (values) { - return new Promise(function (resolve, reject) { - for (var i = 0, len = values.length; i < len; i++) { - values[i].then(resolve, reject); - } - }); - }; - - // Use polyfill for setImmediate for performance gains - Promise._immediateFn = - (typeof setImmediate === 'function' && - function (fn) { - setImmediate(fn); - }) || - function (fn) { - setTimeoutFunc(fn, 0); - }; - - Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { - if (typeof console !== 'undefined' && console) { - console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console - } - }; - - /** @suppress {undefinedVars} */ - var globalNS = (function () { - // the only reliable means to get the global object is - // `Function('return this')()` - // However, this causes CSP violations in Chrome apps. - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('unable to locate global object'); - })(); - - if (!('Promise' in globalNS)) { - globalNS['Promise'] = Promise; - } else if (!globalNS.Promise.prototype['finally']) { - globalNS.Promise.prototype['finally'] = finallyConstructor; - } - -}))); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js ***! - \**************************************************************************************/ -/*! exports provided: KeyMod, createMonacoBaseAPI */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyMod", function() { return KeyMod; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMonacoBaseAPI", function() { return createMonacoBaseAPI; }); -/* harmony import */ var _promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./promise-polyfill/polyfill.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js"); -/* harmony import */ var _promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _core_token_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../core/token.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js"); -/* harmony import */ var _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./standaloneEnums.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/cancellation.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - - - - - - - - - -var KeyMod = /** @class */ (function () { - function KeyMod() { +var shortcutEvent = Object.freeze(function (callback, context) { + var handle = setTimeout(callback.bind(context), 0); + return { dispose: function () { clearTimeout(handle); } }; +}); +var cancellation_CancellationToken; +(function (CancellationToken) { + function isCancellationToken(thing) { + if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) { + return true; + } + if (thing instanceof cancellation_MutableToken) { + return true; + } + if (!thing || typeof thing !== 'object') { + return false; + } + return typeof thing.isCancellationRequested === 'boolean' + && typeof thing.onCancellationRequested === 'function'; } - KeyMod.chord = function (firstPart, secondPart) { - return Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_3__["KeyChord"])(firstPart, secondPart); + CancellationToken.isCancellationToken = isCancellationToken; + CancellationToken.None = Object.freeze({ + isCancellationRequested: false, + onCancellationRequested: event_Event.None + }); + CancellationToken.Cancelled = Object.freeze({ + isCancellationRequested: true, + onCancellationRequested: shortcutEvent + }); +})(cancellation_CancellationToken || (cancellation_CancellationToken = {})); +var cancellation_MutableToken = /** @class */ (function () { + function MutableToken() { + this._isCancelled = false; + this._emitter = null; + } + MutableToken.prototype.cancel = function () { + if (!this._isCancelled) { + this._isCancelled = true; + if (this._emitter) { + this._emitter.fire(undefined); + this.dispose(); + } + } }; - KeyMod.CtrlCmd = 2048 /* CtrlCmd */; - KeyMod.Shift = 1024 /* Shift */; - KeyMod.Alt = 512 /* Alt */; - KeyMod.WinCtrl = 256 /* WinCtrl */; - return KeyMod; + Object.defineProperty(MutableToken.prototype, "isCancellationRequested", { + get: function () { + return this._isCancelled; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MutableToken.prototype, "onCancellationRequested", { + get: function () { + if (this._isCancelled) { + return shortcutEvent; + } + if (!this._emitter) { + this._emitter = new event_Emitter(); + } + return this._emitter.event; + }, + enumerable: true, + configurable: true + }); + MutableToken.prototype.dispose = function () { + if (this._emitter) { + this._emitter.dispose(); + this._emitter = null; + } + }; + return MutableToken; +}()); +var CancellationTokenSource = /** @class */ (function () { + function CancellationTokenSource(parent) { + this._token = undefined; + this._parentListener = undefined; + this._parentListener = parent && parent.onCancellationRequested(this.cancel, this); + } + Object.defineProperty(CancellationTokenSource.prototype, "token", { + get: function () { + if (!this._token) { + // be lazy and create the token only when + // actually needed + this._token = new cancellation_MutableToken(); + } + return this._token; + }, + enumerable: true, + configurable: true + }); + CancellationTokenSource.prototype.cancel = function () { + if (!this._token) { + // save an object by returning the default + // cancelled token when cancellation happens + // before someone asks for the token + this._token = cancellation_CancellationToken.Cancelled; + } + else if (this._token instanceof cancellation_MutableToken) { + // actually cancel + this._token.cancel(); + } + }; + CancellationTokenSource.prototype.dispose = function () { + if (this._parentListener) { + this._parentListener.dispose(); + } + if (!this._token) { + // ensure to initialize with an empty token if we had none + this._token = cancellation_CancellationToken.None; + } + else if (this._token instanceof cancellation_MutableToken) { + // actually dispose + this._token.dispose(); + } + }; + return CancellationTokenSource; }()); -function createMonacoBaseAPI() { - return { - editor: undefined, - languages: undefined, - CancellationTokenSource: _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationTokenSource"], - Emitter: _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"], - KeyCode: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["KeyCode"], - KeyMod: KeyMod, - Position: _core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"], - Range: _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"], - Selection: _core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"], - SelectionDirection: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["SelectionDirection"], - MarkerSeverity: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["MarkerSeverity"], - MarkerTag: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["MarkerTag"], - Uri: _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"], - Token: _core_token_js__WEBPACK_IMPORTED_MODULE_8__["Token"] + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var KeyCodeStrMap = /** @class */ (function () { + function KeyCodeStrMap() { + this._keyCodeToStr = []; + this._strToKeyCode = Object.create(null); + } + KeyCodeStrMap.prototype.define = function (keyCode, str) { + this._keyCodeToStr[keyCode] = str; + this._strToKeyCode[str.toLowerCase()] = keyCode; }; + KeyCodeStrMap.prototype.keyCodeToStr = function (keyCode) { + return this._keyCodeToStr[keyCode]; + }; + KeyCodeStrMap.prototype.strToKeyCode = function (str) { + return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */; + }; + return KeyCodeStrMap; +}()); +var uiMap = new KeyCodeStrMap(); +var userSettingsUSMap = new KeyCodeStrMap(); +var userSettingsGeneralMap = new KeyCodeStrMap(); +(function () { + function define(keyCode, uiLabel, usUserSettingsLabel, generalUserSettingsLabel) { + if (usUserSettingsLabel === void 0) { usUserSettingsLabel = uiLabel; } + if (generalUserSettingsLabel === void 0) { generalUserSettingsLabel = usUserSettingsLabel; } + uiMap.define(keyCode, uiLabel); + userSettingsUSMap.define(keyCode, usUserSettingsLabel); + userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel); + } + define(0 /* Unknown */, 'unknown'); + define(1 /* Backspace */, 'Backspace'); + define(2 /* Tab */, 'Tab'); + define(3 /* Enter */, 'Enter'); + define(4 /* Shift */, 'Shift'); + define(5 /* Ctrl */, 'Ctrl'); + define(6 /* Alt */, 'Alt'); + define(7 /* PauseBreak */, 'PauseBreak'); + define(8 /* CapsLock */, 'CapsLock'); + define(9 /* Escape */, 'Escape'); + define(10 /* Space */, 'Space'); + define(11 /* PageUp */, 'PageUp'); + define(12 /* PageDown */, 'PageDown'); + define(13 /* End */, 'End'); + define(14 /* Home */, 'Home'); + define(15 /* LeftArrow */, 'LeftArrow', 'Left'); + define(16 /* UpArrow */, 'UpArrow', 'Up'); + define(17 /* RightArrow */, 'RightArrow', 'Right'); + define(18 /* DownArrow */, 'DownArrow', 'Down'); + define(19 /* Insert */, 'Insert'); + define(20 /* Delete */, 'Delete'); + define(21 /* KEY_0 */, '0'); + define(22 /* KEY_1 */, '1'); + define(23 /* KEY_2 */, '2'); + define(24 /* KEY_3 */, '3'); + define(25 /* KEY_4 */, '4'); + define(26 /* KEY_5 */, '5'); + define(27 /* KEY_6 */, '6'); + define(28 /* KEY_7 */, '7'); + define(29 /* KEY_8 */, '8'); + define(30 /* KEY_9 */, '9'); + define(31 /* KEY_A */, 'A'); + define(32 /* KEY_B */, 'B'); + define(33 /* KEY_C */, 'C'); + define(34 /* KEY_D */, 'D'); + define(35 /* KEY_E */, 'E'); + define(36 /* KEY_F */, 'F'); + define(37 /* KEY_G */, 'G'); + define(38 /* KEY_H */, 'H'); + define(39 /* KEY_I */, 'I'); + define(40 /* KEY_J */, 'J'); + define(41 /* KEY_K */, 'K'); + define(42 /* KEY_L */, 'L'); + define(43 /* KEY_M */, 'M'); + define(44 /* KEY_N */, 'N'); + define(45 /* KEY_O */, 'O'); + define(46 /* KEY_P */, 'P'); + define(47 /* KEY_Q */, 'Q'); + define(48 /* KEY_R */, 'R'); + define(49 /* KEY_S */, 'S'); + define(50 /* KEY_T */, 'T'); + define(51 /* KEY_U */, 'U'); + define(52 /* KEY_V */, 'V'); + define(53 /* KEY_W */, 'W'); + define(54 /* KEY_X */, 'X'); + define(55 /* KEY_Y */, 'Y'); + define(56 /* KEY_Z */, 'Z'); + define(57 /* Meta */, 'Meta'); + define(58 /* ContextMenu */, 'ContextMenu'); + define(59 /* F1 */, 'F1'); + define(60 /* F2 */, 'F2'); + define(61 /* F3 */, 'F3'); + define(62 /* F4 */, 'F4'); + define(63 /* F5 */, 'F5'); + define(64 /* F6 */, 'F6'); + define(65 /* F7 */, 'F7'); + define(66 /* F8 */, 'F8'); + define(67 /* F9 */, 'F9'); + define(68 /* F10 */, 'F10'); + define(69 /* F11 */, 'F11'); + define(70 /* F12 */, 'F12'); + define(71 /* F13 */, 'F13'); + define(72 /* F14 */, 'F14'); + define(73 /* F15 */, 'F15'); + define(74 /* F16 */, 'F16'); + define(75 /* F17 */, 'F17'); + define(76 /* F18 */, 'F18'); + define(77 /* F19 */, 'F19'); + define(78 /* NumLock */, 'NumLock'); + define(79 /* ScrollLock */, 'ScrollLock'); + define(80 /* US_SEMICOLON */, ';', ';', 'OEM_1'); + define(81 /* US_EQUAL */, '=', '=', 'OEM_PLUS'); + define(82 /* US_COMMA */, ',', ',', 'OEM_COMMA'); + define(83 /* US_MINUS */, '-', '-', 'OEM_MINUS'); + define(84 /* US_DOT */, '.', '.', 'OEM_PERIOD'); + define(85 /* US_SLASH */, '/', '/', 'OEM_2'); + define(86 /* US_BACKTICK */, '`', '`', 'OEM_3'); + define(110 /* ABNT_C1 */, 'ABNT_C1'); + define(111 /* ABNT_C2 */, 'ABNT_C2'); + define(87 /* US_OPEN_SQUARE_BRACKET */, '[', '[', 'OEM_4'); + define(88 /* US_BACKSLASH */, '\\', '\\', 'OEM_5'); + define(89 /* US_CLOSE_SQUARE_BRACKET */, ']', ']', 'OEM_6'); + define(90 /* US_QUOTE */, '\'', '\'', 'OEM_7'); + define(91 /* OEM_8 */, 'OEM_8'); + define(92 /* OEM_102 */, 'OEM_102'); + define(93 /* NUMPAD_0 */, 'NumPad0'); + define(94 /* NUMPAD_1 */, 'NumPad1'); + define(95 /* NUMPAD_2 */, 'NumPad2'); + define(96 /* NUMPAD_3 */, 'NumPad3'); + define(97 /* NUMPAD_4 */, 'NumPad4'); + define(98 /* NUMPAD_5 */, 'NumPad5'); + define(99 /* NUMPAD_6 */, 'NumPad6'); + define(100 /* NUMPAD_7 */, 'NumPad7'); + define(101 /* NUMPAD_8 */, 'NumPad8'); + define(102 /* NUMPAD_9 */, 'NumPad9'); + define(103 /* NUMPAD_MULTIPLY */, 'NumPad_Multiply'); + define(104 /* NUMPAD_ADD */, 'NumPad_Add'); + define(105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator'); + define(106 /* NUMPAD_SUBTRACT */, 'NumPad_Subtract'); + define(107 /* NUMPAD_DECIMAL */, 'NumPad_Decimal'); + define(108 /* NUMPAD_DIVIDE */, 'NumPad_Divide'); +})(); +var KeyCodeUtils; +(function (KeyCodeUtils) { + function toString(keyCode) { + return uiMap.keyCodeToStr(keyCode); + } + KeyCodeUtils.toString = toString; + function fromString(key) { + return uiMap.strToKeyCode(key); + } + KeyCodeUtils.fromString = fromString; + function toUserSettingsUS(keyCode) { + return userSettingsUSMap.keyCodeToStr(keyCode); + } + KeyCodeUtils.toUserSettingsUS = toUserSettingsUS; + function toUserSettingsGeneral(keyCode) { + return userSettingsGeneralMap.keyCodeToStr(keyCode); + } + KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral; + function fromUserSettings(key) { + return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); + } + KeyCodeUtils.fromUserSettings = fromUserSettings; +})(KeyCodeUtils || (KeyCodeUtils = {})); +function KeyChord(firstPart, secondPart) { + var chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0; + return (firstPart | chordPart) >>> 0; } +function createKeybinding(keybinding, OS) { + if (keybinding === 0) { + return null; + } + var firstPart = (keybinding & 0x0000FFFF) >>> 0; + var chordPart = (keybinding & 0xFFFF0000) >>> 16; + if (chordPart !== 0) { + return new keyCodes_ChordKeybinding([ + createSimpleKeybinding(firstPart, OS), + createSimpleKeybinding(chordPart, OS) + ]); + } + return new keyCodes_ChordKeybinding([createSimpleKeybinding(firstPart, OS)]); +} +function createSimpleKeybinding(keybinding, OS) { + var ctrlCmd = (keybinding & 2048 /* CtrlCmd */ ? true : false); + var winCtrl = (keybinding & 256 /* WinCtrl */ ? true : false); + var ctrlKey = (OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd); + var shiftKey = (keybinding & 1024 /* Shift */ ? true : false); + var altKey = (keybinding & 512 /* Alt */ ? true : false); + var metaKey = (OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl); + var keyCode = (keybinding & 255 /* KeyCode */); + return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode); +} +var SimpleKeybinding = /** @class */ (function () { + function SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode) { + this.ctrlKey = ctrlKey; + this.shiftKey = shiftKey; + this.altKey = altKey; + this.metaKey = metaKey; + this.keyCode = keyCode; + } + SimpleKeybinding.prototype.equals = function (other) { + return (this.ctrlKey === other.ctrlKey + && this.shiftKey === other.shiftKey + && this.altKey === other.altKey + && this.metaKey === other.metaKey + && this.keyCode === other.keyCode); + }; + SimpleKeybinding.prototype.isModifierKey = function () { + return (this.keyCode === 0 /* Unknown */ + || this.keyCode === 5 /* Ctrl */ + || this.keyCode === 57 /* Meta */ + || this.keyCode === 6 /* Alt */ + || this.keyCode === 4 /* Shift */); + }; + SimpleKeybinding.prototype.toChord = function () { + return new keyCodes_ChordKeybinding([this]); + }; + /** + * Does this keybinding refer to the key code of a modifier and it also has the modifier flag? + */ + SimpleKeybinding.prototype.isDuplicateModifierCase = function () { + return ((this.ctrlKey && this.keyCode === 5 /* Ctrl */) + || (this.shiftKey && this.keyCode === 4 /* Shift */) + || (this.altKey && this.keyCode === 6 /* Alt */) + || (this.metaKey && this.keyCode === 57 /* Meta */)); + }; + return SimpleKeybinding; +}()); + +var keyCodes_ChordKeybinding = /** @class */ (function () { + function ChordKeybinding(parts) { + if (parts.length === 0) { + throw illegalArgument("parts"); + } + this.parts = parts; + } + ChordKeybinding.prototype.equals = function (other) { + if (other === null) { + return false; + } + if (this.parts.length !== other.parts.length) { + return false; + } + for (var i = 0; i < this.parts.length; i++) { + if (!this.parts[i].equals(other.parts[i])) { + return false; + } + } + return true; + }; + return ChordKeybinding; +}()); + +var ResolvedKeybindingPart = /** @class */ (function () { + function ResolvedKeybindingPart(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) { + this.ctrlKey = ctrlKey; + this.shiftKey = shiftKey; + this.altKey = altKey; + this.metaKey = metaKey; + this.keyLabel = kbLabel; + this.keyAriaLabel = kbAriaLabel; + } + return ResolvedKeybindingPart; +}()); + +/** + * A resolved keybinding. Can be a simple keybinding or a chord keybinding. + */ +var ResolvedKeybinding = /** @class */ (function () { + function ResolvedKeybinding() { + } + return ResolvedKeybinding; +}()); -/***/ }), +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var selection_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js ***! - \***************************************************************************************/ -/*! exports provided: MarkerTag, MarkerSeverity, KeyCode, SelectionDirection, ScrollbarVisibility, OverviewRulerLane, EndOfLinePreference, DefaultEndOfLine, EndOfLineSequence, TrackedRangeStickiness, ScrollType, CursorChangeReason, RenderMinimap, WrappingIndent, TextEditorCursorBlinkingStyle, TextEditorCursorStyle, RenderLineNumbersType, ContentWidgetPositionPreference, OverlayWidgetPositionPreference, MouseTargetType, IndentAction, CompletionItemKind, CompletionItemInsertTextRule, CompletionTriggerKind, SignatureHelpTriggerKind, DocumentHighlightKind, SymbolKind */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerTag", function() { return MarkerTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerSeverity", function() { return MarkerSeverity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCode", function() { return KeyCode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionDirection", function() { return SelectionDirection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollbarVisibility", function() { return ScrollbarVisibility; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverviewRulerLane", function() { return OverviewRulerLane; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLinePreference", function() { return EndOfLinePreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultEndOfLine", function() { return DefaultEndOfLine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLineSequence", function() { return EndOfLineSequence; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackedRangeStickiness", function() { return TrackedRangeStickiness; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollType", function() { return ScrollType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorChangeReason", function() { return CursorChangeReason; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderMinimap", function() { return RenderMinimap; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WrappingIndent", function() { return WrappingIndent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorBlinkingStyle", function() { return TextEditorCursorBlinkingStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorStyle", function() { return TextEditorCursorStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderLineNumbersType", function() { return RenderLineNumbersType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentWidgetPositionPreference", function() { return ContentWidgetPositionPreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverlayWidgetPositionPreference", function() { return OverlayWidgetPositionPreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MouseTargetType", function() { return MouseTargetType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentAction", function() { return IndentAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemInsertTextRule", function() { return CompletionItemInsertTextRule; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionTriggerKind", function() { return CompletionTriggerKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureHelpTriggerKind", function() { return SignatureHelpTriggerKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; }); +/** + * A selection in the editor. + * The selection is a range that has an orientation. + */ +var selection_Selection = /** @class */ (function (_super) { + selection_extends(Selection, _super); + function Selection(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) { + var _this = _super.call(this, selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) || this; + _this.selectionStartLineNumber = selectionStartLineNumber; + _this.selectionStartColumn = selectionStartColumn; + _this.positionLineNumber = positionLineNumber; + _this.positionColumn = positionColumn; + return _this; + } + /** + * Clone this selection. + */ + Selection.prototype.clone = function () { + return new Selection(this.selectionStartLineNumber, this.selectionStartColumn, this.positionLineNumber, this.positionColumn); + }; + /** + * Transform to a human-readable representation. + */ + Selection.prototype.toString = function () { + return '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']'; + }; + /** + * Test if equals other selection. + */ + Selection.prototype.equalsSelection = function (other) { + return (Selection.selectionsEqual(this, other)); + }; + /** + * Test if the two selections are equal. + */ + Selection.selectionsEqual = function (a, b) { + return (a.selectionStartLineNumber === b.selectionStartLineNumber && + a.selectionStartColumn === b.selectionStartColumn && + a.positionLineNumber === b.positionLineNumber && + a.positionColumn === b.positionColumn); + }; + /** + * Get directions (LTR or RTL). + */ + Selection.prototype.getDirection = function () { + if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) { + return 0 /* LTR */; + } + return 1 /* RTL */; + }; + /** + * Create a new selection with a different `positionLineNumber` and `positionColumn`. + */ + Selection.prototype.setEndPosition = function (endLineNumber, endColumn) { + if (this.getDirection() === 0 /* LTR */) { + return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn); + } + return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn); + }; + /** + * Get the position at `positionLineNumber` and `positionColumn`. + */ + Selection.prototype.getPosition = function () { + return new Position(this.positionLineNumber, this.positionColumn); + }; + /** + * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. + */ + Selection.prototype.setStartPosition = function (startLineNumber, startColumn) { + if (this.getDirection() === 0 /* LTR */) { + return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn); + } + return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn); + }; + // ---- + /** + * Create a `Selection` from one or two positions + */ + Selection.fromPositions = function (start, end) { + if (end === void 0) { end = start; } + return new Selection(start.lineNumber, start.column, end.lineNumber, end.column); + }; + /** + * Create a `Selection` from an `ISelection`. + */ + Selection.liftSelection = function (sel) { + return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn); + }; + /** + * `a` equals `b`. + */ + Selection.selectionsArrEqual = function (a, b) { + if (a && !b || !a && b) { + return false; + } + if (!a && !b) { + return true; + } + if (a.length !== b.length) { + return false; + } + for (var i = 0, len = a.length; i < len; i++) { + if (!this.selectionsEqual(a[i], b[i])) { + return false; + } + } + return true; + }; + /** + * Test if `obj` is an `ISelection`. + */ + Selection.isISelection = function (obj) { + return (obj + && (typeof obj.selectionStartLineNumber === 'number') + && (typeof obj.selectionStartColumn === 'number') + && (typeof obj.positionLineNumber === 'number') + && (typeof obj.positionColumn === 'number')); + }; + /** + * Create with a direction. + */ + Selection.createWithDirection = function (startLineNumber, startColumn, endLineNumber, endColumn, direction) { + if (direction === 0 /* LTR */) { + return new Selection(startLineNumber, startColumn, endLineNumber, endColumn); + } + return new Selection(endLineNumber, endColumn, startLineNumber, startColumn); + }; + return Selection; +}(range_Range)); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/token.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var Token = /** @class */ (function () { + function Token(offset, type, language) { + this.offset = offset | 0; // @perf + this.type = type; + this.language = language; + } + Token.prototype.toString = function () { + return '(' + this.offset + ', ' + this.type + ')'; + }; + return Token; +}()); + +var TokenizationResult = /** @class */ (function () { + function TokenizationResult(tokens, endState) { + this.tokens = tokens; + this.endState = endState; + } + return TokenizationResult; +}()); + +var TokenizationResult2 = /** @class */ (function () { + function TokenizationResult2(tokens, endState) { + this.tokens = tokens; + this.endState = endState; + } + return TokenizationResult2; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -8151,238 +6909,603 @@ var SymbolKind; SymbolKind[SymbolKind["TypeParameter"] = 25] = "TypeParameter"; })(SymbolKind || (SymbolKind = {})); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js ***! - \****************************************************************************************/ -/*! exports provided: PrefixSumIndexOfResult, PrefixSumComputer, PrefixSumComputerWithCache */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumIndexOfResult", function() { return PrefixSumIndexOfResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumComputer", function() { return PrefixSumComputer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumComputerWithCache", function() { return PrefixSumComputerWithCache; }); -/* harmony import */ var _core_uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/uint.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var PrefixSumIndexOfResult = /** @class */ (function () { - function PrefixSumIndexOfResult(index, remainder) { - this.index = index; - this.remainder = remainder; + + + + + + + + + +var standaloneBase_KeyMod = /** @class */ (function () { + function KeyMod() { } - return PrefixSumIndexOfResult; + KeyMod.chord = function (firstPart, secondPart) { + return KeyChord(firstPart, secondPart); + }; + KeyMod.CtrlCmd = 2048 /* CtrlCmd */; + KeyMod.Shift = 1024 /* Shift */; + KeyMod.Alt = 512 /* Alt */; + KeyMod.WinCtrl = 256 /* WinCtrl */; + return KeyMod; }()); -var PrefixSumComputer = /** @class */ (function () { - function PrefixSumComputer(values) { - this.values = values; - this.prefixSum = new Uint32Array(values.length); - this.prefixSumValidIndex = new Int32Array(1); - this.prefixSumValidIndex[0] = -1; +function createMonacoBaseAPI() { + return { + editor: undefined, + languages: undefined, + CancellationTokenSource: CancellationTokenSource, + Emitter: event_Emitter, + KeyCode: KeyCode, + KeyMod: standaloneBase_KeyMod, + Position: Position, + Range: range_Range, + Selection: selection_Selection, + SelectionDirection: SelectionDirection, + MarkerSeverity: MarkerSeverity, + MarkerTag: MarkerTag, + Uri: uri_URI, + Token: Token + }; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var editorSimpleWorker_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + + + + + + + + + + + +/** + * @internal + */ +var editorSimpleWorker_MirrorModel = /** @class */ (function (_super) { + editorSimpleWorker_extends(MirrorModel, _super); + function MirrorModel() { + return _super !== null && _super.apply(this, arguments) || this; } - PrefixSumComputer.prototype.getCount = function () { - return this.values.length; + Object.defineProperty(MirrorModel.prototype, "uri", { + get: function () { + return this._uri; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MirrorModel.prototype, "version", { + get: function () { + return this._versionId; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MirrorModel.prototype, "eol", { + get: function () { + return this._eol; + }, + enumerable: true, + configurable: true + }); + MirrorModel.prototype.getValue = function () { + return this.getText(); }; - PrefixSumComputer.prototype.insertValues = function (insertIndex, insertValues) { - insertIndex = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(insertIndex); - var oldValues = this.values; - var oldPrefixSum = this.prefixSum; - var insertValuesLen = insertValues.length; - if (insertValuesLen === 0) { - return false; - } - this.values = new Uint32Array(oldValues.length + insertValuesLen); - this.values.set(oldValues.subarray(0, insertIndex), 0); - this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen); - this.values.set(insertValues, insertIndex); - if (insertIndex - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = insertIndex - 1; - } - this.prefixSum = new Uint32Array(this.values.length); - if (this.prefixSumValidIndex[0] >= 0) { - this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); - } - return true; + MirrorModel.prototype.getLinesContent = function () { + return this._lines.slice(0); }; - PrefixSumComputer.prototype.changeValue = function (index, value) { - index = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index); - value = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(value); - if (this.values[index] === value) { - return false; - } - this.values[index] = value; - if (index - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = index - 1; - } - return true; + MirrorModel.prototype.getLineCount = function () { + return this._lines.length; }; - PrefixSumComputer.prototype.removeValues = function (startIndex, cnt) { - startIndex = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(startIndex); - cnt = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(cnt); - var oldValues = this.values; - var oldPrefixSum = this.prefixSum; - if (startIndex >= oldValues.length) { - return false; - } - var maxCnt = oldValues.length - startIndex; - if (cnt >= maxCnt) { - cnt = maxCnt; - } - if (cnt === 0) { - return false; - } - this.values = new Uint32Array(oldValues.length - cnt); - this.values.set(oldValues.subarray(0, startIndex), 0); - this.values.set(oldValues.subarray(startIndex + cnt), startIndex); - this.prefixSum = new Uint32Array(this.values.length); - if (startIndex - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = startIndex - 1; - } - if (this.prefixSumValidIndex[0] >= 0) { - this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); - } - return true; + MirrorModel.prototype.getLineContent = function (lineNumber) { + return this._lines[lineNumber - 1]; }; - PrefixSumComputer.prototype.getTotalValue = function () { - if (this.values.length === 0) { - return 0; + MirrorModel.prototype.getWordAtPosition = function (position, wordDefinition) { + var wordAtText = getWordAtText(position.column, ensureValidWordDefinition(wordDefinition), this._lines[position.lineNumber - 1], 0); + if (wordAtText) { + return new range_Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn); } - return this._getAccumulatedValue(this.values.length - 1); + return null; }; - PrefixSumComputer.prototype.getAccumulatedValue = function (index) { - if (index < 0) { - return 0; + MirrorModel.prototype.getWordUntilPosition = function (position, wordDefinition) { + var wordAtPosition = this.getWordAtPosition(position, wordDefinition); + if (!wordAtPosition) { + return { + word: '', + startColumn: position.column, + endColumn: position.column + }; } - index = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index); - return this._getAccumulatedValue(index); + return { + word: this._lines[position.lineNumber - 1].substring(wordAtPosition.startColumn - 1, position.column - 1), + startColumn: wordAtPosition.startColumn, + endColumn: position.column + }; }; - PrefixSumComputer.prototype._getAccumulatedValue = function (index) { - if (index <= this.prefixSumValidIndex[0]) { - return this.prefixSum[index]; - } - var startIndex = this.prefixSumValidIndex[0] + 1; - if (startIndex === 0) { - this.prefixSum[0] = this.values[0]; - startIndex++; - } - if (index >= this.values.length) { - index = this.values.length - 1; - } - for (var i = startIndex; i <= index; i++) { - this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i]; - } - this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index); - return this.prefixSum[index]; - }; - PrefixSumComputer.prototype.getIndexOf = function (accumulatedValue) { - accumulatedValue = Math.floor(accumulatedValue); //@perf - // Compute all sums (to get a fully valid prefixSum) - this.getTotalValue(); - var low = 0; - var high = this.values.length - 1; - var mid = 0; - var midStop = 0; - var midStart = 0; - while (low <= high) { - mid = low + ((high - low) / 2) | 0; - midStop = this.prefixSum[mid]; - midStart = midStop - this.values[mid]; - if (accumulatedValue < midStart) { - high = mid - 1; + MirrorModel.prototype.createWordIterator = function (wordDefinition) { + var _this = this; + var obj; + var lineNumber = 0; + var lineText; + var wordRangesIdx = 0; + var wordRanges = []; + var next = function () { + if (wordRangesIdx < wordRanges.length) { + var value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end); + wordRangesIdx += 1; + if (!obj) { + obj = { done: false, value: value }; + } + else { + obj.value = value; + } + return obj; } - else if (accumulatedValue >= midStop) { - low = mid + 1; + else if (lineNumber >= _this._lines.length) { + return FIN; } else { + lineText = _this._lines[lineNumber]; + wordRanges = _this._wordenize(lineText, wordDefinition); + wordRangesIdx = 0; + lineNumber += 1; + return next(); + } + }; + return { next: next }; + }; + MirrorModel.prototype.getLineWords = function (lineNumber, wordDefinition) { + var content = this._lines[lineNumber - 1]; + var ranges = this._wordenize(content, wordDefinition); + var words = []; + for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { + var range = ranges_1[_i]; + words.push({ + word: content.substring(range.start, range.end), + startColumn: range.start + 1, + endColumn: range.end + 1 + }); + } + return words; + }; + MirrorModel.prototype._wordenize = function (content, wordDefinition) { + var result = []; + var match; + wordDefinition.lastIndex = 0; // reset lastIndex just to be sure + while (match = wordDefinition.exec(content)) { + if (match[0].length === 0) { + // it did match the empty string break; } + result.push({ start: match.index, end: match.index + match[0].length }); } - return new PrefixSumIndexOfResult(mid, accumulatedValue - midStart); + return result; }; - return PrefixSumComputer; -}()); - -var PrefixSumComputerWithCache = /** @class */ (function () { - function PrefixSumComputerWithCache(values) { - this._cacheAccumulatedValueStart = 0; - this._cache = null; - this._actual = new PrefixSumComputer(values); - this._bustCache(); - } - PrefixSumComputerWithCache.prototype._bustCache = function () { - this._cacheAccumulatedValueStart = 0; - this._cache = null; - }; - PrefixSumComputerWithCache.prototype.insertValues = function (insertIndex, insertValues) { - if (this._actual.insertValues(insertIndex, insertValues)) { - this._bustCache(); + MirrorModel.prototype.getValueInRange = function (range) { + range = this._validateRange(range); + if (range.startLineNumber === range.endLineNumber) { + return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); } - }; - PrefixSumComputerWithCache.prototype.changeValue = function (index, value) { - if (this._actual.changeValue(index, value)) { - this._bustCache(); + var lineEnding = this._eol; + var startLineIndex = range.startLineNumber - 1; + var endLineIndex = range.endLineNumber - 1; + var resultLines = []; + resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); + for (var i = startLineIndex + 1; i < endLineIndex; i++) { + resultLines.push(this._lines[i]); } + resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); + return resultLines.join(lineEnding); }; - PrefixSumComputerWithCache.prototype.removeValues = function (startIndex, cnt) { - if (this._actual.removeValues(startIndex, cnt)) { - this._bustCache(); + MirrorModel.prototype.offsetAt = function (position) { + position = this._validatePosition(position); + this._ensureLineStarts(); + return this._lineStarts.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1); + }; + MirrorModel.prototype.positionAt = function (offset) { + offset = Math.floor(offset); + offset = Math.max(0, offset); + this._ensureLineStarts(); + var out = this._lineStarts.getIndexOf(offset); + var lineLength = this._lines[out.index].length; + // Ensure we return a valid position + return { + lineNumber: 1 + out.index, + column: 1 + Math.min(out.remainder, lineLength) + }; + }; + MirrorModel.prototype._validateRange = function (range) { + var start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn }); + var end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn }); + if (start.lineNumber !== range.startLineNumber + || start.column !== range.startColumn + || end.lineNumber !== range.endLineNumber + || end.column !== range.endColumn) { + return { + startLineNumber: start.lineNumber, + startColumn: start.column, + endLineNumber: end.lineNumber, + endColumn: end.column + }; } + return range; }; - PrefixSumComputerWithCache.prototype.getTotalValue = function () { - return this._actual.getTotalValue(); - }; - PrefixSumComputerWithCache.prototype.getAccumulatedValue = function (index) { - return this._actual.getAccumulatedValue(index); - }; - PrefixSumComputerWithCache.prototype.getIndexOf = function (accumulatedValue) { - accumulatedValue = Math.floor(accumulatedValue); //@perf - if (this._cache !== null) { - var cacheIndex = accumulatedValue - this._cacheAccumulatedValueStart; - if (cacheIndex >= 0 && cacheIndex < this._cache.length) { - // Cache hit! - return this._cache[cacheIndex]; + MirrorModel.prototype._validatePosition = function (position) { + if (!Position.isIPosition(position)) { + throw new Error('bad position'); + } + var lineNumber = position.lineNumber, column = position.column; + var hasChanged = false; + if (lineNumber < 1) { + lineNumber = 1; + column = 1; + hasChanged = true; + } + else if (lineNumber > this._lines.length) { + lineNumber = this._lines.length; + column = this._lines[lineNumber - 1].length + 1; + hasChanged = true; + } + else { + var maxCharacter = this._lines[lineNumber - 1].length + 1; + if (column < 1) { + column = 1; + hasChanged = true; + } + else if (column > maxCharacter) { + column = maxCharacter; + hasChanged = true; } } - // Cache miss! - return this._actual.getIndexOf(accumulatedValue); - }; - /** - * Gives a hint that a lot of requests are about to come in for these accumulated values. - */ - PrefixSumComputerWithCache.prototype.warmUpCache = function (accumulatedValueStart, accumulatedValueEnd) { - var newCache = []; - for (var accumulatedValue = accumulatedValueStart; accumulatedValue <= accumulatedValueEnd; accumulatedValue++) { - newCache[accumulatedValue - accumulatedValueStart] = this.getIndexOf(accumulatedValue); + if (!hasChanged) { + return position; + } + else { + return { lineNumber: lineNumber, column: column }; } - this._cache = newCache; - this._cacheAccumulatedValueStart = accumulatedValueStart; }; - return PrefixSumComputerWithCache; + return MirrorModel; +}(mirrorTextModel_MirrorTextModel)); +/** + * @internal + */ +var editorSimpleWorker_BaseEditorSimpleWorker = /** @class */ (function () { + function BaseEditorSimpleWorker(foreignModuleFactory) { + this._foreignModuleFactory = foreignModuleFactory; + this._foreignModule = null; + } + // ---- BEGIN diff -------------------------------------------------------------------------- + BaseEditorSimpleWorker.prototype.computeDiff = function (originalUrl, modifiedUrl, ignoreTrimWhitespace) { + var original = this._getModel(originalUrl); + var modified = this._getModel(modifiedUrl); + if (!original || !modified) { + return Promise.resolve(null); + } + var originalLines = original.getLinesContent(); + var modifiedLines = modified.getLinesContent(); + var diffComputer = new DiffComputer(originalLines, modifiedLines, { + shouldComputeCharChanges: true, + shouldPostProcessCharChanges: true, + shouldIgnoreTrimWhitespace: ignoreTrimWhitespace, + shouldMakePrettyDiff: true + }); + var changes = diffComputer.computeDiff(); + var identical = (changes.length > 0 ? false : this._modelsAreIdentical(original, modified)); + return Promise.resolve({ + identical: identical, + changes: changes + }); + }; + BaseEditorSimpleWorker.prototype._modelsAreIdentical = function (original, modified) { + var originalLineCount = original.getLineCount(); + var modifiedLineCount = modified.getLineCount(); + if (originalLineCount !== modifiedLineCount) { + return false; + } + for (var line = 1; line <= originalLineCount; line++) { + var originalLine = original.getLineContent(line); + var modifiedLine = modified.getLineContent(line); + if (originalLine !== modifiedLine) { + return false; + } + } + return true; + }; + BaseEditorSimpleWorker.prototype.computeMoreMinimalEdits = function (modelUrl, edits) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(edits); + } + var result = []; + var lastEol = undefined; + edits = mergeSort(edits, function (a, b) { + if (a.range && b.range) { + return range_Range.compareRangesUsingStarts(a.range, b.range); + } + // eol only changes should go to the end + var aRng = a.range ? 0 : 1; + var bRng = b.range ? 0 : 1; + return aRng - bRng; + }); + for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { + var _a = edits_1[_i], range = _a.range, text = _a.text, eol = _a.eol; + if (typeof eol === 'number') { + lastEol = eol; + } + if (range_Range.isEmpty(range) && !text) { + // empty change + continue; + } + var original = model.getValueInRange(range); + text = text.replace(/\r\n|\n|\r/g, model.eol); + if (original === text) { + // noop + continue; + } + // make sure diff won't take too long + if (Math.max(text.length, original.length) > BaseEditorSimpleWorker._diffLimit) { + result.push({ range: range, text: text }); + continue; + } + // compute diff between original and edit.text + var changes = stringDiff(original, text, false); + var editOffset = model.offsetAt(range_Range.lift(range).getStartPosition()); + for (var _b = 0, changes_1 = changes; _b < changes_1.length; _b++) { + var change = changes_1[_b]; + var start = model.positionAt(editOffset + change.originalStart); + var end = model.positionAt(editOffset + change.originalStart + change.originalLength); + var newEdit = { + text: text.substr(change.modifiedStart, change.modifiedLength), + range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column } + }; + if (model.getValueInRange(newEdit.range) !== newEdit.text) { + result.push(newEdit); + } + } + } + if (typeof lastEol === 'number') { + result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }); + } + return Promise.resolve(result); + }; + // ---- END minimal edits --------------------------------------------------------------- + BaseEditorSimpleWorker.prototype.computeLinks = function (modelUrl) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(null); + } + return Promise.resolve(computeLinks(model)); + }; + BaseEditorSimpleWorker.prototype.textualSuggest = function (modelUrl, position, wordDef, wordDefFlags) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(null); + } + var seen = Object.create(null); + var suggestions = []; + var wordDefRegExp = new RegExp(wordDef, wordDefFlags); + var wordUntil = model.getWordUntilPosition(position, wordDefRegExp); + var wordAt = model.getWordAtPosition(position, wordDefRegExp); + if (wordAt) { + seen[model.getValueInRange(wordAt)] = true; + } + for (var iter = model.createWordIterator(wordDefRegExp), e = iter.next(); !e.done && suggestions.length <= BaseEditorSimpleWorker._suggestionsLimit; e = iter.next()) { + var word = e.value; + if (seen[word]) { + continue; + } + seen[word] = true; + if (!isNaN(Number(word))) { + continue; + } + suggestions.push({ + kind: 18 /* Text */, + label: word, + insertText: word, + range: { startLineNumber: position.lineNumber, startColumn: wordUntil.startColumn, endLineNumber: position.lineNumber, endColumn: wordUntil.endColumn } + }); + } + return Promise.resolve({ suggestions: suggestions }); + }; + // ---- END suggest -------------------------------------------------------------------------- + //#region -- word ranges -- + BaseEditorSimpleWorker.prototype.computeWordRanges = function (modelUrl, range, wordDef, wordDefFlags) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(Object.create(null)); + } + var wordDefRegExp = new RegExp(wordDef, wordDefFlags); + var result = Object.create(null); + for (var line = range.startLineNumber; line < range.endLineNumber; line++) { + var words = model.getLineWords(line, wordDefRegExp); + for (var _i = 0, words_1 = words; _i < words_1.length; _i++) { + var word = words_1[_i]; + if (!isNaN(Number(word.word))) { + continue; + } + var array = result[word.word]; + if (!array) { + array = []; + result[word.word] = array; + } + array.push({ + startLineNumber: line, + startColumn: word.startColumn, + endLineNumber: line, + endColumn: word.endColumn + }); + } + } + return Promise.resolve(result); + }; + //#endregion + BaseEditorSimpleWorker.prototype.navigateValueSet = function (modelUrl, range, up, wordDef, wordDefFlags) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(null); + } + var wordDefRegExp = new RegExp(wordDef, wordDefFlags); + if (range.startColumn === range.endColumn) { + range = { + startLineNumber: range.startLineNumber, + startColumn: range.startColumn, + endLineNumber: range.endLineNumber, + endColumn: range.endColumn + 1 + }; + } + var selectionText = model.getValueInRange(range); + var wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp); + if (!wordRange) { + return Promise.resolve(null); + } + var word = model.getValueInRange(wordRange); + var result = BasicInplaceReplace.INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up); + return Promise.resolve(result); + }; + // ---- BEGIN foreign module support -------------------------------------------------------------------------- + BaseEditorSimpleWorker.prototype.loadForeignModule = function (moduleId, createData) { + var _this = this; + var ctx = { + getMirrorModels: function () { + return _this._getModels(); + } + }; + if (this._foreignModuleFactory) { + this._foreignModule = this._foreignModuleFactory(ctx, createData); + // static foreing module + var methods = []; + for (var _i = 0, _a = getAllPropertyNames(this._foreignModule); _i < _a.length; _i++) { + var prop = _a[_i]; + if (typeof this._foreignModule[prop] === 'function') { + methods.push(prop); + } + } + return Promise.resolve(methods); + } + // ESM-comment-begin + // return new Promise((resolve, reject) => { + // require([moduleId], (foreignModule: { create: IForeignModuleFactory }) => { + // this._foreignModule = foreignModule.create(ctx, createData); + // + // let methods: string[] = []; + // for (const prop of getAllPropertyNames(this._foreignModule)) { + // if (typeof this._foreignModule[prop] === 'function') { + // methods.push(prop); + // } + // } + // + // resolve(methods); + // + // }, reject); + // }); + // ESM-comment-end + // ESM-uncomment-begin + return Promise.reject(new Error("Unexpected usage")); + // ESM-uncomment-end + }; + // foreign method request + BaseEditorSimpleWorker.prototype.fmr = function (method, args) { + if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') { + return Promise.reject(new Error('Missing requestHandler or method: ' + method)); + } + try { + return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args)); + } + catch (e) { + return Promise.reject(e); + } + }; + // ---- END diff -------------------------------------------------------------------------- + // ---- BEGIN minimal edits --------------------------------------------------------------- + BaseEditorSimpleWorker._diffLimit = 100000; + // ---- BEGIN suggest -------------------------------------------------------------------------- + BaseEditorSimpleWorker._suggestionsLimit = 10000; + return BaseEditorSimpleWorker; }()); +/** + * @internal + */ +var editorSimpleWorker_EditorSimpleWorkerImpl = /** @class */ (function (_super) { + editorSimpleWorker_extends(EditorSimpleWorkerImpl, _super); + function EditorSimpleWorkerImpl(foreignModuleFactory) { + var _this = _super.call(this, foreignModuleFactory) || this; + _this._models = Object.create(null); + return _this; + } + EditorSimpleWorkerImpl.prototype.dispose = function () { + this._models = Object.create(null); + }; + EditorSimpleWorkerImpl.prototype._getModel = function (uri) { + return this._models[uri]; + }; + EditorSimpleWorkerImpl.prototype._getModels = function () { + var _this = this; + var all = []; + Object.keys(this._models).forEach(function (key) { return all.push(_this._models[key]); }); + return all; + }; + EditorSimpleWorkerImpl.prototype.acceptNewModel = function (data) { + this._models[data.url] = new editorSimpleWorker_MirrorModel(uri_URI.parse(data.url), data.lines, data.EOL, data.versionId); + }; + EditorSimpleWorkerImpl.prototype.acceptModelChanged = function (strURL, e) { + if (!this._models[strURL]) { + return; + } + var model = this._models[strURL]; + model.onEvents(e); + }; + EditorSimpleWorkerImpl.prototype.acceptRemovedModel = function (strURL) { + if (!this._models[strURL]) { + return; + } + delete this._models[strURL]; + }; + return EditorSimpleWorkerImpl; +}(editorSimpleWorker_BaseEditorSimpleWorker)); +/** + * Called on the worker side + * @internal + */ +function editorSimpleWorker_create() { + return new editorSimpleWorker_EditorSimpleWorkerImpl(null); +} +if (typeof importScripts === 'function') { + // Running in a web worker + globals.monaco = createMonacoBaseAPI(); +} -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/editor.worker.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/editor.worker.js ***! - \*******************************************************************/ -/*! exports provided: initialize */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initialize", function() { return initialize; }); -/* harmony import */ var _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/common/worker/simpleWorker.js */ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js"); -/* harmony import */ var _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/services/editorSimpleWorker.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/editor.worker.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -8395,8 +7518,8 @@ function initialize(foreignModule) { return; } initialized = true; - var editorWorker = new _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__["EditorSimpleWorkerImpl"](foreignModule); - var simpleWorker = new _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__["SimpleWorkerServer"](function (msg) { + var editorWorker = new editorSimpleWorker_EditorSimpleWorkerImpl(foreignModule); + var simpleWorker = new simpleWorker_SimpleWorkerServer(function (msg) { self.postMessage(msg); }, editorWorker); self.onmessage = function (e) { @@ -8410,215 +7533,1850 @@ self.onmessage = function (e) { } }; +// 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 main_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; +})(main_Position || (main_Position = {})); +/** + * The Range namespace provides helper functions to work with + * [Range](#Range) literals. + */ +var main_Range; +(function (Range) { + function create(one, two, three, four) { + if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) { + return { start: main_Position.create(one, two), end: main_Position.create(three, four) }; + } + else if (main_Position.is(one) && main_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) && main_Position.is(candidate.start) && main_Position.is(candidate.end); + } + Range.is = is; +})(main_Range || (main_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) && main_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) && main_Range.is(candidate.targetRange) && Is.string(candidate.targetUri) + && (main_Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) + && (main_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 main_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 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) + && main_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) + && main_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 main_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; +})(main_CompletionItemKind || (main_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 = {})); +/** + * 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 || main_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 main_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; +})(main_DocumentHighlightKind || (main_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 main_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; +})(main_SymbolKind || (main_SymbolKind = {})); +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 = {})); +/** + * Represents programming constructs like variables, classes, interfaces etc. + * that appear in a document. Document symbols can be hierarchical and they + * have two ranges: one that encloses its definition and one that points to + * its most interesting range, e.g. the range of an identifier. + */ +var DocumentSymbol = /** @class */ (function () { + function DocumentSymbol() { + } + return DocumentSymbol; +}()); + +(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) && + main_Range.is(candidate.range) && main_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) { + /** + * 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'; +})(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 null) { + 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.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) && main_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 = {})); +/** + * A document link is a range in a text document that links to an internal or external resource, like another + * text document or a web site. + */ +var DocumentLink = /** @class */ (function () { + function DocumentLink() { + } + return DocumentLink; +}()); + +/** + * The DocumentLink namespace provides helper functions to work with + * [DocumentLink](#DocumentLink) literals. + */ +(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) && main_Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); + } + DocumentLink.is = is; +})(DocumentLink || (DocumentLink = {})); +var EOL = ['\n', '\r\n', '\r']; +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 = {})); +/** + * Represents reasons why a text document is saved. + */ +var TextDocumentSaveReason; +(function (TextDocumentSaveReason) { + /** + * Manually triggered, e.g. by the user pressing save, by starting debugging, + * or by an API call. + */ + TextDocumentSaveReason.Manual = 1; + /** + * Automatic after a delay. + */ + TextDocumentSaveReason.AfterDelay = 2; + /** + * When the editor lost focus. + */ + TextDocumentSaveReason.FocusOut = 3; +})(TextDocumentSaveReason || (TextDocumentSaveReason = {})); +var FullTextDocument = /** @class */ (function () { + function FullTextDocument(uri, languageId, version, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version; + this._content = content; + this._lineOffsets = null; + } + 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 = null; + }; + FullTextDocument.prototype.getLineOffsets = function () { + if (this._lineOffsets === null) { + 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 main_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 main_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 = {})); -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/edit.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/edit.js ***! - \*****************************************************************************************/ -/*! exports provided: removeProperty, setProperty, applyEdit, isWS */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeProperty", function() { return removeProperty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setProperty", function() { return setProperty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyEdit", function() { return applyEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWS", function() { return isWS; }); -/* harmony import */ var _format_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./format.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/format.js"); -/* harmony import */ var _parser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parser.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/parser.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/scanner.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - - -function removeProperty(text, path, formattingOptions) { - return setProperty(text, path, void 0, formattingOptions); -} -function setProperty(text, originalPath, value, formattingOptions, getInsertionIndex) { - var _a; - var path = originalPath.slice(); - var errors = []; - var root = Object(_parser_js__WEBPACK_IMPORTED_MODULE_1__["parseTree"])(text, errors); - var parent = void 0; - var lastSegment = void 0; - while (path.length > 0) { - lastSegment = path.pop(); - parent = Object(_parser_js__WEBPACK_IMPORTED_MODULE_1__["findNodeAtLocation"])(root, path); - if (parent === void 0 && value !== void 0) { - if (typeof lastSegment === 'string') { - value = (_a = {}, _a[lastSegment] = value, _a); +/** + * Creates a JSON scanner on the given text. + * If ignoreTrivia is set, whitespaces or comments are ignored. + */ +function createScanner(text, ignoreTrivia) { + if (ignoreTrivia === void 0) { ignoreTrivia = false; } + var pos = 0, len = text.length, value = '', tokenOffset = 0, token = 16 /* Unknown */, scanError = 0 /* None */; + function scanHexDigits(count, exact) { + var digits = 0; + var value = 0; + while (digits < count || !exact) { + var ch = text.charCodeAt(pos); + if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { + value = value * 16 + ch - 48 /* _0 */; + } + else if (ch >= 65 /* A */ && ch <= 70 /* F */) { + value = value * 16 + ch - 65 /* A */ + 10; + } + else if (ch >= 97 /* a */ && ch <= 102 /* f */) { + value = value * 16 + ch - 97 /* a */ + 10; } else { - value = [value]; + break; } + pos++; + digits++; + } + if (digits < count) { + value = -1; + } + return value; + } + function setPosition(newPosition) { + pos = newPosition; + value = ''; + tokenOffset = 0; + token = 16 /* Unknown */; + scanError = 0 /* None */; + } + function scanNumber() { + var start = pos; + if (text.charCodeAt(pos) === 48 /* _0 */) { + pos++; } else { - break; + pos++; + while (pos < text.length && isDigit(text.charCodeAt(pos))) { + pos++; + } } - } - if (!parent) { - // empty document - if (value === void 0) { // delete - throw new Error('Can not delete in empty document'); - } - return withFormatting(text, { offset: root ? root.offset : 0, length: root ? root.length : 0, content: JSON.stringify(value) }, formattingOptions); - } - else if (parent.type === 'object' && typeof lastSegment === 'string' && Array.isArray(parent.children)) { - var existing = Object(_parser_js__WEBPACK_IMPORTED_MODULE_1__["findNodeAtLocation"])(parent, [lastSegment]); - if (existing !== void 0) { - if (value === void 0) { // delete - if (!existing.parent) { - throw new Error('Malformed AST'); + if (pos < text.length && text.charCodeAt(pos) === 46 /* dot */) { + pos++; + if (pos < text.length && isDigit(text.charCodeAt(pos))) { + pos++; + while (pos < text.length && isDigit(text.charCodeAt(pos))) { + pos++; } - var propertyIndex = parent.children.indexOf(existing.parent); - var removeBegin = void 0; - var removeEnd = existing.parent.offset + existing.parent.length; - if (propertyIndex > 0) { - // remove the comma of the previous node - var previous = parent.children[propertyIndex - 1]; - removeBegin = previous.offset + previous.length; + } + else { + scanError = 3 /* UnexpectedEndOfNumber */; + return text.substring(start, pos); + } + } + var end = pos; + if (pos < text.length && (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */)) { + pos++; + if (pos < text.length && text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) { + pos++; + } + if (pos < text.length && isDigit(text.charCodeAt(pos))) { + pos++; + while (pos < text.length && isDigit(text.charCodeAt(pos))) { + pos++; + } + end = pos; + } + else { + scanError = 3 /* UnexpectedEndOfNumber */; + } + } + return text.substring(start, end); + } + function scanString() { + var result = '', start = pos; + while (true) { + if (pos >= len) { + result += text.substring(start, pos); + scanError = 2 /* UnexpectedEndOfString */; + break; + } + var ch = text.charCodeAt(pos); + if (ch === 34 /* doubleQuote */) { + result += text.substring(start, pos); + pos++; + break; + } + if (ch === 92 /* backslash */) { + result += text.substring(start, pos); + pos++; + if (pos >= len) { + scanError = 2 /* UnexpectedEndOfString */; + break; + } + ch = text.charCodeAt(pos++); + switch (ch) { + case 34 /* doubleQuote */: + result += '\"'; + break; + case 92 /* backslash */: + result += '\\'; + break; + case 47 /* slash */: + result += '/'; + break; + case 98 /* b */: + result += '\b'; + break; + case 102 /* f */: + result += '\f'; + break; + case 110 /* n */: + result += '\n'; + break; + case 114 /* r */: + result += '\r'; + break; + case 116 /* t */: + result += '\t'; + break; + case 117 /* u */: + var ch_1 = scanHexDigits(4, true); + if (ch_1 >= 0) { + result += String.fromCharCode(ch_1); + } + else { + scanError = 4 /* InvalidUnicode */; + } + break; + default: + scanError = 5 /* InvalidEscapeCharacter */; + } + start = pos; + continue; + } + if (ch >= 0 && ch <= 0x1f) { + if (isLineBreak(ch)) { + result += text.substring(start, pos); + scanError = 2 /* UnexpectedEndOfString */; + break; } else { - removeBegin = parent.offset + 1; - if (parent.children.length > 1) { - // remove the comma of the next node - var next = parent.children[1]; - removeEnd = next.offset; + scanError = 6 /* InvalidCharacter */; + // mark as error but continue with string + } + } + pos++; + } + return result; + } + function scanNext() { + value = ''; + scanError = 0 /* None */; + tokenOffset = pos; + if (pos >= len) { + // at the end + tokenOffset = len; + return token = 17 /* EOF */; + } + var code = text.charCodeAt(pos); + // trivia: whitespace + if (isWhiteSpace(code)) { + do { + pos++; + value += String.fromCharCode(code); + code = text.charCodeAt(pos); + } while (isWhiteSpace(code)); + return token = 15 /* Trivia */; + } + // trivia: newlines + if (isLineBreak(code)) { + pos++; + value += String.fromCharCode(code); + if (code === 13 /* carriageReturn */ && text.charCodeAt(pos) === 10 /* lineFeed */) { + pos++; + value += '\n'; + } + return token = 14 /* LineBreakTrivia */; + } + switch (code) { + // tokens: []{}:, + case 123 /* openBrace */: + pos++; + return token = 1 /* OpenBraceToken */; + case 125 /* closeBrace */: + pos++; + return token = 2 /* CloseBraceToken */; + case 91 /* openBracket */: + pos++; + return token = 3 /* OpenBracketToken */; + case 93 /* closeBracket */: + pos++; + return token = 4 /* CloseBracketToken */; + case 58 /* colon */: + pos++; + return token = 6 /* ColonToken */; + case 44 /* comma */: + pos++; + return token = 5 /* CommaToken */; + // strings + case 34 /* doubleQuote */: + pos++; + value = scanString(); + return token = 10 /* StringLiteral */; + // comments + case 47 /* slash */: + var start = pos - 1; + // Single-line comment + if (text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + while (pos < len) { + if (isLineBreak(text.charCodeAt(pos))) { + break; + } + pos++; } + value = text.substring(start, pos); + return token = 12 /* LineCommentTrivia */; } - return withFormatting(text, { offset: removeBegin, length: removeEnd - removeBegin, content: '' }, formattingOptions); - } - else { - // set value of existing property - return withFormatting(text, { offset: existing.offset, length: existing.length, content: JSON.stringify(value) }, formattingOptions); - } - } - else { - if (value === void 0) { // delete - return []; // property does not exist, nothing to do - } - var newProperty = JSON.stringify(lastSegment) + ": " + JSON.stringify(value); - var index = getInsertionIndex ? getInsertionIndex(parent.children.map(function (p) { return p.children[0].value; })) : parent.children.length; - var edit = void 0; - if (index > 0) { - var previous = parent.children[index - 1]; - edit = { offset: previous.offset + previous.length, length: 0, content: ',' + newProperty }; - } - else if (parent.children.length === 0) { - edit = { offset: parent.offset + 1, length: 0, content: newProperty }; - } - else { - edit = { offset: parent.offset + 1, length: 0, content: newProperty + ',' }; - } - return withFormatting(text, edit, formattingOptions); - } - } - else if (parent.type === 'array' && typeof lastSegment === 'number' && Array.isArray(parent.children)) { - var insertIndex = lastSegment; - if (insertIndex === -1) { - // Insert - var newProperty = "" + JSON.stringify(value); - var edit = void 0; - if (parent.children.length === 0) { - edit = { offset: parent.offset + 1, length: 0, content: newProperty }; - } - else { - var previous = parent.children[parent.children.length - 1]; - edit = { offset: previous.offset + previous.length, length: 0, content: ',' + newProperty }; - } - return withFormatting(text, edit, formattingOptions); - } - else { - if (value === void 0 && parent.children.length >= 0) { - //Removal - var removalIndex = lastSegment; - var toRemove = parent.children[removalIndex]; - var edit = void 0; - if (parent.children.length === 1) { - // only item - edit = { offset: parent.offset + 1, length: parent.length - 2, content: '' }; + // Multi-line comment + if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { + pos += 2; + var safeLength = len - 1; // For lookahead. + var commentClosed = false; + while (pos < safeLength) { + var ch = text.charCodeAt(pos); + if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { + pos += 2; + commentClosed = true; + break; + } + pos++; + } + if (!commentClosed) { + pos++; + scanError = 1 /* UnexpectedEndOfComment */; + } + value = text.substring(start, pos); + return token = 13 /* BlockCommentTrivia */; } - else if (parent.children.length - 1 === removalIndex) { - // last item - var previous = parent.children[removalIndex - 1]; - var offset = previous.offset + previous.length; - var parentEndOffset = parent.offset + parent.length; - edit = { offset: offset, length: parentEndOffset - 2 - offset, content: '' }; + // just a single slash + value += String.fromCharCode(code); + pos++; + return token = 16 /* Unknown */; + // numbers + case 45 /* minus */: + value += String.fromCharCode(code); + pos++; + if (pos === len || !isDigit(text.charCodeAt(pos))) { + return token = 16 /* Unknown */; } - else { - edit = { offset: toRemove.offset, length: parent.children[removalIndex + 1].offset - toRemove.offset, content: '' }; + // found a minus, followed by a number so + // we fall through to proceed with scanning + // numbers + case 48 /* _0 */: + case 49 /* _1 */: + case 50 /* _2 */: + case 51 /* _3 */: + case 52 /* _4 */: + case 53 /* _5 */: + case 54 /* _6 */: + case 55 /* _7 */: + case 56 /* _8 */: + case 57 /* _9 */: + value += scanNumber(); + return token = 11 /* NumericLiteral */; + // literals and unknown symbols + default: + // is a literal? Read the full word. + while (pos < len && isUnknownContentCharacter(code)) { + pos++; + code = text.charCodeAt(pos); } - return withFormatting(text, edit, formattingOptions); - } - else { - throw new Error('Array modification not supported yet'); - } + if (tokenOffset !== pos) { + value = text.substring(tokenOffset, pos); + // keywords: true, false, null + switch (value) { + case 'true': return token = 8 /* TrueKeyword */; + case 'false': return token = 9 /* FalseKeyword */; + case 'null': return token = 7 /* NullKeyword */; + } + return token = 16 /* Unknown */; + } + // some + value += String.fromCharCode(code); + pos++; + return token = 16 /* Unknown */; } } - else { - throw new Error("Can not add " + (typeof lastSegment !== 'number' ? 'index' : 'property') + " to parent of type " + parent.type); - } -} -function withFormatting(text, edit, formattingOptions) { - // apply the edit - var newText = applyEdit(text, edit); - // format the new text - var begin = edit.offset; - var end = edit.offset + edit.content.length; - if (edit.length === 0 || edit.content.length === 0) { // insert or remove - while (begin > 0 && !Object(_format_js__WEBPACK_IMPORTED_MODULE_0__["isEOL"])(newText, begin - 1)) { - begin--; + function isUnknownContentCharacter(code) { + if (isWhiteSpace(code) || isLineBreak(code)) { + return false; } - while (end < newText.length && !Object(_format_js__WEBPACK_IMPORTED_MODULE_0__["isEOL"])(newText, end)) { - end++; + switch (code) { + case 125 /* closeBrace */: + case 93 /* closeBracket */: + case 123 /* openBrace */: + case 91 /* openBracket */: + case 34 /* doubleQuote */: + case 58 /* colon */: + case 44 /* comma */: + case 47 /* slash */: + return false; } + return true; } - var edits = Object(_format_js__WEBPACK_IMPORTED_MODULE_0__["format"])(newText, { offset: begin, length: end - begin }, formattingOptions); - // apply the formatting edits and track the begin and end offsets of the changes - for (var i = edits.length - 1; i >= 0; i--) { - var edit_1 = edits[i]; - newText = applyEdit(newText, edit_1); - begin = Math.min(begin, edit_1.offset); - end = Math.max(end, edit_1.offset + edit_1.length); - end += edit_1.content.length - edit_1.length; + function scanNextNonTrivia() { + var result; + do { + result = scanNext(); + } while (result >= 12 /* LineCommentTrivia */ && result <= 15 /* Trivia */); + return result; } - // create a single edit with all changes - var editLength = text.length - (newText.length - end) - begin; - return [{ offset: begin, length: editLength, content: newText.substring(begin, end) }]; + return { + setPosition: setPosition, + getPosition: function () { return pos; }, + scan: ignoreTrivia ? scanNextNonTrivia : scanNext, + getToken: function () { return token; }, + getTokenValue: function () { return value; }, + getTokenOffset: function () { return tokenOffset; }, + getTokenLength: function () { return pos - tokenOffset; }, + getTokenError: function () { return scanError; } + }; } -function applyEdit(text, edit) { - return text.substring(0, edit.offset) + edit.content + text.substring(edit.offset + edit.length); +function isWhiteSpace(ch) { + return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ || + ch === 160 /* nonBreakingSpace */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || + ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */; } -function isWS(text, offset) { - return '\r\n \t'.indexOf(text.charAt(offset)) !== -1; +function isLineBreak(ch) { + return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */; } -//# sourceMappingURL=edit.js.map - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/format.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/format.js ***! - \*******************************************************************************************/ -/*! exports provided: format, isEOL */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "format", function() { return format; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEOL", function() { return isEOL; }); -/* harmony import */ var _scanner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scanner.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/scanner.js"); +function isDigit(ch) { + return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; +} +//# sourceMappingURL=scanner.js.map +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/format.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(documentText, range, options) { +function format_format(documentText, range, options) { var initialIndentLevel; var formatText; var formatTextStart; @@ -8650,15 +9408,15 @@ function format(documentText, range, options) { var indentLevel = 0; var indentValue; if (options.insertSpaces) { - indentValue = repeat(' ', options.tabSize || 4); + indentValue = format_repeat(' ', options.tabSize || 4); } else { indentValue = '\t'; } - var scanner = Object(_scanner_js__WEBPACK_IMPORTED_MODULE_0__["createScanner"])(formatText, false); + var scanner = createScanner(formatText, false); var hasError = false; function newLineAndIndent() { - return eol + repeat(indentValue, initialIndentLevel + indentLevel); + return eol + format_repeat(indentValue, initialIndentLevel + indentLevel); } function scanNext() { var token = scanner.scan(); @@ -8679,7 +9437,7 @@ function format(documentText, range, options) { var firstToken = scanNext(); if (firstToken !== 17 /* EOF */) { var firstTokenStart = scanner.getTokenOffset() + formatTextStart; - var initialIndent = repeat(indentValue, initialIndentLevel); + var initialIndent = format_repeat(indentValue, initialIndentLevel); addEdit(initialIndent, formatTextStart, firstTokenStart); } while (firstToken !== 17 /* EOF */) { @@ -8762,7 +9520,7 @@ function format(documentText, range, options) { } return editOperations; } -function repeat(s, count) { +function format_repeat(s, count) { var result = ''; for (var i = 0; i < count; i++) { result += s; @@ -8807,29 +9565,7 @@ function isEOL(text, offset) { return '\r\n'.indexOf(text.charAt(offset)) !== -1; } //# sourceMappingURL=format.js.map - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/parser.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/parser.js ***! - \*******************************************************************************************/ -/*! exports provided: getLocation, parse, parseTree, findNodeAtLocation, getNodePath, getNodeValue, contains, findNodeAtOffset, visit, stripComments */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocation", function() { return getLocation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return parse; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseTree", function() { return parseTree; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findNodeAtLocation", function() { return findNodeAtLocation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodePath", function() { return getNodePath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeValue", function() { return getNodeValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return contains; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findNodeAtOffset", function() { return findNodeAtOffset; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "visit", function() { return visit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stripComments", function() { return stripComments; }); -/* harmony import */ var _scanner_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scanner.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/scanner.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/parser.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -9185,7 +9921,7 @@ function findNodeAtOffset(node, offset, includeRightBound) { */ function visit(text, visitor, options) { if (options === void 0) { options = ParseOptions.DEFAULT; } - var _scanner = Object(_scanner_js__WEBPACK_IMPORTED_MODULE_0__["createScanner"])(text, false); + var _scanner = createScanner(text, false); function toNoArgVisit(visitFunction) { return visitFunction ? function () { return visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength()); } : function () { return true; }; } @@ -9414,7 +10150,7 @@ function visit(text, visitor, options) { * of comments with a replaceCharacter */ function stripComments(text, replaceCh) { - var _scanner = Object(_scanner_js__WEBPACK_IMPORTED_MODULE_0__["createScanner"])(text), parts = [], kind, offset = 0, pos; + var _scanner = createScanner(text), parts = [], kind, offset = 0, pos; do { pos = _scanner.getPosition(); kind = _scanner.scan(); @@ -9443,399 +10179,177 @@ function getLiteralNodeType(value) { } } //# sourceMappingURL=parser.js.map - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/scanner.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/scanner.js ***! - \********************************************************************************************/ -/*! exports provided: createScanner */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createScanner", function() { return createScanner; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/edit.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -/** - * Creates a JSON scanner on the given text. - * If ignoreTrivia is set, whitespaces or comments are ignored. - */ -function createScanner(text, ignoreTrivia) { - if (ignoreTrivia === void 0) { ignoreTrivia = false; } - var pos = 0, len = text.length, value = '', tokenOffset = 0, token = 16 /* Unknown */, scanError = 0 /* None */; - function scanHexDigits(count, exact) { - var digits = 0; - var value = 0; - while (digits < count || !exact) { - var ch = text.charCodeAt(pos); - if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { - value = value * 16 + ch - 48 /* _0 */; - } - else if (ch >= 65 /* A */ && ch <= 70 /* F */) { - value = value * 16 + ch - 65 /* A */ + 10; - } - else if (ch >= 97 /* a */ && ch <= 102 /* f */) { - value = value * 16 + ch - 97 /* a */ + 10; + + +function removeProperty(text, path, formattingOptions) { + return setProperty(text, path, void 0, formattingOptions); +} +function setProperty(text, originalPath, value, formattingOptions, getInsertionIndex) { + var _a; + var path = originalPath.slice(); + var errors = []; + var root = parseTree(text, errors); + var parent = void 0; + var lastSegment = void 0; + while (path.length > 0) { + lastSegment = path.pop(); + parent = findNodeAtLocation(root, path); + if (parent === void 0 && value !== void 0) { + if (typeof lastSegment === 'string') { + value = (_a = {}, _a[lastSegment] = value, _a); } else { - break; + value = [value]; } - pos++; - digits++; - } - if (digits < count) { - value = -1; - } - return value; - } - function setPosition(newPosition) { - pos = newPosition; - value = ''; - tokenOffset = 0; - token = 16 /* Unknown */; - scanError = 0 /* None */; - } - function scanNumber() { - var start = pos; - if (text.charCodeAt(pos) === 48 /* _0 */) { - pos++; } else { - pos++; - while (pos < text.length && isDigit(text.charCodeAt(pos))) { - pos++; - } + break; } - if (pos < text.length && text.charCodeAt(pos) === 46 /* dot */) { - pos++; - if (pos < text.length && isDigit(text.charCodeAt(pos))) { - pos++; - while (pos < text.length && isDigit(text.charCodeAt(pos))) { - pos++; - } - } - else { - scanError = 3 /* UnexpectedEndOfNumber */; - return text.substring(start, pos); - } - } - var end = pos; - if (pos < text.length && (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */)) { - pos++; - if (pos < text.length && text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) { - pos++; - } - if (pos < text.length && isDigit(text.charCodeAt(pos))) { - pos++; - while (pos < text.length && isDigit(text.charCodeAt(pos))) { - pos++; - } - end = pos; - } - else { - scanError = 3 /* UnexpectedEndOfNumber */; - } - } - return text.substring(start, end); } - function scanString() { - var result = '', start = pos; - while (true) { - if (pos >= len) { - result += text.substring(start, pos); - scanError = 2 /* UnexpectedEndOfString */; - break; - } - var ch = text.charCodeAt(pos); - if (ch === 34 /* doubleQuote */) { - result += text.substring(start, pos); - pos++; - break; - } - if (ch === 92 /* backslash */) { - result += text.substring(start, pos); - pos++; - if (pos >= len) { - scanError = 2 /* UnexpectedEndOfString */; - break; + if (!parent) { + // empty document + if (value === void 0) { // delete + throw new Error('Can not delete in empty document'); + } + return withFormatting(text, { offset: root ? root.offset : 0, length: root ? root.length : 0, content: JSON.stringify(value) }, formattingOptions); + } + else if (parent.type === 'object' && typeof lastSegment === 'string' && Array.isArray(parent.children)) { + var existing = findNodeAtLocation(parent, [lastSegment]); + if (existing !== void 0) { + if (value === void 0) { // delete + if (!existing.parent) { + throw new Error('Malformed AST'); } - ch = text.charCodeAt(pos++); - switch (ch) { - case 34 /* doubleQuote */: - result += '\"'; - break; - case 92 /* backslash */: - result += '\\'; - break; - case 47 /* slash */: - result += '/'; - break; - case 98 /* b */: - result += '\b'; - break; - case 102 /* f */: - result += '\f'; - break; - case 110 /* n */: - result += '\n'; - break; - case 114 /* r */: - result += '\r'; - break; - case 116 /* t */: - result += '\t'; - break; - case 117 /* u */: - var ch_1 = scanHexDigits(4, true); - if (ch_1 >= 0) { - result += String.fromCharCode(ch_1); - } - else { - scanError = 4 /* InvalidUnicode */; - } - break; - default: - scanError = 5 /* InvalidEscapeCharacter */; - } - start = pos; - continue; - } - if (ch >= 0 && ch <= 0x1f) { - if (isLineBreak(ch)) { - result += text.substring(start, pos); - scanError = 2 /* UnexpectedEndOfString */; - break; + var propertyIndex = parent.children.indexOf(existing.parent); + var removeBegin = void 0; + var removeEnd = existing.parent.offset + existing.parent.length; + if (propertyIndex > 0) { + // remove the comma of the previous node + var previous = parent.children[propertyIndex - 1]; + removeBegin = previous.offset + previous.length; } else { - scanError = 6 /* InvalidCharacter */; - // mark as error but continue with string + removeBegin = parent.offset + 1; + if (parent.children.length > 1) { + // remove the comma of the next node + var next = parent.children[1]; + removeEnd = next.offset; + } } + return withFormatting(text, { offset: removeBegin, length: removeEnd - removeBegin, content: '' }, formattingOptions); } - pos++; - } - return result; - } - function scanNext() { - value = ''; - scanError = 0 /* None */; - tokenOffset = pos; - if (pos >= len) { - // at the end - tokenOffset = len; - return token = 17 /* EOF */; - } - var code = text.charCodeAt(pos); - // trivia: whitespace - if (isWhiteSpace(code)) { - do { - pos++; - value += String.fromCharCode(code); - code = text.charCodeAt(pos); - } while (isWhiteSpace(code)); - return token = 15 /* Trivia */; - } - // trivia: newlines - if (isLineBreak(code)) { - pos++; - value += String.fromCharCode(code); - if (code === 13 /* carriageReturn */ && text.charCodeAt(pos) === 10 /* lineFeed */) { - pos++; - value += '\n'; + else { + // set value of existing property + return withFormatting(text, { offset: existing.offset, length: existing.length, content: JSON.stringify(value) }, formattingOptions); } - return token = 14 /* LineBreakTrivia */; } - switch (code) { - // tokens: []{}:, - case 123 /* openBrace */: - pos++; - return token = 1 /* OpenBraceToken */; - case 125 /* closeBrace */: - pos++; - return token = 2 /* CloseBraceToken */; - case 91 /* openBracket */: - pos++; - return token = 3 /* OpenBracketToken */; - case 93 /* closeBracket */: - pos++; - return token = 4 /* CloseBracketToken */; - case 58 /* colon */: - pos++; - return token = 6 /* ColonToken */; - case 44 /* comma */: - pos++; - return token = 5 /* CommaToken */; - // strings - case 34 /* doubleQuote */: - pos++; - value = scanString(); - return token = 10 /* StringLiteral */; - // comments - case 47 /* slash */: - var start = pos - 1; - // Single-line comment - if (text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - while (pos < len) { - if (isLineBreak(text.charCodeAt(pos))) { - break; - } - pos++; - } - value = text.substring(start, pos); - return token = 12 /* LineCommentTrivia */; - } - // Multi-line comment - if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { - pos += 2; - var safeLength = len - 1; // For lookahead. - var commentClosed = false; - while (pos < safeLength) { - var ch = text.charCodeAt(pos); - if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - commentClosed = true; - break; - } - pos++; - } - if (!commentClosed) { - pos++; - scanError = 1 /* UnexpectedEndOfComment */; - } - value = text.substring(start, pos); - return token = 13 /* BlockCommentTrivia */; - } - // just a single slash - value += String.fromCharCode(code); - pos++; - return token = 16 /* Unknown */; - // numbers - case 45 /* minus */: - value += String.fromCharCode(code); - pos++; - if (pos === len || !isDigit(text.charCodeAt(pos))) { - return token = 16 /* Unknown */; - } - // found a minus, followed by a number so - // we fall through to proceed with scanning - // numbers - case 48 /* _0 */: - case 49 /* _1 */: - case 50 /* _2 */: - case 51 /* _3 */: - case 52 /* _4 */: - case 53 /* _5 */: - case 54 /* _6 */: - case 55 /* _7 */: - case 56 /* _8 */: - case 57 /* _9 */: - value += scanNumber(); - return token = 11 /* NumericLiteral */; - // literals and unknown symbols - default: - // is a literal? Read the full word. - while (pos < len && isUnknownContentCharacter(code)) { - pos++; - code = text.charCodeAt(pos); - } - if (tokenOffset !== pos) { - value = text.substring(tokenOffset, pos); - // keywords: true, false, null - switch (value) { - case 'true': return token = 8 /* TrueKeyword */; - case 'false': return token = 9 /* FalseKeyword */; - case 'null': return token = 7 /* NullKeyword */; - } - return token = 16 /* Unknown */; - } - // some - value += String.fromCharCode(code); - pos++; - return token = 16 /* Unknown */; + else { + if (value === void 0) { // delete + return []; // property does not exist, nothing to do + } + var newProperty = JSON.stringify(lastSegment) + ": " + JSON.stringify(value); + var index = getInsertionIndex ? getInsertionIndex(parent.children.map(function (p) { return p.children[0].value; })) : parent.children.length; + var edit = void 0; + if (index > 0) { + var previous = parent.children[index - 1]; + edit = { offset: previous.offset + previous.length, length: 0, content: ',' + newProperty }; + } + else if (parent.children.length === 0) { + edit = { offset: parent.offset + 1, length: 0, content: newProperty }; + } + else { + edit = { offset: parent.offset + 1, length: 0, content: newProperty + ',' }; + } + return withFormatting(text, edit, formattingOptions); } } - function isUnknownContentCharacter(code) { - if (isWhiteSpace(code) || isLineBreak(code)) { - return false; + else if (parent.type === 'array' && typeof lastSegment === 'number' && Array.isArray(parent.children)) { + var insertIndex = lastSegment; + if (insertIndex === -1) { + // Insert + var newProperty = "" + JSON.stringify(value); + var edit = void 0; + if (parent.children.length === 0) { + edit = { offset: parent.offset + 1, length: 0, content: newProperty }; + } + else { + var previous = parent.children[parent.children.length - 1]; + edit = { offset: previous.offset + previous.length, length: 0, content: ',' + newProperty }; + } + return withFormatting(text, edit, formattingOptions); } - switch (code) { - case 125 /* closeBrace */: - case 93 /* closeBracket */: - case 123 /* openBrace */: - case 91 /* openBracket */: - case 34 /* doubleQuote */: - case 58 /* colon */: - case 44 /* comma */: - case 47 /* slash */: - return false; + else { + if (value === void 0 && parent.children.length >= 0) { + //Removal + var removalIndex = lastSegment; + var toRemove = parent.children[removalIndex]; + var edit = void 0; + if (parent.children.length === 1) { + // only item + edit = { offset: parent.offset + 1, length: parent.length - 2, content: '' }; + } + else if (parent.children.length - 1 === removalIndex) { + // last item + var previous = parent.children[removalIndex - 1]; + var offset = previous.offset + previous.length; + var parentEndOffset = parent.offset + parent.length; + edit = { offset: offset, length: parentEndOffset - 2 - offset, content: '' }; + } + else { + edit = { offset: toRemove.offset, length: parent.children[removalIndex + 1].offset - toRemove.offset, content: '' }; + } + return withFormatting(text, edit, formattingOptions); + } + else { + throw new Error('Array modification not supported yet'); + } } - return true; } - function scanNextNonTrivia() { - var result; - do { - result = scanNext(); - } while (result >= 12 /* LineCommentTrivia */ && result <= 15 /* Trivia */); - return result; + else { + throw new Error("Can not add " + (typeof lastSegment !== 'number' ? 'index' : 'property') + " to parent of type " + parent.type); } - return { - setPosition: setPosition, - getPosition: function () { return pos; }, - scan: ignoreTrivia ? scanNextNonTrivia : scanNext, - getToken: function () { return token; }, - getTokenValue: function () { return value; }, - getTokenOffset: function () { return tokenOffset; }, - getTokenLength: function () { return pos - tokenOffset; }, - getTokenError: function () { return scanError; } - }; } -function isWhiteSpace(ch) { - return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ || - ch === 160 /* nonBreakingSpace */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || - ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */; +function withFormatting(text, edit, formattingOptions) { + // apply the edit + var newText = applyEdit(text, edit); + // format the new text + var begin = edit.offset; + var end = edit.offset + edit.content.length; + if (edit.length === 0 || edit.content.length === 0) { // insert or remove + while (begin > 0 && !isEOL(newText, begin - 1)) { + begin--; + } + while (end < newText.length && !isEOL(newText, end)) { + end++; + } + } + var edits = format_format(newText, { offset: begin, length: end - begin }, formattingOptions); + // apply the formatting edits and track the begin and end offsets of the changes + for (var i = edits.length - 1; i >= 0; i--) { + var edit_1 = edits[i]; + newText = applyEdit(newText, edit_1); + begin = Math.min(begin, edit_1.offset); + end = Math.max(end, edit_1.offset + edit_1.length); + end += edit_1.content.length - edit_1.length; + } + // create a single edit with all changes + var editLength = text.length - (newText.length - end) - begin; + return [{ offset: begin, length: editLength, content: newText.substring(begin, end) }]; } -function isLineBreak(ch) { - return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */; +function applyEdit(text, edit) { + return text.substring(0, edit.offset) + edit.content + text.substring(edit.offset + edit.length); } -function isDigit(ch) { - return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; +function isWS(text, offset) { + return '\r\n \t'.indexOf(text.charAt(offset)) !== -1; } -//# sourceMappingURL=scanner.js.map - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js": -/*!************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js ***! - \************************************************************************************/ -/*! exports provided: createScanner, getLocation, parse, parseTree, findNodeAtLocation, findNodeAtOffset, getNodePath, getNodeValue, visit, stripComments, printParseErrorCode, format, modify, applyEdits */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createScanner", function() { return createScanner; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLocation", function() { return getLocation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return parse; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseTree", function() { return parseTree; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findNodeAtLocation", function() { return findNodeAtLocation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findNodeAtOffset", function() { return findNodeAtOffset; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodePath", function() { return getNodePath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeValue", function() { return getNodeValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "visit", function() { return visit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stripComments", function() { return stripComments; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "printParseErrorCode", function() { return printParseErrorCode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "format", function() { return format; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modify", function() { return modify; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyEdits", function() { return applyEdits; }); -/* harmony import */ var _impl_format_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./impl/format.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/format.js"); -/* harmony import */ var _impl_edit_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./impl/edit.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/edit.js"); -/* harmony import */ var _impl_scanner_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./impl/scanner.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/scanner.js"); -/* harmony import */ var _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./impl/parser.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/impl/parser.js"); +//# sourceMappingURL=edit.js.map +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -9849,46 +10363,46 @@ __webpack_require__.r(__webpack_exports__); * Creates a JSON scanner on the given text. * If ignoreTrivia is set, whitespaces or comments are ignored. */ -var createScanner = _impl_scanner_js__WEBPACK_IMPORTED_MODULE_2__["createScanner"]; +var main_createScanner = createScanner; /** * For a given offset, evaluate the location in the JSON document. Each segment in the location path is either a property name or an array index. */ -var getLocation = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["getLocation"]; +var main_getLocation = getLocation; /** * Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result. * Therefore always check the errors list to find out if the input was valid. */ -var parse = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["parse"]; +var main_parse = parse; /** * Parses the given text and returns a tree representation the JSON content. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result. */ -var parseTree = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["parseTree"]; +var main_parseTree = parseTree; /** * Finds the node at the given path in a JSON DOM. */ -var findNodeAtLocation = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["findNodeAtLocation"]; +var main_findNodeAtLocation = findNodeAtLocation; /** * Finds the most inner node at the given offset. If includeRightBound is set, also finds nodes that end at the given offset. */ -var findNodeAtOffset = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["findNodeAtOffset"]; +var main_findNodeAtOffset = findNodeAtOffset; /** * Gets the JSON path of the given JSON DOM node */ -var getNodePath = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["getNodePath"]; +var main_getNodePath = getNodePath; /** * Evaluates the JavaScript object of the given JSON DOM node */ -var getNodeValue = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["getNodeValue"]; +var main_getNodeValue = getNodeValue; /** * Parses the given text and invokes the visitor functions for each object, array and literal reached. */ -var visit = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["visit"]; +var main_visit = visit; /** * Takes JSON with JavaScript-style comments and remove * them. Optionally replaces every none-newline character * of comments with a replaceCharacter */ -var stripComments = _impl_parser_js__WEBPACK_IMPORTED_MODULE_3__["stripComments"]; +var main_stripComments = stripComments; function printParseErrorCode(code) { switch (code) { case 1 /* InvalidSymbol */: return 'InvalidSymbol'; @@ -9922,8 +10436,8 @@ function printParseErrorCode(code) { * the same offset, for example multiple inserts, or an insert followed by a remove or replace. The order in the array defines which edit is applied first. * To apply edits to an input, you can use `applyEdits` */ -function format(documentText, range, options) { - return _impl_format_js__WEBPACK_IMPORTED_MODULE_0__["format"](documentText, range, options); +function main_format(documentText, range, options) { + return format_format(documentText, range, options); } /** * Computes the edits needed to modify a value in the JSON document. @@ -9941,175 +10455,86 @@ function format(documentText, range, options) { * To apply edits to an input, you can use `applyEdits` */ function modify(text, path, value, options) { - return _impl_edit_js__WEBPACK_IMPORTED_MODULE_1__["setProperty"](text, path, value, options.formattingOptions, options.getInsertionIndex); + return setProperty(text, path, value, options.formattingOptions, options.getInsertionIndex); } /** * Applies edits to a input string. */ function applyEdits(text, edits) { for (var i = edits.length - 1; i >= 0; i--) { - text = _impl_edit_js__WEBPACK_IMPORTED_MODULE_1__["applyEdit"](text, edits[i]); + text = applyEdit(text, edits[i]); } return text; } //# sourceMappingURL=main.js.map - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageService.js": -/*!******************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageService.js ***! - \******************************************************************************************************************/ -/*! exports provided: TextDocument, Position, CompletionItem, CompletionList, Hover, Range, SymbolInformation, Diagnostic, TextEdit, FormattingOptions, MarkedString, getLanguageService, Color, ColorInformation, ColorPresentation, FoldingRange, FoldingRangeKind, SelectionRangeKind, ErrorCode, ClientCapabilities */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLanguageService", function() { return getLanguageService; }); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-types/main.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextDocument", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextDocument"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Position"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CompletionItem", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["CompletionItem"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CompletionList", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["CompletionList"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Hover", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Hover"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Range"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SymbolInformation", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["SymbolInformation"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Diagnostic", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Diagnostic"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextEdit", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextEdit"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormattingOptions", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["FormattingOptions"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MarkedString", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["MarkedString"]; }); - -/* harmony import */ var _services_jsonCompletion_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./services/jsonCompletion.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonCompletion.js"); -/* harmony import */ var _services_jsonHover_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./services/jsonHover.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonHover.js"); -/* harmony import */ var _services_jsonValidation_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/jsonValidation.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonValidation.js"); -/* harmony import */ var _services_jsonDocumentSymbols_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./services/jsonDocumentSymbols.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonDocumentSymbols.js"); -/* harmony import */ var _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parser/jsonParser.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js"); -/* harmony import */ var _services_configuration_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./services/configuration.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/configuration.js"); -/* harmony import */ var _services_jsonSchemaService_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./services/jsonSchemaService.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSchemaService.js"); -/* harmony import */ var _services_jsonFolding_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./services/jsonFolding.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonFolding.js"); -/* harmony import */ var _services_jsonSelectionRanges_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./services/jsonSelectionRanges.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSelectionRanges.js"); -/* harmony import */ var _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../jsonc-parser/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js"); -/* harmony import */ var _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./jsonLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_11__["Color"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorInformation", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_11__["ColorInformation"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorPresentation", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_11__["ColorPresentation"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FoldingRange", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_11__["FoldingRange"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FoldingRangeKind", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_11__["FoldingRangeKind"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SelectionRangeKind", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_11__["SelectionRangeKind"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ErrorCode", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_11__["ErrorCode"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ClientCapabilities", function() { return _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_11__["ClientCapabilities"]; }); - +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/objects.js /*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - - - - - - - - - - - -function getLanguageService(params) { - var promise = params.promiseConstructor || Promise; - var jsonSchemaService = new _services_jsonSchemaService_js__WEBPACK_IMPORTED_MODULE_7__["JSONSchemaService"](params.schemaRequestService, params.workspaceContext, promise); - jsonSchemaService.setSchemaContributions(_services_configuration_js__WEBPACK_IMPORTED_MODULE_6__["schemaContributions"]); - var jsonCompletion = new _services_jsonCompletion_js__WEBPACK_IMPORTED_MODULE_1__["JSONCompletion"](jsonSchemaService, params.contributions, promise, params.clientCapabilities); - var jsonHover = new _services_jsonHover_js__WEBPACK_IMPORTED_MODULE_2__["JSONHover"](jsonSchemaService, params.contributions, promise); - var jsonDocumentSymbols = new _services_jsonDocumentSymbols_js__WEBPACK_IMPORTED_MODULE_4__["JSONDocumentSymbols"](jsonSchemaService); - var jsonValidation = new _services_jsonValidation_js__WEBPACK_IMPORTED_MODULE_3__["JSONValidation"](jsonSchemaService, promise); - return { - configure: function (settings) { - jsonSchemaService.clearExternalSchemas(); - if (settings.schemas) { - settings.schemas.forEach(function (settings) { - jsonSchemaService.registerExternalSchema(settings.uri, settings.fileMatch, settings.schema); - }); - } - jsonValidation.configure(settings); - }, - resetSchema: function (uri) { return jsonSchemaService.onResourceChange(uri); }, - doValidation: jsonValidation.doValidation.bind(jsonValidation), - parseJSONDocument: function (document) { return Object(_parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_5__["parse"])(document, { collectComments: true }); }, - newJSONDocument: function (root, diagnostics) { return Object(_parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_5__["newJSONDocument"])(root, diagnostics); }, - doResolve: jsonCompletion.doResolve.bind(jsonCompletion), - doComplete: jsonCompletion.doComplete.bind(jsonCompletion), - findDocumentSymbols: jsonDocumentSymbols.findDocumentSymbols.bind(jsonDocumentSymbols), - findDocumentSymbols2: jsonDocumentSymbols.findDocumentSymbols2.bind(jsonDocumentSymbols), - findColorSymbols: function (d, s) { return jsonDocumentSymbols.findDocumentColors(d, s).then(function (s) { return s.map(function (s) { return s.range; }); }); }, - findDocumentColors: jsonDocumentSymbols.findDocumentColors.bind(jsonDocumentSymbols), - getColorPresentations: jsonDocumentSymbols.getColorPresentations.bind(jsonDocumentSymbols), - doHover: jsonHover.doHover.bind(jsonHover), - getFoldingRanges: _services_jsonFolding_js__WEBPACK_IMPORTED_MODULE_8__["getFoldingRanges"], - getSelectionRanges: _services_jsonSelectionRanges_js__WEBPACK_IMPORTED_MODULE_9__["getSelectionRanges"], - format: function (d, r, o) { - var range = void 0; - if (r) { - var offset = d.offsetAt(r.start); - var length = d.offsetAt(r.end) - offset; - range = { offset: offset, length: length }; - } - var options = { tabSize: o ? o.tabSize : 4, insertSpaces: o ? o.insertSpaces : true, eol: '\n' }; - return Object(_jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_10__["format"])(d.getText(), range, options).map(function (e) { - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextEdit"].replace(_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Range"].create(d.positionAt(e.offset), d.positionAt(e.offset + e.length)), e.content); - }); +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT License. See License.txt in the project root for license information. +*--------------------------------------------------------------------------------------------*/ +function objects_equals(one, other) { + if (one === other) { + return true; + } + if (one === null || one === undefined || other === null || other === undefined) { + return false; + } + if (typeof one !== typeof other) { + return false; + } + if (typeof one !== 'object') { + return false; + } + if ((Array.isArray(one)) !== (Array.isArray(other))) { + return false; + } + var i, key; + if (Array.isArray(one)) { + if (one.length !== other.length) { + return false; } - }; + for (i = 0; i < one.length; i++) { + if (!objects_equals(one[i], other[i])) { + return false; + } + } + } + else { + var oneKeys = []; + for (key in one) { + oneKeys.push(key); + } + oneKeys.sort(); + var otherKeys = []; + for (key in other) { + otherKeys.push(key); + } + otherKeys.sort(); + if (!objects_equals(oneKeys, otherKeys)) { + return false; + } + for (i = 0; i < oneKeys.length; i++) { + if (!objects_equals(one[oneKeys[i]], other[oneKeys[i]])) { + return false; + } + } + } + return true; +} +function objects_isNumber(val) { + return typeof val === 'number'; +} +function isDefined(val) { + return typeof val !== 'undefined'; +} +function objects_isBoolean(val) { + return typeof val === 'boolean'; +} +function objects_isString(val) { + return typeof val === 'string'; } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js": -/*!****************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js ***! - \****************************************************************************************************************/ -/*! exports provided: Range, TextEdit, Color, ColorInformation, ColorPresentation, FoldingRange, FoldingRangeKind, SelectionRangeKind, ErrorCode, ClientCapabilities */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionRangeKind", function() { return SelectionRangeKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorCode", function() { return ErrorCode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClientCapabilities", function() { return ClientCapabilities; }); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-types/main.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Range"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TextEdit", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["TextEdit"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Color"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorInformation", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["ColorInformation"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ColorPresentation", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["ColorPresentation"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FoldingRange", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["FoldingRange"]; }); - -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FoldingRangeKind", function() { return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["FoldingRangeKind"]; }); - +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js // #region Proposed types, remove once added to vscode-languageserver-types @@ -10158,59 +10583,615 @@ var ErrorCode; ErrorCode[ErrorCode["CommentNotPermitted"] = 521] = "CommentNotPermitted"; ErrorCode[ErrorCode["SchemaResolveError"] = 768] = "SchemaResolveError"; })(ErrorCode || (ErrorCode = {})); -var ClientCapabilities; +var jsonLanguageTypes_ClientCapabilities; (function (ClientCapabilities) { ClientCapabilities.LATEST = { textDocument: { completion: { completionItem: { - documentationFormat: [_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["MarkupKind"].Markdown, _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["MarkupKind"].PlainText] + documentationFormat: [MarkupKind.Markdown, MarkupKind.PlainText] } } } }; -})(ClientCapabilities || (ClientCapabilities = {})); +})(jsonLanguageTypes_ClientCapabilities || (jsonLanguageTypes_ClientCapabilities = {})); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js": -/*!****************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js ***! - \****************************************************************************************************************/ -/*! exports provided: ASTNodeImpl, NullASTNodeImpl, BooleanASTNodeImpl, ArrayASTNodeImpl, NumberASTNodeImpl, StringASTNodeImpl, PropertyASTNodeImpl, ObjectASTNodeImpl, asSchema, EnumMatch, ValidationResult, newJSONDocument, getNodeValue, getNodePath, contains, JSONDocument, parse */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ASTNodeImpl", function() { return ASTNodeImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NullASTNodeImpl", function() { return NullASTNodeImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BooleanASTNodeImpl", function() { return BooleanASTNodeImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayASTNodeImpl", function() { return ArrayASTNodeImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NumberASTNodeImpl", function() { return NumberASTNodeImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringASTNodeImpl", function() { return StringASTNodeImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyASTNodeImpl", function() { return PropertyASTNodeImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObjectASTNodeImpl", function() { return ObjectASTNodeImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asSchema", function() { return asSchema; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EnumMatch", function() { return EnumMatch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ValidationResult", function() { return ValidationResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "newJSONDocument", function() { return newJSONDocument; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodeValue", function() { return getNodeValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNodePath", function() { return getNodePath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return contains; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JSONDocument", function() { return JSONDocument; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parse", function() { return parse; }); -/* harmony import */ var _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../jsonc-parser/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js"); -/* harmony import */ var _utils_objects_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/objects.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/objects.js"); -/* harmony import */ var _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../jsonLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./node_modules/monaco-editor/esm/vs/language/json/fillers/vscode-nls.js"); -/* harmony import */ var _vscode_uri_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../vscode-uri/index.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-uri/index.js"); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-types/main.js"); +// 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. *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { +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-uri/index.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var vscode_uri_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var vscode_uri_isWindows; +if (typeof process === 'object') { + vscode_uri_isWindows = process.platform === 'win32'; +} +else if (typeof navigator === 'object') { + var vscode_uri_userAgent = navigator.userAgent; + vscode_uri_isWindows = vscode_uri_userAgent.indexOf('Windows') >= 0; +} +//#endregion +var vscode_uri_schemePattern = /^\w[\w\d+.-]*$/; +var vscode_uri_singleSlashStart = /^\//; +var vscode_uri_doubleSlashStart = /^\/\//; +function vscode_uri_validateUri(ret) { + // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 + // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) + if (ret.scheme && !vscode_uri_schemePattern.test(ret.scheme)) { + throw new Error('[UriError]: Scheme contains illegal characters.'); + } + // path, http://tools.ietf.org/html/rfc3986#section-3.3 + // If a URI contains an authority component, then the path component + // must either be empty or begin with a slash ("/") character. If a URI + // does not contain an authority component, then the path cannot begin + // with two slash characters ("//"). + if (ret.path) { + if (ret.authority) { + if (!vscode_uri_singleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); + } + } + else { + if (vscode_uri_doubleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); + } + } + } +} +// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 +function vscode_uri_referenceResolution(scheme, path) { + // the slash-character is our 'default base' as we don't + // support constructing URIs relative to other URIs. This + // also means that we alter and potentially break paths. + // see https://tools.ietf.org/html/rfc3986#section-5.1.4 + switch (scheme) { + case 'https': + case 'http': + case 'file': + if (!path) { + path = vscode_uri_slash; + } + else if (path[0] !== vscode_uri_slash) { + path = vscode_uri_slash + path; + } + break; + } + return path; +} +var vscode_uri_empty = ''; +var vscode_uri_slash = '/'; +var vscode_uri_regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; +/** + * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. + * This class is a simple parser which creates the basic component parts + * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation + * and encoding. + * + * foo://example.com:8042/over/there?name=ferret#nose + * \_/ \______________/\_________/ \_________/ \__/ + * | | | | | + * scheme authority path query fragment + * | _____________________|__ + * / \ / \ + * urn:example:animal:ferret:nose + */ +var vscode_uri_URI = (function () { + /** + * @internal + */ + function URI(schemeOrData, authority, path, query, fragment) { + if (typeof schemeOrData === 'object') { + this.scheme = schemeOrData.scheme || vscode_uri_empty; + this.authority = schemeOrData.authority || vscode_uri_empty; + this.path = schemeOrData.path || vscode_uri_empty; + this.query = schemeOrData.query || vscode_uri_empty; + this.fragment = schemeOrData.fragment || vscode_uri_empty; + // no validation because it's this URI + // that creates uri components. + // _validateUri(this); + } + else { + this.scheme = schemeOrData || vscode_uri_empty; + this.authority = authority || vscode_uri_empty; + this.path = vscode_uri_referenceResolution(this.scheme, path || vscode_uri_empty); + this.query = query || vscode_uri_empty; + this.fragment = fragment || vscode_uri_empty; + vscode_uri_validateUri(this); + } + } + URI.isUri = function (thing) { + if (thing instanceof URI) { + return true; + } + if (!thing) { + return false; + } + return typeof thing.authority === 'string' + && typeof thing.fragment === 'string' + && typeof thing.path === 'string' + && typeof thing.query === 'string' + && typeof thing.scheme === 'string'; + }; + Object.defineProperty(URI.prototype, "fsPath", { + // ---- filesystem path ----------------------- + /** + * Returns a string representing the corresponding file system path of this URI. + * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the + * platform specific path separator. + * + * * Will *not* validate the path for invalid characters and semantics. + * * Will *not* look at the scheme of this URI. + * * The result shall *not* be used for display purposes but for accessing a file on disk. + * + * + * The *difference* to `URI#path` is the use of the platform specific separator and the handling + * of UNC paths. See the below sample of a file-uri with an authority (UNC path). + * + * ```ts + const u = URI.parse('file://server/c$/folder/file.txt') + u.authority === 'server' + u.path === '/shares/c$/file.txt' + u.fsPath === '\\server\c$\folder\file.txt' + ``` + * + * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, + * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working + * with URIs that represent files on disk (`file` scheme). + */ + get: function () { + // if (this.scheme !== 'file') { + // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); + // } + return vscode_uri_makeFsPath(this); + }, + enumerable: true, + configurable: true + }); + // ---- modify to new ------------------------- + URI.prototype.with = function (change) { + if (!change) { + return this; + } + var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment; + if (scheme === void 0) { + scheme = this.scheme; + } + else if (scheme === null) { + scheme = vscode_uri_empty; + } + if (authority === void 0) { + authority = this.authority; + } + else if (authority === null) { + authority = vscode_uri_empty; + } + if (path === void 0) { + path = this.path; + } + else if (path === null) { + path = vscode_uri_empty; + } + if (query === void 0) { + query = this.query; + } + else if (query === null) { + query = vscode_uri_empty; + } + if (fragment === void 0) { + fragment = this.fragment; + } + else if (fragment === null) { + fragment = vscode_uri_empty; + } + if (scheme === this.scheme + && authority === this.authority + && path === this.path + && query === this.query + && fragment === this.fragment) { + return this; + } + return new _deps_vscode_uri_URI(scheme, authority, path, query, fragment); + }; + // ---- parse & validate ------------------------ + /** + * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, + * `file:///usr/home`, or `scheme:with/path`. + * + * @param value A string which represents an URI (see `URI#toString`). + */ + URI.parse = function (value) { + var match = vscode_uri_regexp.exec(value); + if (!match) { + return new _deps_vscode_uri_URI(vscode_uri_empty, vscode_uri_empty, vscode_uri_empty, vscode_uri_empty, vscode_uri_empty); + } + return new _deps_vscode_uri_URI(match[2] || vscode_uri_empty, decodeURIComponent(match[4] || vscode_uri_empty), decodeURIComponent(match[5] || vscode_uri_empty), decodeURIComponent(match[7] || vscode_uri_empty), decodeURIComponent(match[9] || vscode_uri_empty)); + }; + /** + * Creates a new URI from a file system path, e.g. `c:\my\files`, + * `/usr/home`, or `\\server\share\some\path`. + * + * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument + * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** + * `URI.parse('file://' + path)` because the path might contain characters that are + * interpreted (# and ?). See the following sample: + * ```ts + const good = URI.file('/coding/c#/project1'); + good.scheme === 'file'; + good.path === '/coding/c#/project1'; + good.fragment === ''; + + const bad = URI.parse('file://' + '/coding/c#/project1'); + bad.scheme === 'file'; + bad.path === '/coding/c'; // path is now broken + bad.fragment === '/project1'; + ``` + * + * @param path A file system path (see `URI#fsPath`) + */ + URI.file = function (path) { + var authority = vscode_uri_empty; + // normalize to fwd-slashes on windows, + // on other systems bwd-slashes are valid + // filename character, eg /f\oo/ba\r.txt + if (vscode_uri_isWindows) { + path = path.replace(/\\/g, vscode_uri_slash); + } + // check for authority as used in UNC shares + // or use the path as given + if (path[0] === vscode_uri_slash && path[1] === vscode_uri_slash) { + var idx = path.indexOf(vscode_uri_slash, 2); + if (idx === -1) { + authority = path.substring(2); + path = vscode_uri_slash; + } + else { + authority = path.substring(2, idx); + path = path.substring(idx) || vscode_uri_slash; + } + } + return new _deps_vscode_uri_URI('file', authority, path, vscode_uri_empty, vscode_uri_empty); + }; + URI.from = function (components) { + return new _deps_vscode_uri_URI(components.scheme, components.authority, components.path, components.query, components.fragment); + }; + // ---- printing/externalize --------------------------- + /** + * Creates a string presentation for this URI. It's guardeed that calling + * `URI.parse` with the result of this function creates an URI which is equal + * to this URI. + * + * * The result shall *not* be used for display purposes but for externalization or transport. + * * The result will be encoded using the percentage encoding and encoding happens mostly + * ignore the scheme-specific encoding rules. + * + * @param skipEncoding Do not encode the result, default is `false` + */ + URI.prototype.toString = function (skipEncoding) { + if (skipEncoding === void 0) { skipEncoding = false; } + return vscode_uri_asFormatted(this, skipEncoding); + }; + URI.prototype.toJSON = function () { + return this; + }; + URI.revive = function (data) { + if (!data) { + return data; + } + else if (data instanceof URI) { + return data; + } + else { + var result = new _deps_vscode_uri_URI(data); + result._fsPath = data.fsPath; + result._formatted = data.external; + return result; + } + }; + return URI; +}()); +/* harmony default export */ var vscode_uri = (vscode_uri_URI); +// tslint:disable-next-line:class-name +var _deps_vscode_uri_URI = (function (_super) { + vscode_uri_extends(_URI, _super); + function _URI() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._formatted = null; + _this._fsPath = null; + return _this; + } + Object.defineProperty(_URI.prototype, "fsPath", { + get: function () { + if (!this._fsPath) { + this._fsPath = vscode_uri_makeFsPath(this); + } + return this._fsPath; + }, + enumerable: true, + configurable: true + }); + _URI.prototype.toString = function (skipEncoding) { + if (skipEncoding === void 0) { skipEncoding = false; } + if (!skipEncoding) { + if (!this._formatted) { + this._formatted = vscode_uri_asFormatted(this, false); + } + return this._formatted; + } + else { + // we don't cache that + return vscode_uri_asFormatted(this, true); + } + }; + _URI.prototype.toJSON = function () { + var res = { + $mid: 1 + }; + // cached state + if (this._fsPath) { + res.fsPath = this._fsPath; + } + if (this._formatted) { + res.external = this._formatted; + } + // uri components + if (this.path) { + res.path = this.path; + } + if (this.scheme) { + res.scheme = this.scheme; + } + if (this.authority) { + res.authority = this.authority; + } + if (this.query) { + res.query = this.query; + } + if (this.fragment) { + res.fragment = this.fragment; + } + return res; + }; + return _URI; +}(vscode_uri_URI)); +// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 +var vscode_uri_encodeTable = (vscode_uri_a = {}, + vscode_uri_a[58 /* Colon */] = '%3A', + vscode_uri_a[47 /* Slash */] = '%2F', + vscode_uri_a[63 /* QuestionMark */] = '%3F', + vscode_uri_a[35 /* Hash */] = '%23', + vscode_uri_a[91 /* OpenSquareBracket */] = '%5B', + vscode_uri_a[93 /* CloseSquareBracket */] = '%5D', + vscode_uri_a[64 /* AtSign */] = '%40', + vscode_uri_a[33 /* ExclamationMark */] = '%21', + vscode_uri_a[36 /* DollarSign */] = '%24', + vscode_uri_a[38 /* Ampersand */] = '%26', + vscode_uri_a[39 /* SingleQuote */] = '%27', + vscode_uri_a[40 /* OpenParen */] = '%28', + vscode_uri_a[41 /* CloseParen */] = '%29', + vscode_uri_a[42 /* Asterisk */] = '%2A', + vscode_uri_a[43 /* Plus */] = '%2B', + vscode_uri_a[44 /* Comma */] = '%2C', + vscode_uri_a[59 /* Semicolon */] = '%3B', + vscode_uri_a[61 /* Equals */] = '%3D', + vscode_uri_a[32 /* Space */] = '%20', + vscode_uri_a); +function vscode_uri_encodeURIComponentFast(uriComponent, allowSlash) { + var res = undefined; + var nativeEncodePos = -1; + for (var pos = 0; pos < uriComponent.length; pos++) { + var code = uriComponent.charCodeAt(pos); + // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 + if ((code >= 97 /* a */ && code <= 122 /* z */) + || (code >= 65 /* A */ && code <= 90 /* Z */) + || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) + || code === 45 /* Dash */ + || code === 46 /* Period */ + || code === 95 /* Underline */ + || code === 126 /* Tilde */ + || (allowSlash && code === 47 /* Slash */)) { + // check if we are delaying native encode + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + // check if we write into a new string (by default we try to return the param) + if (res !== undefined) { + res += uriComponent.charAt(pos); + } + } + else { + // encoding needed, we need to allocate a new string + if (res === undefined) { + res = uriComponent.substr(0, pos); + } + // check with default table first + var escaped = vscode_uri_encodeTable[code]; + if (escaped !== undefined) { + // check if we are delaying native encode + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + // append escaped variant to result + res += escaped; + } + else if (nativeEncodePos === -1) { + // use native encode only when needed + nativeEncodePos = pos; + } + } + } + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); + } + return res !== undefined ? res : uriComponent; +} +function vscode_uri_encodeURIComponentMinimal(path) { + var res = undefined; + for (var pos = 0; pos < path.length; pos++) { + var code = path.charCodeAt(pos); + if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { + if (res === undefined) { + res = path.substr(0, pos); + } + res += vscode_uri_encodeTable[code]; + } + else { + if (res !== undefined) { + res += path[pos]; + } + } + } + return res !== undefined ? res : path; +} +/** + * Compute `fsPath` for the given uri + * @param uri + */ +function vscode_uri_makeFsPath(uri) { + var value; + if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { + // unc path: file://shares/c$/far/boo + value = "//" + uri.authority + uri.path; + } + else if (uri.path.charCodeAt(0) === 47 /* Slash */ + && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) + && uri.path.charCodeAt(2) === 58 /* Colon */) { + // windows drive letter: file:///c:/far/boo + value = uri.path[1].toLowerCase() + uri.path.substr(2); + } + else { + // other path + value = uri.path; + } + if (vscode_uri_isWindows) { + value = value.replace(/\//g, '\\'); + } + return value; +} +/** + * Create the external version of a uri + */ +function vscode_uri_asFormatted(uri, skipEncoding) { + var encoder = !skipEncoding + ? vscode_uri_encodeURIComponentFast + : vscode_uri_encodeURIComponentMinimal; + var res = ''; + var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment; + if (scheme) { + res += scheme; + res += ':'; + } + if (authority || scheme === 'file') { + res += vscode_uri_slash; + res += vscode_uri_slash; + } + if (authority) { + var idx = authority.indexOf('@'); + if (idx !== -1) { + // @ + var userinfo = authority.substr(0, idx); + authority = authority.substr(idx + 1); + idx = userinfo.indexOf(':'); + if (idx === -1) { + res += encoder(userinfo, false); + } + else { + // :@ + res += encoder(userinfo.substr(0, idx), false); + res += ':'; + res += encoder(userinfo.substr(idx + 1), false); + } + res += '@'; + } + authority = authority.toLowerCase(); + idx = authority.indexOf(':'); + if (idx === -1) { + res += encoder(authority, false); + } + else { + // : + res += encoder(authority.substr(0, idx), false); + res += authority.substr(idx); + } + } + if (path) { + // lower-case windows drive letters in /C:/fff or C:/fff + if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { + var code = path.charCodeAt(1); + if (code >= 65 /* A */ && code <= 90 /* Z */) { + path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3 + } + } + else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { + var code = path.charCodeAt(0); + if (code >= 65 /* A */ && code <= 90 /* Z */) { + path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3 + } + } + // encode the rest of the path + res += encoder(path, true); + } + if (query) { + res += '?'; + res += encoder(query, false); + } + if (fragment) { + res += '#'; + res += !skipEncoding ? vscode_uri_encodeURIComponentFast(fragment, false) : fragment; + } + return res; +} +var vscode_uri_a; + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var jsonParser_extends = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || @@ -10229,7 +11210,7 @@ var __extends = (undefined && undefined.__extends) || (function () { -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_3__["loadMessageBundle"](); +var jsonParser_localize = loadMessageBundle(); var colorHexPattern = /^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/; var emailPattern = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; var ASTNodeImpl = /** @class */ (function () { @@ -10252,7 +11233,7 @@ var ASTNodeImpl = /** @class */ (function () { }()); var NullASTNodeImpl = /** @class */ (function (_super) { - __extends(NullASTNodeImpl, _super); + jsonParser_extends(NullASTNodeImpl, _super); function NullASTNodeImpl(parent, offset) { var _this = _super.call(this, parent, offset) || this; _this.type = 'null'; @@ -10263,7 +11244,7 @@ var NullASTNodeImpl = /** @class */ (function (_super) { }(ASTNodeImpl)); var BooleanASTNodeImpl = /** @class */ (function (_super) { - __extends(BooleanASTNodeImpl, _super); + jsonParser_extends(BooleanASTNodeImpl, _super); function BooleanASTNodeImpl(parent, boolValue, offset) { var _this = _super.call(this, parent, offset) || this; _this.type = 'boolean'; @@ -10274,7 +11255,7 @@ var BooleanASTNodeImpl = /** @class */ (function (_super) { }(ASTNodeImpl)); var ArrayASTNodeImpl = /** @class */ (function (_super) { - __extends(ArrayASTNodeImpl, _super); + jsonParser_extends(ArrayASTNodeImpl, _super); function ArrayASTNodeImpl(parent, offset) { var _this = _super.call(this, parent, offset) || this; _this.type = 'array'; @@ -10292,7 +11273,7 @@ var ArrayASTNodeImpl = /** @class */ (function (_super) { }(ASTNodeImpl)); var NumberASTNodeImpl = /** @class */ (function (_super) { - __extends(NumberASTNodeImpl, _super); + jsonParser_extends(NumberASTNodeImpl, _super); function NumberASTNodeImpl(parent, offset) { var _this = _super.call(this, parent, offset) || this; _this.type = 'number'; @@ -10304,7 +11285,7 @@ var NumberASTNodeImpl = /** @class */ (function (_super) { }(ASTNodeImpl)); var StringASTNodeImpl = /** @class */ (function (_super) { - __extends(StringASTNodeImpl, _super); + jsonParser_extends(StringASTNodeImpl, _super); function StringASTNodeImpl(parent, offset, length) { var _this = _super.call(this, parent, offset, length) || this; _this.type = 'string'; @@ -10315,7 +11296,7 @@ var StringASTNodeImpl = /** @class */ (function (_super) { }(ASTNodeImpl)); var PropertyASTNodeImpl = /** @class */ (function (_super) { - __extends(PropertyASTNodeImpl, _super); + jsonParser_extends(PropertyASTNodeImpl, _super); function PropertyASTNodeImpl(parent, offset) { var _this = _super.call(this, parent, offset) || this; _this.type = 'property'; @@ -10333,7 +11314,7 @@ var PropertyASTNodeImpl = /** @class */ (function (_super) { }(ASTNodeImpl)); var ObjectASTNodeImpl = /** @class */ (function (_super) { - __extends(ObjectASTNodeImpl, _super); + jsonParser_extends(ObjectASTNodeImpl, _super); function ObjectASTNodeImpl(parent, offset) { var _this = _super.call(this, parent, offset) || this; _this.type = 'object'; @@ -10351,7 +11332,7 @@ var ObjectASTNodeImpl = /** @class */ (function (_super) { }(ASTNodeImpl)); function asSchema(schema) { - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isBoolean"])(schema)) { + if (objects_isBoolean(schema)) { return schema ? {} : { "not": {} }; } return schema; @@ -10377,7 +11358,7 @@ var SchemaCollector = /** @class */ (function () { (_a = this.schemas).push.apply(_a, other.schemas); }; SchemaCollector.prototype.include = function (node) { - return (this.focusOffset === -1 || contains(node, this.focusOffset)) && (node !== this.exclude); + return (this.focusOffset === -1 || jsonParser_contains(node, this.focusOffset)) && (node !== this.exclude); }; SchemaCollector.prototype.newSub = function () { return new SchemaCollector(-1, this.exclude); @@ -10399,7 +11380,7 @@ var NoOpSchemaCollector = /** @class */ (function () { NoOpSchemaCollector.instance = new NoOpSchemaCollector(); return NoOpSchemaCollector; }()); -var ValidationResult = /** @class */ (function () { +var jsonParser_ValidationResult = /** @class */ (function () { function ValidationResult() { this.problems = []; this.propertiesMatches = 0; @@ -10425,8 +11406,8 @@ var ValidationResult = /** @class */ (function () { this.enumValues = this.enumValues.concat(validationResult.enumValues); for (var _i = 0, _a = this.problems; _i < _a.length; _i++) { var error = _a[_i]; - if (error.code === _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].EnumValueMismatch) { - error.message = localize('enumWarning', 'Value is not accepted. Valid values: {0}.', this.enumValues.map(function (v) { return JSON.stringify(v); }).join(', ')); + if (error.code === ErrorCode.EnumValueMismatch) { + error.message = jsonParser_localize('enumWarning', 'Value is not accepted. Valid values: {0}.', this.enumValues.map(function (v) { return JSON.stringify(v); }).join(', ')); } } } @@ -10462,19 +11443,19 @@ var ValidationResult = /** @class */ (function () { function newJSONDocument(root, diagnostics) { if (diagnostics === void 0) { diagnostics = []; } - return new JSONDocument(root, diagnostics, []); + return new jsonParser_JSONDocument(root, diagnostics, []); } -function getNodeValue(node) { - return _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_0__["getNodeValue"](node); +function jsonParser_getNodeValue(node) { + return main_getNodeValue(node); } -function getNodePath(node) { - return _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_0__["getNodePath"](node); +function jsonParser_getNodePath(node) { + return main_getNodePath(node); } -function contains(node, offset, includeRightBound) { +function jsonParser_contains(node, offset, includeRightBound) { if (includeRightBound === void 0) { includeRightBound = false; } return offset >= node.offset && offset < (node.offset + node.length) || includeRightBound && offset === (node.offset + node.length); } -var JSONDocument = /** @class */ (function () { +var jsonParser_JSONDocument = /** @class */ (function () { function JSONDocument(root, syntaxErrors, comments) { if (syntaxErrors === void 0) { syntaxErrors = []; } if (comments === void 0) { comments = []; } @@ -10485,7 +11466,7 @@ var JSONDocument = /** @class */ (function () { JSONDocument.prototype.getNodeFromOffset = function (offset, includeRightBound) { if (includeRightBound === void 0) { includeRightBound = false; } if (this.root) { - return _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_0__["findNodeAtOffset"](this.root, offset, includeRightBound); + return main_findNodeAtOffset(this.root, offset, includeRightBound); } return void 0; }; @@ -10506,11 +11487,11 @@ var JSONDocument = /** @class */ (function () { }; JSONDocument.prototype.validate = function (textDocument, schema) { if (this.root && schema) { - var validationResult = new ValidationResult(); + var validationResult = new jsonParser_ValidationResult(); validate(this.root, schema, validationResult, NoOpSchemaCollector.instance); return validationResult.problems.map(function (p) { - var range = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["Range"].create(textDocument.positionAt(p.location.offset), textDocument.positionAt(p.location.offset + p.location.length)); - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["Diagnostic"].create(range, p.message, p.severity, p.code); + var range = main_Range.create(textDocument.positionAt(p.location.offset), textDocument.positionAt(p.location.offset + p.location.length)); + return Diagnostic.create(range, p.message, p.severity, p.code); }); } return null; @@ -10520,7 +11501,7 @@ var JSONDocument = /** @class */ (function () { if (exclude === void 0) { exclude = null; } var matchingSchemas = new SchemaCollector(focusOffset, exclude); if (this.root && schema) { - validate(this.root, schema, new ValidationResult(), matchingSchemas); + validate(this.root, schema, new jsonParser_ValidationResult(), matchingSchemas); } return matchingSchemas.schemas; }; @@ -10557,8 +11538,8 @@ function validate(node, schema, validationResult, matchingSchemas) { if (!schema.type.some(matchesType)) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: schema.errorMessage || localize('typeArrayMismatchWarning', 'Incorrect type. Expected one of {0}.', schema.type.join(', ')) + severity: DiagnosticSeverity.Warning, + message: schema.errorMessage || jsonParser_localize('typeArrayMismatchWarning', 'Incorrect type. Expected one of {0}.', schema.type.join(', ')) }); } } @@ -10566,8 +11547,8 @@ function validate(node, schema, validationResult, matchingSchemas) { if (!matchesType(schema.type)) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: schema.errorMessage || localize('typeMismatchWarning', 'Incorrect type. Expected "{0}".', schema.type) + severity: DiagnosticSeverity.Warning, + message: schema.errorMessage || jsonParser_localize('typeMismatchWarning', 'Incorrect type. Expected "{0}".', schema.type) }); } } @@ -10579,14 +11560,14 @@ function validate(node, schema, validationResult, matchingSchemas) { } var notSchema = asSchema(schema.not); if (notSchema) { - var subValidationResult = new ValidationResult(); + var subValidationResult = new jsonParser_ValidationResult(); var subMatchingSchemas = matchingSchemas.newSub(); validate(node, notSchema, subValidationResult, subMatchingSchemas); if (!subValidationResult.hasProblems()) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: localize('notSchemaWarning', "Matches a schema that is not allowed.") + severity: DiagnosticSeverity.Warning, + message: jsonParser_localize('notSchemaWarning', "Matches a schema that is not allowed.") }); } for (var _b = 0, _c = subMatchingSchemas.schemas; _b < _c.length; _b++) { @@ -10602,7 +11583,7 @@ function validate(node, schema, validationResult, matchingSchemas) { for (var _i = 0, alternatives_1 = alternatives; _i < alternatives_1.length; _i++) { var subSchemaRef = alternatives_1[_i]; var subSchema = asSchema(subSchemaRef); - var subValidationResult = new ValidationResult(); + var subValidationResult = new jsonParser_ValidationResult(); var subMatchingSchemas = matchingSchemas.newSub(); validate(node, subSchema, subValidationResult, subMatchingSchemas); if (!subValidationResult.hasProblems()) { @@ -10635,8 +11616,8 @@ function validate(node, schema, validationResult, matchingSchemas) { if (matches.length > 1 && maxOneMatch) { validationResult.problems.push({ location: { offset: node.offset, length: 1 }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: localize('oneOfWarning', "Matches multiple schemas when only one must validate.") + severity: DiagnosticSeverity.Warning, + message: jsonParser_localize('oneOfWarning', "Matches multiple schemas when only one must validate.") }); } if (bestMatch !== null) { @@ -10654,7 +11635,7 @@ function validate(node, schema, validationResult, matchingSchemas) { testAlternatives(schema.oneOf, true); } var testBranch = function (schema) { - var subValidationResult = new ValidationResult(); + var subValidationResult = new jsonParser_ValidationResult(); var subMatchingSchemas = matchingSchemas.newSub(); validate(node, asSchema(schema), subValidationResult, subMatchingSchemas); validationResult.merge(subValidationResult); @@ -10664,7 +11645,7 @@ function validate(node, schema, validationResult, matchingSchemas) { }; var testCondition = function (ifSchema, thenSchema, elseSchema) { var subSchema = asSchema(ifSchema); - var subValidationResult = new ValidationResult(); + var subValidationResult = new jsonParser_ValidationResult(); var subMatchingSchemas = matchingSchemas.newSub(); validate(node, subSchema, subValidationResult, subMatchingSchemas); matchingSchemas.merge(subMatchingSchemas); @@ -10682,11 +11663,11 @@ function validate(node, schema, validationResult, matchingSchemas) { testCondition(ifSchema, asSchema(schema.then), asSchema(schema.else)); } if (Array.isArray(schema.enum)) { - var val = getNodeValue(node); + var val = jsonParser_getNodeValue(node); var enumValueMatch = false; for (var _d = 0, _e = schema.enum; _d < _e.length; _d++) { var e = _e[_d]; - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["equals"])(val, e)) { + if (objects_equals(val, e)) { enumValueMatch = true; break; } @@ -10696,20 +11677,20 @@ function validate(node, schema, validationResult, matchingSchemas) { if (!enumValueMatch) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - code: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].EnumValueMismatch, - message: schema.errorMessage || localize('enumWarning', 'Value is not accepted. Valid values: {0}.', schema.enum.map(function (v) { return JSON.stringify(v); }).join(', ')) + severity: DiagnosticSeverity.Warning, + code: ErrorCode.EnumValueMismatch, + message: schema.errorMessage || jsonParser_localize('enumWarning', 'Value is not accepted. Valid values: {0}.', schema.enum.map(function (v) { return JSON.stringify(v); }).join(', ')) }); } } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isDefined"])(schema.const)) { - var val = getNodeValue(node); - if (!Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["equals"])(val, schema.const)) { + if (isDefined(schema.const)) { + var val = jsonParser_getNodeValue(node); + if (!objects_equals(val, schema.const)) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - code: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].EnumValueMismatch, - message: schema.errorMessage || localize('constWarning', 'Value must be {0}.', JSON.stringify(schema.const)) + severity: DiagnosticSeverity.Warning, + code: ErrorCode.EnumValueMismatch, + message: schema.errorMessage || jsonParser_localize('constWarning', 'Value must be {0}.', JSON.stringify(schema.const)) }); validationResult.enumValueMatch = false; } @@ -10721,92 +11702,92 @@ function validate(node, schema, validationResult, matchingSchemas) { if (schema.deprecationMessage && node.parent) { validationResult.problems.push({ location: { offset: node.parent.offset, length: node.parent.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, + severity: DiagnosticSeverity.Warning, message: schema.deprecationMessage }); } } function _validateNumberNode(node, schema, validationResult, matchingSchemas) { var val = node.value; - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(schema.multipleOf)) { + if (objects_isNumber(schema.multipleOf)) { if (val % schema.multipleOf !== 0) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: localize('multipleOfWarning', 'Value is not divisible by {0}.', schema.multipleOf) + severity: DiagnosticSeverity.Warning, + message: jsonParser_localize('multipleOfWarning', 'Value is not divisible by {0}.', schema.multipleOf) }); } } function getExclusiveLimit(limit, exclusive) { - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(exclusive)) { + if (objects_isNumber(exclusive)) { return exclusive; } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isBoolean"])(exclusive) && exclusive) { + if (objects_isBoolean(exclusive) && exclusive) { return limit; } return void 0; } function getLimit(limit, exclusive) { - if (!Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isBoolean"])(exclusive) || !exclusive) { + if (!objects_isBoolean(exclusive) || !exclusive) { return limit; } return void 0; } var exclusiveMinimum = getExclusiveLimit(schema.minimum, schema.exclusiveMinimum); - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(exclusiveMinimum) && val <= exclusiveMinimum) { + if (objects_isNumber(exclusiveMinimum) && val <= exclusiveMinimum) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: localize('exclusiveMinimumWarning', 'Value is below the exclusive minimum of {0}.', exclusiveMinimum) + severity: DiagnosticSeverity.Warning, + message: jsonParser_localize('exclusiveMinimumWarning', 'Value is below the exclusive minimum of {0}.', exclusiveMinimum) }); } var exclusiveMaximum = getExclusiveLimit(schema.maximum, schema.exclusiveMaximum); - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(exclusiveMaximum) && val >= exclusiveMaximum) { + if (objects_isNumber(exclusiveMaximum) && val >= exclusiveMaximum) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: localize('exclusiveMaximumWarning', 'Value is above the exclusive maximum of {0}.', exclusiveMaximum) + severity: DiagnosticSeverity.Warning, + message: jsonParser_localize('exclusiveMaximumWarning', 'Value is above the exclusive maximum of {0}.', exclusiveMaximum) }); } var minimum = getLimit(schema.minimum, schema.exclusiveMinimum); - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(minimum) && val < minimum) { + if (objects_isNumber(minimum) && val < minimum) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: localize('minimumWarning', 'Value is below the minimum of {0}.', minimum) + severity: DiagnosticSeverity.Warning, + message: jsonParser_localize('minimumWarning', 'Value is below the minimum of {0}.', minimum) }); } var maximum = getLimit(schema.maximum, schema.exclusiveMaximum); - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(maximum) && val > maximum) { + if (objects_isNumber(maximum) && val > maximum) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: localize('maximumWarning', 'Value is above the maximum of {0}.', maximum) + severity: DiagnosticSeverity.Warning, + message: jsonParser_localize('maximumWarning', 'Value is above the maximum of {0}.', maximum) }); } } function _validateStringNode(node, schema, validationResult, matchingSchemas) { - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(schema.minLength) && node.value.length < schema.minLength) { + if (objects_isNumber(schema.minLength) && node.value.length < schema.minLength) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: localize('minLengthWarning', 'String is shorter than the minimum length of {0}.', schema.minLength) + severity: DiagnosticSeverity.Warning, + message: jsonParser_localize('minLengthWarning', 'String is shorter than the minimum length of {0}.', schema.minLength) }); } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(schema.maxLength) && node.value.length > schema.maxLength) { + if (objects_isNumber(schema.maxLength) && node.value.length > schema.maxLength) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: localize('maxLengthWarning', 'String is longer than the maximum length of {0}.', schema.maxLength) + severity: DiagnosticSeverity.Warning, + message: jsonParser_localize('maxLengthWarning', 'String is longer than the maximum length of {0}.', schema.maxLength) }); } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isString"])(schema.pattern)) { + if (objects_isString(schema.pattern)) { var regex = new RegExp(schema.pattern); if (!regex.test(node.value)) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: schema.patternErrorMessage || schema.errorMessage || localize('patternWarning', 'String does not match the pattern of "{0}".', schema.pattern) + severity: DiagnosticSeverity.Warning, + message: schema.patternErrorMessage || schema.errorMessage || jsonParser_localize('patternWarning', 'String does not match the pattern of "{0}".', schema.pattern) }); } } @@ -10817,13 +11798,13 @@ function validate(node, schema, validationResult, matchingSchemas) { { var errorMessage = void 0; if (!node.value) { - errorMessage = localize('uriEmpty', 'URI expected.'); + errorMessage = jsonParser_localize('uriEmpty', 'URI expected.'); } else { try { - var uri = _vscode_uri_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].parse(node.value); + var uri = vscode_uri.parse(node.value); if (!uri.scheme && schema.format === 'uri') { - errorMessage = localize('uriSchemeMissing', 'URI with a scheme is expected.'); + errorMessage = jsonParser_localize('uriSchemeMissing', 'URI with a scheme is expected.'); } } catch (e) { @@ -10833,8 +11814,8 @@ function validate(node, schema, validationResult, matchingSchemas) { if (errorMessage) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: schema.patternErrorMessage || schema.errorMessage || localize('uriFormatWarning', 'String is not a URI: {0}', errorMessage) + severity: DiagnosticSeverity.Warning, + message: schema.patternErrorMessage || schema.errorMessage || jsonParser_localize('uriFormatWarning', 'String is not a URI: {0}', errorMessage) }); } } @@ -10844,8 +11825,8 @@ function validate(node, schema, validationResult, matchingSchemas) { if (!node.value.match(emailPattern)) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: schema.patternErrorMessage || schema.errorMessage || localize('emailFormatWarning', 'String is not an e-mail address.') + severity: DiagnosticSeverity.Warning, + message: schema.patternErrorMessage || schema.errorMessage || jsonParser_localize('emailFormatWarning', 'String is not an e-mail address.') }); } } @@ -10855,8 +11836,8 @@ function validate(node, schema, validationResult, matchingSchemas) { if (!node.value.match(colorHexPattern)) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: schema.patternErrorMessage || schema.errorMessage || localize('colorHexFormatWarning', 'Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.') + severity: DiagnosticSeverity.Warning, + message: schema.patternErrorMessage || schema.errorMessage || jsonParser_localize('colorHexFormatWarning', 'Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.') }); } } @@ -10871,7 +11852,7 @@ function validate(node, schema, validationResult, matchingSchemas) { for (var index = 0; index < subSchemas.length; index++) { var subSchemaRef = subSchemas[index]; var subSchema = asSchema(subSchemaRef); - var itemValidationResult = new ValidationResult(); + var itemValidationResult = new jsonParser_ValidationResult(); var item = node.items[index]; if (item) { validate(item, subSchema, itemValidationResult, matchingSchemas); @@ -10884,7 +11865,7 @@ function validate(node, schema, validationResult, matchingSchemas) { if (node.items.length > subSchemas.length) { if (typeof schema.additionalItems === 'object') { for (var i = subSchemas.length; i < node.items.length; i++) { - var itemValidationResult = new ValidationResult(); + var itemValidationResult = new jsonParser_ValidationResult(); validate(node.items[i], schema.additionalItems, itemValidationResult, matchingSchemas); validationResult.mergePropertyMatch(itemValidationResult); } @@ -10892,8 +11873,8 @@ function validate(node, schema, validationResult, matchingSchemas) { else if (schema.additionalItems === false) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: localize('additionalItemsWarning', 'Array has too many items according to schema. Expected {0} or fewer.', subSchemas.length) + severity: DiagnosticSeverity.Warning, + message: jsonParser_localize('additionalItemsWarning', 'Array has too many items according to schema. Expected {0} or fewer.', subSchemas.length) }); } } @@ -10903,7 +11884,7 @@ function validate(node, schema, validationResult, matchingSchemas) { if (itemSchema) { for (var _i = 0, _a = node.items; _i < _a.length; _i++) { var item = _a[_i]; - var itemValidationResult = new ValidationResult(); + var itemValidationResult = new jsonParser_ValidationResult(); validate(item, itemSchema, itemValidationResult, matchingSchemas); validationResult.mergePropertyMatch(itemValidationResult); } @@ -10912,42 +11893,42 @@ function validate(node, schema, validationResult, matchingSchemas) { var containsSchema = asSchema(schema.contains); if (containsSchema) { var doesContain = node.items.some(function (item) { - var itemValidationResult = new ValidationResult(); + var itemValidationResult = new jsonParser_ValidationResult(); validate(item, containsSchema, itemValidationResult, NoOpSchemaCollector.instance); return !itemValidationResult.hasProblems(); }); if (!doesContain) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: schema.errorMessage || localize('requiredItemMissingWarning', 'Array does not contain required item.') + severity: DiagnosticSeverity.Warning, + message: schema.errorMessage || jsonParser_localize('requiredItemMissingWarning', 'Array does not contain required item.') }); } } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(schema.minItems) && node.items.length < schema.minItems) { + if (objects_isNumber(schema.minItems) && node.items.length < schema.minItems) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: localize('minItemsWarning', 'Array has too few items. Expected {0} or more.', schema.minItems) + severity: DiagnosticSeverity.Warning, + message: jsonParser_localize('minItemsWarning', 'Array has too few items. Expected {0} or more.', schema.minItems) }); } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(schema.maxItems) && node.items.length > schema.maxItems) { + if (objects_isNumber(schema.maxItems) && node.items.length > schema.maxItems) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: localize('maxItemsWarning', 'Array has too many items. Expected {0} or fewer.', schema.maxItems) + severity: DiagnosticSeverity.Warning, + message: jsonParser_localize('maxItemsWarning', 'Array has too many items. Expected {0} or fewer.', schema.maxItems) }); } if (schema.uniqueItems === true) { - var values_1 = getNodeValue(node); + var values_1 = jsonParser_getNodeValue(node); var duplicates = values_1.some(function (value, index) { return index !== values_1.lastIndexOf(value); }); if (duplicates) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: localize('uniqueItemsWarning', 'Array has duplicate items.') + severity: DiagnosticSeverity.Warning, + message: jsonParser_localize('uniqueItemsWarning', 'Array has duplicate items.') }); } } @@ -10969,8 +11950,8 @@ function validate(node, schema, validationResult, matchingSchemas) { var location = keyNode ? { offset: keyNode.offset, length: keyNode.length } : { offset: node.offset, length: 1 }; validationResult.problems.push({ location: location, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: localize('MissingRequiredPropWarning', 'Missing property "{0}".', propertyName) + severity: DiagnosticSeverity.Warning, + message: jsonParser_localize('MissingRequiredPropWarning', 'Missing property "{0}".', propertyName) }); } } @@ -10989,13 +11970,13 @@ function validate(node, schema, validationResult, matchingSchemas) { var propertySchema = schema.properties[propertyName]; var child = seenKeys[propertyName]; if (child) { - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isBoolean"])(propertySchema)) { + if (objects_isBoolean(propertySchema)) { if (!propertySchema) { var propertyNode = child.parent; validationResult.problems.push({ location: { offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: schema.errorMessage || localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName) + severity: DiagnosticSeverity.Warning, + message: schema.errorMessage || jsonParser_localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName) }); } else { @@ -11004,7 +11985,7 @@ function validate(node, schema, validationResult, matchingSchemas) { } } else { - var propertyValidationResult = new ValidationResult(); + var propertyValidationResult = new jsonParser_ValidationResult(); validate(child, propertySchema, propertyValidationResult, matchingSchemas); validationResult.mergePropertyMatch(propertyValidationResult); } @@ -11022,13 +12003,13 @@ function validate(node, schema, validationResult, matchingSchemas) { var child = seenKeys[propertyName]; if (child) { var propertySchema = schema.patternProperties[propertyPattern]; - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isBoolean"])(propertySchema)) { + if (objects_isBoolean(propertySchema)) { if (!propertySchema) { var propertyNode = child.parent; validationResult.problems.push({ location: { offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: schema.errorMessage || localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName) + severity: DiagnosticSeverity.Warning, + message: schema.errorMessage || jsonParser_localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName) }); } else { @@ -11037,7 +12018,7 @@ function validate(node, schema, validationResult, matchingSchemas) { } } else { - var propertyValidationResult = new ValidationResult(); + var propertyValidationResult = new jsonParser_ValidationResult(); validate(child, propertySchema, propertyValidationResult, matchingSchemas); validationResult.mergePropertyMatch(propertyValidationResult); } @@ -11051,7 +12032,7 @@ function validate(node, schema, validationResult, matchingSchemas) { var propertyName = unprocessedProperties_1[_k]; var child = seenKeys[propertyName]; if (child) { - var propertyValidationResult = new ValidationResult(); + var propertyValidationResult = new jsonParser_ValidationResult(); validate(child, schema.additionalProperties, propertyValidationResult, matchingSchemas); validationResult.mergePropertyMatch(propertyValidationResult); } @@ -11066,28 +12047,28 @@ function validate(node, schema, validationResult, matchingSchemas) { var propertyNode = child.parent; validationResult.problems.push({ location: { offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: schema.errorMessage || localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName) + severity: DiagnosticSeverity.Warning, + message: schema.errorMessage || jsonParser_localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName) }); } } } } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(schema.maxProperties)) { + if (objects_isNumber(schema.maxProperties)) { if (node.properties.length > schema.maxProperties) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: localize('MaxPropWarning', 'Object has more properties than limit of {0}.', schema.maxProperties) + severity: DiagnosticSeverity.Warning, + message: jsonParser_localize('MaxPropWarning', 'Object has more properties than limit of {0}.', schema.maxProperties) }); } } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(schema.minProperties)) { + if (objects_isNumber(schema.minProperties)) { if (node.properties.length < schema.minProperties) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: localize('MinPropWarning', 'Object has fewer properties than the required number of {0}', schema.minProperties) + severity: DiagnosticSeverity.Warning, + message: jsonParser_localize('MinPropWarning', 'Object has fewer properties than the required number of {0}', schema.minProperties) }); } } @@ -11103,8 +12084,8 @@ function validate(node, schema, validationResult, matchingSchemas) { if (!seenKeys[requiredProp]) { validationResult.problems.push({ location: { offset: node.offset, length: node.length }, - severity: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning, - message: localize('RequiredDependentPropWarning', 'Object is missing property {0} required by property {1}.', requiredProp, key) + severity: DiagnosticSeverity.Warning, + message: jsonParser_localize('RequiredDependentPropWarning', 'Object is missing property {0} required by property {1}.', requiredProp, key) }); } else { @@ -11115,7 +12096,7 @@ function validate(node, schema, validationResult, matchingSchemas) { else { var propertySchema = asSchema(propertyDep); if (propertySchema) { - var propertyValidationResult = new ValidationResult(); + var propertyValidationResult = new jsonParser_ValidationResult(); validate(node, propertySchema, propertyValidationResult, matchingSchemas); validationResult.mergePropertyMatch(propertyValidationResult); } @@ -11135,11 +12116,11 @@ function validate(node, schema, validationResult, matchingSchemas) { } } } -function parse(textDocument, config) { +function jsonParser_parse(textDocument, config) { var problems = []; var lastProblemOffset = -1; var text = textDocument.getText(); - var scanner = _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_0__["createScanner"](text, false); + var scanner = main_createScanner(text, false); var commentRanges = config && config.collectComments ? [] : void 0; function _scanNext() { while (true) { @@ -11149,7 +12130,7 @@ function parse(textDocument, config) { case 12 /* LineCommentTrivia */: case 13 /* BlockCommentTrivia */: if (Array.isArray(commentRanges)) { - commentRanges.push(_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["Range"].create(textDocument.positionAt(scanner.getTokenOffset()), textDocument.positionAt(scanner.getTokenOffset() + scanner.getTokenLength()))); + commentRanges.push(main_Range.create(textDocument.positionAt(scanner.getTokenOffset()), textDocument.positionAt(scanner.getTokenOffset() + scanner.getTokenLength()))); } break; case 15 /* Trivia */: @@ -11168,10 +12149,10 @@ function parse(textDocument, config) { return false; } function _errorAtRange(message, code, startOffset, endOffset, severity) { - if (severity === void 0) { severity = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Error; } + if (severity === void 0) { severity = DiagnosticSeverity.Error; } if (problems.length === 0 || startOffset !== lastProblemOffset) { - var range = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["Range"].create(textDocument.positionAt(startOffset), textDocument.positionAt(endOffset)); - problems.push(_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["Diagnostic"].create(range, message, severity, code, textDocument.languageId)); + var range = main_Range.create(textDocument.positionAt(startOffset), textDocument.positionAt(endOffset)); + problems.push(Diagnostic.create(range, message, severity, code, textDocument.languageId)); lastProblemOffset = startOffset; } } @@ -11210,22 +12191,22 @@ function parse(textDocument, config) { function _checkScanError() { switch (scanner.getTokenError()) { case 4 /* InvalidUnicode */: - _error(localize('InvalidUnicode', 'Invalid unicode sequence in string.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].InvalidUnicode); + _error(jsonParser_localize('InvalidUnicode', 'Invalid unicode sequence in string.'), ErrorCode.InvalidUnicode); return true; case 5 /* InvalidEscapeCharacter */: - _error(localize('InvalidEscapeCharacter', 'Invalid escape character in string.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].InvalidEscapeCharacter); + _error(jsonParser_localize('InvalidEscapeCharacter', 'Invalid escape character in string.'), ErrorCode.InvalidEscapeCharacter); return true; case 3 /* UnexpectedEndOfNumber */: - _error(localize('UnexpectedEndOfNumber', 'Unexpected end of number.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].UnexpectedEndOfNumber); + _error(jsonParser_localize('UnexpectedEndOfNumber', 'Unexpected end of number.'), ErrorCode.UnexpectedEndOfNumber); return true; case 1 /* UnexpectedEndOfComment */: - _error(localize('UnexpectedEndOfComment', 'Unexpected end of comment.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].UnexpectedEndOfComment); + _error(jsonParser_localize('UnexpectedEndOfComment', 'Unexpected end of comment.'), ErrorCode.UnexpectedEndOfComment); return true; case 2 /* UnexpectedEndOfString */: - _error(localize('UnexpectedEndOfString', 'Unexpected end of string.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].UnexpectedEndOfString); + _error(jsonParser_localize('UnexpectedEndOfString', 'Unexpected end of string.'), ErrorCode.UnexpectedEndOfString); return true; case 6 /* InvalidCharacter */: - _error(localize('InvalidCharacter', 'Invalid characters in string. Control characters must be escaped.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].InvalidCharacter); + _error(jsonParser_localize('InvalidCharacter', 'Invalid characters in string. Control characters must be escaped.'), ErrorCode.InvalidCharacter); return true; } return false; @@ -11248,23 +12229,23 @@ function parse(textDocument, config) { while (scanner.getToken() !== 4 /* CloseBracketToken */ && scanner.getToken() !== 17 /* EOF */) { if (scanner.getToken() === 5 /* CommaToken */) { if (!needsComma) { - _error(localize('ValueExpected', 'Value expected'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].ValueExpected); + _error(jsonParser_localize('ValueExpected', 'Value expected'), ErrorCode.ValueExpected); } var commaOffset = scanner.getTokenOffset(); _scanNext(); // consume comma if (scanner.getToken() === 4 /* CloseBracketToken */) { if (needsComma) { - _errorAtRange(localize('TrailingComma', 'Trailing comma'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].TrailingComma, commaOffset, commaOffset + 1); + _errorAtRange(jsonParser_localize('TrailingComma', 'Trailing comma'), ErrorCode.TrailingComma, commaOffset, commaOffset + 1); } continue; } } else if (needsComma) { - _error(localize('ExpectedComma', 'Expected comma'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].CommaExpected); + _error(jsonParser_localize('ExpectedComma', 'Expected comma'), ErrorCode.CommaExpected); } var item = _parseValue(node, count++); if (!item) { - _error(localize('PropertyExpected', 'Value expected'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].ValueExpected, null, [], [4 /* CloseBracketToken */, 5 /* CommaToken */]); + _error(jsonParser_localize('PropertyExpected', 'Value expected'), ErrorCode.ValueExpected, null, [], [4 /* CloseBracketToken */, 5 /* CommaToken */]); } else { node.items.push(item); @@ -11272,7 +12253,7 @@ function parse(textDocument, config) { needsComma = true; } if (scanner.getToken() !== 4 /* CloseBracketToken */) { - return _error(localize('ExpectedCloseBracket', 'Expected comma or closing bracket'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].CommaOrCloseBacketExpected, node); + return _error(jsonParser_localize('ExpectedCloseBracket', 'Expected comma or closing bracket'), ErrorCode.CommaOrCloseBacketExpected, node); } return _finalize(node, true); } @@ -11282,7 +12263,7 @@ function parse(textDocument, config) { if (!key) { if (scanner.getToken() === 16 /* Unknown */) { // give a more helpful error message - _error(localize('DoubleQuotesExpected', 'Property keys must be doublequoted'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].Undefined); + _error(jsonParser_localize('DoubleQuotesExpected', 'Property keys must be doublequoted'), ErrorCode.Undefined); var keyNode = new StringASTNodeImpl(node, scanner.getTokenOffset(), scanner.getTokenLength()); keyNode.value = scanner.getTokenValue(); key = keyNode; @@ -11295,9 +12276,9 @@ function parse(textDocument, config) { node.keyNode = key; var seen = keysSeen[key.value]; if (seen) { - _errorAtRange(localize('DuplicateKeyWarning', "Duplicate object key"), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].DuplicateKey, node.keyNode.offset, node.keyNode.offset + node.keyNode.length, _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning); + _errorAtRange(jsonParser_localize('DuplicateKeyWarning', "Duplicate object key"), ErrorCode.DuplicateKey, node.keyNode.offset, node.keyNode.offset + node.keyNode.length, DiagnosticSeverity.Warning); if (typeof seen === 'object') { - _errorAtRange(localize('DuplicateKeyWarning', "Duplicate object key"), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].DuplicateKey, seen.keyNode.offset, seen.keyNode.offset + seen.keyNode.length, _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["DiagnosticSeverity"].Warning); + _errorAtRange(jsonParser_localize('DuplicateKeyWarning', "Duplicate object key"), ErrorCode.DuplicateKey, seen.keyNode.offset, seen.keyNode.offset + seen.keyNode.length, DiagnosticSeverity.Warning); } keysSeen[key.value] = true; // if the same key is duplicate again, avoid duplicate error reporting } @@ -11309,7 +12290,7 @@ function parse(textDocument, config) { _scanNext(); // consume ColonToken } else { - _error(localize('ColonExpected', 'Colon expected'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].ColonExpected); + _error(jsonParser_localize('ColonExpected', 'Colon expected'), ErrorCode.ColonExpected); if (scanner.getToken() === 10 /* StringLiteral */ && textDocument.positionAt(key.offset + key.length).line < textDocument.positionAt(scanner.getTokenOffset()).line) { node.length = key.length; return node; @@ -11317,7 +12298,7 @@ function parse(textDocument, config) { } var value = _parseValue(node, key.value); if (!value) { - return _error(localize('ValueExpected', 'Value expected'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].ValueExpected, node, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]); + return _error(jsonParser_localize('ValueExpected', 'Value expected'), ErrorCode.ValueExpected, node, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]); } node.valueNode = value; node.length = value.offset + value.length - node.offset; @@ -11334,23 +12315,23 @@ function parse(textDocument, config) { while (scanner.getToken() !== 2 /* CloseBraceToken */ && scanner.getToken() !== 17 /* EOF */) { if (scanner.getToken() === 5 /* CommaToken */) { if (!needsComma) { - _error(localize('PropertyExpected', 'Property expected'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].PropertyExpected); + _error(jsonParser_localize('PropertyExpected', 'Property expected'), ErrorCode.PropertyExpected); } var commaOffset = scanner.getTokenOffset(); _scanNext(); // consume comma if (scanner.getToken() === 2 /* CloseBraceToken */) { if (needsComma) { - _errorAtRange(localize('TrailingComma', 'Trailing comma'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].TrailingComma, commaOffset, commaOffset + 1); + _errorAtRange(jsonParser_localize('TrailingComma', 'Trailing comma'), ErrorCode.TrailingComma, commaOffset, commaOffset + 1); } continue; } } else if (needsComma) { - _error(localize('ExpectedComma', 'Expected comma'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].CommaExpected); + _error(jsonParser_localize('ExpectedComma', 'Expected comma'), ErrorCode.CommaExpected); } var property = _parseProperty(node, keysSeen); if (!property) { - _error(localize('PropertyExpected', 'Property expected'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].PropertyExpected, null, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]); + _error(jsonParser_localize('PropertyExpected', 'Property expected'), ErrorCode.PropertyExpected, null, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]); } else { node.properties.push(property); @@ -11358,7 +12339,7 @@ function parse(textDocument, config) { needsComma = true; } if (scanner.getToken() !== 2 /* CloseBraceToken */) { - return _error(localize('ExpectedCloseBrace', 'Expected comma or closing brace'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].CommaOrCloseBraceExpected, node); + return _error(jsonParser_localize('ExpectedCloseBrace', 'Expected comma or closing brace'), ErrorCode.CommaOrCloseBraceExpected, node); } return _finalize(node, true); } @@ -11379,13 +12360,13 @@ function parse(textDocument, config) { var tokenValue = scanner.getTokenValue(); try { var numberValue = JSON.parse(tokenValue); - if (!Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_1__["isNumber"])(numberValue)) { - return _error(localize('InvalidNumberFormat', 'Invalid number format.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].Undefined, node); + if (!objects_isNumber(numberValue)) { + return _error(jsonParser_localize('InvalidNumberFormat', 'Invalid number format.'), ErrorCode.Undefined, node); } node.value = numberValue; } catch (e) { - return _error(localize('InvalidNumberFormat', 'Invalid number format.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].Undefined, node); + return _error(jsonParser_localize('InvalidNumberFormat', 'Invalid number format.'), ErrorCode.Undefined, node); } node.isInteger = tokenValue.indexOf('.') === -1; } @@ -11412,41 +12393,1918 @@ function parse(textDocument, config) { if (token !== 17 /* EOF */) { _root = _parseValue(null, null); if (!_root) { - _error(localize('Invalid symbol', 'Expected a JSON object, array or literal.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].Undefined); + _error(jsonParser_localize('Invalid symbol', 'Expected a JSON object, array or literal.'), ErrorCode.Undefined); } else if (scanner.getToken() !== 17 /* EOF */) { - _error(localize('End of file expected', 'End of file expected.'), _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].Undefined); + _error(jsonParser_localize('End of file expected', 'End of file expected.'), ErrorCode.Undefined); } } - return new JSONDocument(_root, problems, commentRanges); + return new jsonParser_JSONDocument(_root, problems, commentRanges); } +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/json.js +/*--------------------------------------------------------------------------------------------- +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT License. See License.txt in the project root for license information. +*--------------------------------------------------------------------------------------------*/ +function stringifyObject(obj, indent, stringifyLiteral) { + if (obj !== null && typeof obj === 'object') { + var newIndent = indent + '\t'; + if (Array.isArray(obj)) { + if (obj.length === 0) { + return '[]'; + } + var result = '[\n'; + for (var i = 0; i < obj.length; i++) { + result += newIndent + stringifyObject(obj[i], newIndent, stringifyLiteral); + if (i < obj.length - 1) { + result += ','; + } + result += '\n'; + } + result += indent + ']'; + return result; + } + else { + var keys = Object.keys(obj); + if (keys.length === 0) { + return '{}'; + } + var result = '{\n'; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + result += newIndent + JSON.stringify(key) + ': ' + stringifyObject(obj[key], newIndent, stringifyLiteral); + if (i < keys.length - 1) { + result += ','; + } + result += '\n'; + } + result += indent + '}'; + return result; + } + } + return stringifyLiteral(obj); +} -/***/ }), +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/strings.js +/*--------------------------------------------------------------------------------------------- +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT License. See License.txt in the project root for license information. +*--------------------------------------------------------------------------------------------*/ +function strings_startsWith(haystack, needle) { + if (haystack.length < needle.length) { + return false; + } + for (var i = 0; i < needle.length; i++) { + if (haystack[i] !== needle[i]) { + return false; + } + } + return true; +} +/** + * Determines if haystack ends with needle. + */ +function strings_endsWith(haystack, needle) { + var diff = haystack.length - needle.length; + if (diff > 0) { + return haystack.lastIndexOf(needle) === diff; + } + else if (diff === 0) { + return haystack === needle; + } + else { + return false; + } +} +function strings_convertSimple2RegExpPattern(pattern) { + return pattern.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&').replace(/[\*]/g, '.*'); +} +function strings_repeat(value, count) { + var s = ''; + while (count > 0) { + if ((count & 1) === 1) { + s += value; + } + value += value; + count = count >>> 1; + } + return s; +} -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/configuration.js": -/*!*********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/configuration.js ***! - \*********************************************************************************************************************/ -/*! exports provided: schemaContributions */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "schemaContributions", function() { return schemaContributions; }); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./node_modules/monaco-editor/esm/vs/language/json/fillers/vscode-nls.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonCompletion.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_0__["loadMessageBundle"](); + + + + + + +var jsonCompletion_localize = loadMessageBundle(); +var jsonCompletion_JSONCompletion = /** @class */ (function () { + function JSONCompletion(schemaService, contributions, promiseConstructor, clientCapabilities) { + if (contributions === void 0) { contributions = []; } + if (promiseConstructor === void 0) { promiseConstructor = Promise; } + if (clientCapabilities === void 0) { clientCapabilities = {}; } + this.schemaService = schemaService; + this.contributions = contributions; + this.promiseConstructor = promiseConstructor; + this.clientCapabilities = clientCapabilities; + this.templateVarIdCounter = 0; + } + JSONCompletion.prototype.doResolve = function (item) { + for (var i = this.contributions.length - 1; i >= 0; i--) { + if (this.contributions[i].resolveCompletion) { + var resolver = this.contributions[i].resolveCompletion(item); + if (resolver) { + return resolver; + } + } + } + return this.promiseConstructor.resolve(item); + }; + JSONCompletion.prototype.doComplete = function (document, position, doc) { + var _this = this; + var result = { + items: [], + isIncomplete: false + }; + var offset = document.offsetAt(position); + var node = doc.getNodeFromOffset(offset, true); + if (this.isInComment(document, node ? node.offset : 0, offset)) { + return Promise.resolve(result); + } + var currentWord = this.getCurrentWord(document, offset); + var overwriteRange = null; + if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) { + overwriteRange = main_Range.create(document.positionAt(node.offset), document.positionAt(node.offset + node.length)); + } + else { + var overwriteStart = offset - currentWord.length; + if (overwriteStart > 0 && document.getText()[overwriteStart - 1] === '"') { + overwriteStart--; + } + overwriteRange = main_Range.create(document.positionAt(overwriteStart), position); + } + var proposed = {}; + var collector = { + add: function (suggestion) { + var existing = proposed[suggestion.label]; + if (!existing) { + proposed[suggestion.label] = suggestion; + if (overwriteRange) { + suggestion.textEdit = TextEdit.replace(overwriteRange, suggestion.insertText); + } + result.items.push(suggestion); + } + else if (!existing.documentation) { + existing.documentation = suggestion.documentation; + } + }, + setAsIncomplete: function () { + result.isIncomplete = true; + }, + error: function (message) { + console.error(message); + }, + log: function (message) { + console.log(message); + }, + getNumberOfProposals: function () { + return result.items.length; + } + }; + return this.schemaService.getSchemaForResource(document.uri, doc).then(function (schema) { + var collectionPromises = []; + var addValue = true; + var currentKey = ''; + var currentProperty = null; + if (node) { + if (node.type === 'string') { + var parent = node.parent; + if (parent && parent.type === 'property' && parent.keyNode === node) { + addValue = !parent.valueNode; + currentProperty = parent; + currentKey = document.getText().substr(node.offset + 1, node.length - 2); + if (parent) { + node = parent.parent; + } + } + } + } + // proposals for properties + if (node && node.type === 'object') { + // don't suggest keys when the cursor is just before the opening curly brace + if (node.offset === offset) { + return result; + } + // don't suggest properties that are already present + var properties = node.properties; + properties.forEach(function (p) { + if (!currentProperty || currentProperty !== p) { + proposed[p.keyNode.value] = CompletionItem.create('__'); + } + }); + var separatorAfter_1 = ''; + if (addValue) { + separatorAfter_1 = _this.evaluateSeparatorAfter(document, document.offsetAt(overwriteRange.end)); + } + if (schema) { + // property proposals with schema + _this.getPropertyCompletions(schema, doc, node, addValue, separatorAfter_1, collector); + } + else { + // property proposals without schema + _this.getSchemaLessPropertyCompletions(doc, node, currentKey, collector); + } + var location_1 = jsonParser_getNodePath(node); + _this.contributions.forEach(function (contribution) { + var collectPromise = contribution.collectPropertyCompletions(document.uri, location_1, currentWord, addValue, separatorAfter_1 === '', collector); + if (collectPromise) { + collectionPromises.push(collectPromise); + } + }); + if ((!schema && currentWord.length > 0 && document.getText().charAt(offset - currentWord.length - 1) !== '"')) { + collector.add({ + kind: main_CompletionItemKind.Property, + label: _this.getLabelForValue(currentWord), + insertText: _this.getInsertTextForProperty(currentWord, null, false, separatorAfter_1), + insertTextFormat: InsertTextFormat.Snippet, documentation: '', + }); + collector.setAsIncomplete(); + } + } + // proposals for values + var types = {}; + if (schema) { + // value proposals with schema + _this.getValueCompletions(schema, doc, node, offset, document, collector, types); + } + else { + // value proposals without schema + _this.getSchemaLessValueCompletions(doc, node, offset, document, collector); + } + if (_this.contributions.length > 0) { + _this.getContributedValueCompletions(doc, node, offset, document, collector, collectionPromises); + } + return _this.promiseConstructor.all(collectionPromises).then(function () { + if (collector.getNumberOfProposals() === 0) { + var offsetForSeparator = offset; + if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) { + offsetForSeparator = node.offset + node.length; + } + var separatorAfter = _this.evaluateSeparatorAfter(document, offsetForSeparator); + _this.addFillerValueCompletions(types, separatorAfter, collector); + } + return result; + }); + }); + }; + JSONCompletion.prototype.getPropertyCompletions = function (schema, doc, node, addValue, separatorAfter, collector) { + var _this = this; + var matchingSchemas = doc.getMatchingSchemas(schema.schema, node.offset); + matchingSchemas.forEach(function (s) { + if (s.node === node && !s.inverted) { + var schemaProperties_1 = s.schema.properties; + if (schemaProperties_1) { + Object.keys(schemaProperties_1).forEach(function (key) { + var propertySchema = schemaProperties_1[key]; + if (typeof propertySchema === 'object' && !propertySchema.deprecationMessage && !propertySchema.doNotSuggest) { + var proposal = { + kind: main_CompletionItemKind.Property, + label: _this.sanitizeLabel(key), + insertText: _this.getInsertTextForProperty(key, propertySchema, addValue, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, + filterText: _this.getFilterTextForValue(key), + documentation: _this.fromMarkup(propertySchema.markdownDescription) || propertySchema.description || '', + }; + if (strings_endsWith(proposal.insertText, "$1" + separatorAfter)) { + proposal.command = { + title: 'Suggest', + command: 'editor.action.triggerSuggest' + }; + } + collector.add(proposal); + } + }); + } + } + }); + }; + JSONCompletion.prototype.getSchemaLessPropertyCompletions = function (doc, node, currentKey, collector) { + var _this = this; + var collectCompletionsForSimilarObject = function (obj) { + obj.properties.forEach(function (p) { + var key = p.keyNode.value; + collector.add({ + kind: main_CompletionItemKind.Property, + label: _this.sanitizeLabel(key), + insertText: _this.getInsertTextForValue(key, ''), + insertTextFormat: InsertTextFormat.Snippet, + filterText: _this.getFilterTextForValue(key), + documentation: '' + }); + }); + }; + if (node.parent) { + if (node.parent.type === 'property') { + // if the object is a property value, check the tree for other objects that hang under a property of the same name + var parentKey_1 = node.parent.keyNode.value; + doc.visit(function (n) { + if (n.type === 'property' && n !== node.parent && n.keyNode.value === parentKey_1 && n.valueNode && n.valueNode.type === 'object') { + collectCompletionsForSimilarObject(n.valueNode); + } + return true; + }); + } + else if (node.parent.type === 'array') { + // if the object is in an array, use all other array elements as similar objects + node.parent.items.forEach(function (n) { + if (n.type === 'object' && n !== node) { + collectCompletionsForSimilarObject(n); + } + }); + } + } + else if (node.type === 'object') { + collector.add({ + kind: main_CompletionItemKind.Property, + label: '$schema', + insertText: this.getInsertTextForProperty('$schema', null, true, ''), + insertTextFormat: InsertTextFormat.Snippet, documentation: '', + filterText: this.getFilterTextForValue("$schema") + }); + } + }; + JSONCompletion.prototype.getSchemaLessValueCompletions = function (doc, node, offset, document, collector) { + var _this = this; + var offsetForSeparator = offset; + if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) { + offsetForSeparator = node.offset + node.length; + node = node.parent; + } + if (!node) { + collector.add({ + kind: this.getSuggestionKind('object'), + label: 'Empty object', + insertText: this.getInsertTextForValue({}, ''), + insertTextFormat: InsertTextFormat.Snippet, + documentation: '' + }); + collector.add({ + kind: this.getSuggestionKind('array'), + label: 'Empty array', + insertText: this.getInsertTextForValue([], ''), + insertTextFormat: InsertTextFormat.Snippet, + documentation: '' + }); + return; + } + var separatorAfter = this.evaluateSeparatorAfter(document, offsetForSeparator); + var collectSuggestionsForValues = function (value) { + if (!jsonParser_contains(value.parent, offset, true)) { + collector.add({ + kind: _this.getSuggestionKind(value.type), + label: _this.getLabelTextForMatchingNode(value, document), + insertText: _this.getInsertTextForMatchingNode(value, document, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, documentation: '' + }); + } + if (value.type === 'boolean') { + _this.addBooleanValueCompletion(!value.value, separatorAfter, collector); + } + }; + if (node.type === 'property') { + if (offset > node.colonOffset) { + var valueNode = node.valueNode; + if (valueNode && (offset > (valueNode.offset + valueNode.length) || valueNode.type === 'object' || valueNode.type === 'array')) { + return; + } + // suggest values at the same key + var parentKey_2 = node.keyNode.value; + doc.visit(function (n) { + if (n.type === 'property' && n.keyNode.value === parentKey_2 && n.valueNode) { + collectSuggestionsForValues(n.valueNode); + } + return true; + }); + if (parentKey_2 === '$schema' && node.parent && !node.parent.parent) { + this.addDollarSchemaCompletions(separatorAfter, collector); + } + } + } + if (node.type === 'array') { + if (node.parent && node.parent.type === 'property') { + // suggest items of an array at the same key + var parentKey_3 = node.parent.keyNode.value; + doc.visit(function (n) { + if (n.type === 'property' && n.keyNode.value === parentKey_3 && n.valueNode && n.valueNode.type === 'array') { + n.valueNode.items.forEach(collectSuggestionsForValues); + } + return true; + }); + } + else { + // suggest items in the same array + node.items.forEach(collectSuggestionsForValues); + } + } + }; + JSONCompletion.prototype.getValueCompletions = function (schema, doc, node, offset, document, collector, types) { + var _this = this; + var offsetForSeparator = offset; + var parentKey = null; + var valueNode = null; + if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) { + offsetForSeparator = node.offset + node.length; + valueNode = node; + node = node.parent; + } + if (!node) { + this.addSchemaValueCompletions(schema.schema, '', collector, types); + return; + } + if ((node.type === 'property') && offset > node.colonOffset) { + var valueNode_1 = node.valueNode; + if (valueNode_1 && offset > (valueNode_1.offset + valueNode_1.length)) { + return; // we are past the value node + } + parentKey = node.keyNode.value; + node = node.parent; + } + if (node && (parentKey !== null || node.type === 'array')) { + var separatorAfter_2 = this.evaluateSeparatorAfter(document, offsetForSeparator); + var matchingSchemas = doc.getMatchingSchemas(schema.schema, node.offset, valueNode); + matchingSchemas.forEach(function (s) { + if (s.node === node && !s.inverted && s.schema) { + if (node.type === 'array' && s.schema.items) { + if (Array.isArray(s.schema.items)) { + var index = _this.findItemAtOffset(node, document, offset); + if (index < s.schema.items.length) { + _this.addSchemaValueCompletions(s.schema.items[index], separatorAfter_2, collector, types); + } + } + else { + _this.addSchemaValueCompletions(s.schema.items, separatorAfter_2, collector, types); + } + } + if (s.schema.properties) { + var propertySchema = s.schema.properties[parentKey]; + if (propertySchema) { + _this.addSchemaValueCompletions(propertySchema, separatorAfter_2, collector, types); + } + } + } + }); + if (parentKey === '$schema' && !node.parent) { + this.addDollarSchemaCompletions(separatorAfter_2, collector); + } + if (types['boolean']) { + this.addBooleanValueCompletion(true, separatorAfter_2, collector); + this.addBooleanValueCompletion(false, separatorAfter_2, collector); + } + if (types['null']) { + this.addNullValueCompletion(separatorAfter_2, collector); + } + } + }; + JSONCompletion.prototype.getContributedValueCompletions = function (doc, node, offset, document, collector, collectionPromises) { + if (!node) { + this.contributions.forEach(function (contribution) { + var collectPromise = contribution.collectDefaultCompletions(document.uri, collector); + if (collectPromise) { + collectionPromises.push(collectPromise); + } + }); + } + else { + if (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null') { + node = node.parent; + } + if ((node.type === 'property') && offset > node.colonOffset) { + var parentKey_4 = node.keyNode.value; + var valueNode = node.valueNode; + if (!valueNode || offset <= (valueNode.offset + valueNode.length)) { + var location_2 = jsonParser_getNodePath(node.parent); + this.contributions.forEach(function (contribution) { + var collectPromise = contribution.collectValueCompletions(document.uri, location_2, parentKey_4, collector); + if (collectPromise) { + collectionPromises.push(collectPromise); + } + }); + } + } + } + }; + JSONCompletion.prototype.addSchemaValueCompletions = function (schema, separatorAfter, collector, types) { + var _this = this; + if (typeof schema === 'object') { + this.addEnumValueCompletions(schema, separatorAfter, collector); + this.addDefaultValueCompletions(schema, separatorAfter, collector); + this.collectTypes(schema, types); + if (Array.isArray(schema.allOf)) { + schema.allOf.forEach(function (s) { return _this.addSchemaValueCompletions(s, separatorAfter, collector, types); }); + } + if (Array.isArray(schema.anyOf)) { + schema.anyOf.forEach(function (s) { return _this.addSchemaValueCompletions(s, separatorAfter, collector, types); }); + } + if (Array.isArray(schema.oneOf)) { + schema.oneOf.forEach(function (s) { return _this.addSchemaValueCompletions(s, separatorAfter, collector, types); }); + } + } + }; + JSONCompletion.prototype.addDefaultValueCompletions = function (schema, separatorAfter, collector, arrayDepth) { + var _this = this; + if (arrayDepth === void 0) { arrayDepth = 0; } + var hasProposals = false; + if (isDefined(schema.default)) { + var type = schema.type; + var value = schema.default; + for (var i = arrayDepth; i > 0; i--) { + value = [value]; + type = 'array'; + } + collector.add({ + kind: this.getSuggestionKind(type), + label: this.getLabelForValue(value), + insertText: this.getInsertTextForValue(value, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, + detail: jsonCompletion_localize('json.suggest.default', 'Default value') + }); + hasProposals = true; + } + if (Array.isArray(schema.examples)) { + schema.examples.forEach(function (example) { + var type = schema.type; + var value = example; + for (var i = arrayDepth; i > 0; i--) { + value = [value]; + type = 'array'; + } + collector.add({ + kind: _this.getSuggestionKind(type), + label: _this.getLabelForValue(value), + insertText: _this.getInsertTextForValue(value, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet + }); + hasProposals = true; + }); + } + if (Array.isArray(schema.defaultSnippets)) { + schema.defaultSnippets.forEach(function (s) { + var type = schema.type; + var value = s.body; + var label = s.label; + var insertText; + var filterText; + if (isDefined(value)) { + var type_1 = schema.type; + for (var i = arrayDepth; i > 0; i--) { + value = [value]; + type_1 = 'array'; + } + insertText = _this.getInsertTextForSnippetValue(value, separatorAfter); + filterText = _this.getFilterTextForSnippetValue(value); + label = label || _this.getLabelForSnippetValue(value); + } + else if (typeof s.bodyText === 'string') { + var prefix = '', suffix = '', indent = ''; + for (var i = arrayDepth; i > 0; i--) { + prefix = prefix + indent + '[\n'; + suffix = suffix + '\n' + indent + ']'; + indent += '\t'; + type = 'array'; + } + insertText = prefix + indent + s.bodyText.split('\n').join('\n' + indent) + suffix + separatorAfter; + label = label || _this.sanitizeLabel(insertText), + filterText = insertText.replace(/[\n]/g, ''); // remove new lines + } + collector.add({ + kind: _this.getSuggestionKind(type), + label: label, + documentation: _this.fromMarkup(s.markdownDescription) || s.description, + insertText: insertText, + insertTextFormat: InsertTextFormat.Snippet, + filterText: filterText + }); + hasProposals = true; + }); + } + if (!hasProposals && typeof schema.items === 'object' && !Array.isArray(schema.items)) { + this.addDefaultValueCompletions(schema.items, separatorAfter, collector, arrayDepth + 1); + } + }; + JSONCompletion.prototype.addEnumValueCompletions = function (schema, separatorAfter, collector) { + if (isDefined(schema.const)) { + collector.add({ + kind: this.getSuggestionKind(schema.type), + label: this.getLabelForValue(schema.const), + insertText: this.getInsertTextForValue(schema.const, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, + documentation: this.fromMarkup(schema.markdownDescription) || schema.description + }); + } + if (Array.isArray(schema.enum)) { + for (var i = 0, length = schema.enum.length; i < length; i++) { + var enm = schema.enum[i]; + var documentation = this.fromMarkup(schema.markdownDescription) || schema.description; + if (schema.markdownEnumDescriptions && i < schema.markdownEnumDescriptions.length && this.doesSupportMarkdown()) { + documentation = this.fromMarkup(schema.markdownEnumDescriptions[i]); + } + else if (schema.enumDescriptions && i < schema.enumDescriptions.length) { + documentation = schema.enumDescriptions[i]; + } + collector.add({ + kind: this.getSuggestionKind(schema.type), + label: this.getLabelForValue(enm), + insertText: this.getInsertTextForValue(enm, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, + documentation: documentation + }); + } + } + }; + JSONCompletion.prototype.collectTypes = function (schema, types) { + if (Array.isArray(schema.enum) || isDefined(schema.const)) { + return; + } + var type = schema.type; + if (Array.isArray(type)) { + type.forEach(function (t) { return types[t] = true; }); + } + else { + types[type] = true; + } + }; + JSONCompletion.prototype.addFillerValueCompletions = function (types, separatorAfter, collector) { + if (types['object']) { + collector.add({ + kind: this.getSuggestionKind('object'), + label: '{}', + insertText: this.getInsertTextForGuessedValue({}, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, + detail: jsonCompletion_localize('defaults.object', 'New object'), + documentation: '' + }); + } + if (types['array']) { + collector.add({ + kind: this.getSuggestionKind('array'), + label: '[]', + insertText: this.getInsertTextForGuessedValue([], separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, + detail: jsonCompletion_localize('defaults.array', 'New array'), + documentation: '' + }); + } + }; + JSONCompletion.prototype.addBooleanValueCompletion = function (value, separatorAfter, collector) { + collector.add({ + kind: this.getSuggestionKind('boolean'), + label: value ? 'true' : 'false', + insertText: this.getInsertTextForValue(value, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, + documentation: '' + }); + }; + JSONCompletion.prototype.addNullValueCompletion = function (separatorAfter, collector) { + collector.add({ + kind: this.getSuggestionKind('null'), + label: 'null', + insertText: 'null' + separatorAfter, + insertTextFormat: InsertTextFormat.Snippet, + documentation: '' + }); + }; + JSONCompletion.prototype.addDollarSchemaCompletions = function (separatorAfter, collector) { + var _this = this; + var schemaIds = this.schemaService.getRegisteredSchemaIds(function (schema) { return schema === 'http' || schema === 'https'; }); + schemaIds.forEach(function (schemaId) { return collector.add({ + kind: main_CompletionItemKind.Module, + label: _this.getLabelForValue(schemaId), + filterText: _this.getFilterTextForValue(schemaId), + insertText: _this.getInsertTextForValue(schemaId, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, documentation: '' + }); }); + }; + JSONCompletion.prototype.sanitizeLabel = function (label) { + label = label.replace(/[\n]/g, '↵'); + if (label.length > 57) { + label = label.substr(0, 57).trim() + '...'; + } + return label; + }; + JSONCompletion.prototype.getLabelForValue = function (value) { + return this.sanitizeLabel(JSON.stringify(value)); + }; + JSONCompletion.prototype.getFilterTextForValue = function (value) { + return JSON.stringify(value); + }; + JSONCompletion.prototype.getFilterTextForSnippetValue = function (value) { + return JSON.stringify(value).replace(/\$\{\d+:([^}]+)\}|\$\d+/g, '$1'); + }; + JSONCompletion.prototype.getLabelForSnippetValue = function (value) { + var label = JSON.stringify(value); + label = label.replace(/\$\{\d+:([^}]+)\}|\$\d+/g, '$1'); + return this.sanitizeLabel(label); + }; + JSONCompletion.prototype.getInsertTextForPlainText = function (text) { + return text.replace(/[\\\$\}]/g, '\\$&'); // escape $, \ and } + }; + JSONCompletion.prototype.getInsertTextForValue = function (value, separatorAfter) { + var text = JSON.stringify(value, null, '\t'); + if (text === '{}') { + return '{$1}' + separatorAfter; + } + else if (text === '[]') { + return '[$1]' + separatorAfter; + } + return this.getInsertTextForPlainText(text + separatorAfter); + }; + JSONCompletion.prototype.getInsertTextForSnippetValue = function (value, separatorAfter) { + var replacer = function (value) { + if (typeof value === 'string') { + if (value[0] === '^') { + return value.substr(1); + } + } + return JSON.stringify(value); + }; + return stringifyObject(value, '', replacer) + separatorAfter; + }; + JSONCompletion.prototype.getInsertTextForGuessedValue = function (value, separatorAfter) { + switch (typeof value) { + case 'object': + if (value === null) { + return '${1:null}' + separatorAfter; + } + return this.getInsertTextForValue(value, separatorAfter); + case 'string': + var snippetValue = JSON.stringify(value); + snippetValue = snippetValue.substr(1, snippetValue.length - 2); // remove quotes + snippetValue = this.getInsertTextForPlainText(snippetValue); // escape \ and } + return '"${1:' + snippetValue + '}"' + separatorAfter; + case 'number': + case 'boolean': + return '${1:' + JSON.stringify(value) + '}' + separatorAfter; + } + return this.getInsertTextForValue(value, separatorAfter); + }; + JSONCompletion.prototype.getSuggestionKind = function (type) { + if (Array.isArray(type)) { + var array = type; + type = array.length > 0 ? array[0] : null; + } + if (!type) { + return main_CompletionItemKind.Value; + } + switch (type) { + case 'string': return main_CompletionItemKind.Value; + case 'object': return main_CompletionItemKind.Module; + case 'property': return main_CompletionItemKind.Property; + default: return main_CompletionItemKind.Value; + } + }; + JSONCompletion.prototype.getLabelTextForMatchingNode = function (node, document) { + switch (node.type) { + case 'array': + return '[]'; + case 'object': + return '{}'; + default: + var content = document.getText().substr(node.offset, node.length); + return content; + } + }; + JSONCompletion.prototype.getInsertTextForMatchingNode = function (node, document, separatorAfter) { + switch (node.type) { + case 'array': + return this.getInsertTextForValue([], separatorAfter); + case 'object': + return this.getInsertTextForValue({}, separatorAfter); + default: + var content = document.getText().substr(node.offset, node.length) + separatorAfter; + return this.getInsertTextForPlainText(content); + } + }; + JSONCompletion.prototype.getInsertTextForProperty = function (key, propertySchema, addValue, separatorAfter) { + var propertyText = this.getInsertTextForValue(key, ''); + if (!addValue) { + return propertyText; + } + var resultText = propertyText + ': '; + var value; + var nValueProposals = 0; + if (propertySchema) { + if (Array.isArray(propertySchema.defaultSnippets)) { + if (propertySchema.defaultSnippets.length === 1) { + var body = propertySchema.defaultSnippets[0].body; + if (isDefined(body)) { + value = this.getInsertTextForSnippetValue(body, ''); + } + } + nValueProposals += propertySchema.defaultSnippets.length; + } + if (propertySchema.enum) { + if (!value && propertySchema.enum.length === 1) { + value = this.getInsertTextForGuessedValue(propertySchema.enum[0], ''); + } + nValueProposals += propertySchema.enum.length; + } + if (isDefined(propertySchema.default)) { + if (!value) { + value = this.getInsertTextForGuessedValue(propertySchema.default, ''); + } + nValueProposals++; + } + if (nValueProposals === 0) { + var type = Array.isArray(propertySchema.type) ? propertySchema.type[0] : propertySchema.type; + if (!type) { + if (propertySchema.properties) { + type = 'object'; + } + else if (propertySchema.items) { + type = 'array'; + } + } + switch (type) { + case 'boolean': + value = '$1'; + break; + case 'string': + value = '"$1"'; + break; + case 'object': + value = '{$1}'; + break; + case 'array': + value = '[$1]'; + break; + case 'number': + case 'integer': + value = '${1:0}'; + break; + case 'null': + value = '${1:null}'; + break; + default: + return propertyText; + } + } + } + if (!value || nValueProposals > 1) { + value = '$1'; + } + return resultText + value + separatorAfter; + }; + JSONCompletion.prototype.getCurrentWord = function (document, offset) { + var i = offset - 1; + var text = document.getText(); + while (i >= 0 && ' \t\n\r\v":{[,]}'.indexOf(text.charAt(i)) === -1) { + i--; + } + return text.substring(i + 1, offset); + }; + JSONCompletion.prototype.evaluateSeparatorAfter = function (document, offset) { + var scanner = main_createScanner(document.getText(), true); + scanner.setPosition(offset); + var token = scanner.scan(); + switch (token) { + case 5 /* CommaToken */: + case 2 /* CloseBraceToken */: + case 4 /* CloseBracketToken */: + case 17 /* EOF */: + return ''; + default: + return ','; + } + }; + JSONCompletion.prototype.findItemAtOffset = function (node, document, offset) { + var scanner = main_createScanner(document.getText(), true); + var children = node.items; + for (var i = children.length - 1; i >= 0; i--) { + var child = children[i]; + if (offset > child.offset + child.length) { + scanner.setPosition(child.offset + child.length); + var token = scanner.scan(); + if (token === 5 /* CommaToken */ && offset >= scanner.getTokenOffset() + scanner.getTokenLength()) { + return i + 1; + } + return i; + } + else if (offset >= child.offset) { + return i; + } + } + return 0; + }; + JSONCompletion.prototype.isInComment = function (document, start, offset) { + var scanner = main_createScanner(document.getText(), false); + scanner.setPosition(start); + var token = scanner.scan(); + while (token !== 17 /* EOF */ && (scanner.getTokenOffset() + scanner.getTokenLength() < offset)) { + token = scanner.scan(); + } + return (token === 12 /* LineCommentTrivia */ || token === 13 /* BlockCommentTrivia */) && scanner.getTokenOffset() <= offset; + }; + JSONCompletion.prototype.fromMarkup = function (markupString) { + if (markupString && this.doesSupportMarkdown()) { + return { + kind: MarkupKind.Markdown, + value: markupString + }; + } + return undefined; + }; + JSONCompletion.prototype.doesSupportMarkdown = function () { + if (!isDefined(this.supportsMarkdown)) { + var completion = this.clientCapabilities.textDocument && this.clientCapabilities.textDocument.completion; + this.supportsMarkdown = completion && completion.completionItem && Array.isArray(completion.completionItem.documentationFormat) && completion.completionItem.documentationFormat.indexOf(MarkupKind.Markdown) !== -1; + } + return this.supportsMarkdown; + }; + return JSONCompletion; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonHover.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + +var jsonHover_JSONHover = /** @class */ (function () { + function JSONHover(schemaService, contributions, promiseConstructor) { + if (contributions === void 0) { contributions = []; } + this.schemaService = schemaService; + this.contributions = contributions; + this.promise = promiseConstructor || Promise; + } + JSONHover.prototype.doHover = function (document, position, doc) { + var offset = document.offsetAt(position); + var node = doc.getNodeFromOffset(offset); + if (!node || (node.type === 'object' || node.type === 'array') && offset > node.offset + 1 && offset < node.offset + node.length - 1) { + return this.promise.resolve(null); + } + var hoverRangeNode = node; + // use the property description when hovering over an object key + if (node.type === 'string') { + var parent = node.parent; + if (parent && parent.type === 'property' && parent.keyNode === node) { + node = parent.valueNode; + if (!node) { + return this.promise.resolve(null); + } + } + } + var hoverRange = main_Range.create(document.positionAt(hoverRangeNode.offset), document.positionAt(hoverRangeNode.offset + hoverRangeNode.length)); + var createHover = function (contents) { + var result = { + contents: contents, + range: hoverRange + }; + return result; + }; + var location = jsonParser_getNodePath(node); + for (var i = this.contributions.length - 1; i >= 0; i--) { + var contribution = this.contributions[i]; + var promise = contribution.getInfoContribution(document.uri, location); + if (promise) { + return promise.then(function (htmlContent) { return createHover(htmlContent); }); + } + } + return this.schemaService.getSchemaForResource(document.uri, doc).then(function (schema) { + if (schema) { + var matchingSchemas = doc.getMatchingSchemas(schema.schema, node.offset); + var title_1 = null; + var markdownDescription_1 = null; + var markdownEnumValueDescription_1 = null, enumValue_1 = null; + matchingSchemas.every(function (s) { + if (s.node === node && !s.inverted && s.schema) { + title_1 = title_1 || s.schema.title; + markdownDescription_1 = markdownDescription_1 || s.schema.markdownDescription || toMarkdown(s.schema.description); + if (s.schema.enum) { + var idx = s.schema.enum.indexOf(jsonParser_getNodeValue(node)); + if (s.schema.markdownEnumDescriptions) { + markdownEnumValueDescription_1 = s.schema.markdownEnumDescriptions[idx]; + } + else if (s.schema.enumDescriptions) { + markdownEnumValueDescription_1 = toMarkdown(s.schema.enumDescriptions[idx]); + } + if (markdownEnumValueDescription_1) { + enumValue_1 = s.schema.enum[idx]; + if (typeof enumValue_1 !== 'string') { + enumValue_1 = JSON.stringify(enumValue_1); + } + } + } + } + return true; + }); + var result = ''; + if (title_1) { + result = toMarkdown(title_1); + } + if (markdownDescription_1) { + if (result.length > 0) { + result += "\n\n"; + } + result += markdownDescription_1; + } + if (markdownEnumValueDescription_1) { + if (result.length > 0) { + result += "\n\n"; + } + result += "`" + toMarkdown(enumValue_1) + "`: " + markdownEnumValueDescription_1; + } + return createHover([result]); + } + return null; + }); + }; + return JSONHover; +}()); + +function toMarkdown(plain) { + if (plain) { + var res = plain.replace(/([^\n\r])(\r?\n)([^\n\r])/gm, '$1\n\n$3'); // single new lines to \n\n (Markdown paragraph) + return res.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&"); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash + } + return void 0; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSchemaService.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + + + +var jsonSchemaService_localize = loadMessageBundle(); +var jsonSchemaService_FilePatternAssociation = /** @class */ (function () { + function FilePatternAssociation(pattern) { + try { + this.patternRegExp = new RegExp(strings_convertSimple2RegExpPattern(pattern) + '$'); + } + catch (e) { + // invalid pattern + this.patternRegExp = null; + } + this.schemas = []; + } + FilePatternAssociation.prototype.addSchema = function (id) { + this.schemas.push(id); + }; + FilePatternAssociation.prototype.matchesPattern = function (fileName) { + return this.patternRegExp && this.patternRegExp.test(fileName); + }; + FilePatternAssociation.prototype.getSchemas = function () { + return this.schemas; + }; + return FilePatternAssociation; +}()); +var SchemaHandle = /** @class */ (function () { + function SchemaHandle(service, url, unresolvedSchemaContent) { + this.service = service; + this.url = url; + this.dependencies = {}; + if (unresolvedSchemaContent) { + this.unresolvedSchema = this.service.promise.resolve(new UnresolvedSchema(unresolvedSchemaContent)); + } + } + SchemaHandle.prototype.getUnresolvedSchema = function () { + if (!this.unresolvedSchema) { + this.unresolvedSchema = this.service.loadSchema(this.url); + } + return this.unresolvedSchema; + }; + SchemaHandle.prototype.getResolvedSchema = function () { + var _this = this; + if (!this.resolvedSchema) { + this.resolvedSchema = this.getUnresolvedSchema().then(function (unresolved) { + return _this.service.resolveSchemaContent(unresolved, _this.url, _this.dependencies); + }); + } + return this.resolvedSchema; + }; + SchemaHandle.prototype.clearSchema = function () { + this.resolvedSchema = null; + this.unresolvedSchema = null; + this.dependencies = {}; + }; + return SchemaHandle; +}()); +var UnresolvedSchema = /** @class */ (function () { + function UnresolvedSchema(schema, errors) { + if (errors === void 0) { errors = []; } + this.schema = schema; + this.errors = errors; + } + return UnresolvedSchema; +}()); + +var jsonSchemaService_ResolvedSchema = /** @class */ (function () { + function ResolvedSchema(schema, errors) { + if (errors === void 0) { errors = []; } + this.schema = schema; + this.errors = errors; + } + ResolvedSchema.prototype.getSection = function (path) { + return asSchema(this.getSectionRecursive(path, this.schema)); + }; + ResolvedSchema.prototype.getSectionRecursive = function (path, schema) { + if (!schema || typeof schema === 'boolean' || path.length === 0) { + return schema; + } + var next = path.shift(); + if (schema.properties && typeof schema.properties[next]) { + return this.getSectionRecursive(path, schema.properties[next]); + } + else if (schema.patternProperties) { + for (var _i = 0, _a = Object.keys(schema.patternProperties); _i < _a.length; _i++) { + var pattern = _a[_i]; + var regex = new RegExp(pattern); + if (regex.test(next)) { + return this.getSectionRecursive(path, schema.patternProperties[pattern]); + } + } + } + else if (typeof schema.additionalProperties === 'object') { + return this.getSectionRecursive(path, schema.additionalProperties); + } + else if (next.match('[0-9]+')) { + if (Array.isArray(schema.items)) { + var index = parseInt(next, 10); + if (!isNaN(index) && schema.items[index]) { + return this.getSectionRecursive(path, schema.items[index]); + } + } + else if (schema.items) { + return this.getSectionRecursive(path, schema.items); + } + } + return null; + }; + return ResolvedSchema; +}()); + +var jsonSchemaService_JSONSchemaService = /** @class */ (function () { + function JSONSchemaService(requestService, contextService, promiseConstructor) { + this.contextService = contextService; + this.requestService = requestService; + this.promiseConstructor = promiseConstructor || Promise; + this.callOnDispose = []; + this.contributionSchemas = {}; + this.contributionAssociations = {}; + this.schemasById = {}; + this.filePatternAssociations = []; + this.filePatternAssociationById = {}; + this.registeredSchemasIds = {}; + } + JSONSchemaService.prototype.getRegisteredSchemaIds = function (filter) { + return Object.keys(this.registeredSchemasIds).filter(function (id) { + var scheme = vscode_uri.parse(id).scheme; + return scheme !== 'schemaservice' && (!filter || filter(scheme)); + }); + }; + Object.defineProperty(JSONSchemaService.prototype, "promise", { + get: function () { + return this.promiseConstructor; + }, + enumerable: true, + configurable: true + }); + JSONSchemaService.prototype.dispose = function () { + while (this.callOnDispose.length > 0) { + this.callOnDispose.pop()(); + } + }; + JSONSchemaService.prototype.onResourceChange = function (uri) { + var _this = this; + var hasChanges = false; + uri = this.normalizeId(uri); + var toWalk = [uri]; + var all = Object.keys(this.schemasById).map(function (key) { return _this.schemasById[key]; }); + while (toWalk.length) { + var curr = toWalk.pop(); + for (var i = 0; i < all.length; i++) { + var handle = all[i]; + if (handle && (handle.url === curr || handle.dependencies[curr])) { + if (handle.url !== curr) { + toWalk.push(handle.url); + } + handle.clearSchema(); + all[i] = undefined; + hasChanges = true; + } + } + } + return hasChanges; + }; + JSONSchemaService.prototype.normalizeId = function (id) { + // remove trailing '#', normalize drive capitalization + return vscode_uri.parse(id).toString(); + }; + JSONSchemaService.prototype.setSchemaContributions = function (schemaContributions) { + if (schemaContributions.schemas) { + var schemas = schemaContributions.schemas; + for (var id in schemas) { + var normalizedId = this.normalizeId(id); + this.contributionSchemas[normalizedId] = this.addSchemaHandle(normalizedId, schemas[id]); + } + } + if (schemaContributions.schemaAssociations) { + var schemaAssociations = schemaContributions.schemaAssociations; + for (var pattern in schemaAssociations) { + var associations = schemaAssociations[pattern]; + this.contributionAssociations[pattern] = associations; + var fpa = this.getOrAddFilePatternAssociation(pattern); + for (var _i = 0, associations_1 = associations; _i < associations_1.length; _i++) { + var schemaId = associations_1[_i]; + var id = this.normalizeId(schemaId); + fpa.addSchema(id); + } + } + } + }; + JSONSchemaService.prototype.addSchemaHandle = function (id, unresolvedSchemaContent) { + var schemaHandle = new SchemaHandle(this, id, unresolvedSchemaContent); + this.schemasById[id] = schemaHandle; + return schemaHandle; + }; + JSONSchemaService.prototype.getOrAddSchemaHandle = function (id, unresolvedSchemaContent) { + return this.schemasById[id] || this.addSchemaHandle(id, unresolvedSchemaContent); + }; + JSONSchemaService.prototype.getOrAddFilePatternAssociation = function (pattern) { + var fpa = this.filePatternAssociationById[pattern]; + if (!fpa) { + fpa = new jsonSchemaService_FilePatternAssociation(pattern); + this.filePatternAssociationById[pattern] = fpa; + this.filePatternAssociations.push(fpa); + } + return fpa; + }; + JSONSchemaService.prototype.registerExternalSchema = function (uri, filePatterns, unresolvedSchemaContent) { + if (filePatterns === void 0) { filePatterns = null; } + var id = this.normalizeId(uri); + this.registeredSchemasIds[id] = true; + if (filePatterns) { + for (var _i = 0, filePatterns_1 = filePatterns; _i < filePatterns_1.length; _i++) { + var pattern = filePatterns_1[_i]; + this.getOrAddFilePatternAssociation(pattern).addSchema(id); + } + } + return unresolvedSchemaContent ? this.addSchemaHandle(id, unresolvedSchemaContent) : this.getOrAddSchemaHandle(id); + }; + JSONSchemaService.prototype.clearExternalSchemas = function () { + this.schemasById = {}; + this.filePatternAssociations = []; + this.filePatternAssociationById = {}; + this.registeredSchemasIds = {}; + for (var id in this.contributionSchemas) { + this.schemasById[id] = this.contributionSchemas[id]; + this.registeredSchemasIds[id] = true; + } + for (var pattern in this.contributionAssociations) { + var fpa = this.getOrAddFilePatternAssociation(pattern); + for (var _i = 0, _a = this.contributionAssociations[pattern]; _i < _a.length; _i++) { + var schemaId = _a[_i]; + var id = this.normalizeId(schemaId); + fpa.addSchema(id); + } + } + }; + JSONSchemaService.prototype.getResolvedSchema = function (schemaId) { + var id = this.normalizeId(schemaId); + var schemaHandle = this.schemasById[id]; + if (schemaHandle) { + return schemaHandle.getResolvedSchema(); + } + return this.promise.resolve(null); + }; + JSONSchemaService.prototype.loadSchema = function (url) { + if (!this.requestService) { + var errorMessage = jsonSchemaService_localize('json.schema.norequestservice', 'Unable to load schema from \'{0}\'. No schema request service available', toDisplayString(url)); + return this.promise.resolve(new UnresolvedSchema({}, [errorMessage])); + } + return this.requestService(url).then(function (content) { + if (!content) { + var errorMessage = jsonSchemaService_localize('json.schema.nocontent', 'Unable to load schema from \'{0}\': No content.', toDisplayString(url)); + return new UnresolvedSchema({}, [errorMessage]); + } + var schemaContent = {}; + var jsonErrors = []; + schemaContent = main_parse(content, jsonErrors); + var errors = jsonErrors.length ? [jsonSchemaService_localize('json.schema.invalidFormat', 'Unable to parse content from \'{0}\': Parse error at offset {1}.', toDisplayString(url), jsonErrors[0].offset)] : []; + return new UnresolvedSchema(schemaContent, errors); + }, function (error) { + var errorMessage = error.toString(); + var errorSplit = error.toString().split('Error: '); + if (errorSplit.length > 1) { + // more concise error message, URL and context are attached by caller anyways + errorMessage = errorSplit[1]; + } + return new UnresolvedSchema({}, [errorMessage]); + }); + }; + JSONSchemaService.prototype.resolveSchemaContent = function (schemaToResolve, schemaURL, dependencies) { + var _this = this; + var resolveErrors = schemaToResolve.errors.slice(0); + var schema = schemaToResolve.schema; + var contextService = this.contextService; + var findSection = function (schema, path) { + if (!path) { + return schema; + } + var current = schema; + if (path[0] === '/') { + path = path.substr(1); + } + path.split('/').some(function (part) { + current = current[part]; + return !current; + }); + return current; + }; + var merge = function (target, sourceRoot, sourceURI, path) { + var section = findSection(sourceRoot, path); + if (section) { + for (var key in section) { + if (section.hasOwnProperty(key) && !target.hasOwnProperty(key)) { + target[key] = section[key]; + } + } + } + else { + resolveErrors.push(jsonSchemaService_localize('json.schema.invalidref', '$ref \'{0}\' in \'{1}\' can not be resolved.', path, sourceURI)); + } + }; + var resolveExternalLink = function (node, uri, linkPath, parentSchemaURL, parentSchemaDependencies) { + if (contextService && !/^\w+:\/\/.*/.test(uri)) { + uri = contextService.resolveRelativePath(uri, parentSchemaURL); + } + uri = _this.normalizeId(uri); + var referencedHandle = _this.getOrAddSchemaHandle(uri); + return referencedHandle.getUnresolvedSchema().then(function (unresolvedSchema) { + parentSchemaDependencies[uri] = true; + if (unresolvedSchema.errors.length) { + var loc = linkPath ? uri + '#' + linkPath : uri; + resolveErrors.push(jsonSchemaService_localize('json.schema.problemloadingref', 'Problems loading reference \'{0}\': {1}', loc, unresolvedSchema.errors[0])); + } + merge(node, unresolvedSchema.schema, uri, linkPath); + return resolveRefs(node, unresolvedSchema.schema, uri, referencedHandle.dependencies); + }); + }; + var resolveRefs = function (node, parentSchema, parentSchemaURL, parentSchemaDependencies) { + if (!node || typeof node !== 'object') { + return Promise.resolve(null); + } + var toWalk = [node]; + var seen = []; + var openPromises = []; + var collectEntries = function () { + var entries = []; + for (var _i = 0; _i < arguments.length; _i++) { + entries[_i] = arguments[_i]; + } + for (var _a = 0, entries_1 = entries; _a < entries_1.length; _a++) { + var entry = entries_1[_a]; + if (typeof entry === 'object') { + toWalk.push(entry); + } + } + }; + var collectMapEntries = function () { + var maps = []; + for (var _i = 0; _i < arguments.length; _i++) { + maps[_i] = arguments[_i]; + } + for (var _a = 0, maps_1 = maps; _a < maps_1.length; _a++) { + var map = maps_1[_a]; + if (typeof map === 'object') { + for (var key in map) { + var entry = map[key]; + if (typeof entry === 'object') { + toWalk.push(entry); + } + } + } + } + }; + var collectArrayEntries = function () { + var arrays = []; + for (var _i = 0; _i < arguments.length; _i++) { + arrays[_i] = arguments[_i]; + } + for (var _a = 0, arrays_1 = arrays; _a < arrays_1.length; _a++) { + var array = arrays_1[_a]; + if (Array.isArray(array)) { + for (var _b = 0, array_1 = array; _b < array_1.length; _b++) { + var entry = array_1[_b]; + if (typeof entry === 'object') { + toWalk.push(entry); + } + } + } + } + }; + var handleRef = function (next) { + var seenRefs = []; + while (next.$ref) { + var ref = next.$ref; + var segments = ref.split('#', 2); + delete next.$ref; + if (segments[0].length > 0) { + openPromises.push(resolveExternalLink(next, segments[0], segments[1], parentSchemaURL, parentSchemaDependencies)); + return; + } + else { + if (seenRefs.indexOf(ref) === -1) { + merge(next, parentSchema, parentSchemaURL, segments[1]); // can set next.$ref again, use seenRefs to avoid circle + seenRefs.push(ref); + } + } + } + collectEntries(next.items, next.additionalProperties, next.not, next.contains, next.propertyNames, next.if, next.then, next.else); + collectMapEntries(next.definitions, next.properties, next.patternProperties, next.dependencies); + collectArrayEntries(next.anyOf, next.allOf, next.oneOf, next.items); + }; + while (toWalk.length) { + var next = toWalk.pop(); + if (seen.indexOf(next) >= 0) { + continue; + } + seen.push(next); + handleRef(next); + } + return _this.promise.all(openPromises); + }; + return resolveRefs(schema, schema, schemaURL, dependencies).then(function (_) { return new jsonSchemaService_ResolvedSchema(schema, resolveErrors); }); + }; + JSONSchemaService.prototype.getSchemaForResource = function (resource, document) { + // first use $schema if present + if (document && document.root && document.root.type === 'object') { + var schemaProperties = document.root.properties.filter(function (p) { return (p.keyNode.value === '$schema') && p.valueNode && p.valueNode.type === 'string'; }); + if (schemaProperties.length > 0) { + var schemeId = jsonParser_getNodeValue(schemaProperties[0].valueNode); + if (schemeId && strings_startsWith(schemeId, '.') && this.contextService) { + schemeId = this.contextService.resolveRelativePath(schemeId, resource); + } + if (schemeId) { + var id = this.normalizeId(schemeId); + return this.getOrAddSchemaHandle(id).getResolvedSchema(); + } + } + } + var seen = Object.create(null); + var schemas = []; + for (var _i = 0, _a = this.filePatternAssociations; _i < _a.length; _i++) { + var entry = _a[_i]; + if (entry.matchesPattern(resource)) { + for (var _b = 0, _c = entry.getSchemas(); _b < _c.length; _b++) { + var schemaId = _c[_b]; + if (!seen[schemaId]) { + schemas.push(schemaId); + seen[schemaId] = true; + } + } + } + } + if (schemas.length > 0) { + return this.createCombinedSchema(resource, schemas).getResolvedSchema(); + } + return this.promise.resolve(null); + }; + JSONSchemaService.prototype.createCombinedSchema = function (resource, schemaIds) { + if (schemaIds.length === 1) { + return this.getOrAddSchemaHandle(schemaIds[0]); + } + else { + var combinedSchemaId = 'schemaservice://combinedSchema/' + encodeURIComponent(resource); + var combinedSchema = { + allOf: schemaIds.map(function (schemaId) { return ({ $ref: schemaId }); }) + }; + return this.addSchemaHandle(combinedSchemaId, combinedSchema); + } + }; + return JSONSchemaService; +}()); + +function toDisplayString(url) { + try { + var uri = vscode_uri.parse(url); + if (uri.scheme === 'file') { + return uri.fsPath; + } + } + catch (e) { + // ignore + } + return url; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonValidation.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + + +var jsonValidation_localize = loadMessageBundle(); +var jsonValidation_JSONValidation = /** @class */ (function () { + function JSONValidation(jsonSchemaService, promiseConstructor) { + this.jsonSchemaService = jsonSchemaService; + this.promise = promiseConstructor; + this.validationEnabled = true; + } + JSONValidation.prototype.configure = function (raw) { + if (raw) { + this.validationEnabled = raw.validate; + this.commentSeverity = raw.allowComments ? void 0 : DiagnosticSeverity.Error; + } + }; + JSONValidation.prototype.doValidation = function (textDocument, jsonDocument, documentSettings, schema) { + var _this = this; + if (!this.validationEnabled) { + return this.promise.resolve([]); + } + var diagnostics = []; + var added = {}; + var addProblem = function (problem) { + // remove duplicated messages + var signature = problem.range.start.line + ' ' + problem.range.start.character + ' ' + problem.message; + if (!added[signature]) { + added[signature] = true; + diagnostics.push(problem); + } + }; + var getDiagnostics = function (schema) { + var trailingCommaSeverity = documentSettings ? toDiagnosticSeverity(documentSettings.trailingCommas) : DiagnosticSeverity.Error; + var commentSeverity = documentSettings ? toDiagnosticSeverity(documentSettings.comments) : _this.commentSeverity; + if (schema) { + if (schema.errors.length && jsonDocument.root) { + var astRoot = jsonDocument.root; + var property = astRoot.type === 'object' ? astRoot.properties[0] : null; + if (property && property.keyNode.value === '$schema') { + var node = property.valueNode || property; + var range = main_Range.create(textDocument.positionAt(node.offset), textDocument.positionAt(node.offset + node.length)); + addProblem(Diagnostic.create(range, schema.errors[0], DiagnosticSeverity.Warning, ErrorCode.SchemaResolveError)); + } + else { + var range = main_Range.create(textDocument.positionAt(astRoot.offset), textDocument.positionAt(astRoot.offset + 1)); + addProblem(Diagnostic.create(range, schema.errors[0], DiagnosticSeverity.Warning, ErrorCode.SchemaResolveError)); + } + } + else { + var semanticErrors = jsonDocument.validate(textDocument, schema.schema); + if (semanticErrors) { + semanticErrors.forEach(addProblem); + } + } + if (schemaAllowsComments(schema.schema)) { + trailingCommaSeverity = commentSeverity = void 0; + } + } + for (var _i = 0, _a = jsonDocument.syntaxErrors; _i < _a.length; _i++) { + var p = _a[_i]; + if (p.code === ErrorCode.TrailingComma) { + if (typeof trailingCommaSeverity !== 'number') { + continue; + } + p.severity = trailingCommaSeverity; + } + addProblem(p); + } + if (typeof commentSeverity === 'number') { + var message_1 = jsonValidation_localize('InvalidCommentToken', 'Comments are not permitted in JSON.'); + jsonDocument.comments.forEach(function (c) { + addProblem(Diagnostic.create(c, message_1, commentSeverity, ErrorCode.CommentNotPermitted)); + }); + } + return diagnostics; + }; + if (schema) { + var id = schema.id || ('schemaservice://untitled/' + idCounter++); + return this.jsonSchemaService.resolveSchemaContent(new UnresolvedSchema(schema), id, {}).then(function (resolvedSchema) { + return getDiagnostics(resolvedSchema); + }); + } + return this.jsonSchemaService.getSchemaForResource(textDocument.uri, jsonDocument).then(function (schema) { + return getDiagnostics(schema); + }); + }; + return JSONValidation; +}()); + +var idCounter = 0; +function schemaAllowsComments(schemaRef) { + if (schemaRef && typeof schemaRef === 'object') { + if (schemaRef.allowComments) { + return true; + } + if (schemaRef.allOf) { + return schemaRef.allOf.some(schemaAllowsComments); + } + } + return false; +} +function toDiagnosticSeverity(severityLevel) { + switch (severityLevel) { + case 'error': return DiagnosticSeverity.Error; + case 'warning': return DiagnosticSeverity.Warning; + case 'ignore': return void 0; + } + return void 0; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/colors.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var Digit0 = 48; +var Digit9 = 57; +var A = 65; +var colors_a = 97; +var colors_f = 102; +function hexDigit(charCode) { + if (charCode < Digit0) { + return 0; + } + if (charCode <= Digit9) { + return charCode - Digit0; + } + if (charCode < colors_a) { + charCode += (colors_a - A); + } + if (charCode >= colors_a && charCode <= colors_f) { + return charCode - colors_a + 10; + } + return 0; +} +function colorFromHex(text) { + if (text[0] !== '#') { + return null; + } + switch (text.length) { + case 4: + return { + red: (hexDigit(text.charCodeAt(1)) * 0x11) / 255.0, + green: (hexDigit(text.charCodeAt(2)) * 0x11) / 255.0, + blue: (hexDigit(text.charCodeAt(3)) * 0x11) / 255.0, + alpha: 1 + }; + case 5: + return { + red: (hexDigit(text.charCodeAt(1)) * 0x11) / 255.0, + green: (hexDigit(text.charCodeAt(2)) * 0x11) / 255.0, + blue: (hexDigit(text.charCodeAt(3)) * 0x11) / 255.0, + alpha: (hexDigit(text.charCodeAt(4)) * 0x11) / 255.0, + }; + case 7: + return { + red: (hexDigit(text.charCodeAt(1)) * 0x10 + hexDigit(text.charCodeAt(2))) / 255.0, + green: (hexDigit(text.charCodeAt(3)) * 0x10 + hexDigit(text.charCodeAt(4))) / 255.0, + blue: (hexDigit(text.charCodeAt(5)) * 0x10 + hexDigit(text.charCodeAt(6))) / 255.0, + alpha: 1 + }; + case 9: + return { + red: (hexDigit(text.charCodeAt(1)) * 0x10 + hexDigit(text.charCodeAt(2))) / 255.0, + green: (hexDigit(text.charCodeAt(3)) * 0x10 + hexDigit(text.charCodeAt(4))) / 255.0, + blue: (hexDigit(text.charCodeAt(5)) * 0x10 + hexDigit(text.charCodeAt(6))) / 255.0, + alpha: (hexDigit(text.charCodeAt(7)) * 0x10 + hexDigit(text.charCodeAt(8))) / 255.0 + }; + } + return null; +} +function colorFrom256RGB(red, green, blue, alpha) { + if (alpha === void 0) { alpha = 1.0; } + return { + red: red / 255.0, + green: green / 255.0, + blue: blue / 255.0, + alpha: alpha + }; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonDocumentSymbols.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + + +var jsonDocumentSymbols_JSONDocumentSymbols = /** @class */ (function () { + function JSONDocumentSymbols(schemaService) { + this.schemaService = schemaService; + } + JSONDocumentSymbols.prototype.findDocumentSymbols = function (document, doc) { + var _this = this; + var root = doc.root; + if (!root) { + return null; + } + // special handling for key bindings + var resourceString = document.uri; + if ((resourceString === 'vscode://defaultsettings/keybindings.json') || strings_endsWith(resourceString.toLowerCase(), '/user/keybindings.json')) { + if (root.type === 'array') { + var result_1 = []; + root.items.forEach(function (item) { + if (item.type === 'object') { + for (var _i = 0, _a = item.properties; _i < _a.length; _i++) { + var property = _a[_i]; + if (property.keyNode.value === 'key') { + if (property.valueNode) { + if (property.valueNode) { + var location = Location.create(document.uri, getRange(document, item)); + result_1.push({ name: jsonParser_getNodeValue(property.valueNode), kind: main_SymbolKind.Function, location: location }); + } + return; + } + } + } + } + }); + return result_1; + } + } + var collectOutlineEntries = function (result, node, containerName) { + if (node.type === 'array') { + node.items.forEach(function (node) { return collectOutlineEntries(result, node, containerName); }); + } + else if (node.type === 'object') { + node.properties.forEach(function (property) { + var location = Location.create(document.uri, getRange(document, property)); + var valueNode = property.valueNode; + if (valueNode) { + var childContainerName = containerName ? containerName + '.' + property.keyNode.value : property.keyNode.value; + result.push({ name: _this.getKeyLabel(property), kind: _this.getSymbolKind(valueNode.type), location: location, containerName: containerName }); + collectOutlineEntries(result, valueNode, childContainerName); + } + }); + } + return result; + }; + var result = collectOutlineEntries([], root, void 0); + return result; + }; + JSONDocumentSymbols.prototype.findDocumentSymbols2 = function (document, doc) { + var _this = this; + var root = doc.root; + if (!root) { + return null; + } + // special handling for key bindings + var resourceString = document.uri; + if ((resourceString === 'vscode://defaultsettings/keybindings.json') || strings_endsWith(resourceString.toLowerCase(), '/user/keybindings.json')) { + if (root.type === 'array') { + var result_2 = []; + root.items.forEach(function (item) { + if (item.type === 'object') { + for (var _i = 0, _a = item.properties; _i < _a.length; _i++) { + var property = _a[_i]; + if (property.keyNode.value === 'key') { + if (property.valueNode) { + var range = getRange(document, item); + var selectionRange = getRange(document, property.keyNode); + result_2.push({ name: jsonParser_getNodeValue(property.valueNode), kind: main_SymbolKind.Function, range: range, selectionRange: selectionRange }); + } + return; + } + } + } + }); + return result_2; + } + } + var collectOutlineEntries = function (result, node) { + if (node.type === 'array') { + node.items.forEach(function (node, index) { + if (node) { + var range = getRange(document, node); + var selectionRange = range; + var name = String(index); + var children = collectOutlineEntries([], node); + result.push({ name: name, kind: _this.getSymbolKind(node.type), range: range, selectionRange: selectionRange, children: children }); + } + }); + } + else if (node.type === 'object') { + node.properties.forEach(function (property) { + var valueNode = property.valueNode; + if (valueNode) { + var range = getRange(document, property); + var selectionRange = getRange(document, property.keyNode); + var children = collectOutlineEntries([], valueNode); + result.push({ name: _this.getKeyLabel(property), kind: _this.getSymbolKind(valueNode.type), range: range, selectionRange: selectionRange, children: children }); + } + }); + } + return result; + }; + var result = collectOutlineEntries([], root); + return result; + }; + JSONDocumentSymbols.prototype.getSymbolKind = function (nodeType) { + switch (nodeType) { + case 'object': + return main_SymbolKind.Module; + case 'string': + return main_SymbolKind.String; + case 'number': + return main_SymbolKind.Number; + case 'array': + return main_SymbolKind.Array; + case 'boolean': + return main_SymbolKind.Boolean; + default: // 'null' + return main_SymbolKind.Variable; + } + }; + JSONDocumentSymbols.prototype.getKeyLabel = function (property) { + var name = property.keyNode.value; + if (name) { + name = name.replace(/[\n]/g, '↵'); + } + if (name && name.trim()) { + return name; + } + return "\"" + name + "\""; + }; + JSONDocumentSymbols.prototype.findDocumentColors = function (document, doc) { + return this.schemaService.getSchemaForResource(document.uri, doc).then(function (schema) { + var result = []; + if (schema) { + var matchingSchemas = doc.getMatchingSchemas(schema.schema); + var visitedNode = {}; + for (var _i = 0, matchingSchemas_1 = matchingSchemas; _i < matchingSchemas_1.length; _i++) { + var s = matchingSchemas_1[_i]; + if (!s.inverted && s.schema && (s.schema.format === 'color' || s.schema.format === 'color-hex') && s.node && s.node.type === 'string') { + var nodeId = String(s.node.offset); + if (!visitedNode[nodeId]) { + var color = colorFromHex(jsonParser_getNodeValue(s.node)); + if (color) { + var range = getRange(document, s.node); + result.push({ color: color, range: range }); + } + visitedNode[nodeId] = true; + } + } + } + } + return result; + }); + }; + JSONDocumentSymbols.prototype.getColorPresentations = function (document, doc, color, range) { + var result = []; + var red256 = Math.round(color.red * 255), green256 = Math.round(color.green * 255), blue256 = Math.round(color.blue * 255); + function toTwoDigitHex(n) { + var r = n.toString(16); + return r.length !== 2 ? '0' + r : r; + } + var label; + if (color.alpha === 1) { + label = "#" + toTwoDigitHex(red256) + toTwoDigitHex(green256) + toTwoDigitHex(blue256); + } + else { + label = "#" + toTwoDigitHex(red256) + toTwoDigitHex(green256) + toTwoDigitHex(blue256) + toTwoDigitHex(Math.round(color.alpha * 255)); + } + result.push({ label: label, textEdit: TextEdit.replace(range, JSON.stringify(label)) }); + return result; + }; + return JSONDocumentSymbols; +}()); + +function getRange(document, node) { + return main_Range.create(document.positionAt(node.offset), document.positionAt(node.offset + node.length)); +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/configuration.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var configuration_localize = loadMessageBundle(); var schemaContributions = { schemaAssociations: {}, schemas: { // bundle the schema-schema to include (localized) descriptions 'http://json-schema.org/draft-04/schema#': { - 'title': localize('schema.json', 'Describes a JSON file using a schema. See json-schema.org for more info.'), + 'title': configuration_localize('schema.json', 'Describes a JSON file using a schema. See json-schema.org for more info.'), '$schema': 'http://json-schema.org/draft-04/schema#', 'definitions': { 'schemaArray': { @@ -11730,7 +14588,7 @@ var schemaContributions = { 'default': {} }, 'http://json-schema.org/draft-07/schema#': { - 'title': localize('schema.json', 'Describes a JSON file using a schema. See json-schema.org for more info.'), + 'title': configuration_localize('schema.json', 'Describes a JSON file using a schema. See json-schema.org for more info.'), 'definitions': { 'schemaArray': { 'type': 'array', @@ -11898,1154 +14756,71 @@ var schemaContributions = { } }; var descriptions = { - id: localize('schema.json.id', "A unique identifier for the schema."), - $schema: localize('schema.json.$schema', "The schema to verify this document against."), - title: localize('schema.json.title', "A descriptive title of the element."), - description: localize('schema.json.description', "A long description of the element. Used in hover menus and suggestions."), - default: localize('schema.json.default', "A default value. Used by suggestions."), - multipleOf: localize('schema.json.multipleOf', "A number that should cleanly divide the current value (i.e. have no remainder)."), - maximum: localize('schema.json.maximum', "The maximum numerical value, inclusive by default."), - exclusiveMaximum: localize('schema.json.exclusiveMaximum', "Makes the maximum property exclusive."), - minimum: localize('schema.json.minimum', "The minimum numerical value, inclusive by default."), - exclusiveMinimum: localize('schema.json.exclusiveMininum', "Makes the minimum property exclusive."), - maxLength: localize('schema.json.maxLength', "The maximum length of a string."), - minLength: localize('schema.json.minLength', "The minimum length of a string."), - pattern: localize('schema.json.pattern', "A regular expression to match the string against. It is not implicitly anchored."), - additionalItems: localize('schema.json.additionalItems', "For arrays, only when items is set as an array. If it is a schema, then this schema validates items after the ones specified by the items array. If it is false, then additional items will cause validation to fail."), - items: localize('schema.json.items', "For arrays. Can either be a schema to validate every element against or an array of schemas to validate each item against in order (the first schema will validate the first element, the second schema will validate the second element, and so on."), - maxItems: localize('schema.json.maxItems', "The maximum number of items that can be inside an array. Inclusive."), - minItems: localize('schema.json.minItems', "The minimum number of items that can be inside an array. Inclusive."), - uniqueItems: localize('schema.json.uniqueItems', "If all of the items in the array must be unique. Defaults to false."), - maxProperties: localize('schema.json.maxProperties', "The maximum number of properties an object can have. Inclusive."), - minProperties: localize('schema.json.minProperties', "The minimum number of properties an object can have. Inclusive."), - required: localize('schema.json.required', "An array of strings that lists the names of all properties required on this object."), - additionalProperties: localize('schema.json.additionalProperties', "Either a schema or a boolean. If a schema, then used to validate all properties not matched by 'properties' or 'patternProperties'. If false, then any properties not matched by either will cause this schema to fail."), - definitions: localize('schema.json.definitions', "Not used for validation. Place subschemas here that you wish to reference inline with $ref."), - properties: localize('schema.json.properties', "A map of property names to schemas for each property."), - patternProperties: localize('schema.json.patternProperties', "A map of regular expressions on property names to schemas for matching properties."), - dependencies: localize('schema.json.dependencies', "A map of property names to either an array of property names or a schema. An array of property names means the property named in the key depends on the properties in the array being present in the object in order to be valid. If the value is a schema, then the schema is only applied to the object if the property in the key exists on the object."), - enum: localize('schema.json.enum', "The set of literal values that are valid."), - type: localize('schema.json.type', "Either a string of one of the basic schema types (number, integer, null, array, object, boolean, string) or an array of strings specifying a subset of those types."), - format: localize('schema.json.format', "Describes the format expected for the value."), - allOf: localize('schema.json.allOf', "An array of schemas, all of which must match."), - anyOf: localize('schema.json.anyOf', "An array of schemas, where at least one must match."), - oneOf: localize('schema.json.oneOf', "An array of schemas, exactly one of which must match."), - not: localize('schema.json.not', "A schema which must not match."), - $id: localize('schema.json.$id', "A unique identifier for the schema."), - $ref: localize('schema.json.$ref', "Reference a definition hosted on any location."), - $comment: localize('schema.json.$comment', "Comments from schema authors to readers or maintainers of the schema."), - readOnly: localize('schema.json.readOnly', "Indicates that the value of the instance is managed exclusively by the owning authority."), - examples: localize('schema.json.examples', "Sample JSON values associated with a particular schema, for the purpose of illustrating usage."), - contains: localize('schema.json.contains', "An array instance is valid against \"contains\" if at least one of its elements is valid against the given schema."), - propertyNames: localize('schema.json.propertyNames', "If the instance is an object, this keyword validates if every property name in the instance validates against the provided schema."), - const: localize('schema.json.const', "An instance validates successfully against this keyword if its value is equal to the value of the keyword."), - contentMediaType: localize('schema.json.contentMediaType', "Describes the media type of a string property."), - contentEncoding: localize('schema.json.contentEncoding', "Describes the content encoding of a string property."), - if: localize('schema.json.if', "The validation outcome of the \"if\" subschema controls which of the \"then\" or \"else\" keywords are evaluated."), - then: localize('schema.json.then', "The \"if\" subschema is used for validation when the \"if\" subschema succeeds."), - else: localize('schema.json.else', "The \"else\" subschema is used for validation when the \"if\" subschema fails.") + id: configuration_localize('schema.json.id', "A unique identifier for the schema."), + $schema: configuration_localize('schema.json.$schema', "The schema to verify this document against."), + title: configuration_localize('schema.json.title', "A descriptive title of the element."), + description: configuration_localize('schema.json.description', "A long description of the element. Used in hover menus and suggestions."), + default: configuration_localize('schema.json.default', "A default value. Used by suggestions."), + multipleOf: configuration_localize('schema.json.multipleOf', "A number that should cleanly divide the current value (i.e. have no remainder)."), + maximum: configuration_localize('schema.json.maximum', "The maximum numerical value, inclusive by default."), + exclusiveMaximum: configuration_localize('schema.json.exclusiveMaximum', "Makes the maximum property exclusive."), + minimum: configuration_localize('schema.json.minimum', "The minimum numerical value, inclusive by default."), + exclusiveMinimum: configuration_localize('schema.json.exclusiveMininum', "Makes the minimum property exclusive."), + maxLength: configuration_localize('schema.json.maxLength', "The maximum length of a string."), + minLength: configuration_localize('schema.json.minLength', "The minimum length of a string."), + pattern: configuration_localize('schema.json.pattern', "A regular expression to match the string against. It is not implicitly anchored."), + additionalItems: configuration_localize('schema.json.additionalItems', "For arrays, only when items is set as an array. If it is a schema, then this schema validates items after the ones specified by the items array. If it is false, then additional items will cause validation to fail."), + items: configuration_localize('schema.json.items', "For arrays. Can either be a schema to validate every element against or an array of schemas to validate each item against in order (the first schema will validate the first element, the second schema will validate the second element, and so on."), + maxItems: configuration_localize('schema.json.maxItems', "The maximum number of items that can be inside an array. Inclusive."), + minItems: configuration_localize('schema.json.minItems', "The minimum number of items that can be inside an array. Inclusive."), + uniqueItems: configuration_localize('schema.json.uniqueItems', "If all of the items in the array must be unique. Defaults to false."), + maxProperties: configuration_localize('schema.json.maxProperties', "The maximum number of properties an object can have. Inclusive."), + minProperties: configuration_localize('schema.json.minProperties', "The minimum number of properties an object can have. Inclusive."), + required: configuration_localize('schema.json.required', "An array of strings that lists the names of all properties required on this object."), + additionalProperties: configuration_localize('schema.json.additionalProperties', "Either a schema or a boolean. If a schema, then used to validate all properties not matched by 'properties' or 'patternProperties'. If false, then any properties not matched by either will cause this schema to fail."), + definitions: configuration_localize('schema.json.definitions', "Not used for validation. Place subschemas here that you wish to reference inline with $ref."), + properties: configuration_localize('schema.json.properties', "A map of property names to schemas for each property."), + patternProperties: configuration_localize('schema.json.patternProperties', "A map of regular expressions on property names to schemas for matching properties."), + dependencies: configuration_localize('schema.json.dependencies', "A map of property names to either an array of property names or a schema. An array of property names means the property named in the key depends on the properties in the array being present in the object in order to be valid. If the value is a schema, then the schema is only applied to the object if the property in the key exists on the object."), + enum: configuration_localize('schema.json.enum', "The set of literal values that are valid."), + type: configuration_localize('schema.json.type', "Either a string of one of the basic schema types (number, integer, null, array, object, boolean, string) or an array of strings specifying a subset of those types."), + format: configuration_localize('schema.json.format', "Describes the format expected for the value."), + allOf: configuration_localize('schema.json.allOf', "An array of schemas, all of which must match."), + anyOf: configuration_localize('schema.json.anyOf', "An array of schemas, where at least one must match."), + oneOf: configuration_localize('schema.json.oneOf', "An array of schemas, exactly one of which must match."), + not: configuration_localize('schema.json.not', "A schema which must not match."), + $id: configuration_localize('schema.json.$id', "A unique identifier for the schema."), + $ref: configuration_localize('schema.json.$ref', "Reference a definition hosted on any location."), + $comment: configuration_localize('schema.json.$comment', "Comments from schema authors to readers or maintainers of the schema."), + readOnly: configuration_localize('schema.json.readOnly', "Indicates that the value of the instance is managed exclusively by the owning authority."), + examples: configuration_localize('schema.json.examples', "Sample JSON values associated with a particular schema, for the purpose of illustrating usage."), + contains: configuration_localize('schema.json.contains', "An array instance is valid against \"contains\" if at least one of its elements is valid against the given schema."), + propertyNames: configuration_localize('schema.json.propertyNames', "If the instance is an object, this keyword validates if every property name in the instance validates against the provided schema."), + const: configuration_localize('schema.json.const', "An instance validates successfully against this keyword if its value is equal to the value of the keyword."), + contentMediaType: configuration_localize('schema.json.contentMediaType', "Describes the media type of a string property."), + contentEncoding: configuration_localize('schema.json.contentEncoding', "Describes the content encoding of a string property."), + if: configuration_localize('schema.json.if', "The validation outcome of the \"if\" subschema controls which of the \"then\" or \"else\" keywords are evaluated."), + then: configuration_localize('schema.json.then', "The \"if\" subschema is used for validation when the \"if\" subschema succeeds."), + else: configuration_localize('schema.json.else', "The \"else\" subschema is used for validation when the \"if\" subschema fails.") }; for (var schemaName in schemaContributions.schemas) { - var schema = schemaContributions.schemas[schemaName]; - for (var property in schema.properties) { - var propertyObject = schema.properties[property]; + var configuration_schema = schemaContributions.schemas[schemaName]; + for (var configuration_property in configuration_schema.properties) { + var propertyObject = configuration_schema.properties[configuration_property]; if (propertyObject === true) { - propertyObject = schema.properties[property] = {}; + propertyObject = configuration_schema.properties[configuration_property] = {}; } - var description = descriptions[property]; + var description = descriptions[configuration_property]; if (description) { propertyObject['description'] = description; } else { - console.log(property + ": localize('schema.json." + property + "', \"\")"); + console.log(configuration_property + ": localize('schema.json." + configuration_property + "', \"\")"); } } } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonCompletion.js": -/*!**********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonCompletion.js ***! - \**********************************************************************************************************************/ -/*! exports provided: JSONCompletion */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JSONCompletion", function() { return JSONCompletion; }); -/* harmony import */ var _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/jsonParser.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js"); -/* harmony import */ var _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jsonc-parser/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js"); -/* harmony import */ var _utils_json_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/json.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/json.js"); -/* harmony import */ var _utils_strings_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/strings.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/strings.js"); -/* harmony import */ var _utils_objects_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/objects.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/objects.js"); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./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. - *--------------------------------------------------------------------------------------------*/ - - - - - - - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_6__["loadMessageBundle"](); -var JSONCompletion = /** @class */ (function () { - function JSONCompletion(schemaService, contributions, promiseConstructor, clientCapabilities) { - if (contributions === void 0) { contributions = []; } - if (promiseConstructor === void 0) { promiseConstructor = Promise; } - if (clientCapabilities === void 0) { clientCapabilities = {}; } - this.schemaService = schemaService; - this.contributions = contributions; - this.promiseConstructor = promiseConstructor; - this.clientCapabilities = clientCapabilities; - this.templateVarIdCounter = 0; - } - JSONCompletion.prototype.doResolve = function (item) { - for (var i = this.contributions.length - 1; i >= 0; i--) { - if (this.contributions[i].resolveCompletion) { - var resolver = this.contributions[i].resolveCompletion(item); - if (resolver) { - return resolver; - } - } - } - return this.promiseConstructor.resolve(item); - }; - JSONCompletion.prototype.doComplete = function (document, position, doc) { - var _this = this; - var result = { - items: [], - isIncomplete: false - }; - var offset = document.offsetAt(position); - var node = doc.getNodeFromOffset(offset, true); - if (this.isInComment(document, node ? node.offset : 0, offset)) { - return Promise.resolve(result); - } - var currentWord = this.getCurrentWord(document, offset); - var overwriteRange = null; - if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) { - overwriteRange = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["Range"].create(document.positionAt(node.offset), document.positionAt(node.offset + node.length)); - } - else { - var overwriteStart = offset - currentWord.length; - if (overwriteStart > 0 && document.getText()[overwriteStart - 1] === '"') { - overwriteStart--; - } - overwriteRange = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["Range"].create(document.positionAt(overwriteStart), position); - } - var proposed = {}; - var collector = { - add: function (suggestion) { - var existing = proposed[suggestion.label]; - if (!existing) { - proposed[suggestion.label] = suggestion; - if (overwriteRange) { - suggestion.textEdit = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["TextEdit"].replace(overwriteRange, suggestion.insertText); - } - result.items.push(suggestion); - } - else if (!existing.documentation) { - existing.documentation = suggestion.documentation; - } - }, - setAsIncomplete: function () { - result.isIncomplete = true; - }, - error: function (message) { - console.error(message); - }, - log: function (message) { - console.log(message); - }, - getNumberOfProposals: function () { - return result.items.length; - } - }; - return this.schemaService.getSchemaForResource(document.uri, doc).then(function (schema) { - var collectionPromises = []; - var addValue = true; - var currentKey = ''; - var currentProperty = null; - if (node) { - if (node.type === 'string') { - var parent = node.parent; - if (parent && parent.type === 'property' && parent.keyNode === node) { - addValue = !parent.valueNode; - currentProperty = parent; - currentKey = document.getText().substr(node.offset + 1, node.length - 2); - if (parent) { - node = parent.parent; - } - } - } - } - // proposals for properties - if (node && node.type === 'object') { - // don't suggest keys when the cursor is just before the opening curly brace - if (node.offset === offset) { - return result; - } - // don't suggest properties that are already present - var properties = node.properties; - properties.forEach(function (p) { - if (!currentProperty || currentProperty !== p) { - proposed[p.keyNode.value] = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItem"].create('__'); - } - }); - var separatorAfter_1 = ''; - if (addValue) { - separatorAfter_1 = _this.evaluateSeparatorAfter(document, document.offsetAt(overwriteRange.end)); - } - if (schema) { - // property proposals with schema - _this.getPropertyCompletions(schema, doc, node, addValue, separatorAfter_1, collector); - } - else { - // property proposals without schema - _this.getSchemaLessPropertyCompletions(doc, node, currentKey, collector); - } - var location_1 = _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__["getNodePath"](node); - _this.contributions.forEach(function (contribution) { - var collectPromise = contribution.collectPropertyCompletions(document.uri, location_1, currentWord, addValue, separatorAfter_1 === '', collector); - if (collectPromise) { - collectionPromises.push(collectPromise); - } - }); - if ((!schema && currentWord.length > 0 && document.getText().charAt(offset - currentWord.length - 1) !== '"')) { - collector.add({ - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Property, - label: _this.getLabelForValue(currentWord), - insertText: _this.getInsertTextForProperty(currentWord, null, false, separatorAfter_1), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, documentation: '', - }); - collector.setAsIncomplete(); - } - } - // proposals for values - var types = {}; - if (schema) { - // value proposals with schema - _this.getValueCompletions(schema, doc, node, offset, document, collector, types); - } - else { - // value proposals without schema - _this.getSchemaLessValueCompletions(doc, node, offset, document, collector); - } - if (_this.contributions.length > 0) { - _this.getContributedValueCompletions(doc, node, offset, document, collector, collectionPromises); - } - return _this.promiseConstructor.all(collectionPromises).then(function () { - if (collector.getNumberOfProposals() === 0) { - var offsetForSeparator = offset; - if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) { - offsetForSeparator = node.offset + node.length; - } - var separatorAfter = _this.evaluateSeparatorAfter(document, offsetForSeparator); - _this.addFillerValueCompletions(types, separatorAfter, collector); - } - return result; - }); - }); - }; - JSONCompletion.prototype.getPropertyCompletions = function (schema, doc, node, addValue, separatorAfter, collector) { - var _this = this; - var matchingSchemas = doc.getMatchingSchemas(schema.schema, node.offset); - matchingSchemas.forEach(function (s) { - if (s.node === node && !s.inverted) { - var schemaProperties_1 = s.schema.properties; - if (schemaProperties_1) { - Object.keys(schemaProperties_1).forEach(function (key) { - var propertySchema = schemaProperties_1[key]; - if (typeof propertySchema === 'object' && !propertySchema.deprecationMessage && !propertySchema.doNotSuggest) { - var proposal = { - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Property, - label: _this.sanitizeLabel(key), - insertText: _this.getInsertTextForProperty(key, propertySchema, addValue, separatorAfter), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - filterText: _this.getFilterTextForValue(key), - documentation: _this.fromMarkup(propertySchema.markdownDescription) || propertySchema.description || '', - }; - if (Object(_utils_strings_js__WEBPACK_IMPORTED_MODULE_3__["endsWith"])(proposal.insertText, "$1" + separatorAfter)) { - proposal.command = { - title: 'Suggest', - command: 'editor.action.triggerSuggest' - }; - } - collector.add(proposal); - } - }); - } - } - }); - }; - JSONCompletion.prototype.getSchemaLessPropertyCompletions = function (doc, node, currentKey, collector) { - var _this = this; - var collectCompletionsForSimilarObject = function (obj) { - obj.properties.forEach(function (p) { - var key = p.keyNode.value; - collector.add({ - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Property, - label: _this.sanitizeLabel(key), - insertText: _this.getInsertTextForValue(key, ''), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - filterText: _this.getFilterTextForValue(key), - documentation: '' - }); - }); - }; - if (node.parent) { - if (node.parent.type === 'property') { - // if the object is a property value, check the tree for other objects that hang under a property of the same name - var parentKey_1 = node.parent.keyNode.value; - doc.visit(function (n) { - if (n.type === 'property' && n !== node.parent && n.keyNode.value === parentKey_1 && n.valueNode && n.valueNode.type === 'object') { - collectCompletionsForSimilarObject(n.valueNode); - } - return true; - }); - } - else if (node.parent.type === 'array') { - // if the object is in an array, use all other array elements as similar objects - node.parent.items.forEach(function (n) { - if (n.type === 'object' && n !== node) { - collectCompletionsForSimilarObject(n); - } - }); - } - } - else if (node.type === 'object') { - collector.add({ - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Property, - label: '$schema', - insertText: this.getInsertTextForProperty('$schema', null, true, ''), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, documentation: '', - filterText: this.getFilterTextForValue("$schema") - }); - } - }; - JSONCompletion.prototype.getSchemaLessValueCompletions = function (doc, node, offset, document, collector) { - var _this = this; - var offsetForSeparator = offset; - if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) { - offsetForSeparator = node.offset + node.length; - node = node.parent; - } - if (!node) { - collector.add({ - kind: this.getSuggestionKind('object'), - label: 'Empty object', - insertText: this.getInsertTextForValue({}, ''), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - documentation: '' - }); - collector.add({ - kind: this.getSuggestionKind('array'), - label: 'Empty array', - insertText: this.getInsertTextForValue([], ''), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - documentation: '' - }); - return; - } - var separatorAfter = this.evaluateSeparatorAfter(document, offsetForSeparator); - var collectSuggestionsForValues = function (value) { - if (!_parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__["contains"](value.parent, offset, true)) { - collector.add({ - kind: _this.getSuggestionKind(value.type), - label: _this.getLabelTextForMatchingNode(value, document), - insertText: _this.getInsertTextForMatchingNode(value, document, separatorAfter), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, documentation: '' - }); - } - if (value.type === 'boolean') { - _this.addBooleanValueCompletion(!value.value, separatorAfter, collector); - } - }; - if (node.type === 'property') { - if (offset > node.colonOffset) { - var valueNode = node.valueNode; - if (valueNode && (offset > (valueNode.offset + valueNode.length) || valueNode.type === 'object' || valueNode.type === 'array')) { - return; - } - // suggest values at the same key - var parentKey_2 = node.keyNode.value; - doc.visit(function (n) { - if (n.type === 'property' && n.keyNode.value === parentKey_2 && n.valueNode) { - collectSuggestionsForValues(n.valueNode); - } - return true; - }); - if (parentKey_2 === '$schema' && node.parent && !node.parent.parent) { - this.addDollarSchemaCompletions(separatorAfter, collector); - } - } - } - if (node.type === 'array') { - if (node.parent && node.parent.type === 'property') { - // suggest items of an array at the same key - var parentKey_3 = node.parent.keyNode.value; - doc.visit(function (n) { - if (n.type === 'property' && n.keyNode.value === parentKey_3 && n.valueNode && n.valueNode.type === 'array') { - n.valueNode.items.forEach(collectSuggestionsForValues); - } - return true; - }); - } - else { - // suggest items in the same array - node.items.forEach(collectSuggestionsForValues); - } - } - }; - JSONCompletion.prototype.getValueCompletions = function (schema, doc, node, offset, document, collector, types) { - var _this = this; - var offsetForSeparator = offset; - var parentKey = null; - var valueNode = null; - if (node && (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null')) { - offsetForSeparator = node.offset + node.length; - valueNode = node; - node = node.parent; - } - if (!node) { - this.addSchemaValueCompletions(schema.schema, '', collector, types); - return; - } - if ((node.type === 'property') && offset > node.colonOffset) { - var valueNode_1 = node.valueNode; - if (valueNode_1 && offset > (valueNode_1.offset + valueNode_1.length)) { - return; // we are past the value node - } - parentKey = node.keyNode.value; - node = node.parent; - } - if (node && (parentKey !== null || node.type === 'array')) { - var separatorAfter_2 = this.evaluateSeparatorAfter(document, offsetForSeparator); - var matchingSchemas = doc.getMatchingSchemas(schema.schema, node.offset, valueNode); - matchingSchemas.forEach(function (s) { - if (s.node === node && !s.inverted && s.schema) { - if (node.type === 'array' && s.schema.items) { - if (Array.isArray(s.schema.items)) { - var index = _this.findItemAtOffset(node, document, offset); - if (index < s.schema.items.length) { - _this.addSchemaValueCompletions(s.schema.items[index], separatorAfter_2, collector, types); - } - } - else { - _this.addSchemaValueCompletions(s.schema.items, separatorAfter_2, collector, types); - } - } - if (s.schema.properties) { - var propertySchema = s.schema.properties[parentKey]; - if (propertySchema) { - _this.addSchemaValueCompletions(propertySchema, separatorAfter_2, collector, types); - } - } - } - }); - if (parentKey === '$schema' && !node.parent) { - this.addDollarSchemaCompletions(separatorAfter_2, collector); - } - if (types['boolean']) { - this.addBooleanValueCompletion(true, separatorAfter_2, collector); - this.addBooleanValueCompletion(false, separatorAfter_2, collector); - } - if (types['null']) { - this.addNullValueCompletion(separatorAfter_2, collector); - } - } - }; - JSONCompletion.prototype.getContributedValueCompletions = function (doc, node, offset, document, collector, collectionPromises) { - if (!node) { - this.contributions.forEach(function (contribution) { - var collectPromise = contribution.collectDefaultCompletions(document.uri, collector); - if (collectPromise) { - collectionPromises.push(collectPromise); - } - }); - } - else { - if (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null') { - node = node.parent; - } - if ((node.type === 'property') && offset > node.colonOffset) { - var parentKey_4 = node.keyNode.value; - var valueNode = node.valueNode; - if (!valueNode || offset <= (valueNode.offset + valueNode.length)) { - var location_2 = _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__["getNodePath"](node.parent); - this.contributions.forEach(function (contribution) { - var collectPromise = contribution.collectValueCompletions(document.uri, location_2, parentKey_4, collector); - if (collectPromise) { - collectionPromises.push(collectPromise); - } - }); - } - } - } - }; - JSONCompletion.prototype.addSchemaValueCompletions = function (schema, separatorAfter, collector, types) { - var _this = this; - if (typeof schema === 'object') { - this.addEnumValueCompletions(schema, separatorAfter, collector); - this.addDefaultValueCompletions(schema, separatorAfter, collector); - this.collectTypes(schema, types); - if (Array.isArray(schema.allOf)) { - schema.allOf.forEach(function (s) { return _this.addSchemaValueCompletions(s, separatorAfter, collector, types); }); - } - if (Array.isArray(schema.anyOf)) { - schema.anyOf.forEach(function (s) { return _this.addSchemaValueCompletions(s, separatorAfter, collector, types); }); - } - if (Array.isArray(schema.oneOf)) { - schema.oneOf.forEach(function (s) { return _this.addSchemaValueCompletions(s, separatorAfter, collector, types); }); - } - } - }; - JSONCompletion.prototype.addDefaultValueCompletions = function (schema, separatorAfter, collector, arrayDepth) { - var _this = this; - if (arrayDepth === void 0) { arrayDepth = 0; } - var hasProposals = false; - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_4__["isDefined"])(schema.default)) { - var type = schema.type; - var value = schema.default; - for (var i = arrayDepth; i > 0; i--) { - value = [value]; - type = 'array'; - } - collector.add({ - kind: this.getSuggestionKind(type), - label: this.getLabelForValue(value), - insertText: this.getInsertTextForValue(value, separatorAfter), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - detail: localize('json.suggest.default', 'Default value') - }); - hasProposals = true; - } - if (Array.isArray(schema.examples)) { - schema.examples.forEach(function (example) { - var type = schema.type; - var value = example; - for (var i = arrayDepth; i > 0; i--) { - value = [value]; - type = 'array'; - } - collector.add({ - kind: _this.getSuggestionKind(type), - label: _this.getLabelForValue(value), - insertText: _this.getInsertTextForValue(value, separatorAfter), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet - }); - hasProposals = true; - }); - } - if (Array.isArray(schema.defaultSnippets)) { - schema.defaultSnippets.forEach(function (s) { - var type = schema.type; - var value = s.body; - var label = s.label; - var insertText; - var filterText; - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_4__["isDefined"])(value)) { - var type_1 = schema.type; - for (var i = arrayDepth; i > 0; i--) { - value = [value]; - type_1 = 'array'; - } - insertText = _this.getInsertTextForSnippetValue(value, separatorAfter); - filterText = _this.getFilterTextForSnippetValue(value); - label = label || _this.getLabelForSnippetValue(value); - } - else if (typeof s.bodyText === 'string') { - var prefix = '', suffix = '', indent = ''; - for (var i = arrayDepth; i > 0; i--) { - prefix = prefix + indent + '[\n'; - suffix = suffix + '\n' + indent + ']'; - indent += '\t'; - type = 'array'; - } - insertText = prefix + indent + s.bodyText.split('\n').join('\n' + indent) + suffix + separatorAfter; - label = label || _this.sanitizeLabel(insertText), - filterText = insertText.replace(/[\n]/g, ''); // remove new lines - } - collector.add({ - kind: _this.getSuggestionKind(type), - label: label, - documentation: _this.fromMarkup(s.markdownDescription) || s.description, - insertText: insertText, - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - filterText: filterText - }); - hasProposals = true; - }); - } - if (!hasProposals && typeof schema.items === 'object' && !Array.isArray(schema.items)) { - this.addDefaultValueCompletions(schema.items, separatorAfter, collector, arrayDepth + 1); - } - }; - JSONCompletion.prototype.addEnumValueCompletions = function (schema, separatorAfter, collector) { - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_4__["isDefined"])(schema.const)) { - collector.add({ - kind: this.getSuggestionKind(schema.type), - label: this.getLabelForValue(schema.const), - insertText: this.getInsertTextForValue(schema.const, separatorAfter), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - documentation: this.fromMarkup(schema.markdownDescription) || schema.description - }); - } - if (Array.isArray(schema.enum)) { - for (var i = 0, length = schema.enum.length; i < length; i++) { - var enm = schema.enum[i]; - var documentation = this.fromMarkup(schema.markdownDescription) || schema.description; - if (schema.markdownEnumDescriptions && i < schema.markdownEnumDescriptions.length && this.doesSupportMarkdown()) { - documentation = this.fromMarkup(schema.markdownEnumDescriptions[i]); - } - else if (schema.enumDescriptions && i < schema.enumDescriptions.length) { - documentation = schema.enumDescriptions[i]; - } - collector.add({ - kind: this.getSuggestionKind(schema.type), - label: this.getLabelForValue(enm), - insertText: this.getInsertTextForValue(enm, separatorAfter), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - documentation: documentation - }); - } - } - }; - JSONCompletion.prototype.collectTypes = function (schema, types) { - if (Array.isArray(schema.enum) || Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_4__["isDefined"])(schema.const)) { - return; - } - var type = schema.type; - if (Array.isArray(type)) { - type.forEach(function (t) { return types[t] = true; }); - } - else { - types[type] = true; - } - }; - JSONCompletion.prototype.addFillerValueCompletions = function (types, separatorAfter, collector) { - if (types['object']) { - collector.add({ - kind: this.getSuggestionKind('object'), - label: '{}', - insertText: this.getInsertTextForGuessedValue({}, separatorAfter), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - detail: localize('defaults.object', 'New object'), - documentation: '' - }); - } - if (types['array']) { - collector.add({ - kind: this.getSuggestionKind('array'), - label: '[]', - insertText: this.getInsertTextForGuessedValue([], separatorAfter), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - detail: localize('defaults.array', 'New array'), - documentation: '' - }); - } - }; - JSONCompletion.prototype.addBooleanValueCompletion = function (value, separatorAfter, collector) { - collector.add({ - kind: this.getSuggestionKind('boolean'), - label: value ? 'true' : 'false', - insertText: this.getInsertTextForValue(value, separatorAfter), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - documentation: '' - }); - }; - JSONCompletion.prototype.addNullValueCompletion = function (separatorAfter, collector) { - collector.add({ - kind: this.getSuggestionKind('null'), - label: 'null', - insertText: 'null' + separatorAfter, - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, - documentation: '' - }); - }; - JSONCompletion.prototype.addDollarSchemaCompletions = function (separatorAfter, collector) { - var _this = this; - var schemaIds = this.schemaService.getRegisteredSchemaIds(function (schema) { return schema === 'http' || schema === 'https'; }); - schemaIds.forEach(function (schemaId) { return collector.add({ - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Module, - label: _this.getLabelForValue(schemaId), - filterText: _this.getFilterTextForValue(schemaId), - insertText: _this.getInsertTextForValue(schemaId, separatorAfter), - insertTextFormat: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["InsertTextFormat"].Snippet, documentation: '' - }); }); - }; - JSONCompletion.prototype.sanitizeLabel = function (label) { - label = label.replace(/[\n]/g, '↵'); - if (label.length > 57) { - label = label.substr(0, 57).trim() + '...'; - } - return label; - }; - JSONCompletion.prototype.getLabelForValue = function (value) { - return this.sanitizeLabel(JSON.stringify(value)); - }; - JSONCompletion.prototype.getFilterTextForValue = function (value) { - return JSON.stringify(value); - }; - JSONCompletion.prototype.getFilterTextForSnippetValue = function (value) { - return JSON.stringify(value).replace(/\$\{\d+:([^}]+)\}|\$\d+/g, '$1'); - }; - JSONCompletion.prototype.getLabelForSnippetValue = function (value) { - var label = JSON.stringify(value); - label = label.replace(/\$\{\d+:([^}]+)\}|\$\d+/g, '$1'); - return this.sanitizeLabel(label); - }; - JSONCompletion.prototype.getInsertTextForPlainText = function (text) { - return text.replace(/[\\\$\}]/g, '\\$&'); // escape $, \ and } - }; - JSONCompletion.prototype.getInsertTextForValue = function (value, separatorAfter) { - var text = JSON.stringify(value, null, '\t'); - if (text === '{}') { - return '{$1}' + separatorAfter; - } - else if (text === '[]') { - return '[$1]' + separatorAfter; - } - return this.getInsertTextForPlainText(text + separatorAfter); - }; - JSONCompletion.prototype.getInsertTextForSnippetValue = function (value, separatorAfter) { - var replacer = function (value) { - if (typeof value === 'string') { - if (value[0] === '^') { - return value.substr(1); - } - } - return JSON.stringify(value); - }; - return Object(_utils_json_js__WEBPACK_IMPORTED_MODULE_2__["stringifyObject"])(value, '', replacer) + separatorAfter; - }; - JSONCompletion.prototype.getInsertTextForGuessedValue = function (value, separatorAfter) { - switch (typeof value) { - case 'object': - if (value === null) { - return '${1:null}' + separatorAfter; - } - return this.getInsertTextForValue(value, separatorAfter); - case 'string': - var snippetValue = JSON.stringify(value); - snippetValue = snippetValue.substr(1, snippetValue.length - 2); // remove quotes - snippetValue = this.getInsertTextForPlainText(snippetValue); // escape \ and } - return '"${1:' + snippetValue + '}"' + separatorAfter; - case 'number': - case 'boolean': - return '${1:' + JSON.stringify(value) + '}' + separatorAfter; - } - return this.getInsertTextForValue(value, separatorAfter); - }; - JSONCompletion.prototype.getSuggestionKind = function (type) { - if (Array.isArray(type)) { - var array = type; - type = array.length > 0 ? array[0] : null; - } - if (!type) { - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Value; - } - switch (type) { - case 'string': return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Value; - case 'object': return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Module; - case 'property': return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Property; - default: return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["CompletionItemKind"].Value; - } - }; - JSONCompletion.prototype.getLabelTextForMatchingNode = function (node, document) { - switch (node.type) { - case 'array': - return '[]'; - case 'object': - return '{}'; - default: - var content = document.getText().substr(node.offset, node.length); - return content; - } - }; - JSONCompletion.prototype.getInsertTextForMatchingNode = function (node, document, separatorAfter) { - switch (node.type) { - case 'array': - return this.getInsertTextForValue([], separatorAfter); - case 'object': - return this.getInsertTextForValue({}, separatorAfter); - default: - var content = document.getText().substr(node.offset, node.length) + separatorAfter; - return this.getInsertTextForPlainText(content); - } - }; - JSONCompletion.prototype.getInsertTextForProperty = function (key, propertySchema, addValue, separatorAfter) { - var propertyText = this.getInsertTextForValue(key, ''); - if (!addValue) { - return propertyText; - } - var resultText = propertyText + ': '; - var value; - var nValueProposals = 0; - if (propertySchema) { - if (Array.isArray(propertySchema.defaultSnippets)) { - if (propertySchema.defaultSnippets.length === 1) { - var body = propertySchema.defaultSnippets[0].body; - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_4__["isDefined"])(body)) { - value = this.getInsertTextForSnippetValue(body, ''); - } - } - nValueProposals += propertySchema.defaultSnippets.length; - } - if (propertySchema.enum) { - if (!value && propertySchema.enum.length === 1) { - value = this.getInsertTextForGuessedValue(propertySchema.enum[0], ''); - } - nValueProposals += propertySchema.enum.length; - } - if (Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_4__["isDefined"])(propertySchema.default)) { - if (!value) { - value = this.getInsertTextForGuessedValue(propertySchema.default, ''); - } - nValueProposals++; - } - if (nValueProposals === 0) { - var type = Array.isArray(propertySchema.type) ? propertySchema.type[0] : propertySchema.type; - if (!type) { - if (propertySchema.properties) { - type = 'object'; - } - else if (propertySchema.items) { - type = 'array'; - } - } - switch (type) { - case 'boolean': - value = '$1'; - break; - case 'string': - value = '"$1"'; - break; - case 'object': - value = '{$1}'; - break; - case 'array': - value = '[$1]'; - break; - case 'number': - case 'integer': - value = '${1:0}'; - break; - case 'null': - value = '${1:null}'; - break; - default: - return propertyText; - } - } - } - if (!value || nValueProposals > 1) { - value = '$1'; - } - return resultText + value + separatorAfter; - }; - JSONCompletion.prototype.getCurrentWord = function (document, offset) { - var i = offset - 1; - var text = document.getText(); - while (i >= 0 && ' \t\n\r\v":{[,]}'.indexOf(text.charAt(i)) === -1) { - i--; - } - return text.substring(i + 1, offset); - }; - JSONCompletion.prototype.evaluateSeparatorAfter = function (document, offset) { - var scanner = _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_1__["createScanner"](document.getText(), true); - scanner.setPosition(offset); - var token = scanner.scan(); - switch (token) { - case 5 /* CommaToken */: - case 2 /* CloseBraceToken */: - case 4 /* CloseBracketToken */: - case 17 /* EOF */: - return ''; - default: - return ','; - } - }; - JSONCompletion.prototype.findItemAtOffset = function (node, document, offset) { - var scanner = _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_1__["createScanner"](document.getText(), true); - var children = node.items; - for (var i = children.length - 1; i >= 0; i--) { - var child = children[i]; - if (offset > child.offset + child.length) { - scanner.setPosition(child.offset + child.length); - var token = scanner.scan(); - if (token === 5 /* CommaToken */ && offset >= scanner.getTokenOffset() + scanner.getTokenLength()) { - return i + 1; - } - return i; - } - else if (offset >= child.offset) { - return i; - } - } - return 0; - }; - JSONCompletion.prototype.isInComment = function (document, start, offset) { - var scanner = _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_1__["createScanner"](document.getText(), false); - scanner.setPosition(start); - var token = scanner.scan(); - while (token !== 17 /* EOF */ && (scanner.getTokenOffset() + scanner.getTokenLength() < offset)) { - token = scanner.scan(); - } - return (token === 12 /* LineCommentTrivia */ || token === 13 /* BlockCommentTrivia */) && scanner.getTokenOffset() <= offset; - }; - JSONCompletion.prototype.fromMarkup = function (markupString) { - if (markupString && this.doesSupportMarkdown()) { - return { - kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["MarkupKind"].Markdown, - value: markupString - }; - } - return undefined; - }; - JSONCompletion.prototype.doesSupportMarkdown = function () { - if (!Object(_utils_objects_js__WEBPACK_IMPORTED_MODULE_4__["isDefined"])(this.supportsMarkdown)) { - var completion = this.clientCapabilities.textDocument && this.clientCapabilities.textDocument.completion; - this.supportsMarkdown = completion && completion.completionItem && Array.isArray(completion.completionItem.documentationFormat) && completion.completionItem.documentationFormat.indexOf(_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_5__["MarkupKind"].Markdown) !== -1; - } - return this.supportsMarkdown; - }; - return JSONCompletion; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonDocumentSymbols.js": -/*!***************************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonDocumentSymbols.js ***! - \***************************************************************************************************************************/ -/*! exports provided: JSONDocumentSymbols */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JSONDocumentSymbols", function() { return JSONDocumentSymbols; }); -/* harmony import */ var _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/jsonParser.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js"); -/* harmony import */ var _utils_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/strings.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/strings.js"); -/* harmony import */ var _utils_colors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/colors.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/colors.js"); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./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. - *--------------------------------------------------------------------------------------------*/ - - - - -var JSONDocumentSymbols = /** @class */ (function () { - function JSONDocumentSymbols(schemaService) { - this.schemaService = schemaService; - } - JSONDocumentSymbols.prototype.findDocumentSymbols = function (document, doc) { - var _this = this; - var root = doc.root; - if (!root) { - return null; - } - // special handling for key bindings - var resourceString = document.uri; - if ((resourceString === 'vscode://defaultsettings/keybindings.json') || _utils_strings_js__WEBPACK_IMPORTED_MODULE_1__["endsWith"](resourceString.toLowerCase(), '/user/keybindings.json')) { - if (root.type === 'array') { - var result_1 = []; - root.items.forEach(function (item) { - if (item.type === 'object') { - for (var _i = 0, _a = item.properties; _i < _a.length; _i++) { - var property = _a[_i]; - if (property.keyNode.value === 'key') { - if (property.valueNode) { - if (property.valueNode) { - var location = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_3__["Location"].create(document.uri, getRange(document, item)); - result_1.push({ name: _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__["getNodeValue"](property.valueNode), kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_3__["SymbolKind"].Function, location: location }); - } - return; - } - } - } - } - }); - return result_1; - } - } - var collectOutlineEntries = function (result, node, containerName) { - if (node.type === 'array') { - node.items.forEach(function (node) { return collectOutlineEntries(result, node, containerName); }); - } - else if (node.type === 'object') { - node.properties.forEach(function (property) { - var location = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_3__["Location"].create(document.uri, getRange(document, property)); - var valueNode = property.valueNode; - if (valueNode) { - var childContainerName = containerName ? containerName + '.' + property.keyNode.value : property.keyNode.value; - result.push({ name: _this.getKeyLabel(property), kind: _this.getSymbolKind(valueNode.type), location: location, containerName: containerName }); - collectOutlineEntries(result, valueNode, childContainerName); - } - }); - } - return result; - }; - var result = collectOutlineEntries([], root, void 0); - return result; - }; - JSONDocumentSymbols.prototype.findDocumentSymbols2 = function (document, doc) { - var _this = this; - var root = doc.root; - if (!root) { - return null; - } - // special handling for key bindings - var resourceString = document.uri; - if ((resourceString === 'vscode://defaultsettings/keybindings.json') || _utils_strings_js__WEBPACK_IMPORTED_MODULE_1__["endsWith"](resourceString.toLowerCase(), '/user/keybindings.json')) { - if (root.type === 'array') { - var result_2 = []; - root.items.forEach(function (item) { - if (item.type === 'object') { - for (var _i = 0, _a = item.properties; _i < _a.length; _i++) { - var property = _a[_i]; - if (property.keyNode.value === 'key') { - if (property.valueNode) { - var range = getRange(document, item); - var selectionRange = getRange(document, property.keyNode); - result_2.push({ name: _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__["getNodeValue"](property.valueNode), kind: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_3__["SymbolKind"].Function, range: range, selectionRange: selectionRange }); - } - return; - } - } - } - }); - return result_2; - } - } - var collectOutlineEntries = function (result, node) { - if (node.type === 'array') { - node.items.forEach(function (node, index) { - if (node) { - var range = getRange(document, node); - var selectionRange = range; - var name = String(index); - var children = collectOutlineEntries([], node); - result.push({ name: name, kind: _this.getSymbolKind(node.type), range: range, selectionRange: selectionRange, children: children }); - } - }); - } - else if (node.type === 'object') { - node.properties.forEach(function (property) { - var valueNode = property.valueNode; - if (valueNode) { - var range = getRange(document, property); - var selectionRange = getRange(document, property.keyNode); - var children = collectOutlineEntries([], valueNode); - result.push({ name: _this.getKeyLabel(property), kind: _this.getSymbolKind(valueNode.type), range: range, selectionRange: selectionRange, children: children }); - } - }); - } - return result; - }; - var result = collectOutlineEntries([], root); - return result; - }; - JSONDocumentSymbols.prototype.getSymbolKind = function (nodeType) { - switch (nodeType) { - case 'object': - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_3__["SymbolKind"].Module; - case 'string': - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_3__["SymbolKind"].String; - case 'number': - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_3__["SymbolKind"].Number; - case 'array': - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_3__["SymbolKind"].Array; - case 'boolean': - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_3__["SymbolKind"].Boolean; - default: // 'null' - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_3__["SymbolKind"].Variable; - } - }; - JSONDocumentSymbols.prototype.getKeyLabel = function (property) { - var name = property.keyNode.value; - if (name) { - name = name.replace(/[\n]/g, '↵'); - } - if (name && name.trim()) { - return name; - } - return "\"" + name + "\""; - }; - JSONDocumentSymbols.prototype.findDocumentColors = function (document, doc) { - return this.schemaService.getSchemaForResource(document.uri, doc).then(function (schema) { - var result = []; - if (schema) { - var matchingSchemas = doc.getMatchingSchemas(schema.schema); - var visitedNode = {}; - for (var _i = 0, matchingSchemas_1 = matchingSchemas; _i < matchingSchemas_1.length; _i++) { - var s = matchingSchemas_1[_i]; - if (!s.inverted && s.schema && (s.schema.format === 'color' || s.schema.format === 'color-hex') && s.node && s.node.type === 'string') { - var nodeId = String(s.node.offset); - if (!visitedNode[nodeId]) { - var color = Object(_utils_colors_js__WEBPACK_IMPORTED_MODULE_2__["colorFromHex"])(_parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__["getNodeValue"](s.node)); - if (color) { - var range = getRange(document, s.node); - result.push({ color: color, range: range }); - } - visitedNode[nodeId] = true; - } - } - } - } - return result; - }); - }; - JSONDocumentSymbols.prototype.getColorPresentations = function (document, doc, color, range) { - var result = []; - var red256 = Math.round(color.red * 255), green256 = Math.round(color.green * 255), blue256 = Math.round(color.blue * 255); - function toTwoDigitHex(n) { - var r = n.toString(16); - return r.length !== 2 ? '0' + r : r; - } - var label; - if (color.alpha === 1) { - label = "#" + toTwoDigitHex(red256) + toTwoDigitHex(green256) + toTwoDigitHex(blue256); - } - else { - label = "#" + toTwoDigitHex(red256) + toTwoDigitHex(green256) + toTwoDigitHex(blue256) + toTwoDigitHex(Math.round(color.alpha * 255)); - } - result.push({ label: label, textEdit: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_3__["TextEdit"].replace(range, JSON.stringify(label)) }); - return result; - }; - return JSONDocumentSymbols; -}()); - -function getRange(document, node) { - return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_3__["Range"].create(document.positionAt(node.offset), document.positionAt(node.offset + node.length)); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonFolding.js": -/*!*******************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonFolding.js ***! - \*******************************************************************************************************************/ -/*! exports provided: getFoldingRanges */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFoldingRanges", function() { return getFoldingRanges; }); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jsonc-parser/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js"); -/* harmony import */ var _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../jsonLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonFolding.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -13058,7 +14833,7 @@ function getFoldingRanges(document, context) { var nestingLevels = []; var stack = []; var prevStart = -1; - var scanner = Object(_jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_1__["createScanner"])(document.getText(), false); + var scanner = main_createScanner(document.getText(), false); var token = scanner.scan(); function addRange(range) { ranges.push(range); @@ -13091,11 +14866,11 @@ function getFoldingRanges(document, context) { var startLine = document.positionAt(scanner.getTokenOffset()).line; var endLine = document.positionAt(scanner.getTokenOffset() + scanner.getTokenLength()).line; if (scanner.getTokenError() === 1 /* UnexpectedEndOfComment */ && startLine + 1 < document.lineCount) { - scanner.setPosition(document.offsetAt(_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Position"].create(startLine + 1, 0))); + scanner.setPosition(document.offsetAt(main_Position.create(startLine + 1, 0))); } else { if (startLine < endLine) { - addRange({ startLine: startLine, endLine: endLine, kind: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["FoldingRangeKind"].Comment }); + addRange({ startLine: startLine, endLine: endLine, kind: FoldingRangeKind.Comment }); prevStart = startLine; } } @@ -13107,12 +14882,12 @@ function getFoldingRanges(document, context) { if (m) { var line = document.positionAt(scanner.getTokenOffset()).line; if (m[1]) { // start pattern match - var range = { startLine: line, endLine: line, kind: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["FoldingRangeKind"].Region }; + var range = { startLine: line, endLine: line, kind: FoldingRangeKind.Region }; stack.push(range); } else { var i = stack.length - 1; - while (i >= 0 && stack[i].kind !== _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["FoldingRangeKind"].Region) { + while (i >= 0 && stack[i].kind !== FoldingRangeKind.Region) { i--; } if (i >= 0) { @@ -13166,635 +14941,7 @@ function getFoldingRanges(document, context) { return result; } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonHover.js": -/*!*****************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonHover.js ***! - \*****************************************************************************************************************/ -/*! exports provided: JSONHover */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JSONHover", function() { return JSONHover; }); -/* harmony import */ var _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/jsonParser.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js"); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./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. - *--------------------------------------------------------------------------------------------*/ - - -var JSONHover = /** @class */ (function () { - function JSONHover(schemaService, contributions, promiseConstructor) { - if (contributions === void 0) { contributions = []; } - this.schemaService = schemaService; - this.contributions = contributions; - this.promise = promiseConstructor || Promise; - } - JSONHover.prototype.doHover = function (document, position, doc) { - var offset = document.offsetAt(position); - var node = doc.getNodeFromOffset(offset); - if (!node || (node.type === 'object' || node.type === 'array') && offset > node.offset + 1 && offset < node.offset + node.length - 1) { - return this.promise.resolve(null); - } - var hoverRangeNode = node; - // use the property description when hovering over an object key - if (node.type === 'string') { - var parent = node.parent; - if (parent && parent.type === 'property' && parent.keyNode === node) { - node = parent.valueNode; - if (!node) { - return this.promise.resolve(null); - } - } - } - var hoverRange = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["Range"].create(document.positionAt(hoverRangeNode.offset), document.positionAt(hoverRangeNode.offset + hoverRangeNode.length)); - var createHover = function (contents) { - var result = { - contents: contents, - range: hoverRange - }; - return result; - }; - var location = _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__["getNodePath"](node); - for (var i = this.contributions.length - 1; i >= 0; i--) { - var contribution = this.contributions[i]; - var promise = contribution.getInfoContribution(document.uri, location); - if (promise) { - return promise.then(function (htmlContent) { return createHover(htmlContent); }); - } - } - return this.schemaService.getSchemaForResource(document.uri, doc).then(function (schema) { - if (schema) { - var matchingSchemas = doc.getMatchingSchemas(schema.schema, node.offset); - var title_1 = null; - var markdownDescription_1 = null; - var markdownEnumValueDescription_1 = null, enumValue_1 = null; - matchingSchemas.every(function (s) { - if (s.node === node && !s.inverted && s.schema) { - title_1 = title_1 || s.schema.title; - markdownDescription_1 = markdownDescription_1 || s.schema.markdownDescription || toMarkdown(s.schema.description); - if (s.schema.enum) { - var idx = s.schema.enum.indexOf(_parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_0__["getNodeValue"](node)); - if (s.schema.markdownEnumDescriptions) { - markdownEnumValueDescription_1 = s.schema.markdownEnumDescriptions[idx]; - } - else if (s.schema.enumDescriptions) { - markdownEnumValueDescription_1 = toMarkdown(s.schema.enumDescriptions[idx]); - } - if (markdownEnumValueDescription_1) { - enumValue_1 = s.schema.enum[idx]; - if (typeof enumValue_1 !== 'string') { - enumValue_1 = JSON.stringify(enumValue_1); - } - } - } - } - return true; - }); - var result = ''; - if (title_1) { - result = toMarkdown(title_1); - } - if (markdownDescription_1) { - if (result.length > 0) { - result += "\n\n"; - } - result += markdownDescription_1; - } - if (markdownEnumValueDescription_1) { - if (result.length > 0) { - result += "\n\n"; - } - result += "`" + toMarkdown(enumValue_1) + "`: " + markdownEnumValueDescription_1; - } - return createHover([result]); - } - return null; - }); - }; - return JSONHover; -}()); - -function toMarkdown(plain) { - if (plain) { - var res = plain.replace(/([^\n\r])(\r?\n)([^\n\r])/gm, '$1\n\n$3'); // single new lines to \n\n (Markdown paragraph) - return res.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&"); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash - } - return void 0; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSchemaService.js": -/*!*************************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSchemaService.js ***! - \*************************************************************************************************************************/ -/*! exports provided: UnresolvedSchema, ResolvedSchema, JSONSchemaService */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnresolvedSchema", function() { return UnresolvedSchema; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedSchema", function() { return ResolvedSchema; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JSONSchemaService", function() { return JSONSchemaService; }); -/* harmony import */ var _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../jsonc-parser/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js"); -/* harmony import */ var _vscode_uri_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../vscode-uri/index.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-uri/index.js"); -/* harmony import */ var _utils_strings_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/strings.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/strings.js"); -/* harmony import */ var _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../parser/jsonParser.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/parser/jsonParser.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./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. - *--------------------------------------------------------------------------------------------*/ - - - - - -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_4__["loadMessageBundle"](); -var FilePatternAssociation = /** @class */ (function () { - function FilePatternAssociation(pattern) { - try { - this.patternRegExp = new RegExp(_utils_strings_js__WEBPACK_IMPORTED_MODULE_2__["convertSimple2RegExpPattern"](pattern) + '$'); - } - catch (e) { - // invalid pattern - this.patternRegExp = null; - } - this.schemas = []; - } - FilePatternAssociation.prototype.addSchema = function (id) { - this.schemas.push(id); - }; - FilePatternAssociation.prototype.matchesPattern = function (fileName) { - return this.patternRegExp && this.patternRegExp.test(fileName); - }; - FilePatternAssociation.prototype.getSchemas = function () { - return this.schemas; - }; - return FilePatternAssociation; -}()); -var SchemaHandle = /** @class */ (function () { - function SchemaHandle(service, url, unresolvedSchemaContent) { - this.service = service; - this.url = url; - this.dependencies = {}; - if (unresolvedSchemaContent) { - this.unresolvedSchema = this.service.promise.resolve(new UnresolvedSchema(unresolvedSchemaContent)); - } - } - SchemaHandle.prototype.getUnresolvedSchema = function () { - if (!this.unresolvedSchema) { - this.unresolvedSchema = this.service.loadSchema(this.url); - } - return this.unresolvedSchema; - }; - SchemaHandle.prototype.getResolvedSchema = function () { - var _this = this; - if (!this.resolvedSchema) { - this.resolvedSchema = this.getUnresolvedSchema().then(function (unresolved) { - return _this.service.resolveSchemaContent(unresolved, _this.url, _this.dependencies); - }); - } - return this.resolvedSchema; - }; - SchemaHandle.prototype.clearSchema = function () { - this.resolvedSchema = null; - this.unresolvedSchema = null; - this.dependencies = {}; - }; - return SchemaHandle; -}()); -var UnresolvedSchema = /** @class */ (function () { - function UnresolvedSchema(schema, errors) { - if (errors === void 0) { errors = []; } - this.schema = schema; - this.errors = errors; - } - return UnresolvedSchema; -}()); - -var ResolvedSchema = /** @class */ (function () { - function ResolvedSchema(schema, errors) { - if (errors === void 0) { errors = []; } - this.schema = schema; - this.errors = errors; - } - ResolvedSchema.prototype.getSection = function (path) { - return _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_3__["asSchema"](this.getSectionRecursive(path, this.schema)); - }; - ResolvedSchema.prototype.getSectionRecursive = function (path, schema) { - if (!schema || typeof schema === 'boolean' || path.length === 0) { - return schema; - } - var next = path.shift(); - if (schema.properties && typeof schema.properties[next]) { - return this.getSectionRecursive(path, schema.properties[next]); - } - else if (schema.patternProperties) { - for (var _i = 0, _a = Object.keys(schema.patternProperties); _i < _a.length; _i++) { - var pattern = _a[_i]; - var regex = new RegExp(pattern); - if (regex.test(next)) { - return this.getSectionRecursive(path, schema.patternProperties[pattern]); - } - } - } - else if (typeof schema.additionalProperties === 'object') { - return this.getSectionRecursive(path, schema.additionalProperties); - } - else if (next.match('[0-9]+')) { - if (Array.isArray(schema.items)) { - var index = parseInt(next, 10); - if (!isNaN(index) && schema.items[index]) { - return this.getSectionRecursive(path, schema.items[index]); - } - } - else if (schema.items) { - return this.getSectionRecursive(path, schema.items); - } - } - return null; - }; - return ResolvedSchema; -}()); - -var JSONSchemaService = /** @class */ (function () { - function JSONSchemaService(requestService, contextService, promiseConstructor) { - this.contextService = contextService; - this.requestService = requestService; - this.promiseConstructor = promiseConstructor || Promise; - this.callOnDispose = []; - this.contributionSchemas = {}; - this.contributionAssociations = {}; - this.schemasById = {}; - this.filePatternAssociations = []; - this.filePatternAssociationById = {}; - this.registeredSchemasIds = {}; - } - JSONSchemaService.prototype.getRegisteredSchemaIds = function (filter) { - return Object.keys(this.registeredSchemasIds).filter(function (id) { - var scheme = _vscode_uri_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].parse(id).scheme; - return scheme !== 'schemaservice' && (!filter || filter(scheme)); - }); - }; - Object.defineProperty(JSONSchemaService.prototype, "promise", { - get: function () { - return this.promiseConstructor; - }, - enumerable: true, - configurable: true - }); - JSONSchemaService.prototype.dispose = function () { - while (this.callOnDispose.length > 0) { - this.callOnDispose.pop()(); - } - }; - JSONSchemaService.prototype.onResourceChange = function (uri) { - var _this = this; - var hasChanges = false; - uri = this.normalizeId(uri); - var toWalk = [uri]; - var all = Object.keys(this.schemasById).map(function (key) { return _this.schemasById[key]; }); - while (toWalk.length) { - var curr = toWalk.pop(); - for (var i = 0; i < all.length; i++) { - var handle = all[i]; - if (handle && (handle.url === curr || handle.dependencies[curr])) { - if (handle.url !== curr) { - toWalk.push(handle.url); - } - handle.clearSchema(); - all[i] = undefined; - hasChanges = true; - } - } - } - return hasChanges; - }; - JSONSchemaService.prototype.normalizeId = function (id) { - // remove trailing '#', normalize drive capitalization - return _vscode_uri_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].parse(id).toString(); - }; - JSONSchemaService.prototype.setSchemaContributions = function (schemaContributions) { - if (schemaContributions.schemas) { - var schemas = schemaContributions.schemas; - for (var id in schemas) { - var normalizedId = this.normalizeId(id); - this.contributionSchemas[normalizedId] = this.addSchemaHandle(normalizedId, schemas[id]); - } - } - if (schemaContributions.schemaAssociations) { - var schemaAssociations = schemaContributions.schemaAssociations; - for (var pattern in schemaAssociations) { - var associations = schemaAssociations[pattern]; - this.contributionAssociations[pattern] = associations; - var fpa = this.getOrAddFilePatternAssociation(pattern); - for (var _i = 0, associations_1 = associations; _i < associations_1.length; _i++) { - var schemaId = associations_1[_i]; - var id = this.normalizeId(schemaId); - fpa.addSchema(id); - } - } - } - }; - JSONSchemaService.prototype.addSchemaHandle = function (id, unresolvedSchemaContent) { - var schemaHandle = new SchemaHandle(this, id, unresolvedSchemaContent); - this.schemasById[id] = schemaHandle; - return schemaHandle; - }; - JSONSchemaService.prototype.getOrAddSchemaHandle = function (id, unresolvedSchemaContent) { - return this.schemasById[id] || this.addSchemaHandle(id, unresolvedSchemaContent); - }; - JSONSchemaService.prototype.getOrAddFilePatternAssociation = function (pattern) { - var fpa = this.filePatternAssociationById[pattern]; - if (!fpa) { - fpa = new FilePatternAssociation(pattern); - this.filePatternAssociationById[pattern] = fpa; - this.filePatternAssociations.push(fpa); - } - return fpa; - }; - JSONSchemaService.prototype.registerExternalSchema = function (uri, filePatterns, unresolvedSchemaContent) { - if (filePatterns === void 0) { filePatterns = null; } - var id = this.normalizeId(uri); - this.registeredSchemasIds[id] = true; - if (filePatterns) { - for (var _i = 0, filePatterns_1 = filePatterns; _i < filePatterns_1.length; _i++) { - var pattern = filePatterns_1[_i]; - this.getOrAddFilePatternAssociation(pattern).addSchema(id); - } - } - return unresolvedSchemaContent ? this.addSchemaHandle(id, unresolvedSchemaContent) : this.getOrAddSchemaHandle(id); - }; - JSONSchemaService.prototype.clearExternalSchemas = function () { - this.schemasById = {}; - this.filePatternAssociations = []; - this.filePatternAssociationById = {}; - this.registeredSchemasIds = {}; - for (var id in this.contributionSchemas) { - this.schemasById[id] = this.contributionSchemas[id]; - this.registeredSchemasIds[id] = true; - } - for (var pattern in this.contributionAssociations) { - var fpa = this.getOrAddFilePatternAssociation(pattern); - for (var _i = 0, _a = this.contributionAssociations[pattern]; _i < _a.length; _i++) { - var schemaId = _a[_i]; - var id = this.normalizeId(schemaId); - fpa.addSchema(id); - } - } - }; - JSONSchemaService.prototype.getResolvedSchema = function (schemaId) { - var id = this.normalizeId(schemaId); - var schemaHandle = this.schemasById[id]; - if (schemaHandle) { - return schemaHandle.getResolvedSchema(); - } - return this.promise.resolve(null); - }; - JSONSchemaService.prototype.loadSchema = function (url) { - if (!this.requestService) { - var errorMessage = localize('json.schema.norequestservice', 'Unable to load schema from \'{0}\'. No schema request service available', toDisplayString(url)); - return this.promise.resolve(new UnresolvedSchema({}, [errorMessage])); - } - return this.requestService(url).then(function (content) { - if (!content) { - var errorMessage = localize('json.schema.nocontent', 'Unable to load schema from \'{0}\': No content.', toDisplayString(url)); - return new UnresolvedSchema({}, [errorMessage]); - } - var schemaContent = {}; - var jsonErrors = []; - schemaContent = _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_0__["parse"](content, jsonErrors); - var errors = jsonErrors.length ? [localize('json.schema.invalidFormat', 'Unable to parse content from \'{0}\': Parse error at offset {1}.', toDisplayString(url), jsonErrors[0].offset)] : []; - return new UnresolvedSchema(schemaContent, errors); - }, function (error) { - var errorMessage = error.toString(); - var errorSplit = error.toString().split('Error: '); - if (errorSplit.length > 1) { - // more concise error message, URL and context are attached by caller anyways - errorMessage = errorSplit[1]; - } - return new UnresolvedSchema({}, [errorMessage]); - }); - }; - JSONSchemaService.prototype.resolveSchemaContent = function (schemaToResolve, schemaURL, dependencies) { - var _this = this; - var resolveErrors = schemaToResolve.errors.slice(0); - var schema = schemaToResolve.schema; - var contextService = this.contextService; - var findSection = function (schema, path) { - if (!path) { - return schema; - } - var current = schema; - if (path[0] === '/') { - path = path.substr(1); - } - path.split('/').some(function (part) { - current = current[part]; - return !current; - }); - return current; - }; - var merge = function (target, sourceRoot, sourceURI, path) { - var section = findSection(sourceRoot, path); - if (section) { - for (var key in section) { - if (section.hasOwnProperty(key) && !target.hasOwnProperty(key)) { - target[key] = section[key]; - } - } - } - else { - resolveErrors.push(localize('json.schema.invalidref', '$ref \'{0}\' in \'{1}\' can not be resolved.', path, sourceURI)); - } - }; - var resolveExternalLink = function (node, uri, linkPath, parentSchemaURL, parentSchemaDependencies) { - if (contextService && !/^\w+:\/\/.*/.test(uri)) { - uri = contextService.resolveRelativePath(uri, parentSchemaURL); - } - uri = _this.normalizeId(uri); - var referencedHandle = _this.getOrAddSchemaHandle(uri); - return referencedHandle.getUnresolvedSchema().then(function (unresolvedSchema) { - parentSchemaDependencies[uri] = true; - if (unresolvedSchema.errors.length) { - var loc = linkPath ? uri + '#' + linkPath : uri; - resolveErrors.push(localize('json.schema.problemloadingref', 'Problems loading reference \'{0}\': {1}', loc, unresolvedSchema.errors[0])); - } - merge(node, unresolvedSchema.schema, uri, linkPath); - return resolveRefs(node, unresolvedSchema.schema, uri, referencedHandle.dependencies); - }); - }; - var resolveRefs = function (node, parentSchema, parentSchemaURL, parentSchemaDependencies) { - if (!node || typeof node !== 'object') { - return Promise.resolve(null); - } - var toWalk = [node]; - var seen = []; - var openPromises = []; - var collectEntries = function () { - var entries = []; - for (var _i = 0; _i < arguments.length; _i++) { - entries[_i] = arguments[_i]; - } - for (var _a = 0, entries_1 = entries; _a < entries_1.length; _a++) { - var entry = entries_1[_a]; - if (typeof entry === 'object') { - toWalk.push(entry); - } - } - }; - var collectMapEntries = function () { - var maps = []; - for (var _i = 0; _i < arguments.length; _i++) { - maps[_i] = arguments[_i]; - } - for (var _a = 0, maps_1 = maps; _a < maps_1.length; _a++) { - var map = maps_1[_a]; - if (typeof map === 'object') { - for (var key in map) { - var entry = map[key]; - if (typeof entry === 'object') { - toWalk.push(entry); - } - } - } - } - }; - var collectArrayEntries = function () { - var arrays = []; - for (var _i = 0; _i < arguments.length; _i++) { - arrays[_i] = arguments[_i]; - } - for (var _a = 0, arrays_1 = arrays; _a < arrays_1.length; _a++) { - var array = arrays_1[_a]; - if (Array.isArray(array)) { - for (var _b = 0, array_1 = array; _b < array_1.length; _b++) { - var entry = array_1[_b]; - if (typeof entry === 'object') { - toWalk.push(entry); - } - } - } - } - }; - var handleRef = function (next) { - var seenRefs = []; - while (next.$ref) { - var ref = next.$ref; - var segments = ref.split('#', 2); - delete next.$ref; - if (segments[0].length > 0) { - openPromises.push(resolveExternalLink(next, segments[0], segments[1], parentSchemaURL, parentSchemaDependencies)); - return; - } - else { - if (seenRefs.indexOf(ref) === -1) { - merge(next, parentSchema, parentSchemaURL, segments[1]); // can set next.$ref again, use seenRefs to avoid circle - seenRefs.push(ref); - } - } - } - collectEntries(next.items, next.additionalProperties, next.not, next.contains, next.propertyNames, next.if, next.then, next.else); - collectMapEntries(next.definitions, next.properties, next.patternProperties, next.dependencies); - collectArrayEntries(next.anyOf, next.allOf, next.oneOf, next.items); - }; - while (toWalk.length) { - var next = toWalk.pop(); - if (seen.indexOf(next) >= 0) { - continue; - } - seen.push(next); - handleRef(next); - } - return _this.promise.all(openPromises); - }; - return resolveRefs(schema, schema, schemaURL, dependencies).then(function (_) { return new ResolvedSchema(schema, resolveErrors); }); - }; - JSONSchemaService.prototype.getSchemaForResource = function (resource, document) { - // first use $schema if present - if (document && document.root && document.root.type === 'object') { - var schemaProperties = document.root.properties.filter(function (p) { return (p.keyNode.value === '$schema') && p.valueNode && p.valueNode.type === 'string'; }); - if (schemaProperties.length > 0) { - var schemeId = _parser_jsonParser_js__WEBPACK_IMPORTED_MODULE_3__["getNodeValue"](schemaProperties[0].valueNode); - if (schemeId && _utils_strings_js__WEBPACK_IMPORTED_MODULE_2__["startsWith"](schemeId, '.') && this.contextService) { - schemeId = this.contextService.resolveRelativePath(schemeId, resource); - } - if (schemeId) { - var id = this.normalizeId(schemeId); - return this.getOrAddSchemaHandle(id).getResolvedSchema(); - } - } - } - var seen = Object.create(null); - var schemas = []; - for (var _i = 0, _a = this.filePatternAssociations; _i < _a.length; _i++) { - var entry = _a[_i]; - if (entry.matchesPattern(resource)) { - for (var _b = 0, _c = entry.getSchemas(); _b < _c.length; _b++) { - var schemaId = _c[_b]; - if (!seen[schemaId]) { - schemas.push(schemaId); - seen[schemaId] = true; - } - } - } - } - if (schemas.length > 0) { - return this.createCombinedSchema(resource, schemas).getResolvedSchema(); - } - return this.promise.resolve(null); - }; - JSONSchemaService.prototype.createCombinedSchema = function (resource, schemaIds) { - if (schemaIds.length === 1) { - return this.getOrAddSchemaHandle(schemaIds[0]); - } - else { - var combinedSchemaId = 'schemaservice://combinedSchema/' + encodeURIComponent(resource); - var combinedSchema = { - allOf: schemaIds.map(function (schemaId) { return ({ $ref: schemaId }); }) - }; - return this.addSchemaHandle(combinedSchemaId, combinedSchema); - } - }; - return JSONSchemaService; -}()); - -function toDisplayString(url) { - try { - var uri = _vscode_uri_index_js__WEBPACK_IMPORTED_MODULE_1__["default"].parse(url); - if (uri.scheme === 'file') { - return uri.fsPath; - } - } - catch (e) { - // ignore - } - return url; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSelectionRanges.js": -/*!***************************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSelectionRanges.js ***! - \***************************************************************************************************************************/ -/*! exports provided: getSelectionRanges */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSelectionRanges", function() { return getSelectionRanges; }); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../jsonc-parser/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/jsonc-parser/main.js"); -/* harmony import */ var _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../jsonLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSelectionRanges.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -13841,11 +14988,11 @@ function getSelectionRanges(document, positions, doc) { } function newRange(start, end) { return { - range: _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_0__["Range"].create(document.positionAt(start), document.positionAt(end)), - kind: _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["SelectionRangeKind"].Declaration + range: main_Range.create(document.positionAt(start), document.positionAt(end)), + kind: SelectionRangeKind.Declaration }; } - var scanner = Object(_jsonc_parser_main_js__WEBPACK_IMPORTED_MODULE_1__["createScanner"])(document.getText(), true); + var scanner = main_createScanner(document.getText(), true); function getOffsetAfterNextToken(offset, expectedToken) { scanner.setPosition(offset); var token = scanner.scan(); @@ -13857,23 +15004,7 @@ function getSelectionRanges(document, positions, doc) { return positions.map(getSelectionRange); } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonValidation.js": -/*!**********************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonValidation.js ***! - \**********************************************************************************************************************/ -/*! exports provided: JSONValidation */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JSONValidation", function() { return JSONValidation; }); -/* harmony import */ var _jsonSchemaService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jsonSchemaService.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/services/jsonSchemaService.js"); -/* harmony import */ var _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-types/main.js"); -/* harmony import */ var _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../jsonLanguageTypes.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageTypes.js"); -/* harmony import */ var _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../fillers/vscode-nls.js */ "./node_modules/monaco-editor/esm/vs/language/json/fillers/vscode-nls.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageService.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -13882,2599 +15013,63 @@ __webpack_require__.r(__webpack_exports__); -var localize = _fillers_vscode_nls_js__WEBPACK_IMPORTED_MODULE_3__["loadMessageBundle"](); -var JSONValidation = /** @class */ (function () { - function JSONValidation(jsonSchemaService, promiseConstructor) { - this.jsonSchemaService = jsonSchemaService; - this.promise = promiseConstructor; - this.validationEnabled = true; - } - JSONValidation.prototype.configure = function (raw) { - if (raw) { - this.validationEnabled = raw.validate; - this.commentSeverity = raw.allowComments ? void 0 : _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["DiagnosticSeverity"].Error; - } - }; - JSONValidation.prototype.doValidation = function (textDocument, jsonDocument, documentSettings, schema) { - var _this = this; - if (!this.validationEnabled) { - return this.promise.resolve([]); - } - var diagnostics = []; - var added = {}; - var addProblem = function (problem) { - // remove duplicated messages - var signature = problem.range.start.line + ' ' + problem.range.start.character + ' ' + problem.message; - if (!added[signature]) { - added[signature] = true; - diagnostics.push(problem); - } - }; - var getDiagnostics = function (schema) { - var trailingCommaSeverity = documentSettings ? toDiagnosticSeverity(documentSettings.trailingCommas) : _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["DiagnosticSeverity"].Error; - var commentSeverity = documentSettings ? toDiagnosticSeverity(documentSettings.comments) : _this.commentSeverity; - if (schema) { - if (schema.errors.length && jsonDocument.root) { - var astRoot = jsonDocument.root; - var property = astRoot.type === 'object' ? astRoot.properties[0] : null; - if (property && property.keyNode.value === '$schema') { - var node = property.valueNode || property; - var range = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["Range"].create(textDocument.positionAt(node.offset), textDocument.positionAt(node.offset + node.length)); - addProblem(_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["Diagnostic"].create(range, schema.errors[0], _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["DiagnosticSeverity"].Warning, _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].SchemaResolveError)); - } - else { - var range = _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["Range"].create(textDocument.positionAt(astRoot.offset), textDocument.positionAt(astRoot.offset + 1)); - addProblem(_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["Diagnostic"].create(range, schema.errors[0], _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["DiagnosticSeverity"].Warning, _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].SchemaResolveError)); - } - } - else { - var semanticErrors = jsonDocument.validate(textDocument, schema.schema); - if (semanticErrors) { - semanticErrors.forEach(addProblem); - } - } - if (schemaAllowsComments(schema.schema)) { - trailingCommaSeverity = commentSeverity = void 0; - } - } - for (var _i = 0, _a = jsonDocument.syntaxErrors; _i < _a.length; _i++) { - var p = _a[_i]; - if (p.code === _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].TrailingComma) { - if (typeof trailingCommaSeverity !== 'number') { - continue; - } - p.severity = trailingCommaSeverity; - } - addProblem(p); - } - if (typeof commentSeverity === 'number') { - var message_1 = localize('InvalidCommentToken', 'Comments are not permitted in JSON.'); - jsonDocument.comments.forEach(function (c) { - addProblem(_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["Diagnostic"].create(c, message_1, commentSeverity, _jsonLanguageTypes_js__WEBPACK_IMPORTED_MODULE_2__["ErrorCode"].CommentNotPermitted)); + + + + + + + + + +function getLanguageService(params) { + var promise = params.promiseConstructor || Promise; + var jsonSchemaService = new jsonSchemaService_JSONSchemaService(params.schemaRequestService, params.workspaceContext, promise); + jsonSchemaService.setSchemaContributions(schemaContributions); + var jsonCompletion = new jsonCompletion_JSONCompletion(jsonSchemaService, params.contributions, promise, params.clientCapabilities); + var jsonHover = new jsonHover_JSONHover(jsonSchemaService, params.contributions, promise); + var jsonDocumentSymbols = new jsonDocumentSymbols_JSONDocumentSymbols(jsonSchemaService); + var jsonValidation = new jsonValidation_JSONValidation(jsonSchemaService, promise); + return { + configure: function (settings) { + jsonSchemaService.clearExternalSchemas(); + if (settings.schemas) { + settings.schemas.forEach(function (settings) { + jsonSchemaService.registerExternalSchema(settings.uri, settings.fileMatch, settings.schema); }); } - return diagnostics; - }; - if (schema) { - var id = schema.id || ('schemaservice://untitled/' + idCounter++); - return this.jsonSchemaService.resolveSchemaContent(new _jsonSchemaService_js__WEBPACK_IMPORTED_MODULE_0__["UnresolvedSchema"](schema), id, {}).then(function (resolvedSchema) { - return getDiagnostics(resolvedSchema); + jsonValidation.configure(settings); + }, + resetSchema: function (uri) { return jsonSchemaService.onResourceChange(uri); }, + doValidation: jsonValidation.doValidation.bind(jsonValidation), + parseJSONDocument: function (document) { return jsonParser_parse(document, { collectComments: true }); }, + newJSONDocument: function (root, diagnostics) { return newJSONDocument(root, diagnostics); }, + doResolve: jsonCompletion.doResolve.bind(jsonCompletion), + doComplete: jsonCompletion.doComplete.bind(jsonCompletion), + findDocumentSymbols: jsonDocumentSymbols.findDocumentSymbols.bind(jsonDocumentSymbols), + findDocumentSymbols2: jsonDocumentSymbols.findDocumentSymbols2.bind(jsonDocumentSymbols), + findColorSymbols: function (d, s) { return jsonDocumentSymbols.findDocumentColors(d, s).then(function (s) { return s.map(function (s) { return s.range; }); }); }, + findDocumentColors: jsonDocumentSymbols.findDocumentColors.bind(jsonDocumentSymbols), + getColorPresentations: jsonDocumentSymbols.getColorPresentations.bind(jsonDocumentSymbols), + doHover: jsonHover.doHover.bind(jsonHover), + getFoldingRanges: getFoldingRanges, + getSelectionRanges: getSelectionRanges, + format: function (d, r, o) { + var range = void 0; + if (r) { + var offset = d.offsetAt(r.start); + var length = d.offsetAt(r.end) - offset; + range = { offset: offset, length: length }; + } + var options = { tabSize: o ? o.tabSize : 4, insertSpaces: o ? o.insertSpaces : true, eol: '\n' }; + return main_format(d.getText(), range, options).map(function (e) { + return TextEdit.replace(main_Range.create(d.positionAt(e.offset), d.positionAt(e.offset + e.length)), e.content); }); } - return this.jsonSchemaService.getSchemaForResource(textDocument.uri, jsonDocument).then(function (schema) { - return getDiagnostics(schema); - }); - }; - return JSONValidation; -}()); - -var idCounter = 0; -function schemaAllowsComments(schemaRef) { - if (schemaRef && typeof schemaRef === 'object') { - if (schemaRef.allowComments) { - return true; - } - if (schemaRef.allOf) { - return schemaRef.allOf.some(schemaAllowsComments); - } - } - return false; -} -function toDiagnosticSeverity(severityLevel) { - switch (severityLevel) { - case 'error': return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["DiagnosticSeverity"].Error; - case 'warning': return _vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["DiagnosticSeverity"].Warning; - case 'ignore': return void 0; - } - return void 0; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/colors.js": -/*!***********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/colors.js ***! - \***********************************************************************************************************/ -/*! exports provided: hexDigit, colorFromHex, colorFrom256RGB */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hexDigit", function() { return hexDigit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colorFromHex", function() { return colorFromHex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "colorFrom256RGB", function() { return colorFrom256RGB; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var Digit0 = 48; -var Digit9 = 57; -var A = 65; -var a = 97; -var f = 102; -function hexDigit(charCode) { - if (charCode < Digit0) { - return 0; - } - if (charCode <= Digit9) { - return charCode - Digit0; - } - if (charCode < a) { - charCode += (a - A); - } - if (charCode >= a && charCode <= f) { - return charCode - a + 10; - } - return 0; -} -function colorFromHex(text) { - if (text[0] !== '#') { - return null; - } - switch (text.length) { - case 4: - return { - red: (hexDigit(text.charCodeAt(1)) * 0x11) / 255.0, - green: (hexDigit(text.charCodeAt(2)) * 0x11) / 255.0, - blue: (hexDigit(text.charCodeAt(3)) * 0x11) / 255.0, - alpha: 1 - }; - case 5: - return { - red: (hexDigit(text.charCodeAt(1)) * 0x11) / 255.0, - green: (hexDigit(text.charCodeAt(2)) * 0x11) / 255.0, - blue: (hexDigit(text.charCodeAt(3)) * 0x11) / 255.0, - alpha: (hexDigit(text.charCodeAt(4)) * 0x11) / 255.0, - }; - case 7: - return { - red: (hexDigit(text.charCodeAt(1)) * 0x10 + hexDigit(text.charCodeAt(2))) / 255.0, - green: (hexDigit(text.charCodeAt(3)) * 0x10 + hexDigit(text.charCodeAt(4))) / 255.0, - blue: (hexDigit(text.charCodeAt(5)) * 0x10 + hexDigit(text.charCodeAt(6))) / 255.0, - alpha: 1 - }; - case 9: - return { - red: (hexDigit(text.charCodeAt(1)) * 0x10 + hexDigit(text.charCodeAt(2))) / 255.0, - green: (hexDigit(text.charCodeAt(3)) * 0x10 + hexDigit(text.charCodeAt(4))) / 255.0, - blue: (hexDigit(text.charCodeAt(5)) * 0x10 + hexDigit(text.charCodeAt(6))) / 255.0, - alpha: (hexDigit(text.charCodeAt(7)) * 0x10 + hexDigit(text.charCodeAt(8))) / 255.0 - }; - } - return null; -} -function colorFrom256RGB(red, green, blue, alpha) { - if (alpha === void 0) { alpha = 1.0; } - return { - red: red / 255.0, - green: green / 255.0, - blue: blue / 255.0, - alpha: alpha }; } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/json.js": -/*!*********************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/json.js ***! - \*********************************************************************************************************/ -/*! exports provided: stringifyObject */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringifyObject", function() { return stringifyObject; }); -/*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the MIT License. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ -function stringifyObject(obj, indent, stringifyLiteral) { - if (obj !== null && typeof obj === 'object') { - var newIndent = indent + '\t'; - if (Array.isArray(obj)) { - if (obj.length === 0) { - return '[]'; - } - var result = '[\n'; - for (var i = 0; i < obj.length; i++) { - result += newIndent + stringifyObject(obj[i], newIndent, stringifyLiteral); - if (i < obj.length - 1) { - result += ','; - } - result += '\n'; - } - result += indent + ']'; - return result; - } - else { - var keys = Object.keys(obj); - if (keys.length === 0) { - return '{}'; - } - var result = '{\n'; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - result += newIndent + JSON.stringify(key) + ': ' + stringifyObject(obj[key], newIndent, stringifyLiteral); - if (i < keys.length - 1) { - result += ','; - } - result += '\n'; - } - result += indent + '}'; - return result; - } - } - return stringifyLiteral(obj); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/objects.js": -/*!************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/objects.js ***! - \************************************************************************************************************/ -/*! exports provided: equals, isNumber, isDefined, isBoolean, isString */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return isNumber; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDefined", function() { return isDefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return isBoolean; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return isString; }); -/*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the MIT License. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ -function equals(one, other) { - if (one === other) { - return true; - } - if (one === null || one === undefined || other === null || other === undefined) { - return false; - } - if (typeof one !== typeof other) { - return false; - } - if (typeof one !== 'object') { - return false; - } - if ((Array.isArray(one)) !== (Array.isArray(other))) { - return false; - } - var i, key; - if (Array.isArray(one)) { - if (one.length !== other.length) { - return false; - } - for (i = 0; i < one.length; i++) { - if (!equals(one[i], other[i])) { - return false; - } - } - } - else { - var oneKeys = []; - for (key in one) { - oneKeys.push(key); - } - oneKeys.sort(); - var otherKeys = []; - for (key in other) { - otherKeys.push(key); - } - otherKeys.sort(); - if (!equals(oneKeys, otherKeys)) { - return false; - } - for (i = 0; i < oneKeys.length; i++) { - if (!equals(one[oneKeys[i]], other[oneKeys[i]])) { - return false; - } - } - } - return true; -} -function isNumber(val) { - return typeof val === 'number'; -} -function isDefined(val) { - return typeof val !== 'undefined'; -} -function isBoolean(val) { - return typeof val === 'boolean'; -} -function isString(val) { - return typeof val === 'string'; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/strings.js": -/*!************************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/utils/strings.js ***! - \************************************************************************************************************/ -/*! exports provided: startsWith, endsWith, convertSimple2RegExpPattern, repeat */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return startsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return endsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertSimple2RegExpPattern", function() { return convertSimple2RegExpPattern; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return repeat; }); -/*--------------------------------------------------------------------------------------------- -* Copyright (c) Microsoft Corporation. All rights reserved. -* Licensed under the MIT License. See License.txt in the project root for license information. -*--------------------------------------------------------------------------------------------*/ -function startsWith(haystack, needle) { - if (haystack.length < needle.length) { - return false; - } - for (var i = 0; i < needle.length; i++) { - if (haystack[i] !== needle[i]) { - return false; - } - } - return true; -} -/** - * Determines if haystack ends with needle. - */ -function endsWith(haystack, needle) { - var diff = haystack.length - needle.length; - if (diff > 0) { - return haystack.lastIndexOf(needle) === diff; - } - else if (diff === 0) { - return haystack === needle; - } - else { - return false; - } -} -function convertSimple2RegExpPattern(pattern) { - return pattern.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&').replace(/[\*]/g, '.*'); -} -function repeat(value, count) { - var s = ''; - while (count > 0) { - if ((count & 1) === 1) { - s += value; - } - value += value; - count = count >>> 1; - } - return s; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-types/main.js": -/*!***************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-types/main.js ***! - \***************************************************************************************************/ -/*! exports provided: Position, Range, Location, LocationLink, Color, ColorInformation, ColorPresentation, FoldingRangeKind, FoldingRange, DiagnosticRelatedInformation, DiagnosticSeverity, Diagnostic, Command, TextEdit, TextDocumentEdit, CreateFile, RenameFile, DeleteFile, WorkspaceEdit, WorkspaceChange, TextDocumentIdentifier, VersionedTextDocumentIdentifier, TextDocumentItem, MarkupKind, MarkupContent, CompletionItemKind, InsertTextFormat, CompletionItem, CompletionList, MarkedString, Hover, ParameterInformation, SignatureInformation, DocumentHighlightKind, DocumentHighlight, SymbolKind, SymbolInformation, DocumentSymbol, CodeActionKind, CodeActionContext, CodeAction, CodeLens, FormattingOptions, DocumentLink, EOL, TextDocument, TextDocumentSaveReason */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Location", function() { return Location; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocationLink", function() { return LocationLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorInformation", function() { return ColorInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPresentation", function() { return ColorPresentation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRangeKind", function() { return FoldingRangeKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRange", function() { return FoldingRange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticRelatedInformation", function() { return DiagnosticRelatedInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticSeverity", function() { return DiagnosticSeverity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Diagnostic", function() { return Diagnostic; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEdit", function() { return TextEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentEdit", function() { return TextDocumentEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CreateFile", function() { return CreateFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenameFile", function() { return RenameFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteFile", function() { return DeleteFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceEdit", function() { return WorkspaceEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceChange", function() { return WorkspaceChange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentIdentifier", function() { return TextDocumentIdentifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VersionedTextDocumentIdentifier", function() { return VersionedTextDocumentIdentifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentItem", function() { return TextDocumentItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupKind", function() { return MarkupKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupContent", function() { return MarkupContent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InsertTextFormat", function() { return InsertTextFormat; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItem", function() { return CompletionItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionList", function() { return CompletionList; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkedString", function() { return MarkedString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hover", function() { return Hover; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParameterInformation", function() { return ParameterInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureInformation", function() { return SignatureInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlight", function() { return DocumentHighlight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolInformation", function() { return SymbolInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentSymbol", function() { return DocumentSymbol; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionKind", function() { return CodeActionKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionContext", function() { return CodeActionContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeAction", function() { return CodeAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeLens", function() { return CodeLens; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattingOptions", function() { return FormattingOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentLink", function() { return DocumentLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EOL", function() { return EOL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocument", function() { return TextDocument; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentSaveReason", function() { return TextDocumentSaveReason; }); -/* -------------------------------------------------------------------------------------------- - * 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 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 = {})); -/** - * 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 = {})); -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 = {})); -/** - * Represents programming constructs like variables, classes, interfaces etc. - * that appear in a document. Document symbols can be hierarchical and they - * have two ranges: one that encloses its definition and one that points to - * its most interesting range, e.g. the range of an identifier. - */ -var DocumentSymbol = /** @class */ (function () { - function DocumentSymbol() { - } - return DocumentSymbol; -}()); - -(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) { - /** - * 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'; -})(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 null) { - 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.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 = {})); -/** - * A document link is a range in a text document that links to an internal or external resource, like another - * text document or a web site. - */ -var DocumentLink = /** @class */ (function () { - function DocumentLink() { - } - return DocumentLink; -}()); - -/** - * The DocumentLink namespace provides helper functions to work with - * [DocumentLink](#DocumentLink) literals. - */ -(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 = {})); -var EOL = ['\n', '\r\n', '\r']; -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 = {})); -/** - * Represents reasons why a text document is saved. - */ -var TextDocumentSaveReason; -(function (TextDocumentSaveReason) { - /** - * Manually triggered, e.g. by the user pressing save, by starting debugging, - * or by an API call. - */ - TextDocumentSaveReason.Manual = 1; - /** - * Automatic after a delay. - */ - TextDocumentSaveReason.AfterDelay = 2; - /** - * When the editor lost focus. - */ - TextDocumentSaveReason.FocusOut = 3; -})(TextDocumentSaveReason || (TextDocumentSaveReason = {})); -var FullTextDocument = /** @class */ (function () { - function FullTextDocument(uri, languageId, version, content) { - this._uri = uri; - this._languageId = languageId; - this._version = version; - this._content = content; - this._lineOffsets = null; - } - 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 = null; - }; - FullTextDocument.prototype.getLineOffsets = function () { - if (this._lineOffsets === null) { - 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 = {})); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-uri/index.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-uri/index.js ***! - \***********************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var isWindows; -if (typeof process === 'object') { - isWindows = process.platform === 'win32'; -} -else if (typeof navigator === 'object') { - var userAgent = navigator.userAgent; - isWindows = userAgent.indexOf('Windows') >= 0; -} -//#endregion -var _schemePattern = /^\w[\w\d+.-]*$/; -var _singleSlashStart = /^\//; -var _doubleSlashStart = /^\/\//; -function _validateUri(ret) { - // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 - // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - if (ret.scheme && !_schemePattern.test(ret.scheme)) { - throw new Error('[UriError]: Scheme contains illegal characters.'); - } - // path, http://tools.ietf.org/html/rfc3986#section-3.3 - // If a URI contains an authority component, then the path component - // must either be empty or begin with a slash ("/") character. If a URI - // does not contain an authority component, then the path cannot begin - // with two slash characters ("//"). - if (ret.path) { - if (ret.authority) { - if (!_singleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); - } - } - else { - if (_doubleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); - } - } - } -} -// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 -function _referenceResolution(scheme, path) { - // the slash-character is our 'default base' as we don't - // support constructing URIs relative to other URIs. This - // also means that we alter and potentially break paths. - // see https://tools.ietf.org/html/rfc3986#section-5.1.4 - switch (scheme) { - case 'https': - case 'http': - case 'file': - if (!path) { - path = _slash; - } - else if (path[0] !== _slash) { - path = _slash + path; - } - break; - } - return path; -} -var _empty = ''; -var _slash = '/'; -var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; -/** - * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. - * This class is a simple parser which creates the basic component parts - * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation - * and encoding. - * - * foo://example.com:8042/over/there?name=ferret#nose - * \_/ \______________/\_________/ \_________/ \__/ - * | | | | | - * scheme authority path query fragment - * | _____________________|__ - * / \ / \ - * urn:example:animal:ferret:nose - */ -var URI = (function () { - /** - * @internal - */ - function URI(schemeOrData, authority, path, query, fragment) { - if (typeof schemeOrData === 'object') { - this.scheme = schemeOrData.scheme || _empty; - this.authority = schemeOrData.authority || _empty; - this.path = schemeOrData.path || _empty; - this.query = schemeOrData.query || _empty; - this.fragment = schemeOrData.fragment || _empty; - // no validation because it's this URI - // that creates uri components. - // _validateUri(this); - } - else { - this.scheme = schemeOrData || _empty; - this.authority = authority || _empty; - this.path = _referenceResolution(this.scheme, path || _empty); - this.query = query || _empty; - this.fragment = fragment || _empty; - _validateUri(this); - } - } - URI.isUri = function (thing) { - if (thing instanceof URI) { - return true; - } - if (!thing) { - return false; - } - return typeof thing.authority === 'string' - && typeof thing.fragment === 'string' - && typeof thing.path === 'string' - && typeof thing.query === 'string' - && typeof thing.scheme === 'string'; - }; - Object.defineProperty(URI.prototype, "fsPath", { - // ---- filesystem path ----------------------- - /** - * Returns a string representing the corresponding file system path of this URI. - * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the - * platform specific path separator. - * - * * Will *not* validate the path for invalid characters and semantics. - * * Will *not* look at the scheme of this URI. - * * The result shall *not* be used for display purposes but for accessing a file on disk. - * - * - * The *difference* to `URI#path` is the use of the platform specific separator and the handling - * of UNC paths. See the below sample of a file-uri with an authority (UNC path). - * - * ```ts - const u = URI.parse('file://server/c$/folder/file.txt') - u.authority === 'server' - u.path === '/shares/c$/file.txt' - u.fsPath === '\\server\c$\folder\file.txt' - ``` - * - * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, - * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working - * with URIs that represent files on disk (`file` scheme). - */ - get: function () { - // if (this.scheme !== 'file') { - // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); - // } - return _makeFsPath(this); - }, - enumerable: true, - configurable: true - }); - // ---- modify to new ------------------------- - URI.prototype.with = function (change) { - if (!change) { - return this; - } - var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment; - if (scheme === void 0) { - scheme = this.scheme; - } - else if (scheme === null) { - scheme = _empty; - } - if (authority === void 0) { - authority = this.authority; - } - else if (authority === null) { - authority = _empty; - } - if (path === void 0) { - path = this.path; - } - else if (path === null) { - path = _empty; - } - if (query === void 0) { - query = this.query; - } - else if (query === null) { - query = _empty; - } - if (fragment === void 0) { - fragment = this.fragment; - } - else if (fragment === null) { - fragment = _empty; - } - if (scheme === this.scheme - && authority === this.authority - && path === this.path - && query === this.query - && fragment === this.fragment) { - return this; - } - return new _URI(scheme, authority, path, query, fragment); - }; - // ---- parse & validate ------------------------ - /** - * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, - * `file:///usr/home`, or `scheme:with/path`. - * - * @param value A string which represents an URI (see `URI#toString`). - */ - URI.parse = function (value) { - var match = _regexp.exec(value); - if (!match) { - return new _URI(_empty, _empty, _empty, _empty, _empty); - } - return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty)); - }; - /** - * Creates a new URI from a file system path, e.g. `c:\my\files`, - * `/usr/home`, or `\\server\share\some\path`. - * - * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument - * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** - * `URI.parse('file://' + path)` because the path might contain characters that are - * interpreted (# and ?). See the following sample: - * ```ts - const good = URI.file('/coding/c#/project1'); - good.scheme === 'file'; - good.path === '/coding/c#/project1'; - good.fragment === ''; - - const bad = URI.parse('file://' + '/coding/c#/project1'); - bad.scheme === 'file'; - bad.path === '/coding/c'; // path is now broken - bad.fragment === '/project1'; - ``` - * - * @param path A file system path (see `URI#fsPath`) - */ - URI.file = function (path) { - var authority = _empty; - // normalize to fwd-slashes on windows, - // on other systems bwd-slashes are valid - // filename character, eg /f\oo/ba\r.txt - if (isWindows) { - path = path.replace(/\\/g, _slash); - } - // check for authority as used in UNC shares - // or use the path as given - if (path[0] === _slash && path[1] === _slash) { - var idx = path.indexOf(_slash, 2); - if (idx === -1) { - authority = path.substring(2); - path = _slash; - } - else { - authority = path.substring(2, idx); - path = path.substring(idx) || _slash; - } - } - return new _URI('file', authority, path, _empty, _empty); - }; - URI.from = function (components) { - return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment); - }; - // ---- printing/externalize --------------------------- - /** - * Creates a string presentation for this URI. It's guardeed that calling - * `URI.parse` with the result of this function creates an URI which is equal - * to this URI. - * - * * The result shall *not* be used for display purposes but for externalization or transport. - * * The result will be encoded using the percentage encoding and encoding happens mostly - * ignore the scheme-specific encoding rules. - * - * @param skipEncoding Do not encode the result, default is `false` - */ - URI.prototype.toString = function (skipEncoding) { - if (skipEncoding === void 0) { skipEncoding = false; } - return _asFormatted(this, skipEncoding); - }; - URI.prototype.toJSON = function () { - return this; - }; - URI.revive = function (data) { - if (!data) { - return data; - } - else if (data instanceof URI) { - return data; - } - else { - var result = new _URI(data); - result._fsPath = data.fsPath; - result._formatted = data.external; - return result; - } - }; - return URI; -}()); -/* harmony default export */ __webpack_exports__["default"] = (URI); -// tslint:disable-next-line:class-name -var _URI = (function (_super) { - __extends(_URI, _super); - function _URI() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._formatted = null; - _this._fsPath = null; - return _this; - } - Object.defineProperty(_URI.prototype, "fsPath", { - get: function () { - if (!this._fsPath) { - this._fsPath = _makeFsPath(this); - } - return this._fsPath; - }, - enumerable: true, - configurable: true - }); - _URI.prototype.toString = function (skipEncoding) { - if (skipEncoding === void 0) { skipEncoding = false; } - if (!skipEncoding) { - if (!this._formatted) { - this._formatted = _asFormatted(this, false); - } - return this._formatted; - } - else { - // we don't cache that - return _asFormatted(this, true); - } - }; - _URI.prototype.toJSON = function () { - var res = { - $mid: 1 - }; - // cached state - if (this._fsPath) { - res.fsPath = this._fsPath; - } - if (this._formatted) { - res.external = this._formatted; - } - // uri components - if (this.path) { - res.path = this.path; - } - if (this.scheme) { - res.scheme = this.scheme; - } - if (this.authority) { - res.authority = this.authority; - } - if (this.query) { - res.query = this.query; - } - if (this.fragment) { - res.fragment = this.fragment; - } - return res; - }; - return _URI; -}(URI)); -// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 -var encodeTable = (_a = {}, - _a[58 /* Colon */] = '%3A', - _a[47 /* Slash */] = '%2F', - _a[63 /* QuestionMark */] = '%3F', - _a[35 /* Hash */] = '%23', - _a[91 /* OpenSquareBracket */] = '%5B', - _a[93 /* CloseSquareBracket */] = '%5D', - _a[64 /* AtSign */] = '%40', - _a[33 /* ExclamationMark */] = '%21', - _a[36 /* DollarSign */] = '%24', - _a[38 /* Ampersand */] = '%26', - _a[39 /* SingleQuote */] = '%27', - _a[40 /* OpenParen */] = '%28', - _a[41 /* CloseParen */] = '%29', - _a[42 /* Asterisk */] = '%2A', - _a[43 /* Plus */] = '%2B', - _a[44 /* Comma */] = '%2C', - _a[59 /* Semicolon */] = '%3B', - _a[61 /* Equals */] = '%3D', - _a[32 /* Space */] = '%20', - _a); -function encodeURIComponentFast(uriComponent, allowSlash) { - var res = undefined; - var nativeEncodePos = -1; - for (var pos = 0; pos < uriComponent.length; pos++) { - var code = uriComponent.charCodeAt(pos); - // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 - if ((code >= 97 /* a */ && code <= 122 /* z */) - || (code >= 65 /* A */ && code <= 90 /* Z */) - || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) - || code === 45 /* Dash */ - || code === 46 /* Period */ - || code === 95 /* Underline */ - || code === 126 /* Tilde */ - || (allowSlash && code === 47 /* Slash */)) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // check if we write into a new string (by default we try to return the param) - if (res !== undefined) { - res += uriComponent.charAt(pos); - } - } - else { - // encoding needed, we need to allocate a new string - if (res === undefined) { - res = uriComponent.substr(0, pos); - } - // check with default table first - var escaped = encodeTable[code]; - if (escaped !== undefined) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // append escaped variant to result - res += escaped; - } - else if (nativeEncodePos === -1) { - // use native encode only when needed - nativeEncodePos = pos; - } - } - } - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); - } - return res !== undefined ? res : uriComponent; -} -function encodeURIComponentMinimal(path) { - var res = undefined; - for (var pos = 0; pos < path.length; pos++) { - var code = path.charCodeAt(pos); - if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { - if (res === undefined) { - res = path.substr(0, pos); - } - res += encodeTable[code]; - } - else { - if (res !== undefined) { - res += path[pos]; - } - } - } - return res !== undefined ? res : path; -} -/** - * Compute `fsPath` for the given uri - * @param uri - */ -function _makeFsPath(uri) { - var value; - if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { - // unc path: file://shares/c$/far/boo - value = "//" + uri.authority + uri.path; - } - else if (uri.path.charCodeAt(0) === 47 /* Slash */ - && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) - && uri.path.charCodeAt(2) === 58 /* Colon */) { - // windows drive letter: file:///c:/far/boo - value = uri.path[1].toLowerCase() + uri.path.substr(2); - } - else { - // other path - value = uri.path; - } - if (isWindows) { - value = value.replace(/\//g, '\\'); - } - return value; -} -/** - * Create the external version of a uri - */ -function _asFormatted(uri, skipEncoding) { - var encoder = !skipEncoding - ? encodeURIComponentFast - : encodeURIComponentMinimal; - var res = ''; - var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment; - if (scheme) { - res += scheme; - res += ':'; - } - if (authority || scheme === 'file') { - res += _slash; - res += _slash; - } - if (authority) { - var idx = authority.indexOf('@'); - if (idx !== -1) { - // @ - var userinfo = authority.substr(0, idx); - authority = authority.substr(idx + 1); - idx = userinfo.indexOf(':'); - if (idx === -1) { - res += encoder(userinfo, false); - } - else { - // :@ - res += encoder(userinfo.substr(0, idx), false); - res += ':'; - res += encoder(userinfo.substr(idx + 1), false); - } - res += '@'; - } - authority = authority.toLowerCase(); - idx = authority.indexOf(':'); - if (idx === -1) { - res += encoder(authority, false); - } - else { - // : - res += encoder(authority.substr(0, idx), false); - res += authority.substr(idx); - } - } - if (path) { - // lower-case windows drive letters in /C:/fff or C:/fff - if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { - var code = path.charCodeAt(1); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3 - } - } - else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { - var code = path.charCodeAt(0); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3 - } - } - // encode the rest of the path - res += encoder(path, true); - } - if (query) { - res += '?'; - res += encoder(query, false); - } - if (fragment) { - res += '#'; - res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; - } - return res; -} -var _a; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/fillers/vscode-nls.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/fillers/vscode-nls.js ***! - \*******************************************************************************/ -/*! exports provided: loadMessageBundle, config */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadMessageBundle", function() { return loadMessageBundle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "config", function() { return config; }); -/*--------------------------------------------------------------------------------------------- - * 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; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/json.worker.js": -/*!************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/json.worker.js ***! - \************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _editor_editor_worker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editor/editor.worker.js */ "./node_modules/monaco-editor/esm/vs/editor/editor.worker.js"); -/* harmony import */ var _jsonWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jsonWorker.js */ "./node_modules/monaco-editor/esm/vs/language/json/jsonWorker.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -self.onmessage = function () { - // ignore the first message - _editor_editor_worker_js__WEBPACK_IMPORTED_MODULE_0__["initialize"](function (ctx, createData) { - return new _jsonWorker_js__WEBPACK_IMPORTED_MODULE_1__["JSONWorker"](ctx, createData); - }); -}; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/json/jsonWorker.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/json/jsonWorker.js ***! - \***********************************************************************/ -/*! exports provided: JSONWorker, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JSONWorker", function() { return JSONWorker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _deps_vscode_json_languageservice_jsonLanguageService_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_deps/vscode-json-languageservice/jsonLanguageService.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/jsonLanguageService.js"); -/* harmony import */ var _deps_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_deps/vscode-languageserver-types/main.js */ "./node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-languageserver-types/main.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/jsonWorker.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -16508,12 +15103,12 @@ var PromiseAdapter = /** @class */ (function () { }; return PromiseAdapter; }()); -var JSONWorker = /** @class */ (function () { +var jsonWorker_JSONWorker = /** @class */ (function () { function JSONWorker(ctx, createData) { this._ctx = ctx; this._languageSettings = createData.languageSettings; this._languageId = createData.languageId; - this._languageService = _deps_vscode_json_languageservice_jsonLanguageService_js__WEBPACK_IMPORTED_MODULE_0__["getLanguageService"]({ + this._languageService = getLanguageService({ schemaRequestService: createData.enableSchemaRequest && defaultSchemaRequestService, promiseConstructor: PromiseAdapter }); @@ -16576,7 +15171,7 @@ var JSONWorker = /** @class */ (function () { for (var _i = 0, models_1 = models; _i < models_1.length; _i++) { var model = models_1[_i]; if (model.uri.toString() === uri) { - return _deps_vscode_languageserver_types_main_js__WEBPACK_IMPORTED_MODULE_1__["TextDocument"].create(uri, this._languageId, model.version, model.getValue()); + return TextDocument.create(uri, this._languageId, model.version, model.getValue()); } } return null; @@ -16584,12 +15179,323 @@ var JSONWorker = /** @class */ (function () { return JSONWorker; }()); -function create(ctx, createData) { - return new JSONWorker(ctx, createData); +function jsonWorker_create(ctx, createData) { + return new jsonWorker_JSONWorker(ctx, createData); } +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/json/json.worker.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + +self.onmessage = function () { + // ignore the first message + initialize(function (ctx, createData) { + return new jsonWorker_JSONWorker(ctx, createData); + }); +}; + + +/***/ }), + +/***/ "URDS": +/***/ (function(module, exports, __webpack_require__) { + +/*! +Copyright (c) 2014 Taylor Hakes +Copyright (c) 2014 Forbes Lindesay + */ +(function (global, factory) { + true ? factory() : + undefined; +}(this, (function () { + 'use strict'; + + /** + * @this {Promise} + */ + function finallyConstructor(callback) { + var constructor = this.constructor; + return this.then( + function (value) { + return constructor.resolve(callback()).then(function () { + return value; + }); + }, + function (reason) { + return constructor.resolve(callback()).then(function () { + return constructor.reject(reason); + }); + } + ); + } + + // Store setTimeout reference so promise-polyfill will be unaffected by + // other code modifying setTimeout (like sinon.useFakeTimers()) + var setTimeoutFunc = setTimeout; + + function noop() { } + + // Polyfill for Function.prototype.bind + function bind(fn, thisArg) { + return function () { + fn.apply(thisArg, arguments); + }; + } + + /** + * @constructor + * @param {Function} fn + */ + function Promise(fn) { + if (!(this instanceof Promise)) + throw new TypeError('Promises must be constructed via new'); + if (typeof fn !== 'function') throw new TypeError('not a function'); + /** @type {!number} */ + this._state = 0; + /** @type {!boolean} */ + this._handled = false; + /** @type {Promise|undefined} */ + this._value = undefined; + /** @type {!Array} */ + this._deferreds = []; + + doResolve(fn, this); + } + + function handle(self, deferred) { + while (self._state === 3) { + self = self._value; + } + if (self._state === 0) { + self._deferreds.push(deferred); + return; + } + self._handled = true; + Promise._immediateFn(function () { + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (self._state === 1 ? resolve : reject)(deferred.promise, self._value); + return; + } + var ret; + try { + ret = cb(self._value); + } catch (e) { + reject(deferred.promise, e); + return; + } + resolve(deferred.promise, ret); + }); + } + + function resolve(self, newValue) { + try { + // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure + if (newValue === self) + throw new TypeError('A promise cannot be resolved with itself.'); + if ( + newValue && + (typeof newValue === 'object' || typeof newValue === 'function') + ) { + var then = newValue.then; + if (newValue instanceof Promise) { + self._state = 3; + self._value = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(bind(then, newValue), self); + return; + } + } + self._state = 1; + self._value = newValue; + finale(self); + } catch (e) { + reject(self, e); + } + } + + function reject(self, newValue) { + self._state = 2; + self._value = newValue; + finale(self); + } + + function finale(self) { + if (self._state === 2 && self._deferreds.length === 0) { + Promise._immediateFn(function () { + if (!self._handled) { + Promise._unhandledRejectionFn(self._value); + } + }); + } + + for (var i = 0, len = self._deferreds.length; i < len; i++) { + handle(self, self._deferreds[i]); + } + self._deferreds = null; + } + + /** + * @constructor + */ + function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; + } + + /** + * Take a potentially misbehaving resolver function and make sure + * onFulfilled and onRejected are only called once. + * + * Makes no guarantees about asynchrony. + */ + function doResolve(fn, self) { + var done = false; + try { + fn( + function (value) { + if (done) return; + done = true; + resolve(self, value); + }, + function (reason) { + if (done) return; + done = true; + reject(self, reason); + } + ); + } catch (ex) { + if (done) return; + done = true; + reject(self, ex); + } + } + + Promise.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); + }; + + Promise.prototype.then = function (onFulfilled, onRejected) { + // @ts-ignore + var prom = new this.constructor(noop); + + handle(this, new Handler(onFulfilled, onRejected, prom)); + return prom; + }; + + Promise.prototype['finally'] = finallyConstructor; + + Promise.all = function (arr) { + return new Promise(function (resolve, reject) { + if (!arr || typeof arr.length === 'undefined') + throw new TypeError('Promise.all accepts an array'); + var args = Array.prototype.slice.call(arr); + if (args.length === 0) return resolve([]); + var remaining = args.length; + + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call( + val, + function (val) { + res(i, val); + }, + reject + ); + return; + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); + } + } + + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + + Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; + } + + return new Promise(function (resolve) { + resolve(value); + }); + }; + + Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); + }; + + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var i = 0, len = values.length; i < len; i++) { + values[i].then(resolve, reject); + } + }); + }; + + // Use polyfill for setImmediate for performance gains + Promise._immediateFn = + (typeof setImmediate === 'function' && + function (fn) { + setImmediate(fn); + }) || + function (fn) { + setTimeoutFunc(fn, 0); + }; + + Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { + if (typeof console !== 'undefined' && console) { + console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console + } + }; + + /** @suppress {undefinedVars} */ + var globalNS = (function () { + // the only reliable means to get the global object is + // `Function('return this')()` + // However, this causes CSP violations in Chrome apps. + if (typeof self !== 'undefined') { + return self; + } + if (typeof window !== 'undefined') { + return window; + } + if (typeof global !== 'undefined') { + return global; + } + throw new Error('unable to locate global object'); + })(); + + if (!('Promise' in globalNS)) { + globalNS['Promise'] = Promise; + } else if (!globalNS.Promise.prototype['finally']) { + globalNS.Promise.prototype['finally'] = finallyConstructor; + } + +}))); + /***/ }) -/******/ }); -//# sourceMappingURL=json.worker.js.map \ No newline at end of file +/******/ }); \ No newline at end of file diff --git a/public/static/monaco/typescript.worker.js b/public/static/monaco/typescript.worker.js index 7038b88..08145f4 100644 --- a/public/static/monaco/typescript.worker.js +++ b/public/static/monaco/typescript.worker.js @@ -87,40 +87,721 @@ /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js"); +/******/ return __webpack_require__(__webpack_require__.s = "0MeG"); /******/ }) /************************************************************************/ /******/ ({ -/***/ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/arrays.js ***! - \*****************************************************************/ -/*! exports provided: tail, tail2, equals, binarySearch, findFirstInSorted, mergeSort, groupBy, coalesce, isFalsyOrEmpty, isNonEmptyArray, distinct, distinctES6, firstIndex, first, flatten, range, arrayInsert, pushToStart, pushToEnd, asArray */ +/***/ "0MeG": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return tail; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tail2", function() { return tail2; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "binarySearch", function() { return binarySearch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findFirstInSorted", function() { return findFirstInSorted; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeSort", function() { return mergeSort; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return groupBy; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "coalesce", function() { return coalesce; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFalsyOrEmpty", function() { return isFalsyOrEmpty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNonEmptyArray", function() { return isNonEmptyArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return distinct; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctES6", function() { return distinctES6; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstIndex", function() { return firstIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return first; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return flatten; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayInsert", function() { return arrayInsert; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushToStart", function() { return pushToStart; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushToEnd", function() { return pushToEnd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asArray", function() { return asArray; }); + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/errors.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Avoid circular dependency on EventEmitter by implementing a subset of the interface. +var ErrorHandler = /** @class */ (function () { + function ErrorHandler() { + this.listeners = []; + this.unexpectedErrorHandler = function (e) { + setTimeout(function () { + if (e.stack) { + throw new Error(e.message + '\n\n' + e.stack); + } + throw e; + }, 0); + }; + } + ErrorHandler.prototype.emit = function (e) { + this.listeners.forEach(function (listener) { + listener(e); + }); + }; + ErrorHandler.prototype.onUnexpectedError = function (e) { + this.unexpectedErrorHandler(e); + this.emit(e); + }; + // For external errors, we don't want the listeners to be called + ErrorHandler.prototype.onUnexpectedExternalError = function (e) { + this.unexpectedErrorHandler(e); + }; + return ErrorHandler; +}()); + +var errorHandler = new ErrorHandler(); +function onUnexpectedError(e) { + // ignore errors from cancelled promises + if (!isPromiseCanceledError(e)) { + errorHandler.onUnexpectedError(e); + } + return undefined; +} +function onUnexpectedExternalError(e) { + // ignore errors from cancelled promises + if (!isPromiseCanceledError(e)) { + errorHandler.onUnexpectedExternalError(e); + } + return undefined; +} +function transformErrorForSerialization(error) { + if (error instanceof Error) { + var name_1 = error.name, message = error.message; + var stack = error.stacktrace || error.stack; + return { + $isError: true, + name: name_1, + message: message, + stack: stack + }; + } + // return as is + return error; +} +var canceledName = 'Canceled'; +/** + * Checks if the given error is a promise in canceled state + */ +function isPromiseCanceledError(error) { + return error instanceof Error && error.name === canceledName && error.message === canceledName; +} +/** + * Returns an error that signals cancellation. + */ +function canceled() { + var error = new Error(canceledName); + error.name = error.message; + return error; +} +function illegalArgument(name) { + if (name) { + return new Error("Illegal argument: " + name); + } + else { + return new Error('Illegal argument'); + } +} +function illegalState(name) { + if (name) { + return new Error("Illegal state: " + name); + } + else { + return new Error('Illegal state'); + } +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js +function isDisposable(thing) { + return typeof thing.dispose === 'function' + && thing.dispose.length === 0; +} +function lifecycle_dispose(first) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + if (Array.isArray(first)) { + first.forEach(function (d) { return d && d.dispose(); }); + return []; + } + else if (rest.length === 0) { + if (first) { + first.dispose(); + return first; + } + return undefined; + } + else { + lifecycle_dispose(first); + lifecycle_dispose(rest); + return []; + } +} +function combinedDisposable(disposables) { + return { dispose: function () { return lifecycle_dispose(disposables); } }; +} +function toDisposable(fn) { + return { dispose: function () { fn(); } }; +} +var Disposable = /** @class */ (function () { + function Disposable() { + this._toDispose = []; + this._lifecycle_disposable_isDisposed = false; + } + Disposable.prototype.dispose = function () { + this._lifecycle_disposable_isDisposed = true; + this._toDispose = lifecycle_dispose(this._toDispose); + }; + Disposable.prototype._register = function (t) { + if (this._lifecycle_disposable_isDisposed) { + console.warn('Registering disposable on object that has already been disposed.'); + t.dispose(); + } + else { + this._toDispose.push(t); + } + return t; + }; + Disposable.None = Object.freeze({ dispose: function () { } }); + return Disposable; +}()); + +var ImmortalReference = /** @class */ (function () { + function ImmortalReference(object) { + this.object = object; + } + ImmortalReference.prototype.dispose = function () { }; + return ImmortalReference; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/platform.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var LANGUAGE_DEFAULT = 'en'; +var _isWindows = false; +var _isMacintosh = false; +var _isLinux = false; +var _isNative = false; +var _isWeb = false; +var _locale = undefined; +var _language = LANGUAGE_DEFAULT; +var _translationsConfigFile = undefined; +var isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer'); +// OS detection +if (typeof navigator === 'object' && !isElectronRenderer) { + var userAgent = navigator.userAgent; + _isWindows = userAgent.indexOf('Windows') >= 0; + _isMacintosh = userAgent.indexOf('Macintosh') >= 0; + _isLinux = userAgent.indexOf('Linux') >= 0; + _isWeb = true; + _locale = navigator.language; + _language = _locale; +} +else if (typeof process === 'object') { + _isWindows = (process.platform === 'win32'); + _isMacintosh = (process.platform === 'darwin'); + _isLinux = (process.platform === 'linux'); + _locale = LANGUAGE_DEFAULT; + _language = LANGUAGE_DEFAULT; + var rawNlsConfig = process.env['VSCODE_NLS_CONFIG']; + if (rawNlsConfig) { + try { + var nlsConfig = JSON.parse(rawNlsConfig); + var resolved = nlsConfig.availableLanguages['*']; + _locale = nlsConfig.locale; + // VSCode's default language is 'en' + _language = resolved ? resolved : LANGUAGE_DEFAULT; + _translationsConfigFile = nlsConfig._translationsConfigFile; + } + catch (e) { + } + } + _isNative = true; +} +var _platform = 0 /* Web */; +if (_isNative) { + if (_isMacintosh) { + _platform = 1 /* Mac */; + } + else if (_isWindows) { + _platform = 3 /* Windows */; + } + else if (_isLinux) { + _platform = 2 /* Linux */; + } +} +var isWindows = _isWindows; +var isMacintosh = _isMacintosh; +var isLinux = _isLinux; +var isNative = _isNative; +var isWeb = _isWeb; +var _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {}); +var globals = _globals; +var _setImmediate = null; +function setImmediate(callback) { + if (_setImmediate === null) { + if (globals.setImmediate) { + _setImmediate = globals.setImmediate.bind(globals); + } + else if (typeof process !== 'undefined' && typeof process.nextTick === 'function') { + _setImmediate = process.nextTick.bind(process); + } + else { + _setImmediate = globals.setTimeout.bind(globals); + } + } + return _setImmediate(callback); +} +var OS = (_isMacintosh ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */)); + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/types.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var _typeof = { + number: 'number', + string: 'string', + undefined: 'undefined', + object: 'object', + function: 'function' +}; +/** + * @returns whether the provided parameter is a JavaScript Array or not. + */ +function isArray(array) { + if (Array.isArray) { + return Array.isArray(array); + } + if (array && typeof (array.length) === _typeof.number && array.constructor === Array) { + return true; + } + return false; +} +/** + * @returns whether the provided parameter is a JavaScript String or not. + */ +function isString(str) { + if (typeof (str) === _typeof.string || str instanceof String) { + return true; + } + return false; +} +/** + * + * @returns whether the provided parameter is of type `object` but **not** + * `null`, an `array`, a `regexp`, nor a `date`. + */ +function isObject(obj) { + // The method can't do a type cast since there are type (like strings) which + // are subclasses of any put not positvely matched by the function. Hence type + // narrowing results in wrong results. + return typeof obj === _typeof.object + && obj !== null + && !Array.isArray(obj) + && !(obj instanceof RegExp) + && !(obj instanceof Date); +} +/** + * In **contrast** to just checking `typeof` this will return `false` for `NaN`. + * @returns whether the provided parameter is a JavaScript Number or not. + */ +function isNumber(obj) { + if ((typeof (obj) === _typeof.number || obj instanceof Number) && !isNaN(obj)) { + return true; + } + return false; +} +/** + * @returns whether the provided parameter is a JavaScript Boolean or not. + */ +function isBoolean(obj) { + return obj === true || obj === false; +} +/** + * @returns whether the provided parameter is undefined. + */ +function isUndefined(obj) { + return typeof (obj) === _typeof.undefined; +} +/** + * @returns whether the provided parameter is undefined or null. + */ +function isUndefinedOrNull(obj) { + return isUndefined(obj) || obj === null; +} +var types_hasOwnProperty = Object.prototype.hasOwnProperty; +/** + * @returns whether the provided parameter is an empty JavaScript Object or not. + */ +function isEmptyObject(obj) { + if (!isObject(obj)) { + return false; + } + for (var key in obj) { + if (types_hasOwnProperty.call(obj, key)) { + return false; + } + } + return true; +} +/** + * @returns whether the provided parameter is a JavaScript Function or not. + */ +function isFunction(obj) { + return typeof obj === _typeof.function; +} +function validateConstraints(args, constraints) { + var len = Math.min(args.length, constraints.length); + for (var i = 0; i < len; i++) { + validateConstraint(args[i], constraints[i]); + } +} +function validateConstraint(arg, constraint) { + if (isString(constraint)) { + if (typeof arg !== constraint) { + throw new Error("argument does not match constraint: typeof " + constraint); + } + } + else if (isFunction(constraint)) { + try { + if (arg instanceof constraint) { + return; + } + } + catch (_a) { + // ignore + } + if (!isUndefinedOrNull(arg) && arg.constructor === constraint) { + return; + } + if (constraint.length === 1 && constraint.call(undefined, arg) === true) { + return; + } + throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true"); + } +} +function getAllPropertyNames(obj) { + var res = []; + var proto = Object.getPrototypeOf(obj); + while (Object.prototype !== proto) { + res = res.concat(Object.getOwnPropertyNames(proto)); + proto = Object.getPrototypeOf(proto); + } + return res; +} +/** + * Converts null to undefined, passes all other values through. + */ +function withNullAsUndefined(x) { + return x === null ? undefined : x; +} +/** + * Converts undefined to null, passes all other values through. + */ +function withUndefinedAsNull(x) { + return typeof x === 'undefined' ? null : x; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var __extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + +var INITIALIZE = '$initialize'; +var webWorkerWarningLogged = false; +function logOnceWebWorkerWarning(err) { + if (!isWeb) { + // running tests + return; + } + if (!webWorkerWarningLogged) { + webWorkerWarningLogged = true; + console.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq'); + } + console.warn(err.message); +} +var simpleWorker_SimpleWorkerProtocol = /** @class */ (function () { + function SimpleWorkerProtocol(handler) { + this._workerId = -1; + this._handler = handler; + this._lastSentReq = 0; + this._pendingReplies = Object.create(null); + } + SimpleWorkerProtocol.prototype.setWorkerId = function (workerId) { + this._workerId = workerId; + }; + SimpleWorkerProtocol.prototype.sendMessage = function (method, args) { + var _this = this; + var req = String(++this._lastSentReq); + return new Promise(function (resolve, reject) { + _this._pendingReplies[req] = { + resolve: resolve, + reject: reject + }; + _this._send({ + vsWorker: _this._workerId, + req: req, + method: method, + args: args + }); + }); + }; + SimpleWorkerProtocol.prototype.handleMessage = function (serializedMessage) { + var message; + try { + message = JSON.parse(serializedMessage); + } + catch (e) { + // nothing + return; + } + if (!message || !message.vsWorker) { + return; + } + if (this._workerId !== -1 && message.vsWorker !== this._workerId) { + return; + } + this._handleMessage(message); + }; + SimpleWorkerProtocol.prototype._handleMessage = function (msg) { + var _this = this; + if (msg.seq) { + var replyMessage = msg; + if (!this._pendingReplies[replyMessage.seq]) { + console.warn('Got reply to unknown seq'); + return; + } + var reply = this._pendingReplies[replyMessage.seq]; + delete this._pendingReplies[replyMessage.seq]; + if (replyMessage.err) { + var err = replyMessage.err; + if (replyMessage.err.$isError) { + err = new Error(); + err.name = replyMessage.err.name; + err.message = replyMessage.err.message; + err.stack = replyMessage.err.stack; + } + reply.reject(err); + return; + } + reply.resolve(replyMessage.res); + return; + } + var requestMessage = msg; + var req = requestMessage.req; + var result = this._handler.handleMessage(requestMessage.method, requestMessage.args); + result.then(function (r) { + _this._send({ + vsWorker: _this._workerId, + seq: req, + res: r, + err: undefined + }); + }, function (e) { + if (e.detail instanceof Error) { + // Loading errors have a detail property that points to the actual error + e.detail = transformErrorForSerialization(e.detail); + } + _this._send({ + vsWorker: _this._workerId, + seq: req, + res: undefined, + err: transformErrorForSerialization(e) + }); + }); + }; + SimpleWorkerProtocol.prototype._send = function (msg) { + var strMsg = JSON.stringify(msg); + // console.log('SENDING: ' + strMsg); + this._handler.sendMessage(strMsg); + }; + return SimpleWorkerProtocol; +}()); +/** + * Main thread side + */ +var SimpleWorkerClient = /** @class */ (function (_super) { + __extends(SimpleWorkerClient, _super); + function SimpleWorkerClient(workerFactory, moduleId) { + var _this = _super.call(this) || this; + var lazyProxyReject = null; + _this._worker = _this._register(workerFactory.create('vs/base/common/worker/simpleWorker', function (msg) { + _this._protocol.handleMessage(msg); + }, function (err) { + // in Firefox, web workers fail lazily :( + // we will reject the proxy + if (lazyProxyReject) { + lazyProxyReject(err); + } + })); + _this._protocol = new simpleWorker_SimpleWorkerProtocol({ + sendMessage: function (msg) { + _this._worker.postMessage(msg); + }, + handleMessage: function (method, args) { + // Intentionally not supporting worker -> main requests + return Promise.resolve(null); + } + }); + _this._protocol.setWorkerId(_this._worker.getId()); + // Gather loader configuration + var loaderConfiguration = null; + if (typeof self.require !== 'undefined' && typeof self.require.getConfig === 'function') { + // Get the configuration from the Monaco AMD Loader + loaderConfiguration = self.require.getConfig(); + } + else if (typeof self.requirejs !== 'undefined') { + // Get the configuration from requirejs + loaderConfiguration = self.requirejs.s.contexts._.config; + } + // Send initialize message + _this._onModuleLoaded = _this._protocol.sendMessage(INITIALIZE, [ + _this._worker.getId(), + moduleId, + loaderConfiguration + ]); + _this._lazyProxy = new Promise(function (resolve, reject) { + lazyProxyReject = reject; + _this._onModuleLoaded.then(function (availableMethods) { + var proxy = {}; + for (var _i = 0, availableMethods_1 = availableMethods; _i < availableMethods_1.length; _i++) { + var methodName = availableMethods_1[_i]; + proxy[methodName] = createProxyMethod(methodName, proxyMethodRequest); + } + resolve(proxy); + }, function (e) { + reject(e); + _this._onError('Worker failed to load ' + moduleId, e); + }); + }); + // Create proxy to loaded code + var proxyMethodRequest = function (method, args) { + return _this._request(method, args); + }; + var createProxyMethod = function (method, proxyMethodRequest) { + return function () { + var args = Array.prototype.slice.call(arguments, 0); + return proxyMethodRequest(method, args); + }; + }; + return _this; + } + SimpleWorkerClient.prototype.getProxyObject = function () { + return this._lazyProxy; + }; + SimpleWorkerClient.prototype._request = function (method, args) { + var _this = this; + return new Promise(function (resolve, reject) { + _this._onModuleLoaded.then(function () { + _this._protocol.sendMessage(method, args).then(resolve, reject); + }, reject); + }); + }; + SimpleWorkerClient.prototype._onError = function (message, error) { + console.error(message); + console.info(error); + }; + return SimpleWorkerClient; +}(Disposable)); + +/** + * Worker side + */ +var simpleWorker_SimpleWorkerServer = /** @class */ (function () { + function SimpleWorkerServer(postSerializedMessage, requestHandler) { + var _this = this; + this._requestHandler = requestHandler; + this._protocol = new simpleWorker_SimpleWorkerProtocol({ + sendMessage: function (msg) { + postSerializedMessage(msg); + }, + handleMessage: function (method, args) { return _this._handleMessage(method, args); } + }); + } + SimpleWorkerServer.prototype.onmessage = function (msg) { + this._protocol.handleMessage(msg); + }; + SimpleWorkerServer.prototype._handleMessage = function (method, args) { + if (method === INITIALIZE) { + return this.initialize(args[0], args[1], args[2]); + } + if (!this._requestHandler || typeof this._requestHandler[method] !== 'function') { + return Promise.reject(new Error('Missing requestHandler or method: ' + method)); + } + try { + return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args)); + } + catch (e) { + return Promise.reject(e); + } + }; + SimpleWorkerServer.prototype.initialize = function (workerId, moduleId, loaderConfig) { + var _this = this; + this._protocol.setWorkerId(workerId); + if (this._requestHandler) { + // static request handler + var methods = []; + for (var _i = 0, _a = getAllPropertyNames(this._requestHandler); _i < _a.length; _i++) { + var prop = _a[_i]; + if (typeof this._requestHandler[prop] === 'function') { + methods.push(prop); + } + } + return Promise.resolve(methods); + } + if (loaderConfig) { + // Remove 'baseUrl', handling it is beyond scope for now + if (typeof loaderConfig.baseUrl !== 'undefined') { + delete loaderConfig['baseUrl']; + } + if (typeof loaderConfig.paths !== 'undefined') { + if (typeof loaderConfig.paths.vs !== 'undefined') { + delete loaderConfig.paths['vs']; + } + } + // Since this is in a web worker, enable catching errors + loaderConfig.catchError = true; + self.require.config(loaderConfig); + } + return new Promise(function (resolve, reject) { + // Use the global require to be sure to get the global config + self.require([moduleId], function () { + var result = []; + for (var _i = 0; _i < arguments.length; _i++) { + result[_i] = arguments[_i]; + } + var handlerModule = result[0]; + _this._requestHandler = handlerModule.create(); + if (!_this._requestHandler) { + reject(new Error("No RequestHandler!")); + return; + } + var methods = []; + for (var _a = 0, _b = getAllPropertyNames(_this._requestHandler); _a < _b.length; _a++) { + var prop = _b[_a]; + if (typeof _this._requestHandler[prop] === 'function') { + methods.push(prop); + } + } + resolve(methods); + }, reject); + }); + }; + return SimpleWorkerServer; +}()); + +/** + * Called on the worker side + */ +function create(postMessage) { + return new simpleWorker_SimpleWorkerServer(postMessage, null); +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/arrays.js /** * Returns the last element of an array. * @param array The array. @@ -323,7 +1004,7 @@ function flatten(arr) { var _a; return (_a = []).concat.apply(_a, arr); } -function range(arg, to) { +function arrays_range(arg, to) { var from = typeof to === 'number' ? arg : 0; if (typeof to === 'number') { from = arg; @@ -378,161 +1059,43 @@ function asArray(x) { return Array.isArray(x) ? x : [x]; } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/cancellation.js ***! - \***********************************************************************/ -/*! exports provided: CancellationToken, CancellationTokenSource */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationToken", function() { return CancellationToken; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationTokenSource", function() { return CancellationTokenSource; }); -/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -var shortcutEvent = Object.freeze(function (callback, context) { - var handle = setTimeout(callback.bind(context), 0); - return { dispose: function () { clearTimeout(handle); } }; -}); -var CancellationToken; -(function (CancellationToken) { - function isCancellationToken(thing) { - if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) { - return true; - } - if (thing instanceof MutableToken) { - return true; - } - if (!thing || typeof thing !== 'object') { - return false; - } - return typeof thing.isCancellationRequested === 'boolean' - && typeof thing.onCancellationRequested === 'function'; +/** + * Represents information about a specific difference between two sequences. + */ +var DiffChange = /** @class */ (function () { + /** + * Constructs a new DiffChange with the given sequence information + * and content. + */ + function DiffChange(originalStart, originalLength, modifiedStart, modifiedLength) { + //Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0"); + this.originalStart = originalStart; + this.originalLength = originalLength; + this.modifiedStart = modifiedStart; + this.modifiedLength = modifiedLength; } - CancellationToken.isCancellationToken = isCancellationToken; - CancellationToken.None = Object.freeze({ - isCancellationRequested: false, - onCancellationRequested: _event_js__WEBPACK_IMPORTED_MODULE_0__["Event"].None - }); - CancellationToken.Cancelled = Object.freeze({ - isCancellationRequested: true, - onCancellationRequested: shortcutEvent - }); -})(CancellationToken || (CancellationToken = {})); -var MutableToken = /** @class */ (function () { - function MutableToken() { - this._isCancelled = false; - this._emitter = null; - } - MutableToken.prototype.cancel = function () { - if (!this._isCancelled) { - this._isCancelled = true; - if (this._emitter) { - this._emitter.fire(undefined); - this.dispose(); - } - } + /** + * The end point (exclusive) of the change in the original sequence. + */ + DiffChange.prototype.getOriginalEnd = function () { + return this.originalStart + this.originalLength; }; - Object.defineProperty(MutableToken.prototype, "isCancellationRequested", { - get: function () { - return this._isCancelled; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(MutableToken.prototype, "onCancellationRequested", { - get: function () { - if (this._isCancelled) { - return shortcutEvent; - } - if (!this._emitter) { - this._emitter = new _event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"](); - } - return this._emitter.event; - }, - enumerable: true, - configurable: true - }); - MutableToken.prototype.dispose = function () { - if (this._emitter) { - this._emitter.dispose(); - this._emitter = null; - } + /** + * The end point (exclusive) of the change in the modified sequence. + */ + DiffChange.prototype.getModifiedEnd = function () { + return this.modifiedStart + this.modifiedLength; }; - return MutableToken; -}()); -var CancellationTokenSource = /** @class */ (function () { - function CancellationTokenSource(parent) { - this._token = undefined; - this._parentListener = undefined; - this._parentListener = parent && parent.onCancellationRequested(this.cancel, this); - } - Object.defineProperty(CancellationTokenSource.prototype, "token", { - get: function () { - if (!this._token) { - // be lazy and create the token only when - // actually needed - this._token = new MutableToken(); - } - return this._token; - }, - enumerable: true, - configurable: true - }); - CancellationTokenSource.prototype.cancel = function () { - if (!this._token) { - // save an object by returning the default - // cancelled token when cancellation happens - // before someone asks for the token - this._token = CancellationToken.Cancelled; - } - else if (this._token instanceof MutableToken) { - // actually cancel - this._token.cancel(); - } - }; - CancellationTokenSource.prototype.dispose = function () { - if (this._parentListener) { - this._parentListener.dispose(); - } - if (!this._token) { - // ensure to initialize with an empty token if we had none - this._token = CancellationToken.None; - } - else if (this._token instanceof MutableToken) { - // actually dispose - this._token.dispose(); - } - }; - return CancellationTokenSource; + return DiffChange; }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js ***! - \********************************************************************/ -/*! exports provided: stringDiff, Debug, MyArray, LcsDiff */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringDiff", function() { return stringDiff; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Debug", function() { return Debug; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MyArray", function() { return MyArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LcsDiff", function() { return LcsDiff; }); -/* harmony import */ var _diffChange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diffChange.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -545,7 +1108,7 @@ function createStringSequence(a) { }; } function stringDiff(original, modified, pretty) { - return new LcsDiff(createStringSequence(original), createStringSequence(modified)).ComputeDiff(pretty); + return new diff_LcsDiff(createStringSequence(original), createStringSequence(modified)).ComputeDiff(pretty); } // // The code below has been ported from a C# implementation in VS @@ -608,7 +1171,7 @@ var MaxDifferencesHistory = 1447; * distinct changes. At the end, the Changes property can be called to retrieve * the constructed changes. */ -var DiffChangeHelper = /** @class */ (function () { +var diff_DiffChangeHelper = /** @class */ (function () { /** * Constructs a new DiffChangeHelper for the given DiffSequences. */ @@ -626,7 +1189,7 @@ var DiffChangeHelper = /** @class */ (function () { // Only add to the list if there is something to add if (this.m_originalCount > 0 || this.m_modifiedCount > 0) { // Add the new change to our list - this.m_changes.push(new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)); + this.m_changes.push(new DiffChange(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)); } // Reset for the next change this.m_originalCount = 0; @@ -687,7 +1250,7 @@ var DiffChangeHelper = /** @class */ (function () { * An implementation of the difference algorithm described in * "An O(ND) Difference Algorithm and its variations" by Eugene W. Myers */ -var LcsDiff = /** @class */ (function () { +var diff_LcsDiff = /** @class */ (function () { /** * Constructs the DiffFinder */ @@ -751,14 +1314,14 @@ var LcsDiff = /** @class */ (function () { Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd'); // All insertions changes = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1) + new DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1) ]; } else if (originalStart <= originalEnd) { Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd'); // All deletions changes = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, 0) + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0) ]; } else { @@ -793,20 +1356,20 @@ var LcsDiff = /** @class */ (function () { // We did't have time to finish the first half, so we don't have time to compute this half. // Consider the entire rest of the sequence different. rightChanges = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1) + new DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1) ]; } return this.ConcatenateChanges(leftChanges, rightChanges); } // If we hit here, we quit early, and so can't return anything meaningful return [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) ]; }; LcsDiff.prototype.WALKTRACE = function (diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) { var forwardChanges = null, reverseChanges = null; // First, walk backward through the forward diagonals history - var changeHelper = new DiffChangeHelper(); + var changeHelper = new diff_DiffChangeHelper(); var diagonalMin = diagonalForwardStart; var diagonalMax = diagonalForwardEnd; var diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalForwardOffset; @@ -860,12 +1423,12 @@ var LcsDiff = /** @class */ (function () { modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd()); } reverseChanges = [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1) + new DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1) ]; } else { // Now walk backward through the reverse diagonals history - changeHelper = new DiffChangeHelper(); + changeHelper = new diff_DiffChangeHelper(); diagonalMin = diagonalReverseStart; diagonalMax = diagonalReverseEnd; diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalReverseOffset; @@ -1048,7 +1611,7 @@ var LcsDiff = /** @class */ (function () { originalStart++; modifiedStart++; return [ - new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) + new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1) ]; } } @@ -1279,7 +1842,7 @@ var LcsDiff = /** @class */ (function () { if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) { modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart; } - mergedChangeArr[0] = new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalLength, modifiedStart, modifiedLength); + mergedChangeArr[0] = new DiffChange(originalStart, originalLength, modifiedStart, modifiedLength); return true; } else { @@ -1322,952 +1885,12 @@ var LcsDiff = /** @class */ (function () { }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js ***! - \**************************************************************************/ -/*! exports provided: DiffChange */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffChange", function() { return DiffChange; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/iterator.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -/** - * Represents information about a specific difference between two sequences. - */ -var DiffChange = /** @class */ (function () { - /** - * Constructs a new DiffChange with the given sequence information - * and content. - */ - function DiffChange(originalStart, originalLength, modifiedStart, modifiedLength) { - //Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0"); - this.originalStart = originalStart; - this.originalLength = originalLength; - this.modifiedStart = modifiedStart; - this.modifiedLength = modifiedLength; - } - /** - * The end point (exclusive) of the change in the original sequence. - */ - DiffChange.prototype.getOriginalEnd = function () { - return this.originalStart + this.originalLength; - }; - /** - * The end point (exclusive) of the change in the modified sequence. - */ - DiffChange.prototype.getModifiedEnd = function () { - return this.modifiedStart + this.modifiedLength; - }; - return DiffChange; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/errors.js": -/*!*****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/errors.js ***! - \*****************************************************************/ -/*! exports provided: ErrorHandler, errorHandler, onUnexpectedError, onUnexpectedExternalError, transformErrorForSerialization, isPromiseCanceledError, canceled, illegalArgument, illegalState */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorHandler", function() { return ErrorHandler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "errorHandler", function() { return errorHandler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedError", function() { return onUnexpectedError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedExternalError", function() { return onUnexpectedExternalError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformErrorForSerialization", function() { return transformErrorForSerialization; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPromiseCanceledError", function() { return isPromiseCanceledError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canceled", function() { return canceled; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalArgument", function() { return illegalArgument; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalState", function() { return illegalState; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -// Avoid circular dependency on EventEmitter by implementing a subset of the interface. -var ErrorHandler = /** @class */ (function () { - function ErrorHandler() { - this.listeners = []; - this.unexpectedErrorHandler = function (e) { - setTimeout(function () { - if (e.stack) { - throw new Error(e.message + '\n\n' + e.stack); - } - throw e; - }, 0); - }; - } - ErrorHandler.prototype.emit = function (e) { - this.listeners.forEach(function (listener) { - listener(e); - }); - }; - ErrorHandler.prototype.onUnexpectedError = function (e) { - this.unexpectedErrorHandler(e); - this.emit(e); - }; - // For external errors, we don't want the listeners to be called - ErrorHandler.prototype.onUnexpectedExternalError = function (e) { - this.unexpectedErrorHandler(e); - }; - return ErrorHandler; -}()); - -var errorHandler = new ErrorHandler(); -function onUnexpectedError(e) { - // ignore errors from cancelled promises - if (!isPromiseCanceledError(e)) { - errorHandler.onUnexpectedError(e); - } - return undefined; -} -function onUnexpectedExternalError(e) { - // ignore errors from cancelled promises - if (!isPromiseCanceledError(e)) { - errorHandler.onUnexpectedExternalError(e); - } - return undefined; -} -function transformErrorForSerialization(error) { - if (error instanceof Error) { - var name_1 = error.name, message = error.message; - var stack = error.stacktrace || error.stack; - return { - $isError: true, - name: name_1, - message: message, - stack: stack - }; - } - // return as is - return error; -} -var canceledName = 'Canceled'; -/** - * Checks if the given error is a promise in canceled state - */ -function isPromiseCanceledError(error) { - return error instanceof Error && error.name === canceledName && error.message === canceledName; -} -/** - * Returns an error that signals cancellation. - */ -function canceled() { - var error = new Error(canceledName); - error.name = error.message; - return error; -} -function illegalArgument(name) { - if (name) { - return new Error("Illegal argument: " + name); - } - else { - return new Error('Illegal argument'); - } -} -function illegalState(name) { - if (name) { - return new Error("Illegal state: " + name); - } - else { - return new Error('Illegal state'); - } -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/event.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/event.js ***! - \****************************************************************/ -/*! exports provided: Event, Emitter, PauseableEmitter, EventMultiplexer, EventBufferer, Relay */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Event", function() { return Event; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Emitter", function() { return Emitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PauseableEmitter", function() { return PauseableEmitter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventMultiplexer", function() { return EventMultiplexer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventBufferer", function() { return EventBufferer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Relay", function() { return Relay; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _functional_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functional.js */ "./node_modules/monaco-editor/esm/vs/base/common/functional.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _linkedList_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./linkedList.js */ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -var Event; -(function (Event) { - var _disposable = { dispose: function () { } }; - Event.None = function () { return _disposable; }; - /** - * Given an event, returns another event which only fires once. - */ - function once(event) { - return function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - // we need this, in case the event fires during the listener call - var didFire = false; - var result; - result = event(function (e) { - if (didFire) { - return; - } - else if (result) { - result.dispose(); - } - else { - didFire = true; - } - return listener.call(thisArgs, e); - }, null, disposables); - if (didFire) { - result.dispose(); - } - return result; - }; - } - Event.once = once; - /** - * Given an event and a `map` function, returns another event which maps each element - * throught the mapping function. - */ - function map(event, map) { - return snapshot(function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return event(function (i) { return listener.call(thisArgs, map(i)); }, null, disposables); - }); - } - Event.map = map; - /** - * Given an event and an `each` function, returns another identical event and calls - * the `each` function per each element. - */ - function forEach(event, each) { - return snapshot(function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return event(function (i) { each(i); listener.call(thisArgs, i); }, null, disposables); - }); - } - Event.forEach = forEach; - function filter(event, filter) { - return snapshot(function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return event(function (e) { return filter(e) && listener.call(thisArgs, e); }, null, disposables); - }); - } - Event.filter = filter; - /** - * Given an event, returns the same event but typed as `Event`. - */ - function signal(event) { - return event; - } - Event.signal = signal; - /** - * Given a collection of events, returns a single event which emits - * whenever any of the provided events emit. - */ - function any() { - var events = []; - for (var _i = 0; _i < arguments.length; _i++) { - events[_i] = arguments[_i]; - } - return function (listener, thisArgs, disposables) { - if (thisArgs === void 0) { thisArgs = null; } - return Object(_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["combinedDisposable"])(events.map(function (event) { return event(function (e) { return listener.call(thisArgs, e); }, null, disposables); })); - }; - } - Event.any = any; - /** - * Given an event and a `merge` function, returns another event which maps each element - * and the cummulative result throught the `merge` function. Similar to `map`, but with memory. - */ - function reduce(event, merge, initial) { - var output = initial; - return map(event, function (e) { - output = merge(output, e); - return output; - }); - } - Event.reduce = reduce; - /** - * Given a chain of event processing functions (filter, map, etc), each - * function will be invoked per event & per listener. Snapshotting an event - * chain allows each function to be invoked just once per event. - */ - function snapshot(event) { - var listener; - var emitter = new Emitter({ - onFirstListenerAdd: function () { - listener = event(emitter.fire, emitter); - }, - onLastListenerRemove: function () { - listener.dispose(); - } - }); - return emitter.event; - } - Event.snapshot = snapshot; - function debounce(event, merge, delay, leading, leakWarningThreshold) { - if (delay === void 0) { delay = 100; } - if (leading === void 0) { leading = false; } - var subscription; - var output = undefined; - var handle = undefined; - var numDebouncedCalls = 0; - var emitter = new Emitter({ - leakWarningThreshold: leakWarningThreshold, - onFirstListenerAdd: function () { - subscription = event(function (cur) { - numDebouncedCalls++; - output = merge(output, cur); - if (leading && !handle) { - emitter.fire(output); - } - clearTimeout(handle); - handle = setTimeout(function () { - var _output = output; - output = undefined; - handle = undefined; - if (!leading || numDebouncedCalls > 1) { - emitter.fire(_output); - } - numDebouncedCalls = 0; - }, delay); - }); - }, - onLastListenerRemove: function () { - subscription.dispose(); - } - }); - return emitter.event; - } - Event.debounce = debounce; - /** - * Given an event, it returns another event which fires only once and as soon as - * the input event emits. The event data is the number of millis it took for the - * event to fire. - */ - function stopwatch(event) { - var start = new Date().getTime(); - return map(once(event), function (_) { return new Date().getTime() - start; }); - } - Event.stopwatch = stopwatch; - /** - * Given an event, it returns another event which fires only when the event - * element changes. - */ - function latch(event) { - var firstCall = true; - var cache; - return filter(event, function (value) { - var shouldEmit = firstCall || value !== cache; - firstCall = false; - cache = value; - return shouldEmit; - }); - } - Event.latch = latch; - /** - * Buffers the provided event until a first listener comes - * along, at which point fire all the events at once and - * pipe the event from then on. - * - * ```typescript - * const emitter = new Emitter(); - * const event = emitter.event; - * const bufferedEvent = buffer(event); - * - * emitter.fire(1); - * emitter.fire(2); - * emitter.fire(3); - * // nothing... - * - * const listener = bufferedEvent(num => console.log(num)); - * // 1, 2, 3 - * - * emitter.fire(4); - * // 4 - * ``` - */ - function buffer(event, nextTick, _buffer) { - if (nextTick === void 0) { nextTick = false; } - if (_buffer === void 0) { _buffer = []; } - var buffer = _buffer.slice(); - var listener = event(function (e) { - if (buffer) { - buffer.push(e); - } - else { - emitter.fire(e); - } - }); - var flush = function () { - if (buffer) { - buffer.forEach(function (e) { return emitter.fire(e); }); - } - buffer = null; - }; - var emitter = new Emitter({ - onFirstListenerAdd: function () { - if (!listener) { - listener = event(function (e) { return emitter.fire(e); }); - } - }, - onFirstListenerDidAdd: function () { - if (buffer) { - if (nextTick) { - setTimeout(flush); - } - else { - flush(); - } - } - }, - onLastListenerRemove: function () { - if (listener) { - listener.dispose(); - } - listener = null; - } - }); - return emitter.event; - } - Event.buffer = buffer; - var ChainableEvent = /** @class */ (function () { - function ChainableEvent(event) { - this.event = event; - } - ChainableEvent.prototype.map = function (fn) { - return new ChainableEvent(map(this.event, fn)); - }; - ChainableEvent.prototype.forEach = function (fn) { - return new ChainableEvent(forEach(this.event, fn)); - }; - ChainableEvent.prototype.filter = function (fn) { - return new ChainableEvent(filter(this.event, fn)); - }; - ChainableEvent.prototype.reduce = function (merge, initial) { - return new ChainableEvent(reduce(this.event, merge, initial)); - }; - ChainableEvent.prototype.latch = function () { - return new ChainableEvent(latch(this.event)); - }; - ChainableEvent.prototype.on = function (listener, thisArgs, disposables) { - return this.event(listener, thisArgs, disposables); - }; - ChainableEvent.prototype.once = function (listener, thisArgs, disposables) { - return once(this.event)(listener, thisArgs, disposables); - }; - return ChainableEvent; - }()); - function chain(event) { - return new ChainableEvent(event); - } - Event.chain = chain; - function fromNodeEventEmitter(emitter, eventName, map) { - if (map === void 0) { map = function (id) { return id; }; } - var fn = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return result.fire(map.apply(void 0, args)); - }; - var onFirstListenerAdd = function () { return emitter.on(eventName, fn); }; - var onLastListenerRemove = function () { return emitter.removeListener(eventName, fn); }; - var result = new Emitter({ onFirstListenerAdd: onFirstListenerAdd, onLastListenerRemove: onLastListenerRemove }); - return result.event; - } - Event.fromNodeEventEmitter = fromNodeEventEmitter; - function fromPromise(promise) { - var emitter = new Emitter(); - var shouldEmit = false; - promise - .then(undefined, function () { return null; }) - .then(function () { - if (!shouldEmit) { - setTimeout(function () { return emitter.fire(undefined); }, 0); - } - else { - emitter.fire(undefined); - } - }); - shouldEmit = true; - return emitter.event; - } - Event.fromPromise = fromPromise; - function toPromise(event) { - return new Promise(function (c) { return once(event)(c); }); - } - Event.toPromise = toPromise; -})(Event || (Event = {})); -var _globalLeakWarningThreshold = -1; -var LeakageMonitor = /** @class */ (function () { - function LeakageMonitor(customThreshold, name) { - if (name === void 0) { name = Math.random().toString(18).slice(2, 5); } - this.customThreshold = customThreshold; - this.name = name; - this._warnCountdown = 0; - } - LeakageMonitor.prototype.dispose = function () { - if (this._stacks) { - this._stacks.clear(); - } - }; - LeakageMonitor.prototype.check = function (listenerCount) { - var _this = this; - var threshold = _globalLeakWarningThreshold; - if (typeof this.customThreshold === 'number') { - threshold = this.customThreshold; - } - if (threshold <= 0 || listenerCount < threshold) { - return undefined; - } - if (!this._stacks) { - this._stacks = new Map(); - } - var stack = new Error().stack.split('\n').slice(3).join('\n'); - var count = (this._stacks.get(stack) || 0); - this._stacks.set(stack, count + 1); - this._warnCountdown -= 1; - if (this._warnCountdown <= 0) { - // only warn on first exceed and then every time the limit - // is exceeded by 50% again - this._warnCountdown = threshold * 0.5; - // find most frequent listener and print warning - var topStack_1; - var topCount_1 = 0; - this._stacks.forEach(function (count, stack) { - if (!topStack_1 || topCount_1 < count) { - topStack_1 = stack; - topCount_1 = count; - } - }); - console.warn("[" + this.name + "] potential listener LEAK detected, having " + listenerCount + " listeners already. MOST frequent listener (" + topCount_1 + "):"); - console.warn(topStack_1); - } - return function () { - var count = (_this._stacks.get(stack) || 0); - _this._stacks.set(stack, count - 1); - }; - }; - return LeakageMonitor; -}()); -/** - * The Emitter can be used to expose an Event to the public - * to fire it from the insides. - * Sample: - class Document { - - private _onDidChange = new Emitter<(value:string)=>any>(); - - public onDidChange = this._onDidChange.event; - - // getter-style - // get onDidChange(): Event<(value:string)=>any> { - // return this._onDidChange.event; - // } - - private _doIt() { - //... - this._onDidChange.fire(value); - } - } - */ -var Emitter = /** @class */ (function () { - function Emitter(options) { - this._disposed = false; - this._options = options; - this._leakageMon = _globalLeakWarningThreshold > 0 - ? new LeakageMonitor(this._options && this._options.leakWarningThreshold) - : undefined; - } - Object.defineProperty(Emitter.prototype, "event", { - /** - * For the public to allow to subscribe - * to events from this Emitter - */ - get: function () { - var _this = this; - if (!this._event) { - this._event = function (listener, thisArgs, disposables) { - if (!_this._listeners) { - _this._listeners = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"](); - } - var firstListener = _this._listeners.isEmpty(); - if (firstListener && _this._options && _this._options.onFirstListenerAdd) { - _this._options.onFirstListenerAdd(_this); - } - var remove = _this._listeners.push(!thisArgs ? listener : [listener, thisArgs]); - if (firstListener && _this._options && _this._options.onFirstListenerDidAdd) { - _this._options.onFirstListenerDidAdd(_this); - } - if (_this._options && _this._options.onListenerDidAdd) { - _this._options.onListenerDidAdd(_this, listener, thisArgs); - } - // check and record this emitter for potential leakage - var removeMonitor; - if (_this._leakageMon) { - removeMonitor = _this._leakageMon.check(_this._listeners.size); - } - var result; - result = { - dispose: function () { - if (removeMonitor) { - removeMonitor(); - } - result.dispose = Emitter._noop; - if (!_this._disposed) { - remove(); - if (_this._options && _this._options.onLastListenerRemove) { - var hasListeners = (_this._listeners && !_this._listeners.isEmpty()); - if (!hasListeners) { - _this._options.onLastListenerRemove(_this); - } - } - } - } - }; - if (Array.isArray(disposables)) { - disposables.push(result); - } - return result; - }; - } - return this._event; - }, - enumerable: true, - configurable: true - }); - /** - * To be kept private to fire an event to - * subscribers - */ - Emitter.prototype.fire = function (event) { - if (this._listeners) { - // put all [listener,event]-pairs into delivery queue - // then emit all event. an inner/nested event might be - // the driver of this - if (!this._deliveryQueue) { - this._deliveryQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"](); - } - for (var iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) { - this._deliveryQueue.push([e.value, event]); - } - while (this._deliveryQueue.size > 0) { - var _a = this._deliveryQueue.shift(), listener = _a[0], event_1 = _a[1]; - try { - if (typeof listener === 'function') { - listener.call(undefined, event_1); - } - else { - listener[0].call(listener[1], event_1); - } - } - catch (e) { - Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e); - } - } - } - }; - Emitter.prototype.dispose = function () { - if (this._listeners) { - this._listeners.clear(); - } - if (this._deliveryQueue) { - this._deliveryQueue.clear(); - } - if (this._leakageMon) { - this._leakageMon.dispose(); - } - this._disposed = true; - }; - Emitter._noop = function () { }; - return Emitter; -}()); - -var PauseableEmitter = /** @class */ (function (_super) { - __extends(PauseableEmitter, _super); - function PauseableEmitter(options) { - var _this = _super.call(this, options) || this; - _this._isPaused = 0; - _this._eventQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"](); - _this._mergeFn = options && options.merge; - return _this; - } - PauseableEmitter.prototype.pause = function () { - this._isPaused++; - }; - PauseableEmitter.prototype.resume = function () { - if (this._isPaused !== 0 && --this._isPaused === 0) { - if (this._mergeFn) { - // use the merge function to create a single composite - // event. make a copy in case firing pauses this emitter - var events = this._eventQueue.toArray(); - this._eventQueue.clear(); - _super.prototype.fire.call(this, this._mergeFn(events)); - } - else { - // no merging, fire each event individually and test - // that this emitter isn't paused halfway through - while (!this._isPaused && this._eventQueue.size !== 0) { - _super.prototype.fire.call(this, this._eventQueue.shift()); - } - } - } - }; - PauseableEmitter.prototype.fire = function (event) { - if (this._listeners) { - if (this._isPaused !== 0) { - this._eventQueue.push(event); - } - else { - _super.prototype.fire.call(this, event); - } - } - }; - return PauseableEmitter; -}(Emitter)); - -var EventMultiplexer = /** @class */ (function () { - function EventMultiplexer() { - var _this = this; - this.hasListeners = false; - this.events = []; - this.emitter = new Emitter({ - onFirstListenerAdd: function () { return _this.onFirstListenerAdd(); }, - onLastListenerRemove: function () { return _this.onLastListenerRemove(); } - }); - } - Object.defineProperty(EventMultiplexer.prototype, "event", { - get: function () { - return this.emitter.event; - }, - enumerable: true, - configurable: true - }); - EventMultiplexer.prototype.add = function (event) { - var _this = this; - var e = { event: event, listener: null }; - this.events.push(e); - if (this.hasListeners) { - this.hook(e); - } - var dispose = function () { - if (_this.hasListeners) { - _this.unhook(e); - } - var idx = _this.events.indexOf(e); - _this.events.splice(idx, 1); - }; - return Object(_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["toDisposable"])(Object(_functional_js__WEBPACK_IMPORTED_MODULE_1__["once"])(dispose)); - }; - EventMultiplexer.prototype.onFirstListenerAdd = function () { - var _this = this; - this.hasListeners = true; - this.events.forEach(function (e) { return _this.hook(e); }); - }; - EventMultiplexer.prototype.onLastListenerRemove = function () { - var _this = this; - this.hasListeners = false; - this.events.forEach(function (e) { return _this.unhook(e); }); - }; - EventMultiplexer.prototype.hook = function (e) { - var _this = this; - e.listener = e.event(function (r) { return _this.emitter.fire(r); }); - }; - EventMultiplexer.prototype.unhook = function (e) { - if (e.listener) { - e.listener.dispose(); - } - e.listener = null; - }; - EventMultiplexer.prototype.dispose = function () { - this.emitter.dispose(); - }; - return EventMultiplexer; -}()); - -/** - * The EventBufferer is useful in situations in which you want - * to delay firing your events during some code. - * You can wrap that code and be sure that the event will not - * be fired during that wrap. - * - * ``` - * const emitter: Emitter; - * const delayer = new EventDelayer(); - * const delayedEvent = delayer.wrapEvent(emitter.event); - * - * delayedEvent(console.log); - * - * delayer.bufferEvents(() => { - * emitter.fire(); // event will not be fired yet - * }); - * - * // event will only be fired at this point - * ``` - */ -var EventBufferer = /** @class */ (function () { - function EventBufferer() { - this.buffers = []; - } - EventBufferer.prototype.wrapEvent = function (event) { - var _this = this; - return function (listener, thisArgs, disposables) { - return event(function (i) { - var buffer = _this.buffers[_this.buffers.length - 1]; - if (buffer) { - buffer.push(function () { return listener.call(thisArgs, i); }); - } - else { - listener.call(thisArgs, i); - } - }, undefined, disposables); - }; - }; - EventBufferer.prototype.bufferEvents = function (fn) { - var buffer = []; - this.buffers.push(buffer); - var r = fn(); - this.buffers.pop(); - buffer.forEach(function (flush) { return flush(); }); - return r; - }; - return EventBufferer; -}()); - -/** - * A Relay is an event forwarder which functions as a replugabble event pipe. - * Once created, you can connect an input event to it and it will simply forward - * events from that input event through its own `event` property. The `input` - * can be changed at any point in time. - */ -var Relay = /** @class */ (function () { - function Relay() { - var _this = this; - this.listening = false; - this.inputEvent = Event.None; - this.inputEventListener = _lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"].None; - this.emitter = new Emitter({ - onFirstListenerDidAdd: function () { - _this.listening = true; - _this.inputEventListener = _this.inputEvent(_this.emitter.fire, _this.emitter); - }, - onLastListenerRemove: function () { - _this.listening = false; - _this.inputEventListener.dispose(); - } - }); - this.event = this.emitter.event; - } - Object.defineProperty(Relay.prototype, "input", { - set: function (event) { - this.inputEvent = event; - if (this.listening) { - this.inputEventListener.dispose(); - this.inputEventListener = event(this.emitter.fire, this.emitter); - } - }, - enumerable: true, - configurable: true - }); - Relay.prototype.dispose = function () { - this.inputEventListener.dispose(); - this.emitter.dispose(); - }; - return Relay; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/functional.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/functional.js ***! - \*********************************************************************/ -/*! exports provided: once */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "once", function() { return once; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -function once(fn) { - var _this = this; - var didCall = false; - var result; - return function () { - if (didCall) { - return result; - } - didCall = true; - result = fn.apply(_this, arguments); - return result; - }; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/iterator.js ***! - \*******************************************************************/ -/*! exports provided: FIN, Iterator, getSequenceIterator, ArrayIterator, ArrayNavigator, MappedIterator */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FIN", function() { return FIN; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Iterator", function() { return Iterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSequenceIterator", function() { return getSequenceIterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayIterator", function() { return ArrayIterator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayNavigator", function() { return ArrayNavigator; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MappedIterator", function() { return MappedIterator; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { +var iterator_extends = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || @@ -2392,7 +2015,7 @@ var ArrayIterator = /** @class */ (function () { }()); var ArrayNavigator = /** @class */ (function (_super) { - __extends(ArrayNavigator, _super); + iterator_extends(ArrayNavigator, _super); function ArrayNavigator(items, start, end, index) { if (start === void 0) { start = 0; } if (end === void 0) { end = items.length; } @@ -2431,687 +2054,1057 @@ var MappedIterator = /** @class */ (function () { }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js ***! - \*******************************************************************/ -/*! exports provided: KeyCodeUtils, KeyChord, createKeybinding, createSimpleKeybinding, SimpleKeybinding, ChordKeybinding, ResolvedKeybindingPart, ResolvedKeybinding */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCodeUtils", function() { return KeyCodeUtils; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyChord", function() { return KeyChord; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createKeybinding", function() { return createKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSimpleKeybinding", function() { return createSimpleKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleKeybinding", function() { return SimpleKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChordKeybinding", function() { return ChordKeybinding; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybindingPart", function() { return ResolvedKeybindingPart; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybinding", function() { return ResolvedKeybinding; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/uri.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -var KeyCodeStrMap = /** @class */ (function () { - function KeyCodeStrMap() { - this._keyCodeToStr = []; - this._strToKeyCode = Object.create(null); - } - KeyCodeStrMap.prototype.define = function (keyCode, str) { - this._keyCodeToStr[keyCode] = str; - this._strToKeyCode[str.toLowerCase()] = keyCode; +var uri_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); }; - KeyCodeStrMap.prototype.keyCodeToStr = function (keyCode) { - return this._keyCodeToStr[keyCode]; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; - KeyCodeStrMap.prototype.strToKeyCode = function (str) { - return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */; - }; - return KeyCodeStrMap; -}()); -var uiMap = new KeyCodeStrMap(); -var userSettingsUSMap = new KeyCodeStrMap(); -var userSettingsGeneralMap = new KeyCodeStrMap(); -(function () { - function define(keyCode, uiLabel, usUserSettingsLabel, generalUserSettingsLabel) { - if (usUserSettingsLabel === void 0) { usUserSettingsLabel = uiLabel; } - if (generalUserSettingsLabel === void 0) { generalUserSettingsLabel = usUserSettingsLabel; } - uiMap.define(keyCode, uiLabel); - userSettingsUSMap.define(keyCode, usUserSettingsLabel); - userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel); - } - define(0 /* Unknown */, 'unknown'); - define(1 /* Backspace */, 'Backspace'); - define(2 /* Tab */, 'Tab'); - define(3 /* Enter */, 'Enter'); - define(4 /* Shift */, 'Shift'); - define(5 /* Ctrl */, 'Ctrl'); - define(6 /* Alt */, 'Alt'); - define(7 /* PauseBreak */, 'PauseBreak'); - define(8 /* CapsLock */, 'CapsLock'); - define(9 /* Escape */, 'Escape'); - define(10 /* Space */, 'Space'); - define(11 /* PageUp */, 'PageUp'); - define(12 /* PageDown */, 'PageDown'); - define(13 /* End */, 'End'); - define(14 /* Home */, 'Home'); - define(15 /* LeftArrow */, 'LeftArrow', 'Left'); - define(16 /* UpArrow */, 'UpArrow', 'Up'); - define(17 /* RightArrow */, 'RightArrow', 'Right'); - define(18 /* DownArrow */, 'DownArrow', 'Down'); - define(19 /* Insert */, 'Insert'); - define(20 /* Delete */, 'Delete'); - define(21 /* KEY_0 */, '0'); - define(22 /* KEY_1 */, '1'); - define(23 /* KEY_2 */, '2'); - define(24 /* KEY_3 */, '3'); - define(25 /* KEY_4 */, '4'); - define(26 /* KEY_5 */, '5'); - define(27 /* KEY_6 */, '6'); - define(28 /* KEY_7 */, '7'); - define(29 /* KEY_8 */, '8'); - define(30 /* KEY_9 */, '9'); - define(31 /* KEY_A */, 'A'); - define(32 /* KEY_B */, 'B'); - define(33 /* KEY_C */, 'C'); - define(34 /* KEY_D */, 'D'); - define(35 /* KEY_E */, 'E'); - define(36 /* KEY_F */, 'F'); - define(37 /* KEY_G */, 'G'); - define(38 /* KEY_H */, 'H'); - define(39 /* KEY_I */, 'I'); - define(40 /* KEY_J */, 'J'); - define(41 /* KEY_K */, 'K'); - define(42 /* KEY_L */, 'L'); - define(43 /* KEY_M */, 'M'); - define(44 /* KEY_N */, 'N'); - define(45 /* KEY_O */, 'O'); - define(46 /* KEY_P */, 'P'); - define(47 /* KEY_Q */, 'Q'); - define(48 /* KEY_R */, 'R'); - define(49 /* KEY_S */, 'S'); - define(50 /* KEY_T */, 'T'); - define(51 /* KEY_U */, 'U'); - define(52 /* KEY_V */, 'V'); - define(53 /* KEY_W */, 'W'); - define(54 /* KEY_X */, 'X'); - define(55 /* KEY_Y */, 'Y'); - define(56 /* KEY_Z */, 'Z'); - define(57 /* Meta */, 'Meta'); - define(58 /* ContextMenu */, 'ContextMenu'); - define(59 /* F1 */, 'F1'); - define(60 /* F2 */, 'F2'); - define(61 /* F3 */, 'F3'); - define(62 /* F4 */, 'F4'); - define(63 /* F5 */, 'F5'); - define(64 /* F6 */, 'F6'); - define(65 /* F7 */, 'F7'); - define(66 /* F8 */, 'F8'); - define(67 /* F9 */, 'F9'); - define(68 /* F10 */, 'F10'); - define(69 /* F11 */, 'F11'); - define(70 /* F12 */, 'F12'); - define(71 /* F13 */, 'F13'); - define(72 /* F14 */, 'F14'); - define(73 /* F15 */, 'F15'); - define(74 /* F16 */, 'F16'); - define(75 /* F17 */, 'F17'); - define(76 /* F18 */, 'F18'); - define(77 /* F19 */, 'F19'); - define(78 /* NumLock */, 'NumLock'); - define(79 /* ScrollLock */, 'ScrollLock'); - define(80 /* US_SEMICOLON */, ';', ';', 'OEM_1'); - define(81 /* US_EQUAL */, '=', '=', 'OEM_PLUS'); - define(82 /* US_COMMA */, ',', ',', 'OEM_COMMA'); - define(83 /* US_MINUS */, '-', '-', 'OEM_MINUS'); - define(84 /* US_DOT */, '.', '.', 'OEM_PERIOD'); - define(85 /* US_SLASH */, '/', '/', 'OEM_2'); - define(86 /* US_BACKTICK */, '`', '`', 'OEM_3'); - define(110 /* ABNT_C1 */, 'ABNT_C1'); - define(111 /* ABNT_C2 */, 'ABNT_C2'); - define(87 /* US_OPEN_SQUARE_BRACKET */, '[', '[', 'OEM_4'); - define(88 /* US_BACKSLASH */, '\\', '\\', 'OEM_5'); - define(89 /* US_CLOSE_SQUARE_BRACKET */, ']', ']', 'OEM_6'); - define(90 /* US_QUOTE */, '\'', '\'', 'OEM_7'); - define(91 /* OEM_8 */, 'OEM_8'); - define(92 /* OEM_102 */, 'OEM_102'); - define(93 /* NUMPAD_0 */, 'NumPad0'); - define(94 /* NUMPAD_1 */, 'NumPad1'); - define(95 /* NUMPAD_2 */, 'NumPad2'); - define(96 /* NUMPAD_3 */, 'NumPad3'); - define(97 /* NUMPAD_4 */, 'NumPad4'); - define(98 /* NUMPAD_5 */, 'NumPad5'); - define(99 /* NUMPAD_6 */, 'NumPad6'); - define(100 /* NUMPAD_7 */, 'NumPad7'); - define(101 /* NUMPAD_8 */, 'NumPad8'); - define(102 /* NUMPAD_9 */, 'NumPad9'); - define(103 /* NUMPAD_MULTIPLY */, 'NumPad_Multiply'); - define(104 /* NUMPAD_ADD */, 'NumPad_Add'); - define(105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator'); - define(106 /* NUMPAD_SUBTRACT */, 'NumPad_Subtract'); - define(107 /* NUMPAD_DECIMAL */, 'NumPad_Decimal'); - define(108 /* NUMPAD_DIVIDE */, 'NumPad_Divide'); })(); -var KeyCodeUtils; -(function (KeyCodeUtils) { - function toString(keyCode) { - return uiMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toString = toString; - function fromString(key) { - return uiMap.strToKeyCode(key); - } - KeyCodeUtils.fromString = fromString; - function toUserSettingsUS(keyCode) { - return userSettingsUSMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toUserSettingsUS = toUserSettingsUS; - function toUserSettingsGeneral(keyCode) { - return userSettingsGeneralMap.keyCodeToStr(keyCode); - } - KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral; - function fromUserSettings(key) { - return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); - } - KeyCodeUtils.fromUserSettings = fromUserSettings; -})(KeyCodeUtils || (KeyCodeUtils = {})); -function KeyChord(firstPart, secondPart) { - var chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0; - return (firstPart | chordPart) >>> 0; -} -function createKeybinding(keybinding, OS) { - if (keybinding === 0) { - return null; - } - var firstPart = (keybinding & 0x0000FFFF) >>> 0; - var chordPart = (keybinding & 0xFFFF0000) >>> 16; - if (chordPart !== 0) { - return new ChordKeybinding([ - createSimpleKeybinding(firstPart, OS), - createSimpleKeybinding(chordPart, OS) - ]); - } - return new ChordKeybinding([createSimpleKeybinding(firstPart, OS)]); -} -function createSimpleKeybinding(keybinding, OS) { - var ctrlCmd = (keybinding & 2048 /* CtrlCmd */ ? true : false); - var winCtrl = (keybinding & 256 /* WinCtrl */ ? true : false); - var ctrlKey = (OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd); - var shiftKey = (keybinding & 1024 /* Shift */ ? true : false); - var altKey = (keybinding & 512 /* Alt */ ? true : false); - var metaKey = (OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl); - var keyCode = (keybinding & 255 /* KeyCode */); - return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode); -} -var SimpleKeybinding = /** @class */ (function () { - function SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode) { - this.ctrlKey = ctrlKey; - this.shiftKey = shiftKey; - this.altKey = altKey; - this.metaKey = metaKey; - this.keyCode = keyCode; - } - SimpleKeybinding.prototype.equals = function (other) { - return (this.ctrlKey === other.ctrlKey - && this.shiftKey === other.shiftKey - && this.altKey === other.altKey - && this.metaKey === other.metaKey - && this.keyCode === other.keyCode); - }; - SimpleKeybinding.prototype.isModifierKey = function () { - return (this.keyCode === 0 /* Unknown */ - || this.keyCode === 5 /* Ctrl */ - || this.keyCode === 57 /* Meta */ - || this.keyCode === 6 /* Alt */ - || this.keyCode === 4 /* Shift */); - }; - SimpleKeybinding.prototype.toChord = function () { - return new ChordKeybinding([this]); - }; - /** - * Does this keybinding refer to the key code of a modifier and it also has the modifier flag? - */ - SimpleKeybinding.prototype.isDuplicateModifierCase = function () { - return ((this.ctrlKey && this.keyCode === 5 /* Ctrl */) - || (this.shiftKey && this.keyCode === 4 /* Shift */) - || (this.altKey && this.keyCode === 6 /* Alt */) - || (this.metaKey && this.keyCode === 57 /* Meta */)); - }; - return SimpleKeybinding; -}()); +var uri_a; -var ChordKeybinding = /** @class */ (function () { - function ChordKeybinding(parts) { - if (parts.length === 0) { - throw Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["illegalArgument"])("parts"); - } - this.parts = parts; - } - ChordKeybinding.prototype.equals = function (other) { - if (other === null) { - return false; - } - if (this.parts.length !== other.parts.length) { - return false; - } - for (var i = 0; i < this.parts.length; i++) { - if (!this.parts[i].equals(other.parts[i])) { - return false; - } - } - return true; - }; - return ChordKeybinding; -}()); - -var ResolvedKeybindingPart = /** @class */ (function () { - function ResolvedKeybindingPart(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) { - this.ctrlKey = ctrlKey; - this.shiftKey = shiftKey; - this.altKey = altKey; - this.metaKey = metaKey; - this.keyLabel = kbLabel; - this.keyAriaLabel = kbAriaLabel; - } - return ResolvedKeybindingPart; -}()); - -/** - * A resolved keybinding. Can be a simple keybinding or a chord keybinding. - */ -var ResolvedKeybinding = /** @class */ (function () { - function ResolvedKeybinding() { - } - return ResolvedKeybinding; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js": -/*!********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js ***! - \********************************************************************/ -/*! exports provided: isDisposable, dispose, combinedDisposable, toDisposable, Disposable, ImmortalReference */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDisposable", function() { return isDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispose", function() { return dispose; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combinedDisposable", function() { return combinedDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toDisposable", function() { return toDisposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Disposable", function() { return Disposable; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImmortalReference", function() { return ImmortalReference; }); -function isDisposable(thing) { - return typeof thing.dispose === 'function' - && thing.dispose.length === 0; -} -function dispose(first) { - var rest = []; - for (var _i = 1; _i < arguments.length; _i++) { - rest[_i - 1] = arguments[_i]; - } - if (Array.isArray(first)) { - first.forEach(function (d) { return d && d.dispose(); }); - return []; - } - else if (rest.length === 0) { - if (first) { - first.dispose(); - return first; - } - return undefined; - } - else { - dispose(first); - dispose(rest); - return []; - } -} -function combinedDisposable(disposables) { - return { dispose: function () { return dispose(disposables); } }; -} -function toDisposable(fn) { - return { dispose: function () { fn(); } }; -} -var Disposable = /** @class */ (function () { - function Disposable() { - this._toDispose = []; - this._lifecycle_disposable_isDisposed = false; - } - Disposable.prototype.dispose = function () { - this._lifecycle_disposable_isDisposed = true; - this._toDispose = dispose(this._toDispose); - }; - Disposable.prototype._register = function (t) { - if (this._lifecycle_disposable_isDisposed) { - console.warn('Registering disposable on object that has already been disposed.'); - t.dispose(); +var _schemePattern = /^\w[\w\d+.-]*$/; +var _singleSlashStart = /^\//; +var _doubleSlashStart = /^\/\//; +var _throwOnMissingSchema = true; +function _validateUri(ret, _strict) { + // scheme, must be set + if (!ret.scheme) { + if (_strict || _throwOnMissingSchema) { + throw new Error("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); } else { - this._toDispose.push(t); + console.warn("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); } - return t; + } + // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 + // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) + if (ret.scheme && !_schemePattern.test(ret.scheme)) { + throw new Error('[UriError]: Scheme contains illegal characters.'); + } + // path, http://tools.ietf.org/html/rfc3986#section-3.3 + // If a URI contains an authority component, then the path component + // must either be empty or begin with a slash ("/") character. If a URI + // does not contain an authority component, then the path cannot begin + // with two slash characters ("//"). + if (ret.path) { + if (ret.authority) { + if (!_singleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); + } + } + else { + if (_doubleSlashStart.test(ret.path)) { + throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); + } + } + } +} +// for a while we allowed uris *without* schemes and this is the migration +// for them, e.g. an uri without scheme and without strict-mode warns and falls +// back to the file-scheme. that should cause the least carnage and still be a +// clear warning +function _schemeFix(scheme, _strict) { + if (_strict || _throwOnMissingSchema) { + return scheme || _empty; + } + if (!scheme) { + console.trace('BAD uri lacks scheme, falling back to file-scheme.'); + scheme = 'file'; + } + return scheme; +} +// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 +function _referenceResolution(scheme, path) { + // the slash-character is our 'default base' as we don't + // support constructing URIs relative to other URIs. This + // also means that we alter and potentially break paths. + // see https://tools.ietf.org/html/rfc3986#section-5.1.4 + switch (scheme) { + case 'https': + case 'http': + case 'file': + if (!path) { + path = _slash; + } + else if (path[0] !== _slash) { + path = _slash + path; + } + break; + } + return path; +} +var _empty = ''; +var _slash = '/'; +var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; +/** + * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. + * This class is a simple parser which creates the basic component parts + * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation + * and encoding. + * + * foo://example.com:8042/over/there?name=ferret#nose + * \_/ \______________/\_________/ \_________/ \__/ + * | | | | | + * scheme authority path query fragment + * | _____________________|__ + * / \ / \ + * urn:example:animal:ferret:nose + */ +var uri_URI = /** @class */ (function () { + /** + * @internal + */ + function URI(schemeOrData, authority, path, query, fragment, _strict) { + if (_strict === void 0) { _strict = false; } + if (typeof schemeOrData === 'object') { + this.scheme = schemeOrData.scheme || _empty; + this.authority = schemeOrData.authority || _empty; + this.path = schemeOrData.path || _empty; + this.query = schemeOrData.query || _empty; + this.fragment = schemeOrData.fragment || _empty; + // no validation because it's this URI + // that creates uri components. + // _validateUri(this); + } + else { + this.scheme = _schemeFix(schemeOrData, _strict); + this.authority = authority || _empty; + this.path = _referenceResolution(this.scheme, path || _empty); + this.query = query || _empty; + this.fragment = fragment || _empty; + _validateUri(this, _strict); + } + } + URI.isUri = function (thing) { + if (thing instanceof URI) { + return true; + } + if (!thing) { + return false; + } + return typeof thing.authority === 'string' + && typeof thing.fragment === 'string' + && typeof thing.path === 'string' + && typeof thing.query === 'string' + && typeof thing.scheme === 'string' + && typeof thing.fsPath === 'function' + && typeof thing.with === 'function' + && typeof thing.toString === 'function'; }; - Disposable.None = Object.freeze({ dispose: function () { } }); - return Disposable; -}()); - -var ImmortalReference = /** @class */ (function () { - function ImmortalReference(object) { - this.object = object; - } - ImmortalReference.prototype.dispose = function () { }; - return ImmortalReference; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/linkedList.js": -/*!*********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/linkedList.js ***! - \*********************************************************************/ -/*! exports provided: LinkedList */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkedList", function() { return LinkedList; }); -/* harmony import */ var _iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -var Node = /** @class */ (function () { - function Node(element) { - this.element = element; - this.next = Node.Undefined; - this.prev = Node.Undefined; - } - Node.Undefined = new Node(undefined); - return Node; -}()); -var LinkedList = /** @class */ (function () { - function LinkedList() { - this._first = Node.Undefined; - this._last = Node.Undefined; - this._size = 0; - } - Object.defineProperty(LinkedList.prototype, "size", { + Object.defineProperty(URI.prototype, "fsPath", { + // ---- filesystem path ----------------------- + /** + * Returns a string representing the corresponding file system path of this URI. + * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the + * platform specific path separator. + * + * * Will *not* validate the path for invalid characters and semantics. + * * Will *not* look at the scheme of this URI. + * * The result shall *not* be used for display purposes but for accessing a file on disk. + * + * + * The *difference* to `URI#path` is the use of the platform specific separator and the handling + * of UNC paths. See the below sample of a file-uri with an authority (UNC path). + * + * ```ts + const u = URI.parse('file://server/c$/folder/file.txt') + u.authority === 'server' + u.path === '/shares/c$/file.txt' + u.fsPath === '\\server\c$\folder\file.txt' + ``` + * + * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, + * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working + * with URIs that represent files on disk (`file` scheme). + */ get: function () { - return this._size; + // if (this.scheme !== 'file') { + // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); + // } + return _makeFsPath(this); }, enumerable: true, configurable: true }); - LinkedList.prototype.isEmpty = function () { - return this._first === Node.Undefined; - }; - LinkedList.prototype.clear = function () { - this._first = Node.Undefined; - this._last = Node.Undefined; - this._size = 0; - }; - LinkedList.prototype.unshift = function (element) { - return this._insert(element, false); - }; - LinkedList.prototype.push = function (element) { - return this._insert(element, true); - }; - LinkedList.prototype._insert = function (element, atTheEnd) { - var _this = this; - var newNode = new Node(element); - if (this._first === Node.Undefined) { - this._first = newNode; - this._last = newNode; + // ---- modify to new ------------------------- + URI.prototype.with = function (change) { + if (!change) { + return this; } - else if (atTheEnd) { - // push - var oldLast = this._last; - this._last = newNode; - newNode.prev = oldLast; - oldLast.next = newNode; + var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment; + if (scheme === undefined) { + scheme = this.scheme; + } + else if (scheme === null) { + scheme = _empty; + } + if (authority === undefined) { + authority = this.authority; + } + else if (authority === null) { + authority = _empty; + } + if (path === undefined) { + path = this.path; + } + else if (path === null) { + path = _empty; + } + if (query === undefined) { + query = this.query; + } + else if (query === null) { + query = _empty; + } + if (fragment === undefined) { + fragment = this.fragment; + } + else if (fragment === null) { + fragment = _empty; + } + if (scheme === this.scheme + && authority === this.authority + && path === this.path + && query === this.query + && fragment === this.fragment) { + return this; + } + return new _URI(scheme, authority, path, query, fragment); + }; + // ---- parse & validate ------------------------ + /** + * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, + * `file:///usr/home`, or `scheme:with/path`. + * + * @param value A string which represents an URI (see `URI#toString`). + */ + URI.parse = function (value, _strict) { + if (_strict === void 0) { _strict = false; } + var match = _regexp.exec(value); + if (!match) { + return new _URI(_empty, _empty, _empty, _empty, _empty); + } + return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty), _strict); + }; + /** + * Creates a new URI from a file system path, e.g. `c:\my\files`, + * `/usr/home`, or `\\server\share\some\path`. + * + * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument + * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** + * `URI.parse('file://' + path)` because the path might contain characters that are + * interpreted (# and ?). See the following sample: + * ```ts + const good = URI.file('/coding/c#/project1'); + good.scheme === 'file'; + good.path === '/coding/c#/project1'; + good.fragment === ''; + const bad = URI.parse('file://' + '/coding/c#/project1'); + bad.scheme === 'file'; + bad.path === '/coding/c'; // path is now broken + bad.fragment === '/project1'; + ``` + * + * @param path A file system path (see `URI#fsPath`) + */ + URI.file = function (path) { + var authority = _empty; + // normalize to fwd-slashes on windows, + // on other systems bwd-slashes are valid + // filename character, eg /f\oo/ba\r.txt + if (isWindows) { + path = path.replace(/\\/g, _slash); + } + // check for authority as used in UNC shares + // or use the path as given + if (path[0] === _slash && path[1] === _slash) { + var idx = path.indexOf(_slash, 2); + if (idx === -1) { + authority = path.substring(2); + path = _slash; + } + else { + authority = path.substring(2, idx); + path = path.substring(idx) || _slash; + } + } + return new _URI('file', authority, path, _empty, _empty); + }; + URI.from = function (components) { + return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment); + }; + // ---- printing/externalize --------------------------- + /** + * Creates a string representation for this URI. It's guaranteed that calling + * `URI.parse` with the result of this function creates an URI which is equal + * to this URI. + * + * * The result shall *not* be used for display purposes but for externalization or transport. + * * The result will be encoded using the percentage encoding and encoding happens mostly + * ignore the scheme-specific encoding rules. + * + * @param skipEncoding Do not encode the result, default is `false` + */ + URI.prototype.toString = function (skipEncoding) { + if (skipEncoding === void 0) { skipEncoding = false; } + return _asFormatted(this, skipEncoding); + }; + URI.prototype.toJSON = function () { + return this; + }; + URI.revive = function (data) { + if (!data) { + return data; + } + else if (data instanceof URI) { + return data; } else { - // unshift - var oldFirst = this._first; - this._first = newNode; - newNode.next = oldFirst; - oldFirst.prev = newNode; - } - this._size += 1; - var didRemove = false; - return function () { - if (!didRemove) { - didRemove = true; - _this._remove(newNode); - } - }; - }; - LinkedList.prototype.shift = function () { - if (this._first === Node.Undefined) { - return undefined; - } - else { - var res = this._first.element; - this._remove(this._first); - return res; + var result = new _URI(data); + result._fsPath = data.fsPath; + result._formatted = data.external; + return result; } }; - LinkedList.prototype._remove = function (node) { - if (node.prev !== Node.Undefined && node.next !== Node.Undefined) { - // middle - var anchor = node.prev; - anchor.next = node.next; - node.next.prev = anchor; - } - else if (node.prev === Node.Undefined && node.next === Node.Undefined) { - // only node - this._first = Node.Undefined; - this._last = Node.Undefined; - } - else if (node.next === Node.Undefined) { - // last - this._last = this._last.prev; - this._last.next = Node.Undefined; - } - else if (node.prev === Node.Undefined) { - // first - this._first = this._first.next; - this._first.prev = Node.Undefined; - } - // done - this._size -= 1; - }; - LinkedList.prototype.iterator = function () { - var element; - var node = this._first; - return { - next: function () { - if (node === Node.Undefined) { - return _iterator_js__WEBPACK_IMPORTED_MODULE_0__["FIN"]; - } - if (!element) { - element = { done: false, value: node.element }; - } - else { - element.value = node.element; - } - node = node.next; - return element; - } - }; - }; - LinkedList.prototype.toArray = function () { - var result = []; - for (var node = this._first; node !== Node.Undefined; node = node.next) { - result.push(node.element); - } - return result; - }; - return LinkedList; + return URI; }()); +// tslint:disable-next-line:class-name +var _URI = /** @class */ (function (_super) { + uri_extends(_URI, _super); + function _URI() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this._formatted = null; + _this._fsPath = null; + return _this; + } + Object.defineProperty(_URI.prototype, "fsPath", { + get: function () { + if (!this._fsPath) { + this._fsPath = _makeFsPath(this); + } + return this._fsPath; + }, + enumerable: true, + configurable: true + }); + _URI.prototype.toString = function (skipEncoding) { + if (skipEncoding === void 0) { skipEncoding = false; } + if (!skipEncoding) { + if (!this._formatted) { + this._formatted = _asFormatted(this, false); + } + return this._formatted; + } + else { + // we don't cache that + return _asFormatted(this, true); + } + }; + _URI.prototype.toJSON = function () { + var res = { + $mid: 1 + }; + // cached state + if (this._fsPath) { + res.fsPath = this._fsPath; + } + if (this._formatted) { + res.external = this._formatted; + } + // uri components + if (this.path) { + res.path = this.path; + } + if (this.scheme) { + res.scheme = this.scheme; + } + if (this.authority) { + res.authority = this.authority; + } + if (this.query) { + res.query = this.query; + } + if (this.fragment) { + res.fragment = this.fragment; + } + return res; + }; + return _URI; +}(uri_URI)); +// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 +var encodeTable = (uri_a = {}, + uri_a[58 /* Colon */] = '%3A', + uri_a[47 /* Slash */] = '%2F', + uri_a[63 /* QuestionMark */] = '%3F', + uri_a[35 /* Hash */] = '%23', + uri_a[91 /* OpenSquareBracket */] = '%5B', + uri_a[93 /* CloseSquareBracket */] = '%5D', + uri_a[64 /* AtSign */] = '%40', + uri_a[33 /* ExclamationMark */] = '%21', + uri_a[36 /* DollarSign */] = '%24', + uri_a[38 /* Ampersand */] = '%26', + uri_a[39 /* SingleQuote */] = '%27', + uri_a[40 /* OpenParen */] = '%28', + uri_a[41 /* CloseParen */] = '%29', + uri_a[42 /* Asterisk */] = '%2A', + uri_a[43 /* Plus */] = '%2B', + uri_a[44 /* Comma */] = '%2C', + uri_a[59 /* Semicolon */] = '%3B', + uri_a[61 /* Equals */] = '%3D', + uri_a[32 /* Space */] = '%20', + uri_a); +function encodeURIComponentFast(uriComponent, allowSlash) { + var res = undefined; + var nativeEncodePos = -1; + for (var pos = 0; pos < uriComponent.length; pos++) { + var code = uriComponent.charCodeAt(pos); + // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 + if ((code >= 97 /* a */ && code <= 122 /* z */) + || (code >= 65 /* A */ && code <= 90 /* Z */) + || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) + || code === 45 /* Dash */ + || code === 46 /* Period */ + || code === 95 /* Underline */ + || code === 126 /* Tilde */ + || (allowSlash && code === 47 /* Slash */)) { + // check if we are delaying native encode + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + // check if we write into a new string (by default we try to return the param) + if (res !== undefined) { + res += uriComponent.charAt(pos); + } + } + else { + // encoding needed, we need to allocate a new string + if (res === undefined) { + res = uriComponent.substr(0, pos); + } + // check with default table first + var escaped = encodeTable[code]; + if (escaped !== undefined) { + // check if we are delaying native encode + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); + nativeEncodePos = -1; + } + // append escaped variant to result + res += escaped; + } + else if (nativeEncodePos === -1) { + // use native encode only when needed + nativeEncodePos = pos; + } + } + } + if (nativeEncodePos !== -1) { + res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); + } + return res !== undefined ? res : uriComponent; +} +function encodeURIComponentMinimal(path) { + var res = undefined; + for (var pos = 0; pos < path.length; pos++) { + var code = path.charCodeAt(pos); + if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { + if (res === undefined) { + res = path.substr(0, pos); + } + res += encodeTable[code]; + } + else { + if (res !== undefined) { + res += path[pos]; + } + } + } + return res !== undefined ? res : path; +} +/** + * Compute `fsPath` for the given uri + */ +function _makeFsPath(uri) { + var value; + if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { + // unc path: file://shares/c$/far/boo + value = "//" + uri.authority + uri.path; + } + else if (uri.path.charCodeAt(0) === 47 /* Slash */ + && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) + && uri.path.charCodeAt(2) === 58 /* Colon */) { + // windows drive letter: file:///c:/far/boo + value = uri.path[1].toLowerCase() + uri.path.substr(2); + } + else { + // other path + value = uri.path; + } + if (isWindows) { + value = value.replace(/\//g, '\\'); + } + return value; +} +/** + * Create the external version of a uri + */ +function _asFormatted(uri, skipEncoding) { + var encoder = !skipEncoding + ? encodeURIComponentFast + : encodeURIComponentMinimal; + var res = ''; + var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment; + if (scheme) { + res += scheme; + res += ':'; + } + if (authority || scheme === 'file') { + res += _slash; + res += _slash; + } + if (authority) { + var idx = authority.indexOf('@'); + if (idx !== -1) { + // @ + var userinfo = authority.substr(0, idx); + authority = authority.substr(idx + 1); + idx = userinfo.indexOf(':'); + if (idx === -1) { + res += encoder(userinfo, false); + } + else { + // :@ + res += encoder(userinfo.substr(0, idx), false); + res += ':'; + res += encoder(userinfo.substr(idx + 1), false); + } + res += '@'; + } + authority = authority.toLowerCase(); + idx = authority.indexOf(':'); + if (idx === -1) { + res += encoder(authority, false); + } + else { + // : + res += encoder(authority.substr(0, idx), false); + res += authority.substr(idx); + } + } + if (path) { + // lower-case windows drive letters in /C:/fff or C:/fff + if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { + var code = path.charCodeAt(1); + if (code >= 65 /* A */ && code <= 90 /* Z */) { + path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3 + } + } + else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { + var code = path.charCodeAt(0); + if (code >= 65 /* A */ && code <= 90 /* Z */) { + path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3 + } + } + // encode the rest of the path + res += encoder(path, true); + } + if (query) { + res += '?'; + res += encoder(query, false); + } + if (fragment) { + res += '#'; + res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; + } + return res; +} - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/platform.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/platform.js ***! - \*******************************************************************/ -/*! exports provided: isWindows, isMacintosh, isLinux, isNative, isWeb, globals, setImmediate, OS */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWindows", function() { return isWindows; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMacintosh", function() { return isMacintosh; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinux", function() { return isLinux; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNative", function() { return isNative; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWeb", function() { return isWeb; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "globals", function() { return globals; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setImmediate", function() { return setImmediate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OS", function() { return OS; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/position.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var LANGUAGE_DEFAULT = 'en'; -var _isWindows = false; -var _isMacintosh = false; -var _isLinux = false; -var _isNative = false; -var _isWeb = false; -var _locale = undefined; -var _language = LANGUAGE_DEFAULT; -var _translationsConfigFile = undefined; -var isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer'); -// OS detection -if (typeof navigator === 'object' && !isElectronRenderer) { - var userAgent = navigator.userAgent; - _isWindows = userAgent.indexOf('Windows') >= 0; - _isMacintosh = userAgent.indexOf('Macintosh') >= 0; - _isLinux = userAgent.indexOf('Linux') >= 0; - _isWeb = true; - _locale = navigator.language; - _language = _locale; -} -else if (typeof process === 'object') { - _isWindows = (process.platform === 'win32'); - _isMacintosh = (process.platform === 'darwin'); - _isLinux = (process.platform === 'linux'); - _locale = LANGUAGE_DEFAULT; - _language = LANGUAGE_DEFAULT; - var rawNlsConfig = process.env['VSCODE_NLS_CONFIG']; - if (rawNlsConfig) { - try { - var nlsConfig = JSON.parse(rawNlsConfig); - var resolved = nlsConfig.availableLanguages['*']; - _locale = nlsConfig.locale; - // VSCode's default language is 'en' - _language = resolved ? resolved : LANGUAGE_DEFAULT; - _translationsConfigFile = nlsConfig._translationsConfigFile; - } - catch (e) { - } +/** + * A position in the editor. + */ +var Position = /** @class */ (function () { + function Position(lineNumber, column) { + this.lineNumber = lineNumber; + this.column = column; } - _isNative = true; -} -var _platform = 0 /* Web */; -if (_isNative) { - if (_isMacintosh) { - _platform = 1 /* Mac */; - } - else if (_isWindows) { - _platform = 3 /* Windows */; - } - else if (_isLinux) { - _platform = 2 /* Linux */; - } -} -var isWindows = _isWindows; -var isMacintosh = _isMacintosh; -var isLinux = _isLinux; -var isNative = _isNative; -var isWeb = _isWeb; -var _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {}); -var globals = _globals; -var _setImmediate = null; -function setImmediate(callback) { - if (_setImmediate === null) { - if (globals.setImmediate) { - _setImmediate = globals.setImmediate.bind(globals); - } - else if (typeof process !== 'undefined' && typeof process.nextTick === 'function') { - _setImmediate = process.nextTick.bind(process); + /** + * Create a new postion from this position. + * + * @param newLineNumber new line number + * @param newColumn new column + */ + Position.prototype.with = function (newLineNumber, newColumn) { + if (newLineNumber === void 0) { newLineNumber = this.lineNumber; } + if (newColumn === void 0) { newColumn = this.column; } + if (newLineNumber === this.lineNumber && newColumn === this.column) { + return this; } else { - _setImmediate = globals.setTimeout.bind(globals); + return new Position(newLineNumber, newColumn); + } + }; + /** + * Derive a new position from this position. + * + * @param deltaLineNumber line number delta + * @param deltaColumn column delta + */ + Position.prototype.delta = function (deltaLineNumber, deltaColumn) { + if (deltaLineNumber === void 0) { deltaLineNumber = 0; } + if (deltaColumn === void 0) { deltaColumn = 0; } + return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn); + }; + /** + * Test if this position equals other position + */ + Position.prototype.equals = function (other) { + return Position.equals(this, other); + }; + /** + * Test if position `a` equals position `b` + */ + Position.equals = function (a, b) { + if (!a && !b) { + return true; + } + return (!!a && + !!b && + a.lineNumber === b.lineNumber && + a.column === b.column); + }; + /** + * Test if this position is before other position. + * If the two positions are equal, the result will be false. + */ + Position.prototype.isBefore = function (other) { + return Position.isBefore(this, other); + }; + /** + * Test if position `a` is before position `b`. + * If the two positions are equal, the result will be false. + */ + Position.isBefore = function (a, b) { + if (a.lineNumber < b.lineNumber) { + return true; + } + if (b.lineNumber < a.lineNumber) { + return false; + } + return a.column < b.column; + }; + /** + * Test if this position is before other position. + * If the two positions are equal, the result will be true. + */ + Position.prototype.isBeforeOrEqual = function (other) { + return Position.isBeforeOrEqual(this, other); + }; + /** + * Test if position `a` is before position `b`. + * If the two positions are equal, the result will be true. + */ + Position.isBeforeOrEqual = function (a, b) { + if (a.lineNumber < b.lineNumber) { + return true; + } + if (b.lineNumber < a.lineNumber) { + return false; + } + return a.column <= b.column; + }; + /** + * A function that compares positions, useful for sorting + */ + Position.compare = function (a, b) { + var aLineNumber = a.lineNumber | 0; + var bLineNumber = b.lineNumber | 0; + if (aLineNumber === bLineNumber) { + var aColumn = a.column | 0; + var bColumn = b.column | 0; + return aColumn - bColumn; + } + return aLineNumber - bLineNumber; + }; + /** + * Clone this position. + */ + Position.prototype.clone = function () { + return new Position(this.lineNumber, this.column); + }; + /** + * Convert to a human-readable representation. + */ + Position.prototype.toString = function () { + return '(' + this.lineNumber + ',' + this.column + ')'; + }; + // --- + /** + * Create a `Position` from an `IPosition`. + */ + Position.lift = function (pos) { + return new Position(pos.lineNumber, pos.column); + }; + /** + * Test if `obj` is an `IPosition`. + */ + Position.isIPosition = function (obj) { + return (obj + && (typeof obj.lineNumber === 'number') + && (typeof obj.column === 'number')); + }; + return Position; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/range.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/** + * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn) + */ +var range_Range = /** @class */ (function () { + function Range(startLineNumber, startColumn, endLineNumber, endColumn) { + if ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) { + this.startLineNumber = endLineNumber; + this.startColumn = endColumn; + this.endLineNumber = startLineNumber; + this.endColumn = startColumn; + } + else { + this.startLineNumber = startLineNumber; + this.startColumn = startColumn; + this.endLineNumber = endLineNumber; + this.endColumn = endColumn; } } - return _setImmediate(callback); -} -var OS = (_isMacintosh ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */)); + /** + * Test if this range is empty. + */ + Range.prototype.isEmpty = function () { + return Range.isEmpty(this); + }; + /** + * Test if `range` is empty. + */ + Range.isEmpty = function (range) { + return (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn); + }; + /** + * Test if position is in this range. If the position is at the edges, will return true. + */ + Range.prototype.containsPosition = function (position) { + return Range.containsPosition(this, position); + }; + /** + * Test if `position` is in `range`. If the position is at the edges, will return true. + */ + Range.containsPosition = function (range, position) { + if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) { + return false; + } + if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) { + return false; + } + if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) { + return false; + } + return true; + }; + /** + * Test if range is in this range. If the range is equal to this range, will return true. + */ + Range.prototype.containsRange = function (range) { + return Range.containsRange(this, range); + }; + /** + * Test if `otherRange` is in `range`. If the ranges are equal, will return true. + */ + Range.containsRange = function (range, otherRange) { + if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { + return false; + } + if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { + return false; + } + if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) { + return false; + } + if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) { + return false; + } + return true; + }; + /** + * A reunion of the two ranges. + * The smallest position will be used as the start point, and the largest one as the end point. + */ + Range.prototype.plusRange = function (range) { + return Range.plusRange(this, range); + }; + /** + * A reunion of the two ranges. + * The smallest position will be used as the start point, and the largest one as the end point. + */ + Range.plusRange = function (a, b) { + var startLineNumber; + var startColumn; + var endLineNumber; + var endColumn; + if (b.startLineNumber < a.startLineNumber) { + startLineNumber = b.startLineNumber; + startColumn = b.startColumn; + } + else if (b.startLineNumber === a.startLineNumber) { + startLineNumber = b.startLineNumber; + startColumn = Math.min(b.startColumn, a.startColumn); + } + else { + startLineNumber = a.startLineNumber; + startColumn = a.startColumn; + } + if (b.endLineNumber > a.endLineNumber) { + endLineNumber = b.endLineNumber; + endColumn = b.endColumn; + } + else if (b.endLineNumber === a.endLineNumber) { + endLineNumber = b.endLineNumber; + endColumn = Math.max(b.endColumn, a.endColumn); + } + else { + endLineNumber = a.endLineNumber; + endColumn = a.endColumn; + } + return new Range(startLineNumber, startColumn, endLineNumber, endColumn); + }; + /** + * A intersection of the two ranges. + */ + Range.prototype.intersectRanges = function (range) { + return Range.intersectRanges(this, range); + }; + /** + * A intersection of the two ranges. + */ + Range.intersectRanges = function (a, b) { + var resultStartLineNumber = a.startLineNumber; + var resultStartColumn = a.startColumn; + var resultEndLineNumber = a.endLineNumber; + var resultEndColumn = a.endColumn; + var otherStartLineNumber = b.startLineNumber; + var otherStartColumn = b.startColumn; + var otherEndLineNumber = b.endLineNumber; + var otherEndColumn = b.endColumn; + if (resultStartLineNumber < otherStartLineNumber) { + resultStartLineNumber = otherStartLineNumber; + resultStartColumn = otherStartColumn; + } + else if (resultStartLineNumber === otherStartLineNumber) { + resultStartColumn = Math.max(resultStartColumn, otherStartColumn); + } + if (resultEndLineNumber > otherEndLineNumber) { + resultEndLineNumber = otherEndLineNumber; + resultEndColumn = otherEndColumn; + } + else if (resultEndLineNumber === otherEndLineNumber) { + resultEndColumn = Math.min(resultEndColumn, otherEndColumn); + } + // Check if selection is now empty + if (resultStartLineNumber > resultEndLineNumber) { + return null; + } + if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) { + return null; + } + return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn); + }; + /** + * Test if this range equals other. + */ + Range.prototype.equalsRange = function (other) { + return Range.equalsRange(this, other); + }; + /** + * Test if range `a` equals `b`. + */ + Range.equalsRange = function (a, b) { + return (!!a && + !!b && + a.startLineNumber === b.startLineNumber && + a.startColumn === b.startColumn && + a.endLineNumber === b.endLineNumber && + a.endColumn === b.endColumn); + }; + /** + * Return the end position (which will be after or equal to the start position) + */ + Range.prototype.getEndPosition = function () { + return new Position(this.endLineNumber, this.endColumn); + }; + /** + * Return the start position (which will be before or equal to the end position) + */ + Range.prototype.getStartPosition = function () { + return new Position(this.startLineNumber, this.startColumn); + }; + /** + * Transform to a user presentable string representation. + */ + Range.prototype.toString = function () { + return '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']'; + }; + /** + * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position. + */ + Range.prototype.setEndPosition = function (endLineNumber, endColumn) { + return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn); + }; + /** + * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position. + */ + Range.prototype.setStartPosition = function (startLineNumber, startColumn) { + return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn); + }; + /** + * Create a new empty range using this range's start position. + */ + Range.prototype.collapseToStart = function () { + return Range.collapseToStart(this); + }; + /** + * Create a new empty range using this range's start position. + */ + Range.collapseToStart = function (range) { + return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn); + }; + // --- + Range.fromPositions = function (start, end) { + if (end === void 0) { end = start; } + return new Range(start.lineNumber, start.column, end.lineNumber, end.column); + }; + Range.lift = function (range) { + if (!range) { + return null; + } + return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); + }; + /** + * Test if `obj` is an `IRange`. + */ + Range.isIRange = function (obj) { + return (obj + && (typeof obj.startLineNumber === 'number') + && (typeof obj.startColumn === 'number') + && (typeof obj.endLineNumber === 'number') + && (typeof obj.endColumn === 'number')); + }; + /** + * Test if the two ranges are touching in any way. + */ + Range.areIntersectingOrTouching = function (a, b) { + // Check if `a` is before `b` + if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) { + return false; + } + // Check if `b` is before `a` + if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) { + return false; + } + // These ranges must intersect + return true; + }; + /** + * Test if the two ranges are intersecting. If the ranges are touching it returns true. + */ + Range.areIntersecting = function (a, b) { + // Check if `a` is before `b` + if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) { + return false; + } + // Check if `b` is before `a` + if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) { + return false; + } + // These ranges must intersect + return true; + }; + /** + * A function that compares ranges, useful for sorting ranges + * It will first compare ranges on the startPosition and then on the endPosition + */ + Range.compareRangesUsingStarts = function (a, b) { + if (a && b) { + var aStartLineNumber = a.startLineNumber | 0; + var bStartLineNumber = b.startLineNumber | 0; + if (aStartLineNumber === bStartLineNumber) { + var aStartColumn = a.startColumn | 0; + var bStartColumn = b.startColumn | 0; + if (aStartColumn === bStartColumn) { + var aEndLineNumber = a.endLineNumber | 0; + var bEndLineNumber = b.endLineNumber | 0; + if (aEndLineNumber === bEndLineNumber) { + var aEndColumn = a.endColumn | 0; + var bEndColumn = b.endColumn | 0; + return aEndColumn - bEndColumn; + } + return aEndLineNumber - bEndLineNumber; + } + return aStartColumn - bStartColumn; + } + return aStartLineNumber - bStartLineNumber; + } + var aExists = (a ? 1 : 0); + var bExists = (b ? 1 : 0); + return aExists - bExists; + }; + /** + * A function that compares ranges, useful for sorting ranges + * It will first compare ranges on the endPosition and then on the startPosition + */ + Range.compareRangesUsingEnds = function (a, b) { + if (a.endLineNumber === b.endLineNumber) { + if (a.endColumn === b.endColumn) { + if (a.startLineNumber === b.startLineNumber) { + return a.startColumn - b.startColumn; + } + return a.startLineNumber - b.startLineNumber; + } + return a.endColumn - b.endColumn; + } + return a.endLineNumber - b.endLineNumber; + }; + /** + * Test if the range spans multiple lines. + */ + Range.spansMultipleLines = function (range) { + return range.endLineNumber > range.startLineNumber; + }; + return Range; +}()); -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/strings.js": -/*!******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/strings.js ***! - \******************************************************************/ -/*! exports provided: empty, isFalsyOrWhitespace, pad, format, escape, escapeRegExpCharacters, trim, ltrim, rtrim, convertSimple2RegExpPattern, startsWith, endsWith, createRegExp, regExpLeadsToEndlessLoop, regExpFlags, firstNonWhitespaceIndex, getLeadingWhitespace, lastNonWhitespaceIndex, compare, isLowerAsciiLetter, isUpperAsciiLetter, equalsIgnoreCase, startsWithIgnoreCase, commonPrefixLength, commonSuffixLength, isHighSurrogate, isLowSurrogate, containsRTL, containsEmoji, isBasicASCII, containsFullWidthCharacter, isFullWidthCharacter, UTF8_BOM_CHARACTER, startsWithUTF8BOM, safeBtoa, repeat */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFalsyOrWhitespace", function() { return isFalsyOrWhitespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return pad; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "format", function() { return format; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return escape; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeRegExpCharacters", function() { return escapeRegExpCharacters; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trim", function() { return trim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ltrim", function() { return ltrim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rtrim", function() { return rtrim; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertSimple2RegExpPattern", function() { return convertSimple2RegExpPattern; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return startsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return endsWith; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRegExp", function() { return createRegExp; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpLeadsToEndlessLoop", function() { return regExpLeadsToEndlessLoop; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpFlags", function() { return regExpFlags; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstNonWhitespaceIndex", function() { return firstNonWhitespaceIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLeadingWhitespace", function() { return getLeadingWhitespace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lastNonWhitespaceIndex", function() { return lastNonWhitespaceIndex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compare", function() { return compare; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowerAsciiLetter", function() { return isLowerAsciiLetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUpperAsciiLetter", function() { return isUpperAsciiLetter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equalsIgnoreCase", function() { return equalsIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithIgnoreCase", function() { return startsWithIgnoreCase; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonPrefixLength", function() { return commonPrefixLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonSuffixLength", function() { return commonSuffixLength; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHighSurrogate", function() { return isHighSurrogate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowSurrogate", function() { return isLowSurrogate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsRTL", function() { return containsRTL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsEmoji", function() { return containsEmoji; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBasicASCII", function() { return isBasicASCII; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsFullWidthCharacter", function() { return containsFullWidthCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFullWidthCharacter", function() { return isFullWidthCharacter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UTF8_BOM_CHARACTER", function() { return UTF8_BOM_CHARACTER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithUTF8BOM", function() { return startsWithUTF8BOM; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeBtoa", function() { return safeBtoa; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return repeat; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/strings.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -3164,7 +3157,7 @@ function format(value) { * Converts HTML characters inside the string to use entities instead. Makes the string safe from * being used e.g. in HTMLElement.innerHTML. */ -function escape(html) { +function strings_escape(html) { return html.replace(/[<>&]/g, function (match) { switch (match) { case '<': return '<'; @@ -3561,1964 +3554,7 @@ function repeat(s, count) { return result; } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/types.js": -/*!****************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/types.js ***! - \****************************************************************/ -/*! exports provided: isArray, isString, isObject, isNumber, isBoolean, isUndefined, isUndefinedOrNull, isEmptyObject, isFunction, validateConstraints, validateConstraint, getAllPropertyNames, withNullAsUndefined, withUndefinedAsNull */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return isArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return isString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return isNumber; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return isBoolean; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return isUndefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefinedOrNull", function() { return isUndefinedOrNull; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmptyObject", function() { return isEmptyObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraints", function() { return validateConstraints; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraint", function() { return validateConstraint; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllPropertyNames", function() { return getAllPropertyNames; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withNullAsUndefined", function() { return withNullAsUndefined; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withUndefinedAsNull", function() { return withUndefinedAsNull; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var _typeof = { - number: 'number', - string: 'string', - undefined: 'undefined', - object: 'object', - function: 'function' -}; -/** - * @returns whether the provided parameter is a JavaScript Array or not. - */ -function isArray(array) { - if (Array.isArray) { - return Array.isArray(array); - } - if (array && typeof (array.length) === _typeof.number && array.constructor === Array) { - return true; - } - return false; -} -/** - * @returns whether the provided parameter is a JavaScript String or not. - */ -function isString(str) { - if (typeof (str) === _typeof.string || str instanceof String) { - return true; - } - return false; -} -/** - * - * @returns whether the provided parameter is of type `object` but **not** - * `null`, an `array`, a `regexp`, nor a `date`. - */ -function isObject(obj) { - // The method can't do a type cast since there are type (like strings) which - // are subclasses of any put not positvely matched by the function. Hence type - // narrowing results in wrong results. - return typeof obj === _typeof.object - && obj !== null - && !Array.isArray(obj) - && !(obj instanceof RegExp) - && !(obj instanceof Date); -} -/** - * In **contrast** to just checking `typeof` this will return `false` for `NaN`. - * @returns whether the provided parameter is a JavaScript Number or not. - */ -function isNumber(obj) { - if ((typeof (obj) === _typeof.number || obj instanceof Number) && !isNaN(obj)) { - return true; - } - return false; -} -/** - * @returns whether the provided parameter is a JavaScript Boolean or not. - */ -function isBoolean(obj) { - return obj === true || obj === false; -} -/** - * @returns whether the provided parameter is undefined. - */ -function isUndefined(obj) { - return typeof (obj) === _typeof.undefined; -} -/** - * @returns whether the provided parameter is undefined or null. - */ -function isUndefinedOrNull(obj) { - return isUndefined(obj) || obj === null; -} -var hasOwnProperty = Object.prototype.hasOwnProperty; -/** - * @returns whether the provided parameter is an empty JavaScript Object or not. - */ -function isEmptyObject(obj) { - if (!isObject(obj)) { - return false; - } - for (var key in obj) { - if (hasOwnProperty.call(obj, key)) { - return false; - } - } - return true; -} -/** - * @returns whether the provided parameter is a JavaScript Function or not. - */ -function isFunction(obj) { - return typeof obj === _typeof.function; -} -function validateConstraints(args, constraints) { - var len = Math.min(args.length, constraints.length); - for (var i = 0; i < len; i++) { - validateConstraint(args[i], constraints[i]); - } -} -function validateConstraint(arg, constraint) { - if (isString(constraint)) { - if (typeof arg !== constraint) { - throw new Error("argument does not match constraint: typeof " + constraint); - } - } - else if (isFunction(constraint)) { - try { - if (arg instanceof constraint) { - return; - } - } - catch (_a) { - // ignore - } - if (!isUndefinedOrNull(arg) && arg.constructor === constraint) { - return; - } - if (constraint.length === 1 && constraint.call(undefined, arg) === true) { - return; - } - throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true"); - } -} -function getAllPropertyNames(obj) { - var res = []; - var proto = Object.getPrototypeOf(obj); - while (Object.prototype !== proto) { - res = res.concat(Object.getOwnPropertyNames(proto)); - proto = Object.getPrototypeOf(proto); - } - return res; -} -/** - * Converts null to undefined, passes all other values through. - */ -function withNullAsUndefined(x) { - return x === null ? undefined : x; -} -/** - * Converts undefined to null, passes all other values through. - */ -function withUndefinedAsNull(x) { - return typeof x === 'undefined' ? null : x; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/uri.js": -/*!**************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/uri.js ***! - \**************************************************************/ -/*! exports provided: URI */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "URI", function() { return URI; }); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var _a; - -var _schemePattern = /^\w[\w\d+.-]*$/; -var _singleSlashStart = /^\//; -var _doubleSlashStart = /^\/\//; -var _throwOnMissingSchema = true; -function _validateUri(ret, _strict) { - // scheme, must be set - if (!ret.scheme) { - if (_strict || _throwOnMissingSchema) { - throw new Error("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); - } - else { - console.warn("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}"); - } - } - // scheme, https://tools.ietf.org/html/rfc3986#section-3.1 - // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) - if (ret.scheme && !_schemePattern.test(ret.scheme)) { - throw new Error('[UriError]: Scheme contains illegal characters.'); - } - // path, http://tools.ietf.org/html/rfc3986#section-3.3 - // If a URI contains an authority component, then the path component - // must either be empty or begin with a slash ("/") character. If a URI - // does not contain an authority component, then the path cannot begin - // with two slash characters ("//"). - if (ret.path) { - if (ret.authority) { - if (!_singleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character'); - } - } - else { - if (_doubleSlashStart.test(ret.path)) { - throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")'); - } - } - } -} -// for a while we allowed uris *without* schemes and this is the migration -// for them, e.g. an uri without scheme and without strict-mode warns and falls -// back to the file-scheme. that should cause the least carnage and still be a -// clear warning -function _schemeFix(scheme, _strict) { - if (_strict || _throwOnMissingSchema) { - return scheme || _empty; - } - if (!scheme) { - console.trace('BAD uri lacks scheme, falling back to file-scheme.'); - scheme = 'file'; - } - return scheme; -} -// implements a bit of https://tools.ietf.org/html/rfc3986#section-5 -function _referenceResolution(scheme, path) { - // the slash-character is our 'default base' as we don't - // support constructing URIs relative to other URIs. This - // also means that we alter and potentially break paths. - // see https://tools.ietf.org/html/rfc3986#section-5.1.4 - switch (scheme) { - case 'https': - case 'http': - case 'file': - if (!path) { - path = _slash; - } - else if (path[0] !== _slash) { - path = _slash + path; - } - break; - } - return path; -} -var _empty = ''; -var _slash = '/'; -var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; -/** - * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986. - * This class is a simple parser which creates the basic component parts - * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation - * and encoding. - * - * foo://example.com:8042/over/there?name=ferret#nose - * \_/ \______________/\_________/ \_________/ \__/ - * | | | | | - * scheme authority path query fragment - * | _____________________|__ - * / \ / \ - * urn:example:animal:ferret:nose - */ -var URI = /** @class */ (function () { - /** - * @internal - */ - function URI(schemeOrData, authority, path, query, fragment, _strict) { - if (_strict === void 0) { _strict = false; } - if (typeof schemeOrData === 'object') { - this.scheme = schemeOrData.scheme || _empty; - this.authority = schemeOrData.authority || _empty; - this.path = schemeOrData.path || _empty; - this.query = schemeOrData.query || _empty; - this.fragment = schemeOrData.fragment || _empty; - // no validation because it's this URI - // that creates uri components. - // _validateUri(this); - } - else { - this.scheme = _schemeFix(schemeOrData, _strict); - this.authority = authority || _empty; - this.path = _referenceResolution(this.scheme, path || _empty); - this.query = query || _empty; - this.fragment = fragment || _empty; - _validateUri(this, _strict); - } - } - URI.isUri = function (thing) { - if (thing instanceof URI) { - return true; - } - if (!thing) { - return false; - } - return typeof thing.authority === 'string' - && typeof thing.fragment === 'string' - && typeof thing.path === 'string' - && typeof thing.query === 'string' - && typeof thing.scheme === 'string' - && typeof thing.fsPath === 'function' - && typeof thing.with === 'function' - && typeof thing.toString === 'function'; - }; - Object.defineProperty(URI.prototype, "fsPath", { - // ---- filesystem path ----------------------- - /** - * Returns a string representing the corresponding file system path of this URI. - * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the - * platform specific path separator. - * - * * Will *not* validate the path for invalid characters and semantics. - * * Will *not* look at the scheme of this URI. - * * The result shall *not* be used for display purposes but for accessing a file on disk. - * - * - * The *difference* to `URI#path` is the use of the platform specific separator and the handling - * of UNC paths. See the below sample of a file-uri with an authority (UNC path). - * - * ```ts - const u = URI.parse('file://server/c$/folder/file.txt') - u.authority === 'server' - u.path === '/shares/c$/file.txt' - u.fsPath === '\\server\c$\folder\file.txt' - ``` - * - * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path, - * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working - * with URIs that represent files on disk (`file` scheme). - */ - get: function () { - // if (this.scheme !== 'file') { - // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`); - // } - return _makeFsPath(this); - }, - enumerable: true, - configurable: true - }); - // ---- modify to new ------------------------- - URI.prototype.with = function (change) { - if (!change) { - return this; - } - var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment; - if (scheme === undefined) { - scheme = this.scheme; - } - else if (scheme === null) { - scheme = _empty; - } - if (authority === undefined) { - authority = this.authority; - } - else if (authority === null) { - authority = _empty; - } - if (path === undefined) { - path = this.path; - } - else if (path === null) { - path = _empty; - } - if (query === undefined) { - query = this.query; - } - else if (query === null) { - query = _empty; - } - if (fragment === undefined) { - fragment = this.fragment; - } - else if (fragment === null) { - fragment = _empty; - } - if (scheme === this.scheme - && authority === this.authority - && path === this.path - && query === this.query - && fragment === this.fragment) { - return this; - } - return new _URI(scheme, authority, path, query, fragment); - }; - // ---- parse & validate ------------------------ - /** - * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`, - * `file:///usr/home`, or `scheme:with/path`. - * - * @param value A string which represents an URI (see `URI#toString`). - */ - URI.parse = function (value, _strict) { - if (_strict === void 0) { _strict = false; } - var match = _regexp.exec(value); - if (!match) { - return new _URI(_empty, _empty, _empty, _empty, _empty); - } - return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty), _strict); - }; - /** - * Creates a new URI from a file system path, e.g. `c:\my\files`, - * `/usr/home`, or `\\server\share\some\path`. - * - * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument - * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as** - * `URI.parse('file://' + path)` because the path might contain characters that are - * interpreted (# and ?). See the following sample: - * ```ts - const good = URI.file('/coding/c#/project1'); - good.scheme === 'file'; - good.path === '/coding/c#/project1'; - good.fragment === ''; - const bad = URI.parse('file://' + '/coding/c#/project1'); - bad.scheme === 'file'; - bad.path === '/coding/c'; // path is now broken - bad.fragment === '/project1'; - ``` - * - * @param path A file system path (see `URI#fsPath`) - */ - URI.file = function (path) { - var authority = _empty; - // normalize to fwd-slashes on windows, - // on other systems bwd-slashes are valid - // filename character, eg /f\oo/ba\r.txt - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) { - path = path.replace(/\\/g, _slash); - } - // check for authority as used in UNC shares - // or use the path as given - if (path[0] === _slash && path[1] === _slash) { - var idx = path.indexOf(_slash, 2); - if (idx === -1) { - authority = path.substring(2); - path = _slash; - } - else { - authority = path.substring(2, idx); - path = path.substring(idx) || _slash; - } - } - return new _URI('file', authority, path, _empty, _empty); - }; - URI.from = function (components) { - return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment); - }; - // ---- printing/externalize --------------------------- - /** - * Creates a string representation for this URI. It's guaranteed that calling - * `URI.parse` with the result of this function creates an URI which is equal - * to this URI. - * - * * The result shall *not* be used for display purposes but for externalization or transport. - * * The result will be encoded using the percentage encoding and encoding happens mostly - * ignore the scheme-specific encoding rules. - * - * @param skipEncoding Do not encode the result, default is `false` - */ - URI.prototype.toString = function (skipEncoding) { - if (skipEncoding === void 0) { skipEncoding = false; } - return _asFormatted(this, skipEncoding); - }; - URI.prototype.toJSON = function () { - return this; - }; - URI.revive = function (data) { - if (!data) { - return data; - } - else if (data instanceof URI) { - return data; - } - else { - var result = new _URI(data); - result._fsPath = data.fsPath; - result._formatted = data.external; - return result; - } - }; - return URI; -}()); - -// tslint:disable-next-line:class-name -var _URI = /** @class */ (function (_super) { - __extends(_URI, _super); - function _URI() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._formatted = null; - _this._fsPath = null; - return _this; - } - Object.defineProperty(_URI.prototype, "fsPath", { - get: function () { - if (!this._fsPath) { - this._fsPath = _makeFsPath(this); - } - return this._fsPath; - }, - enumerable: true, - configurable: true - }); - _URI.prototype.toString = function (skipEncoding) { - if (skipEncoding === void 0) { skipEncoding = false; } - if (!skipEncoding) { - if (!this._formatted) { - this._formatted = _asFormatted(this, false); - } - return this._formatted; - } - else { - // we don't cache that - return _asFormatted(this, true); - } - }; - _URI.prototype.toJSON = function () { - var res = { - $mid: 1 - }; - // cached state - if (this._fsPath) { - res.fsPath = this._fsPath; - } - if (this._formatted) { - res.external = this._formatted; - } - // uri components - if (this.path) { - res.path = this.path; - } - if (this.scheme) { - res.scheme = this.scheme; - } - if (this.authority) { - res.authority = this.authority; - } - if (this.query) { - res.query = this.query; - } - if (this.fragment) { - res.fragment = this.fragment; - } - return res; - }; - return _URI; -}(URI)); -// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2 -var encodeTable = (_a = {}, - _a[58 /* Colon */] = '%3A', - _a[47 /* Slash */] = '%2F', - _a[63 /* QuestionMark */] = '%3F', - _a[35 /* Hash */] = '%23', - _a[91 /* OpenSquareBracket */] = '%5B', - _a[93 /* CloseSquareBracket */] = '%5D', - _a[64 /* AtSign */] = '%40', - _a[33 /* ExclamationMark */] = '%21', - _a[36 /* DollarSign */] = '%24', - _a[38 /* Ampersand */] = '%26', - _a[39 /* SingleQuote */] = '%27', - _a[40 /* OpenParen */] = '%28', - _a[41 /* CloseParen */] = '%29', - _a[42 /* Asterisk */] = '%2A', - _a[43 /* Plus */] = '%2B', - _a[44 /* Comma */] = '%2C', - _a[59 /* Semicolon */] = '%3B', - _a[61 /* Equals */] = '%3D', - _a[32 /* Space */] = '%20', - _a); -function encodeURIComponentFast(uriComponent, allowSlash) { - var res = undefined; - var nativeEncodePos = -1; - for (var pos = 0; pos < uriComponent.length; pos++) { - var code = uriComponent.charCodeAt(pos); - // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3 - if ((code >= 97 /* a */ && code <= 122 /* z */) - || (code >= 65 /* A */ && code <= 90 /* Z */) - || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */) - || code === 45 /* Dash */ - || code === 46 /* Period */ - || code === 95 /* Underline */ - || code === 126 /* Tilde */ - || (allowSlash && code === 47 /* Slash */)) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // check if we write into a new string (by default we try to return the param) - if (res !== undefined) { - res += uriComponent.charAt(pos); - } - } - else { - // encoding needed, we need to allocate a new string - if (res === undefined) { - res = uriComponent.substr(0, pos); - } - // check with default table first - var escaped = encodeTable[code]; - if (escaped !== undefined) { - // check if we are delaying native encode - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos)); - nativeEncodePos = -1; - } - // append escaped variant to result - res += escaped; - } - else if (nativeEncodePos === -1) { - // use native encode only when needed - nativeEncodePos = pos; - } - } - } - if (nativeEncodePos !== -1) { - res += encodeURIComponent(uriComponent.substring(nativeEncodePos)); - } - return res !== undefined ? res : uriComponent; -} -function encodeURIComponentMinimal(path) { - var res = undefined; - for (var pos = 0; pos < path.length; pos++) { - var code = path.charCodeAt(pos); - if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) { - if (res === undefined) { - res = path.substr(0, pos); - } - res += encodeTable[code]; - } - else { - if (res !== undefined) { - res += path[pos]; - } - } - } - return res !== undefined ? res : path; -} -/** - * Compute `fsPath` for the given uri - */ -function _makeFsPath(uri) { - var value; - if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') { - // unc path: file://shares/c$/far/boo - value = "//" + uri.authority + uri.path; - } - else if (uri.path.charCodeAt(0) === 47 /* Slash */ - && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */) - && uri.path.charCodeAt(2) === 58 /* Colon */) { - // windows drive letter: file:///c:/far/boo - value = uri.path[1].toLowerCase() + uri.path.substr(2); - } - else { - // other path - value = uri.path; - } - if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) { - value = value.replace(/\//g, '\\'); - } - return value; -} -/** - * Create the external version of a uri - */ -function _asFormatted(uri, skipEncoding) { - var encoder = !skipEncoding - ? encodeURIComponentFast - : encodeURIComponentMinimal; - var res = ''; - var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment; - if (scheme) { - res += scheme; - res += ':'; - } - if (authority || scheme === 'file') { - res += _slash; - res += _slash; - } - if (authority) { - var idx = authority.indexOf('@'); - if (idx !== -1) { - // @ - var userinfo = authority.substr(0, idx); - authority = authority.substr(idx + 1); - idx = userinfo.indexOf(':'); - if (idx === -1) { - res += encoder(userinfo, false); - } - else { - // :@ - res += encoder(userinfo.substr(0, idx), false); - res += ':'; - res += encoder(userinfo.substr(idx + 1), false); - } - res += '@'; - } - authority = authority.toLowerCase(); - idx = authority.indexOf(':'); - if (idx === -1) { - res += encoder(authority, false); - } - else { - // : - res += encoder(authority.substr(0, idx), false); - res += authority.substr(idx); - } - } - if (path) { - // lower-case windows drive letters in /C:/fff or C:/fff - if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) { - var code = path.charCodeAt(1); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3 - } - } - else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) { - var code = path.charCodeAt(0); - if (code >= 65 /* A */ && code <= 90 /* Z */) { - path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3 - } - } - // encode the rest of the path - res += encoder(path, true); - } - if (query) { - res += '?'; - res += encoder(query, false); - } - if (fragment) { - res += '#'; - res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment; - } - return res; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js ***! - \******************************************************************************/ -/*! exports provided: logOnceWebWorkerWarning, SimpleWorkerClient, SimpleWorkerServer, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logOnceWebWorkerWarning", function() { return logOnceWebWorkerWarning; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerClient", function() { return SimpleWorkerClient; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerServer", function() { return SimpleWorkerServer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors.js */ "./node_modules/monaco-editor/esm/vs/base/common/errors.js"); -/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lifecycle.js */ "./node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"); -/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -var INITIALIZE = '$initialize'; -var webWorkerWarningLogged = false; -function logOnceWebWorkerWarning(err) { - if (!_platform_js__WEBPACK_IMPORTED_MODULE_2__["isWeb"]) { - // running tests - return; - } - if (!webWorkerWarningLogged) { - webWorkerWarningLogged = true; - console.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq'); - } - console.warn(err.message); -} -var SimpleWorkerProtocol = /** @class */ (function () { - function SimpleWorkerProtocol(handler) { - this._workerId = -1; - this._handler = handler; - this._lastSentReq = 0; - this._pendingReplies = Object.create(null); - } - SimpleWorkerProtocol.prototype.setWorkerId = function (workerId) { - this._workerId = workerId; - }; - SimpleWorkerProtocol.prototype.sendMessage = function (method, args) { - var _this = this; - var req = String(++this._lastSentReq); - return new Promise(function (resolve, reject) { - _this._pendingReplies[req] = { - resolve: resolve, - reject: reject - }; - _this._send({ - vsWorker: _this._workerId, - req: req, - method: method, - args: args - }); - }); - }; - SimpleWorkerProtocol.prototype.handleMessage = function (serializedMessage) { - var message; - try { - message = JSON.parse(serializedMessage); - } - catch (e) { - // nothing - return; - } - if (!message || !message.vsWorker) { - return; - } - if (this._workerId !== -1 && message.vsWorker !== this._workerId) { - return; - } - this._handleMessage(message); - }; - SimpleWorkerProtocol.prototype._handleMessage = function (msg) { - var _this = this; - if (msg.seq) { - var replyMessage = msg; - if (!this._pendingReplies[replyMessage.seq]) { - console.warn('Got reply to unknown seq'); - return; - } - var reply = this._pendingReplies[replyMessage.seq]; - delete this._pendingReplies[replyMessage.seq]; - if (replyMessage.err) { - var err = replyMessage.err; - if (replyMessage.err.$isError) { - err = new Error(); - err.name = replyMessage.err.name; - err.message = replyMessage.err.message; - err.stack = replyMessage.err.stack; - } - reply.reject(err); - return; - } - reply.resolve(replyMessage.res); - return; - } - var requestMessage = msg; - var req = requestMessage.req; - var result = this._handler.handleMessage(requestMessage.method, requestMessage.args); - result.then(function (r) { - _this._send({ - vsWorker: _this._workerId, - seq: req, - res: r, - err: undefined - }); - }, function (e) { - if (e.detail instanceof Error) { - // Loading errors have a detail property that points to the actual error - e.detail = Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e.detail); - } - _this._send({ - vsWorker: _this._workerId, - seq: req, - res: undefined, - err: Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e) - }); - }); - }; - SimpleWorkerProtocol.prototype._send = function (msg) { - var strMsg = JSON.stringify(msg); - // console.log('SENDING: ' + strMsg); - this._handler.sendMessage(strMsg); - }; - return SimpleWorkerProtocol; -}()); -/** - * Main thread side - */ -var SimpleWorkerClient = /** @class */ (function (_super) { - __extends(SimpleWorkerClient, _super); - function SimpleWorkerClient(workerFactory, moduleId) { - var _this = _super.call(this) || this; - var lazyProxyReject = null; - _this._worker = _this._register(workerFactory.create('vs/base/common/worker/simpleWorker', function (msg) { - _this._protocol.handleMessage(msg); - }, function (err) { - // in Firefox, web workers fail lazily :( - // we will reject the proxy - if (lazyProxyReject) { - lazyProxyReject(err); - } - })); - _this._protocol = new SimpleWorkerProtocol({ - sendMessage: function (msg) { - _this._worker.postMessage(msg); - }, - handleMessage: function (method, args) { - // Intentionally not supporting worker -> main requests - return Promise.resolve(null); - } - }); - _this._protocol.setWorkerId(_this._worker.getId()); - // Gather loader configuration - var loaderConfiguration = null; - if (typeof self.require !== 'undefined' && typeof self.require.getConfig === 'function') { - // Get the configuration from the Monaco AMD Loader - loaderConfiguration = self.require.getConfig(); - } - else if (typeof self.requirejs !== 'undefined') { - // Get the configuration from requirejs - loaderConfiguration = self.requirejs.s.contexts._.config; - } - // Send initialize message - _this._onModuleLoaded = _this._protocol.sendMessage(INITIALIZE, [ - _this._worker.getId(), - moduleId, - loaderConfiguration - ]); - _this._lazyProxy = new Promise(function (resolve, reject) { - lazyProxyReject = reject; - _this._onModuleLoaded.then(function (availableMethods) { - var proxy = {}; - for (var _i = 0, availableMethods_1 = availableMethods; _i < availableMethods_1.length; _i++) { - var methodName = availableMethods_1[_i]; - proxy[methodName] = createProxyMethod(methodName, proxyMethodRequest); - } - resolve(proxy); - }, function (e) { - reject(e); - _this._onError('Worker failed to load ' + moduleId, e); - }); - }); - // Create proxy to loaded code - var proxyMethodRequest = function (method, args) { - return _this._request(method, args); - }; - var createProxyMethod = function (method, proxyMethodRequest) { - return function () { - var args = Array.prototype.slice.call(arguments, 0); - return proxyMethodRequest(method, args); - }; - }; - return _this; - } - SimpleWorkerClient.prototype.getProxyObject = function () { - return this._lazyProxy; - }; - SimpleWorkerClient.prototype._request = function (method, args) { - var _this = this; - return new Promise(function (resolve, reject) { - _this._onModuleLoaded.then(function () { - _this._protocol.sendMessage(method, args).then(resolve, reject); - }, reject); - }); - }; - SimpleWorkerClient.prototype._onError = function (message, error) { - console.error(message); - console.info(error); - }; - return SimpleWorkerClient; -}(_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"])); - -/** - * Worker side - */ -var SimpleWorkerServer = /** @class */ (function () { - function SimpleWorkerServer(postSerializedMessage, requestHandler) { - var _this = this; - this._requestHandler = requestHandler; - this._protocol = new SimpleWorkerProtocol({ - sendMessage: function (msg) { - postSerializedMessage(msg); - }, - handleMessage: function (method, args) { return _this._handleMessage(method, args); } - }); - } - SimpleWorkerServer.prototype.onmessage = function (msg) { - this._protocol.handleMessage(msg); - }; - SimpleWorkerServer.prototype._handleMessage = function (method, args) { - if (method === INITIALIZE) { - return this.initialize(args[0], args[1], args[2]); - } - if (!this._requestHandler || typeof this._requestHandler[method] !== 'function') { - return Promise.reject(new Error('Missing requestHandler or method: ' + method)); - } - try { - return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args)); - } - catch (e) { - return Promise.reject(e); - } - }; - SimpleWorkerServer.prototype.initialize = function (workerId, moduleId, loaderConfig) { - var _this = this; - this._protocol.setWorkerId(workerId); - if (this._requestHandler) { - // static request handler - var methods = []; - for (var _i = 0, _a = Object(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllPropertyNames"])(this._requestHandler); _i < _a.length; _i++) { - var prop = _a[_i]; - if (typeof this._requestHandler[prop] === 'function') { - methods.push(prop); - } - } - return Promise.resolve(methods); - } - if (loaderConfig) { - // Remove 'baseUrl', handling it is beyond scope for now - if (typeof loaderConfig.baseUrl !== 'undefined') { - delete loaderConfig['baseUrl']; - } - if (typeof loaderConfig.paths !== 'undefined') { - if (typeof loaderConfig.paths.vs !== 'undefined') { - delete loaderConfig.paths['vs']; - } - } - // Since this is in a web worker, enable catching errors - loaderConfig.catchError = true; - self.require.config(loaderConfig); - } - return new Promise(function (resolve, reject) { - // Use the global require to be sure to get the global config - self.require([moduleId], function () { - var result = []; - for (var _i = 0; _i < arguments.length; _i++) { - result[_i] = arguments[_i]; - } - var handlerModule = result[0]; - _this._requestHandler = handlerModule.create(); - if (!_this._requestHandler) { - reject(new Error("No RequestHandler!")); - return; - } - var methods = []; - for (var _a = 0, _b = Object(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllPropertyNames"])(_this._requestHandler); _a < _b.length; _a++) { - var prop = _b[_a]; - if (typeof _this._requestHandler[prop] === 'function') { - methods.push(prop); - } - } - resolve(methods); - }, reject); - }); - }; - return SimpleWorkerServer; -}()); - -/** - * Called on the worker side - */ -function create(postMessage) { - return new SimpleWorkerServer(postMessage, null); -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js ***! - \*************************************************************************************/ -/*! exports provided: CharacterClassifier, CharacterSet */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterClassifier", function() { return CharacterClassifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterSet", function() { return CharacterSet; }); -/* harmony import */ var _uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uint.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * A fast character classifier that uses a compact array for ASCII values. - */ -var CharacterClassifier = /** @class */ (function () { - function CharacterClassifier(_defaultValue) { - var defaultValue = Object(_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_defaultValue); - this._defaultValue = defaultValue; - this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue); - this._map = new Map(); - } - CharacterClassifier._createAsciiMap = function (defaultValue) { - var asciiMap = new Uint8Array(256); - for (var i = 0; i < 256; i++) { - asciiMap[i] = defaultValue; - } - return asciiMap; - }; - CharacterClassifier.prototype.set = function (charCode, _value) { - var value = Object(_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_value); - if (charCode >= 0 && charCode < 256) { - this._asciiMap[charCode] = value; - } - else { - this._map.set(charCode, value); - } - }; - CharacterClassifier.prototype.get = function (charCode) { - if (charCode >= 0 && charCode < 256) { - return this._asciiMap[charCode]; - } - else { - return (this._map.get(charCode) || this._defaultValue); - } - }; - return CharacterClassifier; -}()); - -var CharacterSet = /** @class */ (function () { - function CharacterSet() { - this._actual = new CharacterClassifier(0 /* False */); - } - CharacterSet.prototype.add = function (charCode) { - this._actual.set(charCode, 1 /* True */); - }; - CharacterSet.prototype.has = function (charCode) { - return (this._actual.get(charCode) === 1 /* True */); - }; - return CharacterSet; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/position.js ***! - \**************************************************************************/ -/*! exports provided: Position */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -/** - * A position in the editor. - */ -var Position = /** @class */ (function () { - function Position(lineNumber, column) { - this.lineNumber = lineNumber; - this.column = column; - } - /** - * Create a new postion from this position. - * - * @param newLineNumber new line number - * @param newColumn new column - */ - Position.prototype.with = function (newLineNumber, newColumn) { - if (newLineNumber === void 0) { newLineNumber = this.lineNumber; } - if (newColumn === void 0) { newColumn = this.column; } - if (newLineNumber === this.lineNumber && newColumn === this.column) { - return this; - } - else { - return new Position(newLineNumber, newColumn); - } - }; - /** - * Derive a new position from this position. - * - * @param deltaLineNumber line number delta - * @param deltaColumn column delta - */ - Position.prototype.delta = function (deltaLineNumber, deltaColumn) { - if (deltaLineNumber === void 0) { deltaLineNumber = 0; } - if (deltaColumn === void 0) { deltaColumn = 0; } - return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn); - }; - /** - * Test if this position equals other position - */ - Position.prototype.equals = function (other) { - return Position.equals(this, other); - }; - /** - * Test if position `a` equals position `b` - */ - Position.equals = function (a, b) { - if (!a && !b) { - return true; - } - return (!!a && - !!b && - a.lineNumber === b.lineNumber && - a.column === b.column); - }; - /** - * Test if this position is before other position. - * If the two positions are equal, the result will be false. - */ - Position.prototype.isBefore = function (other) { - return Position.isBefore(this, other); - }; - /** - * Test if position `a` is before position `b`. - * If the two positions are equal, the result will be false. - */ - Position.isBefore = function (a, b) { - if (a.lineNumber < b.lineNumber) { - return true; - } - if (b.lineNumber < a.lineNumber) { - return false; - } - return a.column < b.column; - }; - /** - * Test if this position is before other position. - * If the two positions are equal, the result will be true. - */ - Position.prototype.isBeforeOrEqual = function (other) { - return Position.isBeforeOrEqual(this, other); - }; - /** - * Test if position `a` is before position `b`. - * If the two positions are equal, the result will be true. - */ - Position.isBeforeOrEqual = function (a, b) { - if (a.lineNumber < b.lineNumber) { - return true; - } - if (b.lineNumber < a.lineNumber) { - return false; - } - return a.column <= b.column; - }; - /** - * A function that compares positions, useful for sorting - */ - Position.compare = function (a, b) { - var aLineNumber = a.lineNumber | 0; - var bLineNumber = b.lineNumber | 0; - if (aLineNumber === bLineNumber) { - var aColumn = a.column | 0; - var bColumn = b.column | 0; - return aColumn - bColumn; - } - return aLineNumber - bLineNumber; - }; - /** - * Clone this position. - */ - Position.prototype.clone = function () { - return new Position(this.lineNumber, this.column); - }; - /** - * Convert to a human-readable representation. - */ - Position.prototype.toString = function () { - return '(' + this.lineNumber + ',' + this.column + ')'; - }; - // --- - /** - * Create a `Position` from an `IPosition`. - */ - Position.lift = function (pos) { - return new Position(pos.lineNumber, pos.column); - }; - /** - * Test if `obj` is an `IPosition`. - */ - Position.isIPosition = function (obj) { - return (obj - && (typeof obj.lineNumber === 'number') - && (typeof obj.column === 'number')); - }; - return Position; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/range.js ***! - \***********************************************************************/ -/*! exports provided: Range */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; }); -/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn) - */ -var Range = /** @class */ (function () { - function Range(startLineNumber, startColumn, endLineNumber, endColumn) { - if ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) { - this.startLineNumber = endLineNumber; - this.startColumn = endColumn; - this.endLineNumber = startLineNumber; - this.endColumn = startColumn; - } - else { - this.startLineNumber = startLineNumber; - this.startColumn = startColumn; - this.endLineNumber = endLineNumber; - this.endColumn = endColumn; - } - } - /** - * Test if this range is empty. - */ - Range.prototype.isEmpty = function () { - return Range.isEmpty(this); - }; - /** - * Test if `range` is empty. - */ - Range.isEmpty = function (range) { - return (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn); - }; - /** - * Test if position is in this range. If the position is at the edges, will return true. - */ - Range.prototype.containsPosition = function (position) { - return Range.containsPosition(this, position); - }; - /** - * Test if `position` is in `range`. If the position is at the edges, will return true. - */ - Range.containsPosition = function (range, position) { - if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) { - return false; - } - if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) { - return false; - } - if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) { - return false; - } - return true; - }; - /** - * Test if range is in this range. If the range is equal to this range, will return true. - */ - Range.prototype.containsRange = function (range) { - return Range.containsRange(this, range); - }; - /** - * Test if `otherRange` is in `range`. If the ranges are equal, will return true. - */ - Range.containsRange = function (range, otherRange) { - if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) { - return false; - } - if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) { - return false; - } - if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) { - return false; - } - if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) { - return false; - } - return true; - }; - /** - * A reunion of the two ranges. - * The smallest position will be used as the start point, and the largest one as the end point. - */ - Range.prototype.plusRange = function (range) { - return Range.plusRange(this, range); - }; - /** - * A reunion of the two ranges. - * The smallest position will be used as the start point, and the largest one as the end point. - */ - Range.plusRange = function (a, b) { - var startLineNumber; - var startColumn; - var endLineNumber; - var endColumn; - if (b.startLineNumber < a.startLineNumber) { - startLineNumber = b.startLineNumber; - startColumn = b.startColumn; - } - else if (b.startLineNumber === a.startLineNumber) { - startLineNumber = b.startLineNumber; - startColumn = Math.min(b.startColumn, a.startColumn); - } - else { - startLineNumber = a.startLineNumber; - startColumn = a.startColumn; - } - if (b.endLineNumber > a.endLineNumber) { - endLineNumber = b.endLineNumber; - endColumn = b.endColumn; - } - else if (b.endLineNumber === a.endLineNumber) { - endLineNumber = b.endLineNumber; - endColumn = Math.max(b.endColumn, a.endColumn); - } - else { - endLineNumber = a.endLineNumber; - endColumn = a.endColumn; - } - return new Range(startLineNumber, startColumn, endLineNumber, endColumn); - }; - /** - * A intersection of the two ranges. - */ - Range.prototype.intersectRanges = function (range) { - return Range.intersectRanges(this, range); - }; - /** - * A intersection of the two ranges. - */ - Range.intersectRanges = function (a, b) { - var resultStartLineNumber = a.startLineNumber; - var resultStartColumn = a.startColumn; - var resultEndLineNumber = a.endLineNumber; - var resultEndColumn = a.endColumn; - var otherStartLineNumber = b.startLineNumber; - var otherStartColumn = b.startColumn; - var otherEndLineNumber = b.endLineNumber; - var otherEndColumn = b.endColumn; - if (resultStartLineNumber < otherStartLineNumber) { - resultStartLineNumber = otherStartLineNumber; - resultStartColumn = otherStartColumn; - } - else if (resultStartLineNumber === otherStartLineNumber) { - resultStartColumn = Math.max(resultStartColumn, otherStartColumn); - } - if (resultEndLineNumber > otherEndLineNumber) { - resultEndLineNumber = otherEndLineNumber; - resultEndColumn = otherEndColumn; - } - else if (resultEndLineNumber === otherEndLineNumber) { - resultEndColumn = Math.min(resultEndColumn, otherEndColumn); - } - // Check if selection is now empty - if (resultStartLineNumber > resultEndLineNumber) { - return null; - } - if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) { - return null; - } - return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn); - }; - /** - * Test if this range equals other. - */ - Range.prototype.equalsRange = function (other) { - return Range.equalsRange(this, other); - }; - /** - * Test if range `a` equals `b`. - */ - Range.equalsRange = function (a, b) { - return (!!a && - !!b && - a.startLineNumber === b.startLineNumber && - a.startColumn === b.startColumn && - a.endLineNumber === b.endLineNumber && - a.endColumn === b.endColumn); - }; - /** - * Return the end position (which will be after or equal to the start position) - */ - Range.prototype.getEndPosition = function () { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.endLineNumber, this.endColumn); - }; - /** - * Return the start position (which will be before or equal to the end position) - */ - Range.prototype.getStartPosition = function () { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.startLineNumber, this.startColumn); - }; - /** - * Transform to a user presentable string representation. - */ - Range.prototype.toString = function () { - return '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']'; - }; - /** - * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position. - */ - Range.prototype.setEndPosition = function (endLineNumber, endColumn) { - return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn); - }; - /** - * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position. - */ - Range.prototype.setStartPosition = function (startLineNumber, startColumn) { - return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn); - }; - /** - * Create a new empty range using this range's start position. - */ - Range.prototype.collapseToStart = function () { - return Range.collapseToStart(this); - }; - /** - * Create a new empty range using this range's start position. - */ - Range.collapseToStart = function (range) { - return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn); - }; - // --- - Range.fromPositions = function (start, end) { - if (end === void 0) { end = start; } - return new Range(start.lineNumber, start.column, end.lineNumber, end.column); - }; - Range.lift = function (range) { - if (!range) { - return null; - } - return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn); - }; - /** - * Test if `obj` is an `IRange`. - */ - Range.isIRange = function (obj) { - return (obj - && (typeof obj.startLineNumber === 'number') - && (typeof obj.startColumn === 'number') - && (typeof obj.endLineNumber === 'number') - && (typeof obj.endColumn === 'number')); - }; - /** - * Test if the two ranges are touching in any way. - */ - Range.areIntersectingOrTouching = function (a, b) { - // Check if `a` is before `b` - if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) { - return false; - } - // Check if `b` is before `a` - if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) { - return false; - } - // These ranges must intersect - return true; - }; - /** - * Test if the two ranges are intersecting. If the ranges are touching it returns true. - */ - Range.areIntersecting = function (a, b) { - // Check if `a` is before `b` - if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) { - return false; - } - // Check if `b` is before `a` - if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) { - return false; - } - // These ranges must intersect - return true; - }; - /** - * A function that compares ranges, useful for sorting ranges - * It will first compare ranges on the startPosition and then on the endPosition - */ - Range.compareRangesUsingStarts = function (a, b) { - if (a && b) { - var aStartLineNumber = a.startLineNumber | 0; - var bStartLineNumber = b.startLineNumber | 0; - if (aStartLineNumber === bStartLineNumber) { - var aStartColumn = a.startColumn | 0; - var bStartColumn = b.startColumn | 0; - if (aStartColumn === bStartColumn) { - var aEndLineNumber = a.endLineNumber | 0; - var bEndLineNumber = b.endLineNumber | 0; - if (aEndLineNumber === bEndLineNumber) { - var aEndColumn = a.endColumn | 0; - var bEndColumn = b.endColumn | 0; - return aEndColumn - bEndColumn; - } - return aEndLineNumber - bEndLineNumber; - } - return aStartColumn - bStartColumn; - } - return aStartLineNumber - bStartLineNumber; - } - var aExists = (a ? 1 : 0); - var bExists = (b ? 1 : 0); - return aExists - bExists; - }; - /** - * A function that compares ranges, useful for sorting ranges - * It will first compare ranges on the endPosition and then on the startPosition - */ - Range.compareRangesUsingEnds = function (a, b) { - if (a.endLineNumber === b.endLineNumber) { - if (a.endColumn === b.endColumn) { - if (a.startLineNumber === b.startLineNumber) { - return a.startColumn - b.startColumn; - } - return a.startLineNumber - b.startLineNumber; - } - return a.endColumn - b.endColumn; - } - return a.endLineNumber - b.endLineNumber; - }; - /** - * Test if the range spans multiple lines. - */ - Range.spansMultipleLines = function (range) { - return range.endLineNumber > range.startLineNumber; - }; - return Range; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js ***! - \***************************************************************************/ -/*! exports provided: Selection */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Selection", function() { return Selection; }); -/* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -/** - * A selection in the editor. - * The selection is a range that has an orientation. - */ -var Selection = /** @class */ (function (_super) { - __extends(Selection, _super); - function Selection(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) { - var _this = _super.call(this, selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) || this; - _this.selectionStartLineNumber = selectionStartLineNumber; - _this.selectionStartColumn = selectionStartColumn; - _this.positionLineNumber = positionLineNumber; - _this.positionColumn = positionColumn; - return _this; - } - /** - * Clone this selection. - */ - Selection.prototype.clone = function () { - return new Selection(this.selectionStartLineNumber, this.selectionStartColumn, this.positionLineNumber, this.positionColumn); - }; - /** - * Transform to a human-readable representation. - */ - Selection.prototype.toString = function () { - return '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']'; - }; - /** - * Test if equals other selection. - */ - Selection.prototype.equalsSelection = function (other) { - return (Selection.selectionsEqual(this, other)); - }; - /** - * Test if the two selections are equal. - */ - Selection.selectionsEqual = function (a, b) { - return (a.selectionStartLineNumber === b.selectionStartLineNumber && - a.selectionStartColumn === b.selectionStartColumn && - a.positionLineNumber === b.positionLineNumber && - a.positionColumn === b.positionColumn); - }; - /** - * Get directions (LTR or RTL). - */ - Selection.prototype.getDirection = function () { - if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) { - return 0 /* LTR */; - } - return 1 /* RTL */; - }; - /** - * Create a new selection with a different `positionLineNumber` and `positionColumn`. - */ - Selection.prototype.setEndPosition = function (endLineNumber, endColumn) { - if (this.getDirection() === 0 /* LTR */) { - return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn); - } - return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn); - }; - /** - * Get the position at `positionLineNumber` and `positionColumn`. - */ - Selection.prototype.getPosition = function () { - return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.positionLineNumber, this.positionColumn); - }; - /** - * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. - */ - Selection.prototype.setStartPosition = function (startLineNumber, startColumn) { - if (this.getDirection() === 0 /* LTR */) { - return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn); - } - return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn); - }; - // ---- - /** - * Create a `Selection` from one or two positions - */ - Selection.fromPositions = function (start, end) { - if (end === void 0) { end = start; } - return new Selection(start.lineNumber, start.column, end.lineNumber, end.column); - }; - /** - * Create a `Selection` from an `ISelection`. - */ - Selection.liftSelection = function (sel) { - return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn); - }; - /** - * `a` equals `b`. - */ - Selection.selectionsArrEqual = function (a, b) { - if (a && !b || !a && b) { - return false; - } - if (!a && !b) { - return true; - } - if (a.length !== b.length) { - return false; - } - for (var i = 0, len = a.length; i < len; i++) { - if (!this.selectionsEqual(a[i], b[i])) { - return false; - } - } - return true; - }; - /** - * Test if `obj` is an `ISelection`. - */ - Selection.isISelection = function (obj) { - return (obj - && (typeof obj.selectionStartLineNumber === 'number') - && (typeof obj.selectionStartColumn === 'number') - && (typeof obj.positionLineNumber === 'number') - && (typeof obj.positionColumn === 'number')); - }; - /** - * Create with a direction. - */ - Selection.createWithDirection = function (startLineNumber, startColumn, endLineNumber, endColumn, direction) { - if (direction === 0 /* LTR */) { - return new Selection(startLineNumber, startColumn, endLineNumber, endColumn); - } - return new Selection(endLineNumber, endColumn, startLineNumber, startColumn); - }; - return Selection; -}(_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"])); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js": -/*!***********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/token.js ***! - \***********************************************************************/ -/*! exports provided: Token, TokenizationResult, TokenizationResult2 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Token", function() { return Token; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult", function() { return TokenizationResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult2", function() { return TokenizationResult2; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var Token = /** @class */ (function () { - function Token(offset, type, language) { - this.offset = offset | 0; // @perf - this.type = type; - this.language = language; - } - Token.prototype.toString = function () { - return '(' + this.offset + ', ' + this.type + ')'; - }; - return Token; -}()); - -var TokenizationResult = /** @class */ (function () { - function TokenizationResult(tokens, endState) { - this.tokens = tokens; - this.endState = endState; - } - return TokenizationResult; -}()); - -var TokenizationResult2 = /** @class */ (function () { - function TokenizationResult2(tokens, endState) { - this.tokens = tokens; - this.endState = endState; - } - return TokenizationResult2; -}()); - - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js": -/*!**********************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js ***! - \**********************************************************************/ -/*! exports provided: Uint8Matrix, toUint8, toUint32, toUint32Array */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uint8Matrix", function() { return Uint8Matrix; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint8", function() { return toUint8; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint32", function() { return toUint32; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint32Array", function() { return toUint32Array; }); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -var Uint8Matrix = /** @class */ (function () { - function Uint8Matrix(rows, cols, defaultValue) { - var data = new Uint8Array(rows * cols); - for (var i = 0, len = rows * cols; i < len; i++) { - data[i] = defaultValue; - } - this._data = data; - this.rows = rows; - this.cols = cols; - } - Uint8Matrix.prototype.get = function (row, col) { - return this._data[row * this.cols + col]; - }; - Uint8Matrix.prototype.set = function (row, col, value) { - this._data[row * this.cols + col] = value; - }; - return Uint8Matrix; -}()); - -function toUint8(v) { - if (v < 0) { - return 0; - } - if (v > 255 /* MAX_UINT_8 */) { - return 255 /* MAX_UINT_8 */; - } - return v | 0; -} -function toUint32(v) { - if (v < 0) { - return 0; - } - if (v > 4294967295 /* MAX_UINT_32 */) { - return 4294967295 /* MAX_UINT_32 */; - } - return v | 0; -} -function toUint32Array(arr) { - var len = arr.length; - var r = new Uint32Array(len); - for (var i = 0; i < len; i++) { - r[i] = toUint32(arr[i]); - } - return r; -} - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js": -/*!******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js ***! - \******************************************************************************/ -/*! exports provided: DiffComputer */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffComputer", function() { return DiffComputer; }); -/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js"); -/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/strings.js */ "./node_modules/monaco-editor/esm/vs/base/common/strings.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -5528,10 +3564,10 @@ __webpack_require__.r(__webpack_exports__); var MAXIMUM_RUN_TIME = 5000; // 5 seconds var MINIMUM_MATCHING_CHARACTER_LENGTH = 3; function computeDiff(originalSequence, modifiedSequence, continueProcessingPredicate, pretty) { - var diffAlgo = new _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__["LcsDiff"](originalSequence, modifiedSequence, continueProcessingPredicate); + var diffAlgo = new diff_LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate); return diffAlgo.ComputeDiff(pretty); } -var LineMarkerSequence = /** @class */ (function () { +var diffComputer_LineMarkerSequence = /** @class */ (function () { function LineMarkerSequence(lines) { var startColumns = []; var endColumns = []; @@ -5556,14 +3592,14 @@ var LineMarkerSequence = /** @class */ (function () { return i + 1; }; LineMarkerSequence._getFirstNonBlankColumn = function (txt, defaultValue) { - var r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["firstNonWhitespaceIndex"](txt); + var r = firstNonWhitespaceIndex(txt); if (r === -1) { return defaultValue; } return r + 1; }; LineMarkerSequence._getLastNonBlankColumn = function (txt, defaultValue) { - var r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["lastNonWhitespaceIndex"](txt); + var r = lastNonWhitespaceIndex(txt); if (r === -1) { return defaultValue; } @@ -5743,8 +3779,8 @@ var DiffComputer = /** @class */ (function () { this.maximumRunTimeMs = MAXIMUM_RUN_TIME; this.originalLines = originalLines; this.modifiedLines = modifiedLines; - this.original = new LineMarkerSequence(originalLines); - this.modified = new LineMarkerSequence(modifiedLines); + this.original = new diffComputer_LineMarkerSequence(originalLines); + this.modified = new diffComputer_LineMarkerSequence(modifiedLines); } DiffComputer.prototype.computeDiff = function () { if (this.original.getLength() === 1 && this.original.getElementAtIndex(0).length === 0) { @@ -5812,8 +3848,8 @@ var DiffComputer = /** @class */ (function () { // These lines differ only in trim whitespace // Check the leading whitespace { - var originalStartColumn = LineMarkerSequence._getFirstNonBlankColumn(originalLine, 1); - var modifiedStartColumn = LineMarkerSequence._getFirstNonBlankColumn(modifiedLine, 1); + var originalStartColumn = diffComputer_LineMarkerSequence._getFirstNonBlankColumn(originalLine, 1); + var modifiedStartColumn = diffComputer_LineMarkerSequence._getFirstNonBlankColumn(modifiedLine, 1); while (originalStartColumn > 1 && modifiedStartColumn > 1) { var originalChar = originalLine.charCodeAt(originalStartColumn - 2); var modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2); @@ -5829,8 +3865,8 @@ var DiffComputer = /** @class */ (function () { } // Check the trailing whitespace { - var originalEndColumn = LineMarkerSequence._getLastNonBlankColumn(originalLine, 1); - var modifiedEndColumn = LineMarkerSequence._getLastNonBlankColumn(modifiedLine, 1); + var originalEndColumn = diffComputer_LineMarkerSequence._getLastNonBlankColumn(originalLine, 1); + var modifiedEndColumn = diffComputer_LineMarkerSequence._getLastNonBlankColumn(modifiedLine, 1); var originalMaxColumn = originalLine.length + 1; var modifiedMaxColumn = modifiedLine.length + 1; while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) { @@ -5901,28 +3937,267 @@ var DiffComputer = /** @class */ (function () { }()); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var Uint8Matrix = /** @class */ (function () { + function Uint8Matrix(rows, cols, defaultValue) { + var data = new Uint8Array(rows * cols); + for (var i = 0, len = rows * cols; i < len; i++) { + data[i] = defaultValue; + } + this._data = data; + this.rows = rows; + this.cols = cols; + } + Uint8Matrix.prototype.get = function (row, col) { + return this._data[row * this.cols + col]; + }; + Uint8Matrix.prototype.set = function (row, col, value) { + this._data[row * this.cols + col] = value; + }; + return Uint8Matrix; +}()); -/***/ }), +function toUint8(v) { + if (v < 0) { + return 0; + } + if (v > 255 /* MAX_UINT_8 */) { + return 255 /* MAX_UINT_8 */; + } + return v | 0; +} +function toUint32(v) { + if (v < 0) { + return 0; + } + if (v > 4294967295 /* MAX_UINT_32 */) { + return 4294967295 /* MAX_UINT_32 */; + } + return v | 0; +} +function toUint32Array(arr) { + var len = arr.length; + var r = new Uint32Array(len); + for (var i = 0; i < len; i++) { + r[i] = toUint32(arr[i]); + } + return r; +} -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js ***! - \**********************************************************************************/ -/*! exports provided: MirrorTextModel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MirrorTextModel", function() { return MirrorTextModel; }); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../viewModel/prefixSumComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js"); +var PrefixSumIndexOfResult = /** @class */ (function () { + function PrefixSumIndexOfResult(index, remainder) { + this.index = index; + this.remainder = remainder; + } + return PrefixSumIndexOfResult; +}()); + +var prefixSumComputer_PrefixSumComputer = /** @class */ (function () { + function PrefixSumComputer(values) { + this.values = values; + this.prefixSum = new Uint32Array(values.length); + this.prefixSumValidIndex = new Int32Array(1); + this.prefixSumValidIndex[0] = -1; + } + PrefixSumComputer.prototype.getCount = function () { + return this.values.length; + }; + PrefixSumComputer.prototype.insertValues = function (insertIndex, insertValues) { + insertIndex = toUint32(insertIndex); + var oldValues = this.values; + var oldPrefixSum = this.prefixSum; + var insertValuesLen = insertValues.length; + if (insertValuesLen === 0) { + return false; + } + this.values = new Uint32Array(oldValues.length + insertValuesLen); + this.values.set(oldValues.subarray(0, insertIndex), 0); + this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen); + this.values.set(insertValues, insertIndex); + if (insertIndex - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = insertIndex - 1; + } + this.prefixSum = new Uint32Array(this.values.length); + if (this.prefixSumValidIndex[0] >= 0) { + this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); + } + return true; + }; + PrefixSumComputer.prototype.changeValue = function (index, value) { + index = toUint32(index); + value = toUint32(value); + if (this.values[index] === value) { + return false; + } + this.values[index] = value; + if (index - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = index - 1; + } + return true; + }; + PrefixSumComputer.prototype.removeValues = function (startIndex, cnt) { + startIndex = toUint32(startIndex); + cnt = toUint32(cnt); + var oldValues = this.values; + var oldPrefixSum = this.prefixSum; + if (startIndex >= oldValues.length) { + return false; + } + var maxCnt = oldValues.length - startIndex; + if (cnt >= maxCnt) { + cnt = maxCnt; + } + if (cnt === 0) { + return false; + } + this.values = new Uint32Array(oldValues.length - cnt); + this.values.set(oldValues.subarray(0, startIndex), 0); + this.values.set(oldValues.subarray(startIndex + cnt), startIndex); + this.prefixSum = new Uint32Array(this.values.length); + if (startIndex - 1 < this.prefixSumValidIndex[0]) { + this.prefixSumValidIndex[0] = startIndex - 1; + } + if (this.prefixSumValidIndex[0] >= 0) { + this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); + } + return true; + }; + PrefixSumComputer.prototype.getTotalValue = function () { + if (this.values.length === 0) { + return 0; + } + return this._getAccumulatedValue(this.values.length - 1); + }; + PrefixSumComputer.prototype.getAccumulatedValue = function (index) { + if (index < 0) { + return 0; + } + index = toUint32(index); + return this._getAccumulatedValue(index); + }; + PrefixSumComputer.prototype._getAccumulatedValue = function (index) { + if (index <= this.prefixSumValidIndex[0]) { + return this.prefixSum[index]; + } + var startIndex = this.prefixSumValidIndex[0] + 1; + if (startIndex === 0) { + this.prefixSum[0] = this.values[0]; + startIndex++; + } + if (index >= this.values.length) { + index = this.values.length - 1; + } + for (var i = startIndex; i <= index; i++) { + this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i]; + } + this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index); + return this.prefixSum[index]; + }; + PrefixSumComputer.prototype.getIndexOf = function (accumulatedValue) { + accumulatedValue = Math.floor(accumulatedValue); //@perf + // Compute all sums (to get a fully valid prefixSum) + this.getTotalValue(); + var low = 0; + var high = this.values.length - 1; + var mid = 0; + var midStop = 0; + var midStart = 0; + while (low <= high) { + mid = low + ((high - low) / 2) | 0; + midStop = this.prefixSum[mid]; + midStart = midStop - this.values[mid]; + if (accumulatedValue < midStart) { + high = mid - 1; + } + else if (accumulatedValue >= midStop) { + low = mid + 1; + } + else { + break; + } + } + return new PrefixSumIndexOfResult(mid, accumulatedValue - midStart); + }; + return PrefixSumComputer; +}()); + +var PrefixSumComputerWithCache = /** @class */ (function () { + function PrefixSumComputerWithCache(values) { + this._cacheAccumulatedValueStart = 0; + this._cache = null; + this._actual = new prefixSumComputer_PrefixSumComputer(values); + this._bustCache(); + } + PrefixSumComputerWithCache.prototype._bustCache = function () { + this._cacheAccumulatedValueStart = 0; + this._cache = null; + }; + PrefixSumComputerWithCache.prototype.insertValues = function (insertIndex, insertValues) { + if (this._actual.insertValues(insertIndex, insertValues)) { + this._bustCache(); + } + }; + PrefixSumComputerWithCache.prototype.changeValue = function (index, value) { + if (this._actual.changeValue(index, value)) { + this._bustCache(); + } + }; + PrefixSumComputerWithCache.prototype.removeValues = function (startIndex, cnt) { + if (this._actual.removeValues(startIndex, cnt)) { + this._bustCache(); + } + }; + PrefixSumComputerWithCache.prototype.getTotalValue = function () { + return this._actual.getTotalValue(); + }; + PrefixSumComputerWithCache.prototype.getAccumulatedValue = function (index) { + return this._actual.getAccumulatedValue(index); + }; + PrefixSumComputerWithCache.prototype.getIndexOf = function (accumulatedValue) { + accumulatedValue = Math.floor(accumulatedValue); //@perf + if (this._cache !== null) { + var cacheIndex = accumulatedValue - this._cacheAccumulatedValueStart; + if (cacheIndex >= 0 && cacheIndex < this._cache.length) { + // Cache hit! + return this._cache[cacheIndex]; + } + } + // Cache miss! + return this._actual.getIndexOf(accumulatedValue); + }; + /** + * Gives a hint that a lot of requests are about to come in for these accumulated values. + */ + PrefixSumComputerWithCache.prototype.warmUpCache = function (accumulatedValueStart, accumulatedValueEnd) { + var newCache = []; + for (var accumulatedValue = accumulatedValueStart; accumulatedValue <= accumulatedValueEnd; accumulatedValue++) { + newCache[accumulatedValue - accumulatedValueStart] = this.getIndexOf(accumulatedValue); + } + this._cache = newCache; + this._cacheAccumulatedValueStart = accumulatedValueStart; + }; + return PrefixSumComputerWithCache; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var MirrorTextModel = /** @class */ (function () { +var mirrorTextModel_MirrorTextModel = /** @class */ (function () { function MirrorTextModel(uri, lines, eol, versionId) { this._uri = uri; this._lines = lines; @@ -5946,7 +4221,7 @@ var MirrorTextModel = /** @class */ (function () { for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) { var change = changes_1[_i]; this._acceptDeleteRange(change.range); - this._acceptInsertText(new _core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](change.range.startLineNumber, change.range.startColumn), change.text); + this._acceptInsertText(new Position(change.range.startLineNumber, change.range.startColumn), change.text); } this._versionId = e.versionId; }; @@ -5958,7 +4233,7 @@ var MirrorTextModel = /** @class */ (function () { for (var i = 0; i < linesLength; i++) { lineStartValues[i] = this._lines[i].length + eolLength; } - this._lineStarts = new _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__["PrefixSumComputer"](lineStartValues); + this._lineStarts = new prefixSumComputer_PrefixSumComputer(lineStartValues); } }; /** @@ -6025,22 +4300,7 @@ var MirrorTextModel = /** @class */ (function () { }()); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js ***! - \*****************************************************************************/ -/*! exports provided: USUAL_WORD_SEPARATORS, DEFAULT_WORD_REGEXP, ensureValidWordDefinition, getWordAtText */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USUAL_WORD_SEPARATORS", function() { return USUAL_WORD_SEPARATORS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_WORD_REGEXP", function() { return DEFAULT_WORD_REGEXP; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureValidWordDefinition", function() { return ensureValidWordDefinition; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWordAtText", function() { return getWordAtText; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -6154,30 +4414,71 @@ function getWordAtText(column, wordDefinition, text, textOffset) { return ret; } +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ -/***/ }), +/** + * A fast character classifier that uses a compact array for ASCII values. + */ +var characterClassifier_CharacterClassifier = /** @class */ (function () { + function CharacterClassifier(_defaultValue) { + var defaultValue = toUint8(_defaultValue); + this._defaultValue = defaultValue; + this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue); + this._map = new Map(); + } + CharacterClassifier._createAsciiMap = function (defaultValue) { + var asciiMap = new Uint8Array(256); + for (var i = 0; i < 256; i++) { + asciiMap[i] = defaultValue; + } + return asciiMap; + }; + CharacterClassifier.prototype.set = function (charCode, _value) { + var value = toUint8(_value); + if (charCode >= 0 && charCode < 256) { + this._asciiMap[charCode] = value; + } + else { + this._map.set(charCode, value); + } + }; + CharacterClassifier.prototype.get = function (charCode) { + if (charCode >= 0 && charCode < 256) { + return this._asciiMap[charCode]; + } + else { + return (this._map.get(charCode) || this._defaultValue); + } + }; + return CharacterClassifier; +}()); -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js ***! - \*******************************************************************************/ -/*! exports provided: StateMachine, LinkComputer, computeLinks */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +var CharacterSet = /** @class */ (function () { + function CharacterSet() { + this._actual = new characterClassifier_CharacterClassifier(0 /* False */); + } + CharacterSet.prototype.add = function (charCode) { + this._actual.set(charCode, 1 /* True */); + }; + CharacterSet.prototype.has = function (charCode) { + return (this._actual.get(charCode) === 1 /* True */); + }; + return CharacterSet; +}()); -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StateMachine", function() { return StateMachine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkComputer", function() { return LinkComputer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeLinks", function() { return computeLinks; }); -/* harmony import */ var _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/characterClassifier.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js"); -/* harmony import */ var _core_uint_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/uint.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js"); + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var StateMachine = /** @class */ (function () { +var linkComputer_StateMachine = /** @class */ (function () { function StateMachine(edges) { var maxCharCode = 0; var maxState = 0 /* Invalid */; @@ -6195,7 +4496,7 @@ var StateMachine = /** @class */ (function () { } maxCharCode++; maxState++; - var states = new _core_uint_js__WEBPACK_IMPORTED_MODULE_1__["Uint8Matrix"](maxState, maxCharCode, 0 /* Invalid */); + var states = new Uint8Matrix(maxState, maxCharCode, 0 /* Invalid */); for (var i = 0, len = edges.length; i < len; i++) { var _b = edges[i], from = _b[0], chCode = _b[1], to = _b[2]; states.set(from, chCode, to); @@ -6216,7 +4517,7 @@ var StateMachine = /** @class */ (function () { var _stateMachine = null; function getStateMachine() { if (_stateMachine === null) { - _stateMachine = new StateMachine([ + _stateMachine = new linkComputer_StateMachine([ [1 /* Start */, 104 /* h */, 2 /* H */], [1 /* Start */, 72 /* H */, 2 /* H */], [1 /* Start */, 102 /* f */, 6 /* F */], @@ -6246,7 +4547,7 @@ function getStateMachine() { var _classifier = null; function getClassifier() { if (_classifier === null) { - _classifier = new _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__["CharacterClassifier"](0 /* None */); + _classifier = new characterClassifier_CharacterClassifier(0 /* None */); var FORCE_TERMINATION_CHARACTERS = ' \t<>\'\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…'; for (var i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) { _classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), 1 /* ForceTermination */); @@ -6412,19 +4713,7 @@ function computeLinks(model) { return LinkComputer.computeLinks(model); } - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js ***! - \*************************************************************************************************/ -/*! exports provided: BasicInplaceReplace */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BasicInplaceReplace", function() { return BasicInplaceReplace; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -6513,40 +4802,171 @@ var BasicInplaceReplace = /** @class */ (function () { }()); +// EXTERNAL MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js +var polyfill = __webpack_require__("URDS"); -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js ***! - \****************************************************************************************/ -/*! exports provided: BaseEditorSimpleWorker, EditorSimpleWorkerImpl, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseEditorSimpleWorker", function() { return BaseEditorSimpleWorker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorSimpleWorkerImpl", function() { return EditorSimpleWorkerImpl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "./node_modules/monaco-editor/esm/vs/base/common/arrays.js"); -/* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "./node_modules/monaco-editor/esm/vs/base/common/diff/diff.js"); -/* harmony import */ var _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/iterator.js */ "./node_modules/monaco-editor/esm/vs/base/common/iterator.js"); -/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/platform.js */ "./node_modules/monaco-editor/esm/vs/base/common/platform.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../diff/diffComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js"); -/* harmony import */ var _model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../model/mirrorTextModel.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js"); -/* harmony import */ var _model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../model/wordHelper.js */ "./node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js"); -/* harmony import */ var _modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../modes/linkComputer.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js"); -/* harmony import */ var _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../modes/supports/inplaceReplaceSupport.js */ "./node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js"); -/* harmony import */ var _standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../standalone/standaloneBase.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js"); -/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../base/common/types.js */ "./node_modules/monaco-editor/esm/vs/base/common/types.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/functional.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var __extends = (undefined && undefined.__extends) || (function () { +function functional_once(fn) { + var _this = this; + var didCall = false; + var result; + return function () { + if (didCall) { + return result; + } + didCall = true; + result = fn.apply(_this, arguments); + return result; + }; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/linkedList.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var Node = /** @class */ (function () { + function Node(element) { + this.element = element; + this.next = Node.Undefined; + this.prev = Node.Undefined; + } + Node.Undefined = new Node(undefined); + return Node; +}()); +var linkedList_LinkedList = /** @class */ (function () { + function LinkedList() { + this._first = Node.Undefined; + this._last = Node.Undefined; + this._size = 0; + } + Object.defineProperty(LinkedList.prototype, "size", { + get: function () { + return this._size; + }, + enumerable: true, + configurable: true + }); + LinkedList.prototype.isEmpty = function () { + return this._first === Node.Undefined; + }; + LinkedList.prototype.clear = function () { + this._first = Node.Undefined; + this._last = Node.Undefined; + this._size = 0; + }; + LinkedList.prototype.unshift = function (element) { + return this._insert(element, false); + }; + LinkedList.prototype.push = function (element) { + return this._insert(element, true); + }; + LinkedList.prototype._insert = function (element, atTheEnd) { + var _this = this; + var newNode = new Node(element); + if (this._first === Node.Undefined) { + this._first = newNode; + this._last = newNode; + } + else if (atTheEnd) { + // push + var oldLast = this._last; + this._last = newNode; + newNode.prev = oldLast; + oldLast.next = newNode; + } + else { + // unshift + var oldFirst = this._first; + this._first = newNode; + newNode.next = oldFirst; + oldFirst.prev = newNode; + } + this._size += 1; + var didRemove = false; + return function () { + if (!didRemove) { + didRemove = true; + _this._remove(newNode); + } + }; + }; + LinkedList.prototype.shift = function () { + if (this._first === Node.Undefined) { + return undefined; + } + else { + var res = this._first.element; + this._remove(this._first); + return res; + } + }; + LinkedList.prototype._remove = function (node) { + if (node.prev !== Node.Undefined && node.next !== Node.Undefined) { + // middle + var anchor = node.prev; + anchor.next = node.next; + node.next.prev = anchor; + } + else if (node.prev === Node.Undefined && node.next === Node.Undefined) { + // only node + this._first = Node.Undefined; + this._last = Node.Undefined; + } + else if (node.next === Node.Undefined) { + // last + this._last = this._last.prev; + this._last.next = Node.Undefined; + } + else if (node.prev === Node.Undefined) { + // first + this._first = this._first.next; + this._first.prev = Node.Undefined; + } + // done + this._size -= 1; + }; + LinkedList.prototype.iterator = function () { + var element; + var node = this._first; + return { + next: function () { + if (node === Node.Undefined) { + return FIN; + } + if (!element) { + element = { done: false, value: node.element }; + } + else { + element.value = node.element; + } + node = node.next; + return element; + } + }; + }; + LinkedList.prototype.toArray = function () { + var result = []; + for (var node = this._first; node !== Node.Undefined; node = node.next) { + result.push(node.element); + } + return result; + }; + return LinkedList; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/event.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var event_extends = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || @@ -6563,944 +4983,1282 @@ var __extends = (undefined && undefined.__extends) || (function () { - - - - - - - - - - -/** - * @internal - */ -var MirrorModel = /** @class */ (function (_super) { - __extends(MirrorModel, _super); - function MirrorModel() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(MirrorModel.prototype, "uri", { - get: function () { - return this._uri; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(MirrorModel.prototype, "version", { - get: function () { - return this._versionId; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(MirrorModel.prototype, "eol", { - get: function () { - return this._eol; - }, - enumerable: true, - configurable: true - }); - MirrorModel.prototype.getValue = function () { - return this.getText(); - }; - MirrorModel.prototype.getLinesContent = function () { - return this._lines.slice(0); - }; - MirrorModel.prototype.getLineCount = function () { - return this._lines.length; - }; - MirrorModel.prototype.getLineContent = function (lineNumber) { - return this._lines[lineNumber - 1]; - }; - MirrorModel.prototype.getWordAtPosition = function (position, wordDefinition) { - var wordAtText = Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__["getWordAtText"])(position.column, Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__["ensureValidWordDefinition"])(wordDefinition), this._lines[position.lineNumber - 1], 0); - if (wordAtText) { - return new _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn); - } - return null; - }; - MirrorModel.prototype.getWordUntilPosition = function (position, wordDefinition) { - var wordAtPosition = this.getWordAtPosition(position, wordDefinition); - if (!wordAtPosition) { - return { - word: '', - startColumn: position.column, - endColumn: position.column - }; - } - return { - word: this._lines[position.lineNumber - 1].substring(wordAtPosition.startColumn - 1, position.column - 1), - startColumn: wordAtPosition.startColumn, - endColumn: position.column - }; - }; - MirrorModel.prototype.createWordIterator = function (wordDefinition) { - var _this = this; - var obj; - var lineNumber = 0; - var lineText; - var wordRangesIdx = 0; - var wordRanges = []; - var next = function () { - if (wordRangesIdx < wordRanges.length) { - var value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end); - wordRangesIdx += 1; - if (!obj) { - obj = { done: false, value: value }; +var event_Event; +(function (Event) { + var _disposable = { dispose: function () { } }; + Event.None = function () { return _disposable; }; + /** + * Given an event, returns another event which only fires once. + */ + function once(event) { + return function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + // we need this, in case the event fires during the listener call + var didFire = false; + var result; + result = event(function (e) { + if (didFire) { + return; + } + else if (result) { + result.dispose(); } else { - obj.value = value; + didFire = true; } - return obj; + return listener.call(thisArgs, e); + }, null, disposables); + if (didFire) { + result.dispose(); } - else if (lineNumber >= _this._lines.length) { - return _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_2__["FIN"]; + return result; + }; + } + Event.once = once; + /** + * Given an event and a `map` function, returns another event which maps each element + * throught the mapping function. + */ + function map(event, map) { + return snapshot(function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return event(function (i) { return listener.call(thisArgs, map(i)); }, null, disposables); + }); + } + Event.map = map; + /** + * Given an event and an `each` function, returns another identical event and calls + * the `each` function per each element. + */ + function forEach(event, each) { + return snapshot(function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return event(function (i) { each(i); listener.call(thisArgs, i); }, null, disposables); + }); + } + Event.forEach = forEach; + function filter(event, filter) { + return snapshot(function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return event(function (e) { return filter(e) && listener.call(thisArgs, e); }, null, disposables); + }); + } + Event.filter = filter; + /** + * Given an event, returns the same event but typed as `Event`. + */ + function signal(event) { + return event; + } + Event.signal = signal; + /** + * Given a collection of events, returns a single event which emits + * whenever any of the provided events emit. + */ + function any() { + var events = []; + for (var _i = 0; _i < arguments.length; _i++) { + events[_i] = arguments[_i]; + } + return function (listener, thisArgs, disposables) { + if (thisArgs === void 0) { thisArgs = null; } + return combinedDisposable(events.map(function (event) { return event(function (e) { return listener.call(thisArgs, e); }, null, disposables); })); + }; + } + Event.any = any; + /** + * Given an event and a `merge` function, returns another event which maps each element + * and the cummulative result throught the `merge` function. Similar to `map`, but with memory. + */ + function reduce(event, merge, initial) { + var output = initial; + return map(event, function (e) { + output = merge(output, e); + return output; + }); + } + Event.reduce = reduce; + /** + * Given a chain of event processing functions (filter, map, etc), each + * function will be invoked per event & per listener. Snapshotting an event + * chain allows each function to be invoked just once per event. + */ + function snapshot(event) { + var listener; + var emitter = new event_Emitter({ + onFirstListenerAdd: function () { + listener = event(emitter.fire, emitter); + }, + onLastListenerRemove: function () { + listener.dispose(); + } + }); + return emitter.event; + } + Event.snapshot = snapshot; + function debounce(event, merge, delay, leading, leakWarningThreshold) { + if (delay === void 0) { delay = 100; } + if (leading === void 0) { leading = false; } + var subscription; + var output = undefined; + var handle = undefined; + var numDebouncedCalls = 0; + var emitter = new event_Emitter({ + leakWarningThreshold: leakWarningThreshold, + onFirstListenerAdd: function () { + subscription = event(function (cur) { + numDebouncedCalls++; + output = merge(output, cur); + if (leading && !handle) { + emitter.fire(output); + } + clearTimeout(handle); + handle = setTimeout(function () { + var _output = output; + output = undefined; + handle = undefined; + if (!leading || numDebouncedCalls > 1) { + emitter.fire(_output); + } + numDebouncedCalls = 0; + }, delay); + }); + }, + onLastListenerRemove: function () { + subscription.dispose(); + } + }); + return emitter.event; + } + Event.debounce = debounce; + /** + * Given an event, it returns another event which fires only once and as soon as + * the input event emits. The event data is the number of millis it took for the + * event to fire. + */ + function stopwatch(event) { + var start = new Date().getTime(); + return map(once(event), function (_) { return new Date().getTime() - start; }); + } + Event.stopwatch = stopwatch; + /** + * Given an event, it returns another event which fires only when the event + * element changes. + */ + function latch(event) { + var firstCall = true; + var cache; + return filter(event, function (value) { + var shouldEmit = firstCall || value !== cache; + firstCall = false; + cache = value; + return shouldEmit; + }); + } + Event.latch = latch; + /** + * Buffers the provided event until a first listener comes + * along, at which point fire all the events at once and + * pipe the event from then on. + * + * ```typescript + * const emitter = new Emitter(); + * const event = emitter.event; + * const bufferedEvent = buffer(event); + * + * emitter.fire(1); + * emitter.fire(2); + * emitter.fire(3); + * // nothing... + * + * const listener = bufferedEvent(num => console.log(num)); + * // 1, 2, 3 + * + * emitter.fire(4); + * // 4 + * ``` + */ + function buffer(event, nextTick, _buffer) { + if (nextTick === void 0) { nextTick = false; } + if (_buffer === void 0) { _buffer = []; } + var buffer = _buffer.slice(); + var listener = event(function (e) { + if (buffer) { + buffer.push(e); } else { - lineText = _this._lines[lineNumber]; - wordRanges = _this._wordenize(lineText, wordDefinition); - wordRangesIdx = 0; - lineNumber += 1; - return next(); + emitter.fire(e); } + }); + var flush = function () { + if (buffer) { + buffer.forEach(function (e) { return emitter.fire(e); }); + } + buffer = null; }; - return { next: next }; - }; - MirrorModel.prototype.getLineWords = function (lineNumber, wordDefinition) { - var content = this._lines[lineNumber - 1]; - var ranges = this._wordenize(content, wordDefinition); - var words = []; - for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { - var range = ranges_1[_i]; - words.push({ - word: content.substring(range.start, range.end), - startColumn: range.start + 1, - endColumn: range.end + 1 - }); - } - return words; - }; - MirrorModel.prototype._wordenize = function (content, wordDefinition) { - var result = []; - var match; - wordDefinition.lastIndex = 0; // reset lastIndex just to be sure - while (match = wordDefinition.exec(content)) { - if (match[0].length === 0) { - // it did match the empty string - break; + var emitter = new event_Emitter({ + onFirstListenerAdd: function () { + if (!listener) { + listener = event(function (e) { return emitter.fire(e); }); + } + }, + onFirstListenerDidAdd: function () { + if (buffer) { + if (nextTick) { + setTimeout(flush); + } + else { + flush(); + } + } + }, + onLastListenerRemove: function () { + if (listener) { + listener.dispose(); + } + listener = null; } - result.push({ start: match.index, end: match.index + match[0].length }); - } - return result; - }; - MirrorModel.prototype.getValueInRange = function (range) { - range = this._validateRange(range); - if (range.startLineNumber === range.endLineNumber) { - return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); - } - var lineEnding = this._eol; - var startLineIndex = range.startLineNumber - 1; - var endLineIndex = range.endLineNumber - 1; - var resultLines = []; - resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); - for (var i = startLineIndex + 1; i < endLineIndex; i++) { - resultLines.push(this._lines[i]); - } - resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); - return resultLines.join(lineEnding); - }; - MirrorModel.prototype.offsetAt = function (position) { - position = this._validatePosition(position); - this._ensureLineStarts(); - return this._lineStarts.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1); - }; - MirrorModel.prototype.positionAt = function (offset) { - offset = Math.floor(offset); - offset = Math.max(0, offset); - this._ensureLineStarts(); - var out = this._lineStarts.getIndexOf(offset); - var lineLength = this._lines[out.index].length; - // Ensure we return a valid position - return { - lineNumber: 1 + out.index, - column: 1 + Math.min(out.remainder, lineLength) - }; - }; - MirrorModel.prototype._validateRange = function (range) { - var start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn }); - var end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn }); - if (start.lineNumber !== range.startLineNumber - || start.column !== range.startColumn - || end.lineNumber !== range.endLineNumber - || end.column !== range.endColumn) { - return { - startLineNumber: start.lineNumber, - startColumn: start.column, - endLineNumber: end.lineNumber, - endColumn: end.column - }; - } - return range; - }; - MirrorModel.prototype._validatePosition = function (position) { - if (!_core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"].isIPosition(position)) { - throw new Error('bad position'); - } - var lineNumber = position.lineNumber, column = position.column; - var hasChanged = false; - if (lineNumber < 1) { - lineNumber = 1; - column = 1; - hasChanged = true; - } - else if (lineNumber > this._lines.length) { - lineNumber = this._lines.length; - column = this._lines[lineNumber - 1].length + 1; - hasChanged = true; - } - else { - var maxCharacter = this._lines[lineNumber - 1].length + 1; - if (column < 1) { - column = 1; - hasChanged = true; - } - else if (column > maxCharacter) { - column = maxCharacter; - hasChanged = true; - } - } - if (!hasChanged) { - return position; - } - else { - return { lineNumber: lineNumber, column: column }; - } - }; - return MirrorModel; -}(_model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_8__["MirrorTextModel"])); -/** - * @internal - */ -var BaseEditorSimpleWorker = /** @class */ (function () { - function BaseEditorSimpleWorker(foreignModuleFactory) { - this._foreignModuleFactory = foreignModuleFactory; - this._foreignModule = null; + }); + return emitter.event; } - // ---- BEGIN diff -------------------------------------------------------------------------- - BaseEditorSimpleWorker.prototype.computeDiff = function (originalUrl, modifiedUrl, ignoreTrimWhitespace) { - var original = this._getModel(originalUrl); - var modified = this._getModel(modifiedUrl); - if (!original || !modified) { - return Promise.resolve(null); + Event.buffer = buffer; + var ChainableEvent = /** @class */ (function () { + function ChainableEvent(event) { + this.event = event; } - var originalLines = original.getLinesContent(); - var modifiedLines = modified.getLinesContent(); - var diffComputer = new _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_7__["DiffComputer"](originalLines, modifiedLines, { - shouldComputeCharChanges: true, - shouldPostProcessCharChanges: true, - shouldIgnoreTrimWhitespace: ignoreTrimWhitespace, - shouldMakePrettyDiff: true - }); - var changes = diffComputer.computeDiff(); - var identical = (changes.length > 0 ? false : this._modelsAreIdentical(original, modified)); - return Promise.resolve({ - identical: identical, - changes: changes - }); - }; - BaseEditorSimpleWorker.prototype._modelsAreIdentical = function (original, modified) { - var originalLineCount = original.getLineCount(); - var modifiedLineCount = modified.getLineCount(); - if (originalLineCount !== modifiedLineCount) { - return false; - } - for (var line = 1; line <= originalLineCount; line++) { - var originalLine = original.getLineContent(line); - var modifiedLine = modified.getLineContent(line); - if (originalLine !== modifiedLine) { - return false; - } - } - return true; - }; - BaseEditorSimpleWorker.prototype.computeMoreMinimalEdits = function (modelUrl, edits) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(edits); - } - var result = []; - var lastEol = undefined; - edits = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["mergeSort"])(edits, function (a, b) { - if (a.range && b.range) { - return _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].compareRangesUsingStarts(a.range, b.range); - } - // eol only changes should go to the end - var aRng = a.range ? 0 : 1; - var bRng = b.range ? 0 : 1; - return aRng - bRng; - }); - for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { - var _a = edits_1[_i], range = _a.range, text = _a.text, eol = _a.eol; - if (typeof eol === 'number') { - lastEol = eol; - } - if (_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].isEmpty(range) && !text) { - // empty change - continue; - } - var original = model.getValueInRange(range); - text = text.replace(/\r\n|\n|\r/g, model.eol); - if (original === text) { - // noop - continue; - } - // make sure diff won't take too long - if (Math.max(text.length, original.length) > BaseEditorSimpleWorker._diffLimit) { - result.push({ range: range, text: text }); - continue; - } - // compute diff between original and edit.text - var changes = Object(_base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__["stringDiff"])(original, text, false); - var editOffset = model.offsetAt(_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].lift(range).getStartPosition()); - for (var _b = 0, changes_1 = changes; _b < changes_1.length; _b++) { - var change = changes_1[_b]; - var start = model.positionAt(editOffset + change.originalStart); - var end = model.positionAt(editOffset + change.originalStart + change.originalLength); - var newEdit = { - text: text.substr(change.modifiedStart, change.modifiedLength), - range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column } - }; - if (model.getValueInRange(newEdit.range) !== newEdit.text) { - result.push(newEdit); - } - } - } - if (typeof lastEol === 'number') { - result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }); - } - return Promise.resolve(result); - }; - // ---- END minimal edits --------------------------------------------------------------- - BaseEditorSimpleWorker.prototype.computeLinks = function (modelUrl) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(null); - } - return Promise.resolve(Object(_modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_10__["computeLinks"])(model)); - }; - BaseEditorSimpleWorker.prototype.textualSuggest = function (modelUrl, position, wordDef, wordDefFlags) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(null); - } - var seen = Object.create(null); - var suggestions = []; - var wordDefRegExp = new RegExp(wordDef, wordDefFlags); - var wordUntil = model.getWordUntilPosition(position, wordDefRegExp); - var wordAt = model.getWordAtPosition(position, wordDefRegExp); - if (wordAt) { - seen[model.getValueInRange(wordAt)] = true; - } - for (var iter = model.createWordIterator(wordDefRegExp), e = iter.next(); !e.done && suggestions.length <= BaseEditorSimpleWorker._suggestionsLimit; e = iter.next()) { - var word = e.value; - if (seen[word]) { - continue; - } - seen[word] = true; - if (!isNaN(Number(word))) { - continue; - } - suggestions.push({ - kind: 18 /* Text */, - label: word, - insertText: word, - range: { startLineNumber: position.lineNumber, startColumn: wordUntil.startColumn, endLineNumber: position.lineNumber, endColumn: wordUntil.endColumn } - }); - } - return Promise.resolve({ suggestions: suggestions }); - }; - // ---- END suggest -------------------------------------------------------------------------- - //#region -- word ranges -- - BaseEditorSimpleWorker.prototype.computeWordRanges = function (modelUrl, range, wordDef, wordDefFlags) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(Object.create(null)); - } - var wordDefRegExp = new RegExp(wordDef, wordDefFlags); - var result = Object.create(null); - for (var line = range.startLineNumber; line < range.endLineNumber; line++) { - var words = model.getLineWords(line, wordDefRegExp); - for (var _i = 0, words_1 = words; _i < words_1.length; _i++) { - var word = words_1[_i]; - if (!isNaN(Number(word.word))) { - continue; - } - var array = result[word.word]; - if (!array) { - array = []; - result[word.word] = array; - } - array.push({ - startLineNumber: line, - startColumn: word.startColumn, - endLineNumber: line, - endColumn: word.endColumn - }); - } - } - return Promise.resolve(result); - }; - //#endregion - BaseEditorSimpleWorker.prototype.navigateValueSet = function (modelUrl, range, up, wordDef, wordDefFlags) { - var model = this._getModel(modelUrl); - if (!model) { - return Promise.resolve(null); - } - var wordDefRegExp = new RegExp(wordDef, wordDefFlags); - if (range.startColumn === range.endColumn) { - range = { - startLineNumber: range.startLineNumber, - startColumn: range.startColumn, - endLineNumber: range.endLineNumber, - endColumn: range.endColumn + 1 - }; - } - var selectionText = model.getValueInRange(range); - var wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp); - if (!wordRange) { - return Promise.resolve(null); - } - var word = model.getValueInRange(wordRange); - var result = _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_11__["BasicInplaceReplace"].INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up); - return Promise.resolve(result); - }; - // ---- BEGIN foreign module support -------------------------------------------------------------------------- - BaseEditorSimpleWorker.prototype.loadForeignModule = function (moduleId, createData) { - var _this = this; - var ctx = { - getMirrorModels: function () { - return _this._getModels(); - } + ChainableEvent.prototype.map = function (fn) { + return new ChainableEvent(map(this.event, fn)); }; - if (this._foreignModuleFactory) { - this._foreignModule = this._foreignModuleFactory(ctx, createData); - // static foreing module - var methods = []; - for (var _i = 0, _a = Object(_base_common_types_js__WEBPACK_IMPORTED_MODULE_13__["getAllPropertyNames"])(this._foreignModule); _i < _a.length; _i++) { - var prop = _a[_i]; - if (typeof this._foreignModule[prop] === 'function') { - methods.push(prop); + ChainableEvent.prototype.forEach = function (fn) { + return new ChainableEvent(forEach(this.event, fn)); + }; + ChainableEvent.prototype.filter = function (fn) { + return new ChainableEvent(filter(this.event, fn)); + }; + ChainableEvent.prototype.reduce = function (merge, initial) { + return new ChainableEvent(reduce(this.event, merge, initial)); + }; + ChainableEvent.prototype.latch = function () { + return new ChainableEvent(latch(this.event)); + }; + ChainableEvent.prototype.on = function (listener, thisArgs, disposables) { + return this.event(listener, thisArgs, disposables); + }; + ChainableEvent.prototype.once = function (listener, thisArgs, disposables) { + return once(this.event)(listener, thisArgs, disposables); + }; + return ChainableEvent; + }()); + function chain(event) { + return new ChainableEvent(event); + } + Event.chain = chain; + function fromNodeEventEmitter(emitter, eventName, map) { + if (map === void 0) { map = function (id) { return id; }; } + var fn = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return result.fire(map.apply(void 0, args)); + }; + var onFirstListenerAdd = function () { return emitter.on(eventName, fn); }; + var onLastListenerRemove = function () { return emitter.removeListener(eventName, fn); }; + var result = new event_Emitter({ onFirstListenerAdd: onFirstListenerAdd, onLastListenerRemove: onLastListenerRemove }); + return result.event; + } + Event.fromNodeEventEmitter = fromNodeEventEmitter; + function fromPromise(promise) { + var emitter = new event_Emitter(); + var shouldEmit = false; + promise + .then(undefined, function () { return null; }) + .then(function () { + if (!shouldEmit) { + setTimeout(function () { return emitter.fire(undefined); }, 0); + } + else { + emitter.fire(undefined); + } + }); + shouldEmit = true; + return emitter.event; + } + Event.fromPromise = fromPromise; + function toPromise(event) { + return new Promise(function (c) { return once(event)(c); }); + } + Event.toPromise = toPromise; +})(event_Event || (event_Event = {})); +var _globalLeakWarningThreshold = -1; +var LeakageMonitor = /** @class */ (function () { + function LeakageMonitor(customThreshold, name) { + if (name === void 0) { name = Math.random().toString(18).slice(2, 5); } + this.customThreshold = customThreshold; + this.name = name; + this._warnCountdown = 0; + } + LeakageMonitor.prototype.dispose = function () { + if (this._stacks) { + this._stacks.clear(); + } + }; + LeakageMonitor.prototype.check = function (listenerCount) { + var _this = this; + var threshold = _globalLeakWarningThreshold; + if (typeof this.customThreshold === 'number') { + threshold = this.customThreshold; + } + if (threshold <= 0 || listenerCount < threshold) { + return undefined; + } + if (!this._stacks) { + this._stacks = new Map(); + } + var stack = new Error().stack.split('\n').slice(3).join('\n'); + var count = (this._stacks.get(stack) || 0); + this._stacks.set(stack, count + 1); + this._warnCountdown -= 1; + if (this._warnCountdown <= 0) { + // only warn on first exceed and then every time the limit + // is exceeded by 50% again + this._warnCountdown = threshold * 0.5; + // find most frequent listener and print warning + var topStack_1; + var topCount_1 = 0; + this._stacks.forEach(function (count, stack) { + if (!topStack_1 || topCount_1 < count) { + topStack_1 = stack; + topCount_1 = count; + } + }); + console.warn("[" + this.name + "] potential listener LEAK detected, having " + listenerCount + " listeners already. MOST frequent listener (" + topCount_1 + "):"); + console.warn(topStack_1); + } + return function () { + var count = (_this._stacks.get(stack) || 0); + _this._stacks.set(stack, count - 1); + }; + }; + return LeakageMonitor; +}()); +/** + * The Emitter can be used to expose an Event to the public + * to fire it from the insides. + * Sample: + class Document { + + private _onDidChange = new Emitter<(value:string)=>any>(); + + public onDidChange = this._onDidChange.event; + + // getter-style + // get onDidChange(): Event<(value:string)=>any> { + // return this._onDidChange.event; + // } + + private _doIt() { + //... + this._onDidChange.fire(value); + } + } + */ +var event_Emitter = /** @class */ (function () { + function Emitter(options) { + this._disposed = false; + this._options = options; + this._leakageMon = _globalLeakWarningThreshold > 0 + ? new LeakageMonitor(this._options && this._options.leakWarningThreshold) + : undefined; + } + Object.defineProperty(Emitter.prototype, "event", { + /** + * For the public to allow to subscribe + * to events from this Emitter + */ + get: function () { + var _this = this; + if (!this._event) { + this._event = function (listener, thisArgs, disposables) { + if (!_this._listeners) { + _this._listeners = new linkedList_LinkedList(); + } + var firstListener = _this._listeners.isEmpty(); + if (firstListener && _this._options && _this._options.onFirstListenerAdd) { + _this._options.onFirstListenerAdd(_this); + } + var remove = _this._listeners.push(!thisArgs ? listener : [listener, thisArgs]); + if (firstListener && _this._options && _this._options.onFirstListenerDidAdd) { + _this._options.onFirstListenerDidAdd(_this); + } + if (_this._options && _this._options.onListenerDidAdd) { + _this._options.onListenerDidAdd(_this, listener, thisArgs); + } + // check and record this emitter for potential leakage + var removeMonitor; + if (_this._leakageMon) { + removeMonitor = _this._leakageMon.check(_this._listeners.size); + } + var result; + result = { + dispose: function () { + if (removeMonitor) { + removeMonitor(); + } + result.dispose = Emitter._noop; + if (!_this._disposed) { + remove(); + if (_this._options && _this._options.onLastListenerRemove) { + var hasListeners = (_this._listeners && !_this._listeners.isEmpty()); + if (!hasListeners) { + _this._options.onLastListenerRemove(_this); + } + } + } + } + }; + if (Array.isArray(disposables)) { + disposables.push(result); + } + return result; + }; + } + return this._event; + }, + enumerable: true, + configurable: true + }); + /** + * To be kept private to fire an event to + * subscribers + */ + Emitter.prototype.fire = function (event) { + if (this._listeners) { + // put all [listener,event]-pairs into delivery queue + // then emit all event. an inner/nested event might be + // the driver of this + if (!this._deliveryQueue) { + this._deliveryQueue = new linkedList_LinkedList(); + } + for (var iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) { + this._deliveryQueue.push([e.value, event]); + } + while (this._deliveryQueue.size > 0) { + var _a = this._deliveryQueue.shift(), listener = _a[0], event_1 = _a[1]; + try { + if (typeof listener === 'function') { + listener.call(undefined, event_1); + } + else { + listener[0].call(listener[1], event_1); + } + } + catch (e) { + onUnexpectedError(e); } } - return Promise.resolve(methods); - } - // ESM-comment-begin - // return new Promise((resolve, reject) => { - // require([moduleId], (foreignModule: { create: IForeignModuleFactory }) => { - // this._foreignModule = foreignModule.create(ctx, createData); - // - // let methods: string[] = []; - // for (const prop of getAllPropertyNames(this._foreignModule)) { - // if (typeof this._foreignModule[prop] === 'function') { - // methods.push(prop); - // } - // } - // - // resolve(methods); - // - // }, reject); - // }); - // ESM-comment-end - // ESM-uncomment-begin - return Promise.reject(new Error("Unexpected usage")); - // ESM-uncomment-end - }; - // foreign method request - BaseEditorSimpleWorker.prototype.fmr = function (method, args) { - if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') { - return Promise.reject(new Error('Missing requestHandler or method: ' + method)); - } - try { - return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args)); - } - catch (e) { - return Promise.reject(e); } }; - // ---- END diff -------------------------------------------------------------------------- - // ---- BEGIN minimal edits --------------------------------------------------------------- - BaseEditorSimpleWorker._diffLimit = 100000; - // ---- BEGIN suggest -------------------------------------------------------------------------- - BaseEditorSimpleWorker._suggestionsLimit = 10000; - return BaseEditorSimpleWorker; + Emitter.prototype.dispose = function () { + if (this._listeners) { + this._listeners.clear(); + } + if (this._deliveryQueue) { + this._deliveryQueue.clear(); + } + if (this._leakageMon) { + this._leakageMon.dispose(); + } + this._disposed = true; + }; + Emitter._noop = function () { }; + return Emitter; +}()); + +var event_PauseableEmitter = /** @class */ (function (_super) { + event_extends(PauseableEmitter, _super); + function PauseableEmitter(options) { + var _this = _super.call(this, options) || this; + _this._isPaused = 0; + _this._eventQueue = new linkedList_LinkedList(); + _this._mergeFn = options && options.merge; + return _this; + } + PauseableEmitter.prototype.pause = function () { + this._isPaused++; + }; + PauseableEmitter.prototype.resume = function () { + if (this._isPaused !== 0 && --this._isPaused === 0) { + if (this._mergeFn) { + // use the merge function to create a single composite + // event. make a copy in case firing pauses this emitter + var events = this._eventQueue.toArray(); + this._eventQueue.clear(); + _super.prototype.fire.call(this, this._mergeFn(events)); + } + else { + // no merging, fire each event individually and test + // that this emitter isn't paused halfway through + while (!this._isPaused && this._eventQueue.size !== 0) { + _super.prototype.fire.call(this, this._eventQueue.shift()); + } + } + } + }; + PauseableEmitter.prototype.fire = function (event) { + if (this._listeners) { + if (this._isPaused !== 0) { + this._eventQueue.push(event); + } + else { + _super.prototype.fire.call(this, event); + } + } + }; + return PauseableEmitter; +}(event_Emitter)); + +var event_EventMultiplexer = /** @class */ (function () { + function EventMultiplexer() { + var _this = this; + this.hasListeners = false; + this.events = []; + this.emitter = new event_Emitter({ + onFirstListenerAdd: function () { return _this.onFirstListenerAdd(); }, + onLastListenerRemove: function () { return _this.onLastListenerRemove(); } + }); + } + Object.defineProperty(EventMultiplexer.prototype, "event", { + get: function () { + return this.emitter.event; + }, + enumerable: true, + configurable: true + }); + EventMultiplexer.prototype.add = function (event) { + var _this = this; + var e = { event: event, listener: null }; + this.events.push(e); + if (this.hasListeners) { + this.hook(e); + } + var dispose = function () { + if (_this.hasListeners) { + _this.unhook(e); + } + var idx = _this.events.indexOf(e); + _this.events.splice(idx, 1); + }; + return toDisposable(functional_once(dispose)); + }; + EventMultiplexer.prototype.onFirstListenerAdd = function () { + var _this = this; + this.hasListeners = true; + this.events.forEach(function (e) { return _this.hook(e); }); + }; + EventMultiplexer.prototype.onLastListenerRemove = function () { + var _this = this; + this.hasListeners = false; + this.events.forEach(function (e) { return _this.unhook(e); }); + }; + EventMultiplexer.prototype.hook = function (e) { + var _this = this; + e.listener = e.event(function (r) { return _this.emitter.fire(r); }); + }; + EventMultiplexer.prototype.unhook = function (e) { + if (e.listener) { + e.listener.dispose(); + } + e.listener = null; + }; + EventMultiplexer.prototype.dispose = function () { + this.emitter.dispose(); + }; + return EventMultiplexer; }()); /** - * @internal + * The EventBufferer is useful in situations in which you want + * to delay firing your events during some code. + * You can wrap that code and be sure that the event will not + * be fired during that wrap. + * + * ``` + * const emitter: Emitter; + * const delayer = new EventDelayer(); + * const delayedEvent = delayer.wrapEvent(emitter.event); + * + * delayedEvent(console.log); + * + * delayer.bufferEvents(() => { + * emitter.fire(); // event will not be fired yet + * }); + * + * // event will only be fired at this point + * ``` */ -var EditorSimpleWorkerImpl = /** @class */ (function (_super) { - __extends(EditorSimpleWorkerImpl, _super); - function EditorSimpleWorkerImpl(foreignModuleFactory) { - var _this = _super.call(this, foreignModuleFactory) || this; - _this._models = Object.create(null); - return _this; +var EventBufferer = /** @class */ (function () { + function EventBufferer() { + this.buffers = []; } - EditorSimpleWorkerImpl.prototype.dispose = function () { - this._models = Object.create(null); - }; - EditorSimpleWorkerImpl.prototype._getModel = function (uri) { - return this._models[uri]; - }; - EditorSimpleWorkerImpl.prototype._getModels = function () { + EventBufferer.prototype.wrapEvent = function (event) { var _this = this; - var all = []; - Object.keys(this._models).forEach(function (key) { return all.push(_this._models[key]); }); - return all; + return function (listener, thisArgs, disposables) { + return event(function (i) { + var buffer = _this.buffers[_this.buffers.length - 1]; + if (buffer) { + buffer.push(function () { return listener.call(thisArgs, i); }); + } + else { + listener.call(thisArgs, i); + } + }, undefined, disposables); + }; }; - EditorSimpleWorkerImpl.prototype.acceptNewModel = function (data) { - this._models[data.url] = new MirrorModel(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"].parse(data.url), data.lines, data.EOL, data.versionId); + EventBufferer.prototype.bufferEvents = function (fn) { + var buffer = []; + this.buffers.push(buffer); + var r = fn(); + this.buffers.pop(); + buffer.forEach(function (flush) { return flush(); }); + return r; }; - EditorSimpleWorkerImpl.prototype.acceptModelChanged = function (strURL, e) { - if (!this._models[strURL]) { - return; - } - var model = this._models[strURL]; - model.onEvents(e); - }; - EditorSimpleWorkerImpl.prototype.acceptRemovedModel = function (strURL) { - if (!this._models[strURL]) { - return; - } - delete this._models[strURL]; - }; - return EditorSimpleWorkerImpl; -}(BaseEditorSimpleWorker)); + return EventBufferer; +}()); /** - * Called on the worker side - * @internal + * A Relay is an event forwarder which functions as a replugabble event pipe. + * Once created, you can connect an input event to it and it will simply forward + * events from that input event through its own `event` property. The `input` + * can be changed at any point in time. */ -function create() { - return new EditorSimpleWorkerImpl(null); -} -if (typeof importScripts === 'function') { - // Running in a web worker - _base_common_platform_js__WEBPACK_IMPORTED_MODULE_3__["globals"].monaco = Object(_standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_12__["createMonacoBaseAPI"])(); -} +var event_Relay = /** @class */ (function () { + function Relay() { + var _this = this; + this.listening = false; + this.inputEvent = event_Event.None; + this.inputEventListener = Disposable.None; + this.emitter = new event_Emitter({ + onFirstListenerDidAdd: function () { + _this.listening = true; + _this.inputEventListener = _this.inputEvent(_this.emitter.fire, _this.emitter); + }, + onLastListenerRemove: function () { + _this.listening = false; + _this.inputEventListener.dispose(); + } + }); + this.event = this.emitter.event; + } + Object.defineProperty(Relay.prototype, "input", { + set: function (event) { + this.inputEvent = event; + if (this.listening) { + this.inputEventListener.dispose(); + this.inputEventListener = event(this.emitter.fire, this.emitter); + } + }, + enumerable: true, + configurable: true + }); + Relay.prototype.dispose = function () { + this.inputEventListener.dispose(); + this.emitter.dispose(); + }; + return Relay; +}()); -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js": -/*!*************************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js ***! - \*************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/*! -Copyright (c) 2014 Taylor Hakes -Copyright (c) 2014 Forbes Lindesay - */ -(function (global, factory) { - true ? factory() : - undefined; -}(this, (function () { - 'use strict'; - - /** - * @this {Promise} - */ - function finallyConstructor(callback) { - var constructor = this.constructor; - return this.then( - function (value) { - return constructor.resolve(callback()).then(function () { - return value; - }); - }, - function (reason) { - return constructor.resolve(callback()).then(function () { - return constructor.reject(reason); - }); - } - ); - } - - // Store setTimeout reference so promise-polyfill will be unaffected by - // other code modifying setTimeout (like sinon.useFakeTimers()) - var setTimeoutFunc = setTimeout; - - function noop() { } - - // Polyfill for Function.prototype.bind - function bind(fn, thisArg) { - return function () { - fn.apply(thisArg, arguments); - }; - } - - /** - * @constructor - * @param {Function} fn - */ - function Promise(fn) { - if (!(this instanceof Promise)) - throw new TypeError('Promises must be constructed via new'); - if (typeof fn !== 'function') throw new TypeError('not a function'); - /** @type {!number} */ - this._state = 0; - /** @type {!boolean} */ - this._handled = false; - /** @type {Promise|undefined} */ - this._value = undefined; - /** @type {!Array} */ - this._deferreds = []; - - doResolve(fn, this); - } - - function handle(self, deferred) { - while (self._state === 3) { - self = self._value; - } - if (self._state === 0) { - self._deferreds.push(deferred); - return; - } - self._handled = true; - Promise._immediateFn(function () { - var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; - if (cb === null) { - (self._state === 1 ? resolve : reject)(deferred.promise, self._value); - return; - } - var ret; - try { - ret = cb(self._value); - } catch (e) { - reject(deferred.promise, e); - return; - } - resolve(deferred.promise, ret); - }); - } - - function resolve(self, newValue) { - try { - // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure - if (newValue === self) - throw new TypeError('A promise cannot be resolved with itself.'); - if ( - newValue && - (typeof newValue === 'object' || typeof newValue === 'function') - ) { - var then = newValue.then; - if (newValue instanceof Promise) { - self._state = 3; - self._value = newValue; - finale(self); - return; - } else if (typeof then === 'function') { - doResolve(bind(then, newValue), self); - return; - } - } - self._state = 1; - self._value = newValue; - finale(self); - } catch (e) { - reject(self, e); - } - } - - function reject(self, newValue) { - self._state = 2; - self._value = newValue; - finale(self); - } - - function finale(self) { - if (self._state === 2 && self._deferreds.length === 0) { - Promise._immediateFn(function () { - if (!self._handled) { - Promise._unhandledRejectionFn(self._value); - } - }); - } - - for (var i = 0, len = self._deferreds.length; i < len; i++) { - handle(self, self._deferreds[i]); - } - self._deferreds = null; - } - - /** - * @constructor - */ - function Handler(onFulfilled, onRejected, promise) { - this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; - this.onRejected = typeof onRejected === 'function' ? onRejected : null; - this.promise = promise; - } - - /** - * Take a potentially misbehaving resolver function and make sure - * onFulfilled and onRejected are only called once. - * - * Makes no guarantees about asynchrony. - */ - function doResolve(fn, self) { - var done = false; - try { - fn( - function (value) { - if (done) return; - done = true; - resolve(self, value); - }, - function (reason) { - if (done) return; - done = true; - reject(self, reason); - } - ); - } catch (ex) { - if (done) return; - done = true; - reject(self, ex); - } - } - - Promise.prototype['catch'] = function (onRejected) { - return this.then(null, onRejected); - }; - - Promise.prototype.then = function (onFulfilled, onRejected) { - // @ts-ignore - var prom = new this.constructor(noop); - - handle(this, new Handler(onFulfilled, onRejected, prom)); - return prom; - }; - - Promise.prototype['finally'] = finallyConstructor; - - Promise.all = function (arr) { - return new Promise(function (resolve, reject) { - if (!arr || typeof arr.length === 'undefined') - throw new TypeError('Promise.all accepts an array'); - var args = Array.prototype.slice.call(arr); - if (args.length === 0) return resolve([]); - var remaining = args.length; - - function res(i, val) { - try { - if (val && (typeof val === 'object' || typeof val === 'function')) { - var then = val.then; - if (typeof then === 'function') { - then.call( - val, - function (val) { - res(i, val); - }, - reject - ); - return; - } - } - args[i] = val; - if (--remaining === 0) { - resolve(args); - } - } catch (ex) { - reject(ex); - } - } - - for (var i = 0; i < args.length; i++) { - res(i, args[i]); - } - }); - }; - - Promise.resolve = function (value) { - if (value && typeof value === 'object' && value.constructor === Promise) { - return value; - } - - return new Promise(function (resolve) { - resolve(value); - }); - }; - - Promise.reject = function (value) { - return new Promise(function (resolve, reject) { - reject(value); - }); - }; - - Promise.race = function (values) { - return new Promise(function (resolve, reject) { - for (var i = 0, len = values.length; i < len; i++) { - values[i].then(resolve, reject); - } - }); - }; - - // Use polyfill for setImmediate for performance gains - Promise._immediateFn = - (typeof setImmediate === 'function' && - function (fn) { - setImmediate(fn); - }) || - function (fn) { - setTimeoutFunc(fn, 0); - }; - - Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { - if (typeof console !== 'undefined' && console) { - console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console - } - }; - - /** @suppress {undefinedVars} */ - var globalNS = (function () { - // the only reliable means to get the global object is - // `Function('return this')()` - // However, this causes CSP violations in Chrome apps. - if (typeof self !== 'undefined') { - return self; - } - if (typeof window !== 'undefined') { - return window; - } - if (typeof global !== 'undefined') { - return global; - } - throw new Error('unable to locate global object'); - })(); - - if (!('Promise' in globalNS)) { - globalNS['Promise'] = Promise; - } else if (!globalNS.Promise.prototype['finally']) { - globalNS.Promise.prototype['finally'] = finallyConstructor; - } - -}))); - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js ***! - \**************************************************************************************/ -/*! exports provided: KeyMod, createMonacoBaseAPI */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyMod", function() { return KeyMod; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMonacoBaseAPI", function() { return createMonacoBaseAPI; }); -/* harmony import */ var _promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./promise-polyfill/polyfill.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js"); -/* harmony import */ var _promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "./node_modules/monaco-editor/esm/vs/base/common/cancellation.js"); -/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/event.js */ "./node_modules/monaco-editor/esm/vs/base/common/event.js"); -/* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"); -/* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/uri.js */ "./node_modules/monaco-editor/esm/vs/base/common/uri.js"); -/* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/position.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/position.js"); -/* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/range.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/range.js"); -/* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/selection.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"); -/* harmony import */ var _core_token_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../core/token.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/token.js"); -/* harmony import */ var _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./standaloneEnums.js */ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/cancellation.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - - - - - - - - - -var KeyMod = /** @class */ (function () { - function KeyMod() { +var shortcutEvent = Object.freeze(function (callback, context) { + var handle = setTimeout(callback.bind(context), 0); + return { dispose: function () { clearTimeout(handle); } }; +}); +var cancellation_CancellationToken; +(function (CancellationToken) { + function isCancellationToken(thing) { + if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) { + return true; + } + if (thing instanceof cancellation_MutableToken) { + return true; + } + if (!thing || typeof thing !== 'object') { + return false; + } + return typeof thing.isCancellationRequested === 'boolean' + && typeof thing.onCancellationRequested === 'function'; } - KeyMod.chord = function (firstPart, secondPart) { - return Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_3__["KeyChord"])(firstPart, secondPart); + CancellationToken.isCancellationToken = isCancellationToken; + CancellationToken.None = Object.freeze({ + isCancellationRequested: false, + onCancellationRequested: event_Event.None + }); + CancellationToken.Cancelled = Object.freeze({ + isCancellationRequested: true, + onCancellationRequested: shortcutEvent + }); +})(cancellation_CancellationToken || (cancellation_CancellationToken = {})); +var cancellation_MutableToken = /** @class */ (function () { + function MutableToken() { + this._isCancelled = false; + this._emitter = null; + } + MutableToken.prototype.cancel = function () { + if (!this._isCancelled) { + this._isCancelled = true; + if (this._emitter) { + this._emitter.fire(undefined); + this.dispose(); + } + } }; - KeyMod.CtrlCmd = 2048 /* CtrlCmd */; - KeyMod.Shift = 1024 /* Shift */; - KeyMod.Alt = 512 /* Alt */; - KeyMod.WinCtrl = 256 /* WinCtrl */; - return KeyMod; + Object.defineProperty(MutableToken.prototype, "isCancellationRequested", { + get: function () { + return this._isCancelled; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MutableToken.prototype, "onCancellationRequested", { + get: function () { + if (this._isCancelled) { + return shortcutEvent; + } + if (!this._emitter) { + this._emitter = new event_Emitter(); + } + return this._emitter.event; + }, + enumerable: true, + configurable: true + }); + MutableToken.prototype.dispose = function () { + if (this._emitter) { + this._emitter.dispose(); + this._emitter = null; + } + }; + return MutableToken; +}()); +var CancellationTokenSource = /** @class */ (function () { + function CancellationTokenSource(parent) { + this._token = undefined; + this._parentListener = undefined; + this._parentListener = parent && parent.onCancellationRequested(this.cancel, this); + } + Object.defineProperty(CancellationTokenSource.prototype, "token", { + get: function () { + if (!this._token) { + // be lazy and create the token only when + // actually needed + this._token = new cancellation_MutableToken(); + } + return this._token; + }, + enumerable: true, + configurable: true + }); + CancellationTokenSource.prototype.cancel = function () { + if (!this._token) { + // save an object by returning the default + // cancelled token when cancellation happens + // before someone asks for the token + this._token = cancellation_CancellationToken.Cancelled; + } + else if (this._token instanceof cancellation_MutableToken) { + // actually cancel + this._token.cancel(); + } + }; + CancellationTokenSource.prototype.dispose = function () { + if (this._parentListener) { + this._parentListener.dispose(); + } + if (!this._token) { + // ensure to initialize with an empty token if we had none + this._token = cancellation_CancellationToken.None; + } + else if (this._token instanceof cancellation_MutableToken) { + // actually dispose + this._token.dispose(); + } + }; + return CancellationTokenSource; }()); -function createMonacoBaseAPI() { - return { - editor: undefined, - languages: undefined, - CancellationTokenSource: _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationTokenSource"], - Emitter: _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"], - KeyCode: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["KeyCode"], - KeyMod: KeyMod, - Position: _core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"], - Range: _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"], - Selection: _core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"], - SelectionDirection: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["SelectionDirection"], - MarkerSeverity: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["MarkerSeverity"], - MarkerTag: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["MarkerTag"], - Uri: _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"], - Token: _core_token_js__WEBPACK_IMPORTED_MODULE_8__["Token"] + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/base/common/keyCodes.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var KeyCodeStrMap = /** @class */ (function () { + function KeyCodeStrMap() { + this._keyCodeToStr = []; + this._strToKeyCode = Object.create(null); + } + KeyCodeStrMap.prototype.define = function (keyCode, str) { + this._keyCodeToStr[keyCode] = str; + this._strToKeyCode[str.toLowerCase()] = keyCode; }; + KeyCodeStrMap.prototype.keyCodeToStr = function (keyCode) { + return this._keyCodeToStr[keyCode]; + }; + KeyCodeStrMap.prototype.strToKeyCode = function (str) { + return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */; + }; + return KeyCodeStrMap; +}()); +var uiMap = new KeyCodeStrMap(); +var userSettingsUSMap = new KeyCodeStrMap(); +var userSettingsGeneralMap = new KeyCodeStrMap(); +(function () { + function define(keyCode, uiLabel, usUserSettingsLabel, generalUserSettingsLabel) { + if (usUserSettingsLabel === void 0) { usUserSettingsLabel = uiLabel; } + if (generalUserSettingsLabel === void 0) { generalUserSettingsLabel = usUserSettingsLabel; } + uiMap.define(keyCode, uiLabel); + userSettingsUSMap.define(keyCode, usUserSettingsLabel); + userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel); + } + define(0 /* Unknown */, 'unknown'); + define(1 /* Backspace */, 'Backspace'); + define(2 /* Tab */, 'Tab'); + define(3 /* Enter */, 'Enter'); + define(4 /* Shift */, 'Shift'); + define(5 /* Ctrl */, 'Ctrl'); + define(6 /* Alt */, 'Alt'); + define(7 /* PauseBreak */, 'PauseBreak'); + define(8 /* CapsLock */, 'CapsLock'); + define(9 /* Escape */, 'Escape'); + define(10 /* Space */, 'Space'); + define(11 /* PageUp */, 'PageUp'); + define(12 /* PageDown */, 'PageDown'); + define(13 /* End */, 'End'); + define(14 /* Home */, 'Home'); + define(15 /* LeftArrow */, 'LeftArrow', 'Left'); + define(16 /* UpArrow */, 'UpArrow', 'Up'); + define(17 /* RightArrow */, 'RightArrow', 'Right'); + define(18 /* DownArrow */, 'DownArrow', 'Down'); + define(19 /* Insert */, 'Insert'); + define(20 /* Delete */, 'Delete'); + define(21 /* KEY_0 */, '0'); + define(22 /* KEY_1 */, '1'); + define(23 /* KEY_2 */, '2'); + define(24 /* KEY_3 */, '3'); + define(25 /* KEY_4 */, '4'); + define(26 /* KEY_5 */, '5'); + define(27 /* KEY_6 */, '6'); + define(28 /* KEY_7 */, '7'); + define(29 /* KEY_8 */, '8'); + define(30 /* KEY_9 */, '9'); + define(31 /* KEY_A */, 'A'); + define(32 /* KEY_B */, 'B'); + define(33 /* KEY_C */, 'C'); + define(34 /* KEY_D */, 'D'); + define(35 /* KEY_E */, 'E'); + define(36 /* KEY_F */, 'F'); + define(37 /* KEY_G */, 'G'); + define(38 /* KEY_H */, 'H'); + define(39 /* KEY_I */, 'I'); + define(40 /* KEY_J */, 'J'); + define(41 /* KEY_K */, 'K'); + define(42 /* KEY_L */, 'L'); + define(43 /* KEY_M */, 'M'); + define(44 /* KEY_N */, 'N'); + define(45 /* KEY_O */, 'O'); + define(46 /* KEY_P */, 'P'); + define(47 /* KEY_Q */, 'Q'); + define(48 /* KEY_R */, 'R'); + define(49 /* KEY_S */, 'S'); + define(50 /* KEY_T */, 'T'); + define(51 /* KEY_U */, 'U'); + define(52 /* KEY_V */, 'V'); + define(53 /* KEY_W */, 'W'); + define(54 /* KEY_X */, 'X'); + define(55 /* KEY_Y */, 'Y'); + define(56 /* KEY_Z */, 'Z'); + define(57 /* Meta */, 'Meta'); + define(58 /* ContextMenu */, 'ContextMenu'); + define(59 /* F1 */, 'F1'); + define(60 /* F2 */, 'F2'); + define(61 /* F3 */, 'F3'); + define(62 /* F4 */, 'F4'); + define(63 /* F5 */, 'F5'); + define(64 /* F6 */, 'F6'); + define(65 /* F7 */, 'F7'); + define(66 /* F8 */, 'F8'); + define(67 /* F9 */, 'F9'); + define(68 /* F10 */, 'F10'); + define(69 /* F11 */, 'F11'); + define(70 /* F12 */, 'F12'); + define(71 /* F13 */, 'F13'); + define(72 /* F14 */, 'F14'); + define(73 /* F15 */, 'F15'); + define(74 /* F16 */, 'F16'); + define(75 /* F17 */, 'F17'); + define(76 /* F18 */, 'F18'); + define(77 /* F19 */, 'F19'); + define(78 /* NumLock */, 'NumLock'); + define(79 /* ScrollLock */, 'ScrollLock'); + define(80 /* US_SEMICOLON */, ';', ';', 'OEM_1'); + define(81 /* US_EQUAL */, '=', '=', 'OEM_PLUS'); + define(82 /* US_COMMA */, ',', ',', 'OEM_COMMA'); + define(83 /* US_MINUS */, '-', '-', 'OEM_MINUS'); + define(84 /* US_DOT */, '.', '.', 'OEM_PERIOD'); + define(85 /* US_SLASH */, '/', '/', 'OEM_2'); + define(86 /* US_BACKTICK */, '`', '`', 'OEM_3'); + define(110 /* ABNT_C1 */, 'ABNT_C1'); + define(111 /* ABNT_C2 */, 'ABNT_C2'); + define(87 /* US_OPEN_SQUARE_BRACKET */, '[', '[', 'OEM_4'); + define(88 /* US_BACKSLASH */, '\\', '\\', 'OEM_5'); + define(89 /* US_CLOSE_SQUARE_BRACKET */, ']', ']', 'OEM_6'); + define(90 /* US_QUOTE */, '\'', '\'', 'OEM_7'); + define(91 /* OEM_8 */, 'OEM_8'); + define(92 /* OEM_102 */, 'OEM_102'); + define(93 /* NUMPAD_0 */, 'NumPad0'); + define(94 /* NUMPAD_1 */, 'NumPad1'); + define(95 /* NUMPAD_2 */, 'NumPad2'); + define(96 /* NUMPAD_3 */, 'NumPad3'); + define(97 /* NUMPAD_4 */, 'NumPad4'); + define(98 /* NUMPAD_5 */, 'NumPad5'); + define(99 /* NUMPAD_6 */, 'NumPad6'); + define(100 /* NUMPAD_7 */, 'NumPad7'); + define(101 /* NUMPAD_8 */, 'NumPad8'); + define(102 /* NUMPAD_9 */, 'NumPad9'); + define(103 /* NUMPAD_MULTIPLY */, 'NumPad_Multiply'); + define(104 /* NUMPAD_ADD */, 'NumPad_Add'); + define(105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator'); + define(106 /* NUMPAD_SUBTRACT */, 'NumPad_Subtract'); + define(107 /* NUMPAD_DECIMAL */, 'NumPad_Decimal'); + define(108 /* NUMPAD_DIVIDE */, 'NumPad_Divide'); +})(); +var KeyCodeUtils; +(function (KeyCodeUtils) { + function toString(keyCode) { + return uiMap.keyCodeToStr(keyCode); + } + KeyCodeUtils.toString = toString; + function fromString(key) { + return uiMap.strToKeyCode(key); + } + KeyCodeUtils.fromString = fromString; + function toUserSettingsUS(keyCode) { + return userSettingsUSMap.keyCodeToStr(keyCode); + } + KeyCodeUtils.toUserSettingsUS = toUserSettingsUS; + function toUserSettingsGeneral(keyCode) { + return userSettingsGeneralMap.keyCodeToStr(keyCode); + } + KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral; + function fromUserSettings(key) { + return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key); + } + KeyCodeUtils.fromUserSettings = fromUserSettings; +})(KeyCodeUtils || (KeyCodeUtils = {})); +function KeyChord(firstPart, secondPart) { + var chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0; + return (firstPart | chordPart) >>> 0; } +function createKeybinding(keybinding, OS) { + if (keybinding === 0) { + return null; + } + var firstPart = (keybinding & 0x0000FFFF) >>> 0; + var chordPart = (keybinding & 0xFFFF0000) >>> 16; + if (chordPart !== 0) { + return new keyCodes_ChordKeybinding([ + createSimpleKeybinding(firstPart, OS), + createSimpleKeybinding(chordPart, OS) + ]); + } + return new keyCodes_ChordKeybinding([createSimpleKeybinding(firstPart, OS)]); +} +function createSimpleKeybinding(keybinding, OS) { + var ctrlCmd = (keybinding & 2048 /* CtrlCmd */ ? true : false); + var winCtrl = (keybinding & 256 /* WinCtrl */ ? true : false); + var ctrlKey = (OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd); + var shiftKey = (keybinding & 1024 /* Shift */ ? true : false); + var altKey = (keybinding & 512 /* Alt */ ? true : false); + var metaKey = (OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl); + var keyCode = (keybinding & 255 /* KeyCode */); + return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode); +} +var SimpleKeybinding = /** @class */ (function () { + function SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode) { + this.ctrlKey = ctrlKey; + this.shiftKey = shiftKey; + this.altKey = altKey; + this.metaKey = metaKey; + this.keyCode = keyCode; + } + SimpleKeybinding.prototype.equals = function (other) { + return (this.ctrlKey === other.ctrlKey + && this.shiftKey === other.shiftKey + && this.altKey === other.altKey + && this.metaKey === other.metaKey + && this.keyCode === other.keyCode); + }; + SimpleKeybinding.prototype.isModifierKey = function () { + return (this.keyCode === 0 /* Unknown */ + || this.keyCode === 5 /* Ctrl */ + || this.keyCode === 57 /* Meta */ + || this.keyCode === 6 /* Alt */ + || this.keyCode === 4 /* Shift */); + }; + SimpleKeybinding.prototype.toChord = function () { + return new keyCodes_ChordKeybinding([this]); + }; + /** + * Does this keybinding refer to the key code of a modifier and it also has the modifier flag? + */ + SimpleKeybinding.prototype.isDuplicateModifierCase = function () { + return ((this.ctrlKey && this.keyCode === 5 /* Ctrl */) + || (this.shiftKey && this.keyCode === 4 /* Shift */) + || (this.altKey && this.keyCode === 6 /* Alt */) + || (this.metaKey && this.keyCode === 57 /* Meta */)); + }; + return SimpleKeybinding; +}()); + +var keyCodes_ChordKeybinding = /** @class */ (function () { + function ChordKeybinding(parts) { + if (parts.length === 0) { + throw illegalArgument("parts"); + } + this.parts = parts; + } + ChordKeybinding.prototype.equals = function (other) { + if (other === null) { + return false; + } + if (this.parts.length !== other.parts.length) { + return false; + } + for (var i = 0; i < this.parts.length; i++) { + if (!this.parts[i].equals(other.parts[i])) { + return false; + } + } + return true; + }; + return ChordKeybinding; +}()); + +var ResolvedKeybindingPart = /** @class */ (function () { + function ResolvedKeybindingPart(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) { + this.ctrlKey = ctrlKey; + this.shiftKey = shiftKey; + this.altKey = altKey; + this.metaKey = metaKey; + this.keyLabel = kbLabel; + this.keyAriaLabel = kbAriaLabel; + } + return ResolvedKeybindingPart; +}()); + +/** + * A resolved keybinding. Can be a simple keybinding or a chord keybinding. + */ +var ResolvedKeybinding = /** @class */ (function () { + function ResolvedKeybinding() { + } + return ResolvedKeybinding; +}()); -/***/ }), +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/selection.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var selection_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js ***! - \***************************************************************************************/ -/*! exports provided: MarkerTag, MarkerSeverity, KeyCode, SelectionDirection, ScrollbarVisibility, OverviewRulerLane, EndOfLinePreference, DefaultEndOfLine, EndOfLineSequence, TrackedRangeStickiness, ScrollType, CursorChangeReason, RenderMinimap, WrappingIndent, TextEditorCursorBlinkingStyle, TextEditorCursorStyle, RenderLineNumbersType, ContentWidgetPositionPreference, OverlayWidgetPositionPreference, MouseTargetType, IndentAction, CompletionItemKind, CompletionItemInsertTextRule, CompletionTriggerKind, SignatureHelpTriggerKind, DocumentHighlightKind, SymbolKind */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerTag", function() { return MarkerTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerSeverity", function() { return MarkerSeverity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCode", function() { return KeyCode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionDirection", function() { return SelectionDirection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollbarVisibility", function() { return ScrollbarVisibility; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverviewRulerLane", function() { return OverviewRulerLane; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLinePreference", function() { return EndOfLinePreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultEndOfLine", function() { return DefaultEndOfLine; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLineSequence", function() { return EndOfLineSequence; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackedRangeStickiness", function() { return TrackedRangeStickiness; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollType", function() { return ScrollType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorChangeReason", function() { return CursorChangeReason; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderMinimap", function() { return RenderMinimap; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WrappingIndent", function() { return WrappingIndent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorBlinkingStyle", function() { return TextEditorCursorBlinkingStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorStyle", function() { return TextEditorCursorStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderLineNumbersType", function() { return RenderLineNumbersType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentWidgetPositionPreference", function() { return ContentWidgetPositionPreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverlayWidgetPositionPreference", function() { return OverlayWidgetPositionPreference; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MouseTargetType", function() { return MouseTargetType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentAction", function() { return IndentAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemInsertTextRule", function() { return CompletionItemInsertTextRule; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionTriggerKind", function() { return CompletionTriggerKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureHelpTriggerKind", function() { return SignatureHelpTriggerKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; }); +/** + * A selection in the editor. + * The selection is a range that has an orientation. + */ +var selection_Selection = /** @class */ (function (_super) { + selection_extends(Selection, _super); + function Selection(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) { + var _this = _super.call(this, selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) || this; + _this.selectionStartLineNumber = selectionStartLineNumber; + _this.selectionStartColumn = selectionStartColumn; + _this.positionLineNumber = positionLineNumber; + _this.positionColumn = positionColumn; + return _this; + } + /** + * Clone this selection. + */ + Selection.prototype.clone = function () { + return new Selection(this.selectionStartLineNumber, this.selectionStartColumn, this.positionLineNumber, this.positionColumn); + }; + /** + * Transform to a human-readable representation. + */ + Selection.prototype.toString = function () { + return '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']'; + }; + /** + * Test if equals other selection. + */ + Selection.prototype.equalsSelection = function (other) { + return (Selection.selectionsEqual(this, other)); + }; + /** + * Test if the two selections are equal. + */ + Selection.selectionsEqual = function (a, b) { + return (a.selectionStartLineNumber === b.selectionStartLineNumber && + a.selectionStartColumn === b.selectionStartColumn && + a.positionLineNumber === b.positionLineNumber && + a.positionColumn === b.positionColumn); + }; + /** + * Get directions (LTR or RTL). + */ + Selection.prototype.getDirection = function () { + if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) { + return 0 /* LTR */; + } + return 1 /* RTL */; + }; + /** + * Create a new selection with a different `positionLineNumber` and `positionColumn`. + */ + Selection.prototype.setEndPosition = function (endLineNumber, endColumn) { + if (this.getDirection() === 0 /* LTR */) { + return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn); + } + return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn); + }; + /** + * Get the position at `positionLineNumber` and `positionColumn`. + */ + Selection.prototype.getPosition = function () { + return new Position(this.positionLineNumber, this.positionColumn); + }; + /** + * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`. + */ + Selection.prototype.setStartPosition = function (startLineNumber, startColumn) { + if (this.getDirection() === 0 /* LTR */) { + return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn); + } + return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn); + }; + // ---- + /** + * Create a `Selection` from one or two positions + */ + Selection.fromPositions = function (start, end) { + if (end === void 0) { end = start; } + return new Selection(start.lineNumber, start.column, end.lineNumber, end.column); + }; + /** + * Create a `Selection` from an `ISelection`. + */ + Selection.liftSelection = function (sel) { + return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn); + }; + /** + * `a` equals `b`. + */ + Selection.selectionsArrEqual = function (a, b) { + if (a && !b || !a && b) { + return false; + } + if (!a && !b) { + return true; + } + if (a.length !== b.length) { + return false; + } + for (var i = 0, len = a.length; i < len; i++) { + if (!this.selectionsEqual(a[i], b[i])) { + return false; + } + } + return true; + }; + /** + * Test if `obj` is an `ISelection`. + */ + Selection.isISelection = function (obj) { + return (obj + && (typeof obj.selectionStartLineNumber === 'number') + && (typeof obj.selectionStartColumn === 'number') + && (typeof obj.positionLineNumber === 'number') + && (typeof obj.positionColumn === 'number')); + }; + /** + * Create with a direction. + */ + Selection.createWithDirection = function (startLineNumber, startColumn, endLineNumber, endColumn, direction) { + if (direction === 0 /* LTR */) { + return new Selection(startLineNumber, startColumn, endLineNumber, endColumn); + } + return new Selection(endLineNumber, endColumn, startLineNumber, startColumn); + }; + return Selection; +}(range_Range)); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/core/token.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var Token = /** @class */ (function () { + function Token(offset, type, language) { + this.offset = offset | 0; // @perf + this.type = type; + this.language = language; + } + Token.prototype.toString = function () { + return '(' + this.offset + ', ' + this.type + ')'; + }; + return Token; +}()); + +var TokenizationResult = /** @class */ (function () { + function TokenizationResult(tokens, endState) { + this.tokens = tokens; + this.endState = endState; + } + return TokenizationResult; +}()); + +var TokenizationResult2 = /** @class */ (function () { + function TokenizationResult2(tokens, endState) { + this.tokens = tokens; + this.endState = endState; + } + return TokenizationResult2; +}()); + + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -8151,238 +6909,603 @@ var SymbolKind; SymbolKind[SymbolKind["TypeParameter"] = 25] = "TypeParameter"; })(SymbolKind || (SymbolKind = {})); - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js": -/*!****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js ***! - \****************************************************************************************/ -/*! exports provided: PrefixSumIndexOfResult, PrefixSumComputer, PrefixSumComputerWithCache */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumIndexOfResult", function() { return PrefixSumIndexOfResult; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumComputer", function() { return PrefixSumComputer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumComputerWithCache", function() { return PrefixSumComputerWithCache; }); -/* harmony import */ var _core_uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/uint.js */ "./node_modules/monaco-editor/esm/vs/editor/common/core/uint.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var PrefixSumIndexOfResult = /** @class */ (function () { - function PrefixSumIndexOfResult(index, remainder) { - this.index = index; - this.remainder = remainder; + + + + + + + + + +var standaloneBase_KeyMod = /** @class */ (function () { + function KeyMod() { } - return PrefixSumIndexOfResult; + KeyMod.chord = function (firstPart, secondPart) { + return KeyChord(firstPart, secondPart); + }; + KeyMod.CtrlCmd = 2048 /* CtrlCmd */; + KeyMod.Shift = 1024 /* Shift */; + KeyMod.Alt = 512 /* Alt */; + KeyMod.WinCtrl = 256 /* WinCtrl */; + return KeyMod; }()); -var PrefixSumComputer = /** @class */ (function () { - function PrefixSumComputer(values) { - this.values = values; - this.prefixSum = new Uint32Array(values.length); - this.prefixSumValidIndex = new Int32Array(1); - this.prefixSumValidIndex[0] = -1; +function createMonacoBaseAPI() { + return { + editor: undefined, + languages: undefined, + CancellationTokenSource: CancellationTokenSource, + Emitter: event_Emitter, + KeyCode: KeyCode, + KeyMod: standaloneBase_KeyMod, + Position: Position, + Range: range_Range, + Selection: selection_Selection, + SelectionDirection: SelectionDirection, + MarkerSeverity: MarkerSeverity, + MarkerTag: MarkerTag, + Uri: uri_URI, + Token: Token + }; +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var editorSimpleWorker_extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); + + + + + + + + + + + + + + +/** + * @internal + */ +var editorSimpleWorker_MirrorModel = /** @class */ (function (_super) { + editorSimpleWorker_extends(MirrorModel, _super); + function MirrorModel() { + return _super !== null && _super.apply(this, arguments) || this; } - PrefixSumComputer.prototype.getCount = function () { - return this.values.length; + Object.defineProperty(MirrorModel.prototype, "uri", { + get: function () { + return this._uri; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MirrorModel.prototype, "version", { + get: function () { + return this._versionId; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MirrorModel.prototype, "eol", { + get: function () { + return this._eol; + }, + enumerable: true, + configurable: true + }); + MirrorModel.prototype.getValue = function () { + return this.getText(); }; - PrefixSumComputer.prototype.insertValues = function (insertIndex, insertValues) { - insertIndex = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(insertIndex); - var oldValues = this.values; - var oldPrefixSum = this.prefixSum; - var insertValuesLen = insertValues.length; - if (insertValuesLen === 0) { - return false; - } - this.values = new Uint32Array(oldValues.length + insertValuesLen); - this.values.set(oldValues.subarray(0, insertIndex), 0); - this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen); - this.values.set(insertValues, insertIndex); - if (insertIndex - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = insertIndex - 1; - } - this.prefixSum = new Uint32Array(this.values.length); - if (this.prefixSumValidIndex[0] >= 0) { - this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); - } - return true; + MirrorModel.prototype.getLinesContent = function () { + return this._lines.slice(0); }; - PrefixSumComputer.prototype.changeValue = function (index, value) { - index = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index); - value = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(value); - if (this.values[index] === value) { - return false; - } - this.values[index] = value; - if (index - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = index - 1; - } - return true; + MirrorModel.prototype.getLineCount = function () { + return this._lines.length; }; - PrefixSumComputer.prototype.removeValues = function (startIndex, cnt) { - startIndex = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(startIndex); - cnt = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(cnt); - var oldValues = this.values; - var oldPrefixSum = this.prefixSum; - if (startIndex >= oldValues.length) { - return false; - } - var maxCnt = oldValues.length - startIndex; - if (cnt >= maxCnt) { - cnt = maxCnt; - } - if (cnt === 0) { - return false; - } - this.values = new Uint32Array(oldValues.length - cnt); - this.values.set(oldValues.subarray(0, startIndex), 0); - this.values.set(oldValues.subarray(startIndex + cnt), startIndex); - this.prefixSum = new Uint32Array(this.values.length); - if (startIndex - 1 < this.prefixSumValidIndex[0]) { - this.prefixSumValidIndex[0] = startIndex - 1; - } - if (this.prefixSumValidIndex[0] >= 0) { - this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1)); - } - return true; + MirrorModel.prototype.getLineContent = function (lineNumber) { + return this._lines[lineNumber - 1]; }; - PrefixSumComputer.prototype.getTotalValue = function () { - if (this.values.length === 0) { - return 0; + MirrorModel.prototype.getWordAtPosition = function (position, wordDefinition) { + var wordAtText = getWordAtText(position.column, ensureValidWordDefinition(wordDefinition), this._lines[position.lineNumber - 1], 0); + if (wordAtText) { + return new range_Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn); } - return this._getAccumulatedValue(this.values.length - 1); + return null; }; - PrefixSumComputer.prototype.getAccumulatedValue = function (index) { - if (index < 0) { - return 0; + MirrorModel.prototype.getWordUntilPosition = function (position, wordDefinition) { + var wordAtPosition = this.getWordAtPosition(position, wordDefinition); + if (!wordAtPosition) { + return { + word: '', + startColumn: position.column, + endColumn: position.column + }; } - index = Object(_core_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index); - return this._getAccumulatedValue(index); + return { + word: this._lines[position.lineNumber - 1].substring(wordAtPosition.startColumn - 1, position.column - 1), + startColumn: wordAtPosition.startColumn, + endColumn: position.column + }; }; - PrefixSumComputer.prototype._getAccumulatedValue = function (index) { - if (index <= this.prefixSumValidIndex[0]) { - return this.prefixSum[index]; - } - var startIndex = this.prefixSumValidIndex[0] + 1; - if (startIndex === 0) { - this.prefixSum[0] = this.values[0]; - startIndex++; - } - if (index >= this.values.length) { - index = this.values.length - 1; - } - for (var i = startIndex; i <= index; i++) { - this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i]; - } - this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index); - return this.prefixSum[index]; - }; - PrefixSumComputer.prototype.getIndexOf = function (accumulatedValue) { - accumulatedValue = Math.floor(accumulatedValue); //@perf - // Compute all sums (to get a fully valid prefixSum) - this.getTotalValue(); - var low = 0; - var high = this.values.length - 1; - var mid = 0; - var midStop = 0; - var midStart = 0; - while (low <= high) { - mid = low + ((high - low) / 2) | 0; - midStop = this.prefixSum[mid]; - midStart = midStop - this.values[mid]; - if (accumulatedValue < midStart) { - high = mid - 1; + MirrorModel.prototype.createWordIterator = function (wordDefinition) { + var _this = this; + var obj; + var lineNumber = 0; + var lineText; + var wordRangesIdx = 0; + var wordRanges = []; + var next = function () { + if (wordRangesIdx < wordRanges.length) { + var value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end); + wordRangesIdx += 1; + if (!obj) { + obj = { done: false, value: value }; + } + else { + obj.value = value; + } + return obj; } - else if (accumulatedValue >= midStop) { - low = mid + 1; + else if (lineNumber >= _this._lines.length) { + return FIN; } else { + lineText = _this._lines[lineNumber]; + wordRanges = _this._wordenize(lineText, wordDefinition); + wordRangesIdx = 0; + lineNumber += 1; + return next(); + } + }; + return { next: next }; + }; + MirrorModel.prototype.getLineWords = function (lineNumber, wordDefinition) { + var content = this._lines[lineNumber - 1]; + var ranges = this._wordenize(content, wordDefinition); + var words = []; + for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) { + var range = ranges_1[_i]; + words.push({ + word: content.substring(range.start, range.end), + startColumn: range.start + 1, + endColumn: range.end + 1 + }); + } + return words; + }; + MirrorModel.prototype._wordenize = function (content, wordDefinition) { + var result = []; + var match; + wordDefinition.lastIndex = 0; // reset lastIndex just to be sure + while (match = wordDefinition.exec(content)) { + if (match[0].length === 0) { + // it did match the empty string break; } + result.push({ start: match.index, end: match.index + match[0].length }); } - return new PrefixSumIndexOfResult(mid, accumulatedValue - midStart); + return result; }; - return PrefixSumComputer; -}()); - -var PrefixSumComputerWithCache = /** @class */ (function () { - function PrefixSumComputerWithCache(values) { - this._cacheAccumulatedValueStart = 0; - this._cache = null; - this._actual = new PrefixSumComputer(values); - this._bustCache(); - } - PrefixSumComputerWithCache.prototype._bustCache = function () { - this._cacheAccumulatedValueStart = 0; - this._cache = null; - }; - PrefixSumComputerWithCache.prototype.insertValues = function (insertIndex, insertValues) { - if (this._actual.insertValues(insertIndex, insertValues)) { - this._bustCache(); + MirrorModel.prototype.getValueInRange = function (range) { + range = this._validateRange(range); + if (range.startLineNumber === range.endLineNumber) { + return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1); } - }; - PrefixSumComputerWithCache.prototype.changeValue = function (index, value) { - if (this._actual.changeValue(index, value)) { - this._bustCache(); + var lineEnding = this._eol; + var startLineIndex = range.startLineNumber - 1; + var endLineIndex = range.endLineNumber - 1; + var resultLines = []; + resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1)); + for (var i = startLineIndex + 1; i < endLineIndex; i++) { + resultLines.push(this._lines[i]); } + resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1)); + return resultLines.join(lineEnding); }; - PrefixSumComputerWithCache.prototype.removeValues = function (startIndex, cnt) { - if (this._actual.removeValues(startIndex, cnt)) { - this._bustCache(); + MirrorModel.prototype.offsetAt = function (position) { + position = this._validatePosition(position); + this._ensureLineStarts(); + return this._lineStarts.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1); + }; + MirrorModel.prototype.positionAt = function (offset) { + offset = Math.floor(offset); + offset = Math.max(0, offset); + this._ensureLineStarts(); + var out = this._lineStarts.getIndexOf(offset); + var lineLength = this._lines[out.index].length; + // Ensure we return a valid position + return { + lineNumber: 1 + out.index, + column: 1 + Math.min(out.remainder, lineLength) + }; + }; + MirrorModel.prototype._validateRange = function (range) { + var start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn }); + var end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn }); + if (start.lineNumber !== range.startLineNumber + || start.column !== range.startColumn + || end.lineNumber !== range.endLineNumber + || end.column !== range.endColumn) { + return { + startLineNumber: start.lineNumber, + startColumn: start.column, + endLineNumber: end.lineNumber, + endColumn: end.column + }; } + return range; }; - PrefixSumComputerWithCache.prototype.getTotalValue = function () { - return this._actual.getTotalValue(); - }; - PrefixSumComputerWithCache.prototype.getAccumulatedValue = function (index) { - return this._actual.getAccumulatedValue(index); - }; - PrefixSumComputerWithCache.prototype.getIndexOf = function (accumulatedValue) { - accumulatedValue = Math.floor(accumulatedValue); //@perf - if (this._cache !== null) { - var cacheIndex = accumulatedValue - this._cacheAccumulatedValueStart; - if (cacheIndex >= 0 && cacheIndex < this._cache.length) { - // Cache hit! - return this._cache[cacheIndex]; + MirrorModel.prototype._validatePosition = function (position) { + if (!Position.isIPosition(position)) { + throw new Error('bad position'); + } + var lineNumber = position.lineNumber, column = position.column; + var hasChanged = false; + if (lineNumber < 1) { + lineNumber = 1; + column = 1; + hasChanged = true; + } + else if (lineNumber > this._lines.length) { + lineNumber = this._lines.length; + column = this._lines[lineNumber - 1].length + 1; + hasChanged = true; + } + else { + var maxCharacter = this._lines[lineNumber - 1].length + 1; + if (column < 1) { + column = 1; + hasChanged = true; + } + else if (column > maxCharacter) { + column = maxCharacter; + hasChanged = true; } } - // Cache miss! - return this._actual.getIndexOf(accumulatedValue); - }; - /** - * Gives a hint that a lot of requests are about to come in for these accumulated values. - */ - PrefixSumComputerWithCache.prototype.warmUpCache = function (accumulatedValueStart, accumulatedValueEnd) { - var newCache = []; - for (var accumulatedValue = accumulatedValueStart; accumulatedValue <= accumulatedValueEnd; accumulatedValue++) { - newCache[accumulatedValue - accumulatedValueStart] = this.getIndexOf(accumulatedValue); + if (!hasChanged) { + return position; + } + else { + return { lineNumber: lineNumber, column: column }; } - this._cache = newCache; - this._cacheAccumulatedValueStart = accumulatedValueStart; }; - return PrefixSumComputerWithCache; + return MirrorModel; +}(mirrorTextModel_MirrorTextModel)); +/** + * @internal + */ +var editorSimpleWorker_BaseEditorSimpleWorker = /** @class */ (function () { + function BaseEditorSimpleWorker(foreignModuleFactory) { + this._foreignModuleFactory = foreignModuleFactory; + this._foreignModule = null; + } + // ---- BEGIN diff -------------------------------------------------------------------------- + BaseEditorSimpleWorker.prototype.computeDiff = function (originalUrl, modifiedUrl, ignoreTrimWhitespace) { + var original = this._getModel(originalUrl); + var modified = this._getModel(modifiedUrl); + if (!original || !modified) { + return Promise.resolve(null); + } + var originalLines = original.getLinesContent(); + var modifiedLines = modified.getLinesContent(); + var diffComputer = new DiffComputer(originalLines, modifiedLines, { + shouldComputeCharChanges: true, + shouldPostProcessCharChanges: true, + shouldIgnoreTrimWhitespace: ignoreTrimWhitespace, + shouldMakePrettyDiff: true + }); + var changes = diffComputer.computeDiff(); + var identical = (changes.length > 0 ? false : this._modelsAreIdentical(original, modified)); + return Promise.resolve({ + identical: identical, + changes: changes + }); + }; + BaseEditorSimpleWorker.prototype._modelsAreIdentical = function (original, modified) { + var originalLineCount = original.getLineCount(); + var modifiedLineCount = modified.getLineCount(); + if (originalLineCount !== modifiedLineCount) { + return false; + } + for (var line = 1; line <= originalLineCount; line++) { + var originalLine = original.getLineContent(line); + var modifiedLine = modified.getLineContent(line); + if (originalLine !== modifiedLine) { + return false; + } + } + return true; + }; + BaseEditorSimpleWorker.prototype.computeMoreMinimalEdits = function (modelUrl, edits) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(edits); + } + var result = []; + var lastEol = undefined; + edits = mergeSort(edits, function (a, b) { + if (a.range && b.range) { + return range_Range.compareRangesUsingStarts(a.range, b.range); + } + // eol only changes should go to the end + var aRng = a.range ? 0 : 1; + var bRng = b.range ? 0 : 1; + return aRng - bRng; + }); + for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { + var _a = edits_1[_i], range = _a.range, text = _a.text, eol = _a.eol; + if (typeof eol === 'number') { + lastEol = eol; + } + if (range_Range.isEmpty(range) && !text) { + // empty change + continue; + } + var original = model.getValueInRange(range); + text = text.replace(/\r\n|\n|\r/g, model.eol); + if (original === text) { + // noop + continue; + } + // make sure diff won't take too long + if (Math.max(text.length, original.length) > BaseEditorSimpleWorker._diffLimit) { + result.push({ range: range, text: text }); + continue; + } + // compute diff between original and edit.text + var changes = stringDiff(original, text, false); + var editOffset = model.offsetAt(range_Range.lift(range).getStartPosition()); + for (var _b = 0, changes_1 = changes; _b < changes_1.length; _b++) { + var change = changes_1[_b]; + var start = model.positionAt(editOffset + change.originalStart); + var end = model.positionAt(editOffset + change.originalStart + change.originalLength); + var newEdit = { + text: text.substr(change.modifiedStart, change.modifiedLength), + range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column } + }; + if (model.getValueInRange(newEdit.range) !== newEdit.text) { + result.push(newEdit); + } + } + } + if (typeof lastEol === 'number') { + result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }); + } + return Promise.resolve(result); + }; + // ---- END minimal edits --------------------------------------------------------------- + BaseEditorSimpleWorker.prototype.computeLinks = function (modelUrl) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(null); + } + return Promise.resolve(computeLinks(model)); + }; + BaseEditorSimpleWorker.prototype.textualSuggest = function (modelUrl, position, wordDef, wordDefFlags) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(null); + } + var seen = Object.create(null); + var suggestions = []; + var wordDefRegExp = new RegExp(wordDef, wordDefFlags); + var wordUntil = model.getWordUntilPosition(position, wordDefRegExp); + var wordAt = model.getWordAtPosition(position, wordDefRegExp); + if (wordAt) { + seen[model.getValueInRange(wordAt)] = true; + } + for (var iter = model.createWordIterator(wordDefRegExp), e = iter.next(); !e.done && suggestions.length <= BaseEditorSimpleWorker._suggestionsLimit; e = iter.next()) { + var word = e.value; + if (seen[word]) { + continue; + } + seen[word] = true; + if (!isNaN(Number(word))) { + continue; + } + suggestions.push({ + kind: 18 /* Text */, + label: word, + insertText: word, + range: { startLineNumber: position.lineNumber, startColumn: wordUntil.startColumn, endLineNumber: position.lineNumber, endColumn: wordUntil.endColumn } + }); + } + return Promise.resolve({ suggestions: suggestions }); + }; + // ---- END suggest -------------------------------------------------------------------------- + //#region -- word ranges -- + BaseEditorSimpleWorker.prototype.computeWordRanges = function (modelUrl, range, wordDef, wordDefFlags) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(Object.create(null)); + } + var wordDefRegExp = new RegExp(wordDef, wordDefFlags); + var result = Object.create(null); + for (var line = range.startLineNumber; line < range.endLineNumber; line++) { + var words = model.getLineWords(line, wordDefRegExp); + for (var _i = 0, words_1 = words; _i < words_1.length; _i++) { + var word = words_1[_i]; + if (!isNaN(Number(word.word))) { + continue; + } + var array = result[word.word]; + if (!array) { + array = []; + result[word.word] = array; + } + array.push({ + startLineNumber: line, + startColumn: word.startColumn, + endLineNumber: line, + endColumn: word.endColumn + }); + } + } + return Promise.resolve(result); + }; + //#endregion + BaseEditorSimpleWorker.prototype.navigateValueSet = function (modelUrl, range, up, wordDef, wordDefFlags) { + var model = this._getModel(modelUrl); + if (!model) { + return Promise.resolve(null); + } + var wordDefRegExp = new RegExp(wordDef, wordDefFlags); + if (range.startColumn === range.endColumn) { + range = { + startLineNumber: range.startLineNumber, + startColumn: range.startColumn, + endLineNumber: range.endLineNumber, + endColumn: range.endColumn + 1 + }; + } + var selectionText = model.getValueInRange(range); + var wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp); + if (!wordRange) { + return Promise.resolve(null); + } + var word = model.getValueInRange(wordRange); + var result = BasicInplaceReplace.INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up); + return Promise.resolve(result); + }; + // ---- BEGIN foreign module support -------------------------------------------------------------------------- + BaseEditorSimpleWorker.prototype.loadForeignModule = function (moduleId, createData) { + var _this = this; + var ctx = { + getMirrorModels: function () { + return _this._getModels(); + } + }; + if (this._foreignModuleFactory) { + this._foreignModule = this._foreignModuleFactory(ctx, createData); + // static foreing module + var methods = []; + for (var _i = 0, _a = getAllPropertyNames(this._foreignModule); _i < _a.length; _i++) { + var prop = _a[_i]; + if (typeof this._foreignModule[prop] === 'function') { + methods.push(prop); + } + } + return Promise.resolve(methods); + } + // ESM-comment-begin + // return new Promise((resolve, reject) => { + // require([moduleId], (foreignModule: { create: IForeignModuleFactory }) => { + // this._foreignModule = foreignModule.create(ctx, createData); + // + // let methods: string[] = []; + // for (const prop of getAllPropertyNames(this._foreignModule)) { + // if (typeof this._foreignModule[prop] === 'function') { + // methods.push(prop); + // } + // } + // + // resolve(methods); + // + // }, reject); + // }); + // ESM-comment-end + // ESM-uncomment-begin + return Promise.reject(new Error("Unexpected usage")); + // ESM-uncomment-end + }; + // foreign method request + BaseEditorSimpleWorker.prototype.fmr = function (method, args) { + if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') { + return Promise.reject(new Error('Missing requestHandler or method: ' + method)); + } + try { + return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args)); + } + catch (e) { + return Promise.reject(e); + } + }; + // ---- END diff -------------------------------------------------------------------------- + // ---- BEGIN minimal edits --------------------------------------------------------------- + BaseEditorSimpleWorker._diffLimit = 100000; + // ---- BEGIN suggest -------------------------------------------------------------------------- + BaseEditorSimpleWorker._suggestionsLimit = 10000; + return BaseEditorSimpleWorker; }()); +/** + * @internal + */ +var editorSimpleWorker_EditorSimpleWorkerImpl = /** @class */ (function (_super) { + editorSimpleWorker_extends(EditorSimpleWorkerImpl, _super); + function EditorSimpleWorkerImpl(foreignModuleFactory) { + var _this = _super.call(this, foreignModuleFactory) || this; + _this._models = Object.create(null); + return _this; + } + EditorSimpleWorkerImpl.prototype.dispose = function () { + this._models = Object.create(null); + }; + EditorSimpleWorkerImpl.prototype._getModel = function (uri) { + return this._models[uri]; + }; + EditorSimpleWorkerImpl.prototype._getModels = function () { + var _this = this; + var all = []; + Object.keys(this._models).forEach(function (key) { return all.push(_this._models[key]); }); + return all; + }; + EditorSimpleWorkerImpl.prototype.acceptNewModel = function (data) { + this._models[data.url] = new editorSimpleWorker_MirrorModel(uri_URI.parse(data.url), data.lines, data.EOL, data.versionId); + }; + EditorSimpleWorkerImpl.prototype.acceptModelChanged = function (strURL, e) { + if (!this._models[strURL]) { + return; + } + var model = this._models[strURL]; + model.onEvents(e); + }; + EditorSimpleWorkerImpl.prototype.acceptRemovedModel = function (strURL) { + if (!this._models[strURL]) { + return; + } + delete this._models[strURL]; + }; + return EditorSimpleWorkerImpl; +}(editorSimpleWorker_BaseEditorSimpleWorker)); +/** + * Called on the worker side + * @internal + */ +function editorSimpleWorker_create() { + return new editorSimpleWorker_EditorSimpleWorkerImpl(null); +} +if (typeof importScripts === 'function') { + // Running in a web worker + globals.monaco = createMonacoBaseAPI(); +} -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/editor/editor.worker.js": -/*!*******************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/editor/editor.worker.js ***! - \*******************************************************************/ -/*! exports provided: initialize */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initialize", function() { return initialize; }); -/* harmony import */ var _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/common/worker/simpleWorker.js */ "./node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js"); -/* harmony import */ var _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/services/editorSimpleWorker.js */ "./node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js"); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/editor/editor.worker.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -8395,8 +7518,8 @@ function initialize(foreignModule) { return; } initialized = true; - var editorWorker = new _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__["EditorSimpleWorkerImpl"](foreignModule); - var simpleWorker = new _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__["SimpleWorkerServer"](function (msg) { + var editorWorker = new editorSimpleWorker_EditorSimpleWorkerImpl(foreignModule); + var simpleWorker = new simpleWorker_SimpleWorkerServer(function (msg) { self.postMessage(msg); }, editorWorker); self.onmessage = function (e) { @@ -8410,35 +7533,10 @@ self.onmessage = function (e) { } }; +// EXTERNAL MODULE: ./node_modules/monaco-editor/esm/vs/language/typescript/lib/typescriptServices.js +var typescriptServices = __webpack_require__("lz1K"); -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/typescript/lib/lib.js": -/*!**************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/typescript/lib/lib.js ***! - \**************************************************************************/ -/*! exports provided: lib_es2015_symbol_dts, lib_es2015_symbol_wellknown_dts, lib_es2015_reflect_dts, lib_es2015_proxy_dts, lib_es2015_iterable_dts, lib_es2015_promise_dts, lib_es2015_generator_dts, lib_es2015_collection_dts, lib_es2015_core_dts, lib_dom_iterable_dts, lib_scripthost_dts, lib_webworker_importscripts_dts, lib_dom_dts, lib_es5_dts, lib_es2015_dts, lib_es6_dts, lib_dts */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lib_es2015_symbol_dts", function() { return lib_es2015_symbol_dts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lib_es2015_symbol_wellknown_dts", function() { return lib_es2015_symbol_wellknown_dts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lib_es2015_reflect_dts", function() { return lib_es2015_reflect_dts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lib_es2015_proxy_dts", function() { return lib_es2015_proxy_dts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lib_es2015_iterable_dts", function() { return lib_es2015_iterable_dts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lib_es2015_promise_dts", function() { return lib_es2015_promise_dts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lib_es2015_generator_dts", function() { return lib_es2015_generator_dts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lib_es2015_collection_dts", function() { return lib_es2015_collection_dts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lib_es2015_core_dts", function() { return lib_es2015_core_dts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lib_dom_iterable_dts", function() { return lib_dom_iterable_dts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lib_scripthost_dts", function() { return lib_scripthost_dts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lib_webworker_importscripts_dts", function() { return lib_webworker_importscripts_dts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lib_dom_dts", function() { return lib_dom_dts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lib_es5_dts", function() { return lib_es5_dts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lib_es2015_dts", function() { return lib_es2015_dts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lib_es6_dts", function() { return lib_es6_dts; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lib_dts", function() { return lib_dts; }); +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/typescript/lib/lib.js /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -8461,27 +7559,540 @@ var lib_es2015_dts = "/*! ****************************************************** var lib_es6_dts = "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved. \nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0 \n \nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, \nMERCHANTABLITY OR NON-INFRINGEMENT. \n \nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n\n/// \n\n" + lib_es2015_dts + "" + lib_dom_dts + "" + lib_dom_iterable_dts + "" + lib_webworker_importscripts_dts + "" + lib_scripthost_dts + ""; var lib_dts = "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved. \nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0 \n \nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, \nMERCHANTABLITY OR NON-INFRINGEMENT. \n \nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n\n/// \n\n" + lib_es5_dts + "" + lib_dom_dts + "" + lib_webworker_importscripts_dts + "" + lib_scripthost_dts + ""; +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/typescript/tsWorker.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + +var DEFAULT_LIB = { + NAME: 'defaultLib:lib.d.ts', + CONTENTS: lib_dts +}; +var ES6_LIB = { + NAME: 'defaultLib:lib.es6.d.ts', + CONTENTS: lib_es6_dts +}; +var tsWorker_TypeScriptWorker = /** @class */ (function () { + function TypeScriptWorker(ctx, createData) { + this._extraLibs = Object.create(null); + this._languageService = typescriptServices["c" /* createLanguageService */](this); + this._ctx = ctx; + this._compilerOptions = createData.compilerOptions; + this._extraLibs = createData.extraLibs; + } + // --- language service host --------------- + TypeScriptWorker.prototype.getCompilationSettings = function () { + return this._compilerOptions; + }; + TypeScriptWorker.prototype.getScriptFileNames = function () { + var models = this._ctx.getMirrorModels().map(function (model) { return model.uri.toString(); }); + return models.concat(Object.keys(this._extraLibs)); + }; + TypeScriptWorker.prototype._getModel = function (fileName) { + var models = this._ctx.getMirrorModels(); + for (var i = 0; i < models.length; i++) { + if (models[i].uri.toString() === fileName) { + return models[i]; + } + } + return null; + }; + TypeScriptWorker.prototype.getScriptVersion = function (fileName) { + var model = this._getModel(fileName); + if (model) { + return model.version.toString(); + } + else if (this.isDefaultLibFileName(fileName)) { + // default lib is static + return '1'; + } + else if (fileName in this._extraLibs) { + return String(this._extraLibs[fileName].version); + } + }; + TypeScriptWorker.prototype.getScriptSnapshot = function (fileName) { + var text; + var model = this._getModel(fileName); + if (model) { + // a true editor model + text = model.getValue(); + } + else if (fileName in this._extraLibs) { + // extra lib + text = this._extraLibs[fileName].content; + } + else if (fileName === DEFAULT_LIB.NAME) { + text = DEFAULT_LIB.CONTENTS; + } + else if (fileName === ES6_LIB.NAME) { + text = ES6_LIB.CONTENTS; + } + else { + return; + } + return { + getText: function (start, end) { return text.substring(start, end); }, + getLength: function () { return text.length; }, + getChangeRange: function () { return undefined; } + }; + }; + TypeScriptWorker.prototype.getScriptKind = function (fileName) { + var suffix = fileName.substr(fileName.lastIndexOf('.') + 1); + switch (suffix) { + case 'ts': return typescriptServices["a" /* ScriptKind */].TS; + case 'tsx': return typescriptServices["a" /* ScriptKind */].TSX; + case 'js': return typescriptServices["a" /* ScriptKind */].JS; + case 'jsx': return typescriptServices["a" /* ScriptKind */].JSX; + default: return this.getCompilationSettings().allowJs + ? typescriptServices["a" /* ScriptKind */].JS + : typescriptServices["a" /* ScriptKind */].TS; + } + }; + TypeScriptWorker.prototype.getCurrentDirectory = function () { + return ''; + }; + TypeScriptWorker.prototype.getDefaultLibFileName = function (options) { + // TODO@joh support lib.es7.d.ts + return options.target <= typescriptServices["b" /* ScriptTarget */].ES5 ? DEFAULT_LIB.NAME : ES6_LIB.NAME; + }; + TypeScriptWorker.prototype.isDefaultLibFileName = function (fileName) { + return fileName === this.getDefaultLibFileName(this._compilerOptions); + }; + // --- language features + TypeScriptWorker.clearFiles = function (diagnostics) { + // Clear the `file` field, which cannot be JSON'yfied because it + // contains cyclic data structures. + diagnostics.forEach(function (diag) { + diag.file = undefined; + var related = diag.relatedInformation; + if (related) { + related.forEach(function (diag2) { return diag2.file = undefined; }); + } + }); + }; + TypeScriptWorker.prototype.getSyntacticDiagnostics = function (fileName) { + var diagnostics = this._languageService.getSyntacticDiagnostics(fileName); + TypeScriptWorker.clearFiles(diagnostics); + return Promise.resolve(diagnostics); + }; + TypeScriptWorker.prototype.getSemanticDiagnostics = function (fileName) { + var diagnostics = this._languageService.getSemanticDiagnostics(fileName); + TypeScriptWorker.clearFiles(diagnostics); + return Promise.resolve(diagnostics); + }; + TypeScriptWorker.prototype.getCompilerOptionsDiagnostics = function (fileName) { + var diagnostics = this._languageService.getCompilerOptionsDiagnostics(); + TypeScriptWorker.clearFiles(diagnostics); + return Promise.resolve(diagnostics); + }; + TypeScriptWorker.prototype.getCompletionsAtPosition = function (fileName, position) { + return Promise.resolve(this._languageService.getCompletionsAtPosition(fileName, position, undefined)); + }; + TypeScriptWorker.prototype.getCompletionEntryDetails = function (fileName, position, entry) { + return Promise.resolve(this._languageService.getCompletionEntryDetails(fileName, position, entry, undefined, undefined, undefined)); + }; + TypeScriptWorker.prototype.getSignatureHelpItems = function (fileName, position) { + return Promise.resolve(this._languageService.getSignatureHelpItems(fileName, position, undefined)); + }; + TypeScriptWorker.prototype.getQuickInfoAtPosition = function (fileName, position) { + return Promise.resolve(this._languageService.getQuickInfoAtPosition(fileName, position)); + }; + TypeScriptWorker.prototype.getOccurrencesAtPosition = function (fileName, position) { + return Promise.resolve(this._languageService.getOccurrencesAtPosition(fileName, position)); + }; + TypeScriptWorker.prototype.getDefinitionAtPosition = function (fileName, position) { + return Promise.resolve(this._languageService.getDefinitionAtPosition(fileName, position)); + }; + TypeScriptWorker.prototype.getReferencesAtPosition = function (fileName, position) { + return Promise.resolve(this._languageService.getReferencesAtPosition(fileName, position)); + }; + TypeScriptWorker.prototype.getNavigationBarItems = function (fileName) { + return Promise.resolve(this._languageService.getNavigationBarItems(fileName)); + }; + TypeScriptWorker.prototype.getFormattingEditsForDocument = function (fileName, options) { + return Promise.resolve(this._languageService.getFormattingEditsForDocument(fileName, options)); + }; + TypeScriptWorker.prototype.getFormattingEditsForRange = function (fileName, start, end, options) { + return Promise.resolve(this._languageService.getFormattingEditsForRange(fileName, start, end, options)); + }; + TypeScriptWorker.prototype.getFormattingEditsAfterKeystroke = function (fileName, postion, ch, options) { + return Promise.resolve(this._languageService.getFormattingEditsAfterKeystroke(fileName, postion, ch, options)); + }; + TypeScriptWorker.prototype.getEmitOutput = function (fileName) { + return Promise.resolve(this._languageService.getEmitOutput(fileName)); + }; + TypeScriptWorker.prototype.updateExtraLibs = function (extraLibs) { + this._extraLibs = extraLibs; + }; + return TypeScriptWorker; +}()); + +function tsWorker_create(ctx, createData) { + return new tsWorker_TypeScriptWorker(ctx, createData); +} + +// CONCATENATED MODULE: ./node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + + +self.onmessage = function () { + // ignore the first message + initialize(function (ctx, createData) { + return new tsWorker_TypeScriptWorker(ctx, createData); + }); +}; + /***/ }), -/***/ "./node_modules/monaco-editor/esm/vs/language/typescript/lib/typescriptServices.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/typescript/lib/typescriptServices.js ***! - \*****************************************************************************************/ -/*! exports provided: createClassifier, createLanguageService, displayPartsToString, EndOfLineState, flattenDiagnosticMessageText, IndentStyle, ScriptKind, ScriptTarget, TokenClass */ +/***/ "BKcT": +/***/ (function(module, exports) { + +module.exports = function(originalModule) { + if (!originalModule.webpackPolyfill) { + var module = Object.create(originalModule); + // module.parent = undefined by default + if (!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + Object.defineProperty(module, "exports", { + enumerable: true + }); + module.webpackPolyfill = 1; + } + return module; +}; + + +/***/ }), + +/***/ "URDS": +/***/ (function(module, exports, __webpack_require__) { + +/*! +Copyright (c) 2014 Taylor Hakes +Copyright (c) 2014 Forbes Lindesay + */ +(function (global, factory) { + true ? factory() : + undefined; +}(this, (function () { + 'use strict'; + + /** + * @this {Promise} + */ + function finallyConstructor(callback) { + var constructor = this.constructor; + return this.then( + function (value) { + return constructor.resolve(callback()).then(function () { + return value; + }); + }, + function (reason) { + return constructor.resolve(callback()).then(function () { + return constructor.reject(reason); + }); + } + ); + } + + // Store setTimeout reference so promise-polyfill will be unaffected by + // other code modifying setTimeout (like sinon.useFakeTimers()) + var setTimeoutFunc = setTimeout; + + function noop() { } + + // Polyfill for Function.prototype.bind + function bind(fn, thisArg) { + return function () { + fn.apply(thisArg, arguments); + }; + } + + /** + * @constructor + * @param {Function} fn + */ + function Promise(fn) { + if (!(this instanceof Promise)) + throw new TypeError('Promises must be constructed via new'); + if (typeof fn !== 'function') throw new TypeError('not a function'); + /** @type {!number} */ + this._state = 0; + /** @type {!boolean} */ + this._handled = false; + /** @type {Promise|undefined} */ + this._value = undefined; + /** @type {!Array} */ + this._deferreds = []; + + doResolve(fn, this); + } + + function handle(self, deferred) { + while (self._state === 3) { + self = self._value; + } + if (self._state === 0) { + self._deferreds.push(deferred); + return; + } + self._handled = true; + Promise._immediateFn(function () { + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (self._state === 1 ? resolve : reject)(deferred.promise, self._value); + return; + } + var ret; + try { + ret = cb(self._value); + } catch (e) { + reject(deferred.promise, e); + return; + } + resolve(deferred.promise, ret); + }); + } + + function resolve(self, newValue) { + try { + // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure + if (newValue === self) + throw new TypeError('A promise cannot be resolved with itself.'); + if ( + newValue && + (typeof newValue === 'object' || typeof newValue === 'function') + ) { + var then = newValue.then; + if (newValue instanceof Promise) { + self._state = 3; + self._value = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(bind(then, newValue), self); + return; + } + } + self._state = 1; + self._value = newValue; + finale(self); + } catch (e) { + reject(self, e); + } + } + + function reject(self, newValue) { + self._state = 2; + self._value = newValue; + finale(self); + } + + function finale(self) { + if (self._state === 2 && self._deferreds.length === 0) { + Promise._immediateFn(function () { + if (!self._handled) { + Promise._unhandledRejectionFn(self._value); + } + }); + } + + for (var i = 0, len = self._deferreds.length; i < len; i++) { + handle(self, self._deferreds[i]); + } + self._deferreds = null; + } + + /** + * @constructor + */ + function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; + } + + /** + * Take a potentially misbehaving resolver function and make sure + * onFulfilled and onRejected are only called once. + * + * Makes no guarantees about asynchrony. + */ + function doResolve(fn, self) { + var done = false; + try { + fn( + function (value) { + if (done) return; + done = true; + resolve(self, value); + }, + function (reason) { + if (done) return; + done = true; + reject(self, reason); + } + ); + } catch (ex) { + if (done) return; + done = true; + reject(self, ex); + } + } + + Promise.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); + }; + + Promise.prototype.then = function (onFulfilled, onRejected) { + // @ts-ignore + var prom = new this.constructor(noop); + + handle(this, new Handler(onFulfilled, onRejected, prom)); + return prom; + }; + + Promise.prototype['finally'] = finallyConstructor; + + Promise.all = function (arr) { + return new Promise(function (resolve, reject) { + if (!arr || typeof arr.length === 'undefined') + throw new TypeError('Promise.all accepts an array'); + var args = Array.prototype.slice.call(arr); + if (args.length === 0) return resolve([]); + var remaining = args.length; + + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call( + val, + function (val) { + res(i, val); + }, + reject + ); + return; + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); + } + } + + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + + Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; + } + + return new Promise(function (resolve) { + resolve(value); + }); + }; + + Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); + }; + + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var i = 0, len = values.length; i < len; i++) { + values[i].then(resolve, reject); + } + }); + }; + + // Use polyfill for setImmediate for performance gains + Promise._immediateFn = + (typeof setImmediate === 'function' && + function (fn) { + setImmediate(fn); + }) || + function (fn) { + setTimeoutFunc(fn, 0); + }; + + Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { + if (typeof console !== 'undefined' && console) { + console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console + } + }; + + /** @suppress {undefinedVars} */ + var globalNS = (function () { + // the only reliable means to get the global object is + // `Function('return this')()` + // However, this causes CSP violations in Chrome apps. + if (typeof self !== 'undefined') { + return self; + } + if (typeof window !== 'undefined') { + return window; + } + if (typeof global !== 'undefined') { + return global; + } + throw new Error('unable to locate global object'); + })(); + + if (!('Promise' in globalNS)) { + globalNS['Promise'] = Promise; + } else if (!globalNS.Promise.prototype['finally']) { + globalNS.Promise.prototype['finally'] = finallyConstructor; + } + +}))); + + +/***/ }), + +/***/ "lz1K": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(__dirname, module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createClassifier", function() { return createClassifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLanguageService", function() { return createLanguageService; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "displayPartsToString", function() { return displayPartsToString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLineState", function() { return EndOfLineState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flattenDiagnosticMessageText", function() { return flattenDiagnosticMessageText; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentStyle", function() { return IndentStyle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScriptKind", function() { return ScriptKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScriptTarget", function() { return ScriptTarget; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenClass", function() { return TokenClass; }); +/* WEBPACK VAR INJECTION */(function(__dirname, module) {/* unused harmony export createClassifier */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return createLanguageService; }); +/* unused harmony export displayPartsToString */ +/* unused harmony export EndOfLineState */ +/* unused harmony export flattenDiagnosticMessageText */ +/* unused harmony export IndentStyle */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ScriptKind; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ScriptTarget; }); +/* unused harmony export TokenClass */ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use @@ -132460,262 +132071,8 @@ const ScriptTarget = ts.ScriptTarget; const TokenClass = ts.TokenClass; // END MONACOCHANGE -/* WEBPACK VAR INJECTION */}.call(this, "/", __webpack_require__(/*! ./../../../../../../next/node_modules/webpack/buildin/harmony-module.js */ "./node_modules/next/node_modules/webpack/buildin/harmony-module.js")(module))) - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js": -/*!****************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js ***! - \****************************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _editor_editor_worker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../editor/editor.worker.js */ "./node_modules/monaco-editor/esm/vs/editor/editor.worker.js"); -/* harmony import */ var _tsWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tsWorker.js */ "./node_modules/monaco-editor/esm/vs/language/typescript/tsWorker.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -self.onmessage = function () { - // ignore the first message - _editor_editor_worker_js__WEBPACK_IMPORTED_MODULE_0__["initialize"](function (ctx, createData) { - return new _tsWorker_js__WEBPACK_IMPORTED_MODULE_1__["TypeScriptWorker"](ctx, createData); - }); -}; - - -/***/ }), - -/***/ "./node_modules/monaco-editor/esm/vs/language/typescript/tsWorker.js": -/*!***************************************************************************!*\ - !*** ./node_modules/monaco-editor/esm/vs/language/typescript/tsWorker.js ***! - \***************************************************************************/ -/*! exports provided: TypeScriptWorker, create */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TypeScriptWorker", function() { return TypeScriptWorker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; }); -/* harmony import */ var _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/typescriptServices.js */ "./node_modules/monaco-editor/esm/vs/language/typescript/lib/typescriptServices.js"); -/* harmony import */ var _lib_lib_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/lib.js */ "./node_modules/monaco-editor/esm/vs/language/typescript/lib/lib.js"); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - - -var DEFAULT_LIB = { - NAME: 'defaultLib:lib.d.ts', - CONTENTS: _lib_lib_js__WEBPACK_IMPORTED_MODULE_1__["lib_dts"] -}; -var ES6_LIB = { - NAME: 'defaultLib:lib.es6.d.ts', - CONTENTS: _lib_lib_js__WEBPACK_IMPORTED_MODULE_1__["lib_es6_dts"] -}; -var TypeScriptWorker = /** @class */ (function () { - function TypeScriptWorker(ctx, createData) { - this._extraLibs = Object.create(null); - this._languageService = _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__["createLanguageService"](this); - this._ctx = ctx; - this._compilerOptions = createData.compilerOptions; - this._extraLibs = createData.extraLibs; - } - // --- language service host --------------- - TypeScriptWorker.prototype.getCompilationSettings = function () { - return this._compilerOptions; - }; - TypeScriptWorker.prototype.getScriptFileNames = function () { - var models = this._ctx.getMirrorModels().map(function (model) { return model.uri.toString(); }); - return models.concat(Object.keys(this._extraLibs)); - }; - TypeScriptWorker.prototype._getModel = function (fileName) { - var models = this._ctx.getMirrorModels(); - for (var i = 0; i < models.length; i++) { - if (models[i].uri.toString() === fileName) { - return models[i]; - } - } - return null; - }; - TypeScriptWorker.prototype.getScriptVersion = function (fileName) { - var model = this._getModel(fileName); - if (model) { - return model.version.toString(); - } - else if (this.isDefaultLibFileName(fileName)) { - // default lib is static - return '1'; - } - else if (fileName in this._extraLibs) { - return String(this._extraLibs[fileName].version); - } - }; - TypeScriptWorker.prototype.getScriptSnapshot = function (fileName) { - var text; - var model = this._getModel(fileName); - if (model) { - // a true editor model - text = model.getValue(); - } - else if (fileName in this._extraLibs) { - // extra lib - text = this._extraLibs[fileName].content; - } - else if (fileName === DEFAULT_LIB.NAME) { - text = DEFAULT_LIB.CONTENTS; - } - else if (fileName === ES6_LIB.NAME) { - text = ES6_LIB.CONTENTS; - } - else { - return; - } - return { - getText: function (start, end) { return text.substring(start, end); }, - getLength: function () { return text.length; }, - getChangeRange: function () { return undefined; } - }; - }; - TypeScriptWorker.prototype.getScriptKind = function (fileName) { - var suffix = fileName.substr(fileName.lastIndexOf('.') + 1); - switch (suffix) { - case 'ts': return _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__["ScriptKind"].TS; - case 'tsx': return _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__["ScriptKind"].TSX; - case 'js': return _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__["ScriptKind"].JS; - case 'jsx': return _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__["ScriptKind"].JSX; - default: return this.getCompilationSettings().allowJs - ? _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__["ScriptKind"].JS - : _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__["ScriptKind"].TS; - } - }; - TypeScriptWorker.prototype.getCurrentDirectory = function () { - return ''; - }; - TypeScriptWorker.prototype.getDefaultLibFileName = function (options) { - // TODO@joh support lib.es7.d.ts - return options.target <= _lib_typescriptServices_js__WEBPACK_IMPORTED_MODULE_0__["ScriptTarget"].ES5 ? DEFAULT_LIB.NAME : ES6_LIB.NAME; - }; - TypeScriptWorker.prototype.isDefaultLibFileName = function (fileName) { - return fileName === this.getDefaultLibFileName(this._compilerOptions); - }; - // --- language features - TypeScriptWorker.clearFiles = function (diagnostics) { - // Clear the `file` field, which cannot be JSON'yfied because it - // contains cyclic data structures. - diagnostics.forEach(function (diag) { - diag.file = undefined; - var related = diag.relatedInformation; - if (related) { - related.forEach(function (diag2) { return diag2.file = undefined; }); - } - }); - }; - TypeScriptWorker.prototype.getSyntacticDiagnostics = function (fileName) { - var diagnostics = this._languageService.getSyntacticDiagnostics(fileName); - TypeScriptWorker.clearFiles(diagnostics); - return Promise.resolve(diagnostics); - }; - TypeScriptWorker.prototype.getSemanticDiagnostics = function (fileName) { - var diagnostics = this._languageService.getSemanticDiagnostics(fileName); - TypeScriptWorker.clearFiles(diagnostics); - return Promise.resolve(diagnostics); - }; - TypeScriptWorker.prototype.getCompilerOptionsDiagnostics = function (fileName) { - var diagnostics = this._languageService.getCompilerOptionsDiagnostics(); - TypeScriptWorker.clearFiles(diagnostics); - return Promise.resolve(diagnostics); - }; - TypeScriptWorker.prototype.getCompletionsAtPosition = function (fileName, position) { - return Promise.resolve(this._languageService.getCompletionsAtPosition(fileName, position, undefined)); - }; - TypeScriptWorker.prototype.getCompletionEntryDetails = function (fileName, position, entry) { - return Promise.resolve(this._languageService.getCompletionEntryDetails(fileName, position, entry, undefined, undefined, undefined)); - }; - TypeScriptWorker.prototype.getSignatureHelpItems = function (fileName, position) { - return Promise.resolve(this._languageService.getSignatureHelpItems(fileName, position, undefined)); - }; - TypeScriptWorker.prototype.getQuickInfoAtPosition = function (fileName, position) { - return Promise.resolve(this._languageService.getQuickInfoAtPosition(fileName, position)); - }; - TypeScriptWorker.prototype.getOccurrencesAtPosition = function (fileName, position) { - return Promise.resolve(this._languageService.getOccurrencesAtPosition(fileName, position)); - }; - TypeScriptWorker.prototype.getDefinitionAtPosition = function (fileName, position) { - return Promise.resolve(this._languageService.getDefinitionAtPosition(fileName, position)); - }; - TypeScriptWorker.prototype.getReferencesAtPosition = function (fileName, position) { - return Promise.resolve(this._languageService.getReferencesAtPosition(fileName, position)); - }; - TypeScriptWorker.prototype.getNavigationBarItems = function (fileName) { - return Promise.resolve(this._languageService.getNavigationBarItems(fileName)); - }; - TypeScriptWorker.prototype.getFormattingEditsForDocument = function (fileName, options) { - return Promise.resolve(this._languageService.getFormattingEditsForDocument(fileName, options)); - }; - TypeScriptWorker.prototype.getFormattingEditsForRange = function (fileName, start, end, options) { - return Promise.resolve(this._languageService.getFormattingEditsForRange(fileName, start, end, options)); - }; - TypeScriptWorker.prototype.getFormattingEditsAfterKeystroke = function (fileName, postion, ch, options) { - return Promise.resolve(this._languageService.getFormattingEditsAfterKeystroke(fileName, postion, ch, options)); - }; - TypeScriptWorker.prototype.getEmitOutput = function (fileName) { - return Promise.resolve(this._languageService.getEmitOutput(fileName)); - }; - TypeScriptWorker.prototype.updateExtraLibs = function (extraLibs) { - this._extraLibs = extraLibs; - }; - return TypeScriptWorker; -}()); - -function create(ctx, createData) { - return new TypeScriptWorker(ctx, createData); -} - - -/***/ }), - -/***/ "./node_modules/next/node_modules/webpack/buildin/harmony-module.js": -/*!*******************************************!*\ - !*** (webpack)/buildin/harmony-module.js ***! - \*******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function(originalModule) { - if (!originalModule.webpackPolyfill) { - var module = Object.create(originalModule); - // module.parent = undefined by default - if (!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - Object.defineProperty(module, "exports", { - enumerable: true - }); - module.webpackPolyfill = 1; - } - return module; -}; - +/* WEBPACK VAR INJECTION */}.call(this, "/", __webpack_require__("BKcT")(module))) /***/ }) -/******/ }); -//# sourceMappingURL=typescript.worker.js.map \ No newline at end of file +/******/ }); \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 45ae16f..c8fc313 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -33,6 +33,6 @@ "esModuleInterop": true, "isolatedModules": true }, - "exclude": ["static", "public", ".next", "node_modules"], + "exclude": ["static", "public", ".next", "node_modules", "assets"], "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"] } diff --git a/typings/npm/evergreen-ui.d.ts b/typings/npm/evergreen-ui.d.ts index 92b1028..cff4582 100644 --- a/typings/npm/evergreen-ui.d.ts +++ b/typings/npm/evergreen-ui.d.ts @@ -255,6 +255,8 @@ declare module "evergreen-ui" { export interface SelectProps extends EnhancerProps { value: string; onChange: (e) => void; + name?: string; + defaultValue?: string | number; } export class Select extends React.PureComponent {} diff --git a/yarn.lock b/yarn.lock index 084ac24..e8c02a1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -94,12 +94,27 @@ source-map "^0.5.0" trim-right "^1.0.1" +"@babel/generator@^7.7.4": + version "7.7.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.7.7.tgz#859ac733c44c74148e1a72980a64ec84b85f4f45" + dependencies: + "@babel/types" "^7.7.4" + jsesc "^2.5.1" + lodash "^4.17.13" + source-map "^0.5.0" + "@babel/helper-annotate-as-pure@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" dependencies: "@babel/types" "^7.0.0" +"@babel/helper-annotate-as-pure@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.7.4.tgz#bb3faf1e74b74bd547e867e48f551fa6b098b6ce" + dependencies: + "@babel/types" "^7.7.4" + "@babel/helper-builder-binary-assignment-operator-visitor@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz#6b69628dfe4087798e0c4ed98e3d4a6b2fbd2f5f" @@ -107,11 +122,11 @@ "@babel/helper-explode-assignable-expression" "^7.1.0" "@babel/types" "^7.0.0" -"@babel/helper-builder-react-jsx@^7.3.0": - version "7.3.0" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.3.0.tgz#a1ac95a5d2b3e88ae5e54846bf462eeb81b318a4" +"@babel/helper-builder-react-jsx@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.7.4.tgz#da188d247508b65375b2c30cf59de187be6b0c66" dependencies: - "@babel/types" "^7.3.0" + "@babel/types" "^7.7.4" esutils "^2.0.0" "@babel/helper-call-delegate@^7.4.4": @@ -122,23 +137,30 @@ "@babel/traverse" "^7.4.4" "@babel/types" "^7.4.4" -"@babel/helper-create-class-features-plugin@^7.4.4", "@babel/helper-create-class-features-plugin@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.5.5.tgz#401f302c8ddbc0edd36f7c6b2887d8fa1122e5a4" +"@babel/helper-create-class-features-plugin@^7.4.4", "@babel/helper-create-class-features-plugin@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.7.4.tgz#fce60939fd50618610942320a8d951b3b639da2d" dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-member-expression-to-functions" "^7.5.5" - "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/helper-function-name" "^7.7.4" + "@babel/helper-member-expression-to-functions" "^7.7.4" + "@babel/helper-optimise-call-expression" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.5.5" - "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/helper-replace-supers" "^7.7.4" + "@babel/helper-split-export-declaration" "^7.7.4" -"@babel/helper-define-map@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.5.5.tgz#3dec32c2046f37e09b28c93eb0b103fd2a25d369" +"@babel/helper-create-regexp-features-plugin@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.4.tgz#6d5762359fd34f4da1500e4cff9955b5299aaf59" dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/types" "^7.5.5" + "@babel/helper-regex" "^7.4.4" + regexpu-core "^4.6.0" + +"@babel/helper-define-map@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.7.4.tgz#2841bf92eb8bd9c906851546fe6b9d45e162f176" + dependencies: + "@babel/helper-function-name" "^7.7.4" + "@babel/types" "^7.7.4" lodash "^4.17.13" "@babel/helper-explode-assignable-expression@^7.1.0": @@ -156,23 +178,43 @@ "@babel/template" "^7.1.0" "@babel/types" "^7.0.0" +"@babel/helper-function-name@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz#ab6e041e7135d436d8f0a3eca15de5b67a341a2e" + dependencies: + "@babel/helper-get-function-arity" "^7.7.4" + "@babel/template" "^7.7.4" + "@babel/types" "^7.7.4" + "@babel/helper-get-function-arity@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" dependencies: "@babel/types" "^7.0.0" +"@babel/helper-get-function-arity@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz#cb46348d2f8808e632f0ab048172130e636005f0" + dependencies: + "@babel/types" "^7.7.4" + "@babel/helper-hoist-variables@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz#0298b5f25c8c09c53102d52ac4a98f773eb2850a" dependencies: "@babel/types" "^7.4.4" -"@babel/helper-member-expression-to-functions@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.5.5.tgz#1fb5b8ec4453a93c439ee9fe3aeea4a84b76b590" +"@babel/helper-hoist-variables@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.7.4.tgz#612384e3d823fdfaaf9fce31550fe5d4db0f3d12" dependencies: - "@babel/types" "^7.5.5" + "@babel/types" "^7.7.4" + +"@babel/helper-member-expression-to-functions@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.7.4.tgz#356438e2569df7321a8326644d4b790d2122cb74" + dependencies: + "@babel/types" "^7.7.4" "@babel/helper-module-imports@^7.0.0": version "7.0.0" @@ -180,22 +222,28 @@ dependencies: "@babel/types" "^7.0.0" -"@babel/helper-module-transforms@^7.1.0", "@babel/helper-module-transforms@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.4.4.tgz#96115ea42a2f139e619e98ed46df6019b94414b8" +"@babel/helper-module-imports@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.7.4.tgz#e5a92529f8888bf319a6376abfbd1cebc491ad91" dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@babel/helper-simple-access" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.4.4" - "@babel/template" "^7.4.4" - "@babel/types" "^7.4.4" - lodash "^4.17.11" + "@babel/types" "^7.7.4" -"@babel/helper-optimise-call-expression@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz#a2920c5702b073c15de51106200aa8cad20497d5" +"@babel/helper-module-transforms@^7.4.4", "@babel/helper-module-transforms@^7.7.4", "@babel/helper-module-transforms@^7.7.5": + version "7.7.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.7.5.tgz#d044da7ffd91ec967db25cd6748f704b6b244835" dependencies: - "@babel/types" "^7.0.0" + "@babel/helper-module-imports" "^7.7.4" + "@babel/helper-simple-access" "^7.7.4" + "@babel/helper-split-export-declaration" "^7.7.4" + "@babel/template" "^7.7.4" + "@babel/types" "^7.7.4" + lodash "^4.17.13" + +"@babel/helper-optimise-call-expression@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.4.tgz#034af31370d2995242aa4df402c3b7794b2dcdf2" + dependencies: + "@babel/types" "^7.7.4" "@babel/helper-plugin-utils@^7.0.0": version "7.0.0" @@ -207,31 +255,31 @@ dependencies: lodash "^4.17.11" -"@babel/helper-remap-async-to-generator@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz#361d80821b6f38da75bd3f0785ece20a88c5fe7f" +"@babel/helper-remap-async-to-generator@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.7.4.tgz#c68c2407350d9af0e061ed6726afb4fff16d0234" dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-wrap-function" "^7.1.0" - "@babel/template" "^7.1.0" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/helper-annotate-as-pure" "^7.7.4" + "@babel/helper-wrap-function" "^7.7.4" + "@babel/template" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" -"@babel/helper-replace-supers@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.5.5.tgz#f84ce43df031222d2bad068d2626cb5799c34bc2" +"@babel/helper-replace-supers@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.7.4.tgz#3c881a6a6a7571275a72d82e6107126ec9e2cdd2" dependencies: - "@babel/helper-member-expression-to-functions" "^7.5.5" - "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/traverse" "^7.5.5" - "@babel/types" "^7.5.5" + "@babel/helper-member-expression-to-functions" "^7.7.4" + "@babel/helper-optimise-call-expression" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" -"@babel/helper-simple-access@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz#65eeb954c8c245beaa4e859da6188f39d71e585c" +"@babel/helper-simple-access@^7.1.0", "@babel/helper-simple-access@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.7.4.tgz#a169a0adb1b5f418cfc19f22586b2ebf58a9a294" dependencies: - "@babel/template" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/template" "^7.7.4" + "@babel/types" "^7.7.4" "@babel/helper-split-export-declaration@^7.4.4": version "7.4.4" @@ -239,16 +287,30 @@ dependencies: "@babel/types" "^7.4.4" -"@babel/helper-wrap-function@^7.1.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa" +"@babel/helper-split-export-declaration@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz#57292af60443c4a3622cf74040ddc28e68336fd8" dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/template" "^7.1.0" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.2.0" + "@babel/types" "^7.7.4" -"@babel/helpers@^7.4.4", "@babel/helpers@^7.5.5": +"@babel/helper-wrap-function@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.7.4.tgz#37ab7fed5150e22d9d7266e830072c0cdd8baace" + dependencies: + "@babel/helper-function-name" "^7.7.4" + "@babel/template" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" + +"@babel/helpers@^7.4.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.7.4.tgz#62c215b9e6c712dadc15a9a0dcab76c92a940302" + dependencies: + "@babel/template" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" + +"@babel/helpers@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.5.5.tgz#63908d2a73942229d1e6685bc2a0e730dde3b75e" dependencies: @@ -272,13 +334,17 @@ version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.5.5.tgz#02f077ac8817d3df4a832ef59de67565e71cca4b" +"@babel/parser@^7.7.4": + version "7.7.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.7.tgz#1b886595419cf92d811316d5b715a53ff38b4937" + "@babel/plugin-proposal-async-generator-functions@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e" + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.7.4.tgz#0351c5ac0a9e927845fffd5b82af476947b7ce6d" dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-remap-async-to-generator" "^7.1.0" - "@babel/plugin-syntax-async-generators" "^7.2.0" + "@babel/helper-remap-async-to-generator" "^7.7.4" + "@babel/plugin-syntax-async-generators" "^7.7.4" "@babel/plugin-proposal-class-properties@7.4.4": version "7.4.4" @@ -302,11 +368,11 @@ "@babel/plugin-syntax-object-rest-spread" "^7.2.0" "@babel/plugin-proposal-object-rest-spread@^7.4.4": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.5.tgz#61939744f71ba76a3ae46b5eea18a54c16d22e58" + version "7.7.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.7.7.tgz#9f27075004ab99be08c5c1bd653a2985813cb370" dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-object-rest-spread" "^7.2.0" + "@babel/plugin-syntax-object-rest-spread" "^7.7.4" "@babel/plugin-proposal-optional-catch-binding@^7.2.0": version "7.2.0" @@ -329,6 +395,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-async-generators@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.7.4.tgz#331aaf310a10c80c44a66b238b6e49132bd3c889" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-dynamic-import@7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz#69c159ffaf4998122161ad8ebc5e6d1f55df8612" @@ -347,21 +419,33 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-jsx@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.7.4.tgz#dab2b56a36fb6c3c222a1fbc71f7bf97f327a9ec" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-object-rest-spread@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-object-rest-spread@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.7.4.tgz#47cf220d19d6d0d7b154304701f468fc1cc6ff46" + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-optional-catch-binding@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz#a94013d6eda8908dfe6a477e7f9eda85656ecf5c" dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-typescript@^7.2.0": - version "7.3.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.3.3.tgz#a7cc3f66119a9f7ebe2de5383cce193473d65991" +"@babel/plugin-syntax-typescript@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.7.4.tgz#5d037ffa10f3b25a16f32570ebbe7a8c2efa304b" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -372,12 +456,12 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-async-to-generator@^7.4.4": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.5.0.tgz#89a3848a0166623b5bc481164b5936ab947e887e" + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.7.4.tgz#694cbeae6d613a34ef0292713fa42fb45c4470ba" dependencies: - "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-module-imports" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-remap-async-to-generator" "^7.1.0" + "@babel/helper-remap-async-to-generator" "^7.7.4" "@babel/plugin-transform-block-scoped-functions@^7.2.0": version "7.2.0" @@ -386,23 +470,23 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-block-scoping@^7.4.4": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.5.5.tgz#a35f395e5402822f10d2119f6f8e045e3639a2ce" + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.7.4.tgz#200aad0dcd6bb80372f94d9e628ea062c58bf224" dependencies: "@babel/helper-plugin-utils" "^7.0.0" lodash "^4.17.13" "@babel/plugin-transform-classes@^7.4.4": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.5.5.tgz#d094299d9bd680a14a2a0edae38305ad60fb4de9" + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.7.4.tgz#c92c14be0a1399e15df72667067a8f510c9400ec" dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-define-map" "^7.5.5" - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/helper-annotate-as-pure" "^7.7.4" + "@babel/helper-define-map" "^7.7.4" + "@babel/helper-function-name" "^7.7.4" + "@babel/helper-optimise-call-expression" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.5.5" - "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/helper-replace-supers" "^7.7.4" + "@babel/helper-split-export-declaration" "^7.7.4" globals "^11.1.0" "@babel/plugin-transform-computed-properties@^7.2.0": @@ -412,8 +496,8 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-destructuring@^7.4.4": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.5.0.tgz#f6c09fdfe3f94516ff074fe877db7bc9ef05855a" + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.7.4.tgz#2b713729e5054a1135097b6a67da1b6fe8789267" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -426,8 +510,8 @@ regexpu-core "^4.5.4" "@babel/plugin-transform-duplicate-keys@^7.2.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.5.0.tgz#c5dbf5106bf84cdf691222c0974c12b1df931853" + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.7.4.tgz#3d21731a42e3f598a73835299dd0169c3b90ac91" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -445,10 +529,10 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-function-name@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.4.tgz#e1436116abb0610c2259094848754ac5230922ad" + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.7.4.tgz#75a6d3303d50db638ff8b5385d12451c865025b1" dependencies: - "@babel/helper-function-name" "^7.1.0" + "@babel/helper-function-name" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-literals@^7.2.0": @@ -464,10 +548,10 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-modules-amd@^7.2.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.5.0.tgz#ef00435d46da0a5961aa728a1d2ecff063e4fb91" + version "7.7.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.7.5.tgz#39e0fb717224b59475b306402bb8eedab01e729c" dependencies: - "@babel/helper-module-transforms" "^7.1.0" + "@babel/helper-module-transforms" "^7.7.5" "@babel/helper-plugin-utils" "^7.0.0" babel-plugin-dynamic-import-node "^2.3.0" @@ -480,34 +564,34 @@ "@babel/helper-simple-access" "^7.1.0" "@babel/plugin-transform-modules-commonjs@^7.4.4": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.5.0.tgz#425127e6045231360858eeaa47a71d75eded7a74" + version "7.7.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.7.5.tgz#1d27f5eb0bcf7543e774950e5b2fa782e637b345" dependencies: - "@babel/helper-module-transforms" "^7.4.4" + "@babel/helper-module-transforms" "^7.7.5" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-simple-access" "^7.1.0" + "@babel/helper-simple-access" "^7.7.4" babel-plugin-dynamic-import-node "^2.3.0" "@babel/plugin-transform-modules-systemjs@^7.4.4": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.5.0.tgz#e75266a13ef94202db2a0620977756f51d52d249" + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.7.4.tgz#cd98152339d3e763dfe838b7d4273edaf520bb30" dependencies: - "@babel/helper-hoist-variables" "^7.4.4" + "@babel/helper-hoist-variables" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" babel-plugin-dynamic-import-node "^2.3.0" "@babel/plugin-transform-modules-umd@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz#7678ce75169f0877b8eb2235538c074268dd01ae" + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.7.4.tgz#1027c355a118de0aae9fee00ad7813c584d9061f" dependencies: - "@babel/helper-module-transforms" "^7.1.0" + "@babel/helper-module-transforms" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-named-capturing-groups-regex@^7.4.5": - version "7.4.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.4.5.tgz#9d269fd28a370258199b4294736813a60bbdd106" + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.7.4.tgz#fb3bcc4ee4198e7385805007373d6b6f42c98220" dependencies: - regexp-tree "^0.1.6" + "@babel/helper-create-regexp-features-plugin" "^7.7.4" "@babel/plugin-transform-new-target@^7.4.4": version "7.4.4" @@ -516,11 +600,11 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-object-super@^7.2.0": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.5.5.tgz#c70021df834073c65eb613b8679cc4a381d1a9f9" + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.7.4.tgz#48488937a2d586c0148451bf51af9d7dda567262" dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.5.5" + "@babel/helper-replace-supers" "^7.7.4" "@babel/plugin-transform-parameters@^7.4.4": version "7.4.4" @@ -557,16 +641,16 @@ "@babel/plugin-syntax-jsx" "^7.2.0" "@babel/plugin-transform-react-jsx@^7.0.0": - version "7.3.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.3.0.tgz#f2cab99026631c767e2745a5368b331cfe8f5290" + version "7.7.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.7.7.tgz#5cbaa7445b4a09f774029f3cc7bb448ff3122a5d" dependencies: - "@babel/helper-builder-react-jsx" "^7.3.0" + "@babel/helper-builder-react-jsx" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-jsx" "^7.2.0" + "@babel/plugin-syntax-jsx" "^7.7.4" "@babel/plugin-transform-regenerator@^7.4.5": - version "7.4.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.5.tgz#629dc82512c55cee01341fb27bdfcb210354680f" + version "7.7.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.7.5.tgz#3a8757ee1a2780f390e89f246065ecf59c26fce9" dependencies: regenerator-transform "^0.14.0" @@ -592,8 +676,8 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-spread@^7.2.0": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.2.2.tgz#3103a9abe22f742b6d406ecd3cd49b774919b406" + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.7.4.tgz#aa673b356fe6b7e70d69b6e33a17fef641008578" dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -618,20 +702,19 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-typescript@^7.3.2": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.5.5.tgz#6d862766f09b2da1cb1f7d505fe2aedab6b7d4b8" + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.7.4.tgz#2974fd05f4e85c695acaf497f432342de9fc0636" dependencies: - "@babel/helper-create-class-features-plugin" "^7.5.5" + "@babel/helper-create-class-features-plugin" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-typescript" "^7.2.0" + "@babel/plugin-syntax-typescript" "^7.7.4" "@babel/plugin-transform-unicode-regex@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz#ab4634bb4f14d36728bf5978322b35587787970f" + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.7.4.tgz#a3c0f65b117c4c81c5b6484f2a5e7b95346b83ae" dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.4.4" - regexpu-core "^4.5.4" "@babel/preset-env@7.4.5": version "7.4.5" @@ -717,12 +800,18 @@ core-js "^2.5.3" regenerator-runtime "^0.11.1" -"@babel/runtime@7.4.5", "@babel/runtime@^7.1.2", "@babel/runtime@^7.4.5": +"@babel/runtime@7.4.5", "@babel/runtime@^7.1.2": version "7.4.5" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.5.tgz#582bb531f5f9dc67d2fcb682979894f75e253f12" dependencies: regenerator-runtime "^0.13.2" +"@babel/runtime@^7.6.3": + version "7.7.7" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.7.7.tgz#194769ca8d6d7790ec23605af9ee3e42a0aa79cf" + dependencies: + regenerator-runtime "^0.13.2" + "@babel/standalone@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/standalone/-/standalone-7.5.5.tgz#9d3143f6078ff408db694a4254bd6f03c5c33962" @@ -735,6 +824,14 @@ "@babel/parser" "^7.4.4" "@babel/types" "^7.4.4" +"@babel/template@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.7.4.tgz#428a7d9eecffe27deac0a98e23bf8e3675d2a77b" + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.7.4" + "@babel/types" "^7.7.4" + "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.4": version "7.4.5" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.5.tgz#4e92d1728fd2f1897dafdd321efbff92156c3216" @@ -749,7 +846,21 @@ globals "^11.1.0" lodash "^4.17.11" -"@babel/traverse@^7.4.5", "@babel/traverse@^7.5.5": +"@babel/traverse@^7.4.5", "@babel/traverse@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.7.4.tgz#9c1e7c60fb679fe4fcfaa42500833333c2058558" + dependencies: + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.7.4" + "@babel/helper-function-name" "^7.7.4" + "@babel/helper-split-export-declaration" "^7.7.4" + "@babel/parser" "^7.7.4" + "@babel/types" "^7.7.4" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.13" + +"@babel/traverse@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.5.5.tgz#f664f8f368ed32988cd648da9f72d5ca70f165bb" dependencies: @@ -763,7 +874,7 @@ globals "^11.1.0" lodash "^4.17.13" -"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.4": +"@babel/types@^7.0.0", "@babel/types@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0" dependencies: @@ -779,6 +890,14 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@babel/types@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.7.4.tgz#516570d539e44ddf308c07569c258ff94fde9193" + dependencies: + esutils "^2.0.2" + lodash "^4.17.13" + to-fast-properties "^2.0.0" + "@blueprintjs/icons@^3.2.0": version "3.9.0" resolved "https://registry.yarnpkg.com/@blueprintjs/icons/-/icons-3.9.0.tgz#173f70b0d6a573d2a97066c54b4d110ffadeee51" @@ -2298,7 +2417,7 @@ check-types@^8.0.3: version "8.0.3" resolved "https://registry.yarnpkg.com/check-types/-/check-types-8.0.3.tgz#3356cca19c889544f2d7a95ed49ce508a0ecf552" -chokidar@^2.0.2, chokidar@^2.0.4: +chokidar@^2.0.2: version "2.1.6" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.6.tgz#b6cad653a929e244ce8a834244164d241fa954c5" dependencies: @@ -2316,6 +2435,24 @@ chokidar@^2.0.2, chokidar@^2.0.4: optionalDependencies: fsevents "^1.2.7" +chokidar@^2.0.4: + version "2.1.8" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" + dependencies: + anymatch "^2.0.0" + async-each "^1.0.1" + braces "^2.3.2" + glob-parent "^3.1.0" + inherits "^2.0.3" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + normalize-path "^3.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.2.1" + upath "^1.1.1" + optionalDependencies: + fsevents "^1.2.7" + chownr@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" @@ -2396,9 +2533,9 @@ cli-truncate@^0.2.1: slice-ansi "0.0.4" string-width "^1.0.1" -clipboard-copy@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/clipboard-copy/-/clipboard-copy-3.0.0.tgz#01ab812f4b5828b763e029172fd23ff92641eefb" +clipboard-copy@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/clipboard-copy/-/clipboard-copy-3.1.0.tgz#4c59030a43d4988990564a664baeafba99f78ca4" cliui@^3.2.0: version "3.2.0" @@ -2836,12 +2973,12 @@ css-tree@1.0.0-alpha.29: mdn-data "~1.1.0" source-map "^0.5.3" -css-tree@1.0.0-alpha.33: - version "1.0.0-alpha.33" - resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.33.tgz#970e20e5a91f7a378ddd0fc58d0b6c8d4f3be93e" +css-tree@1.0.0-alpha.37: + version "1.0.0-alpha.37" + resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.0.0-alpha.37.tgz#98bebd62c4c1d9f960ec340cf9f7522e30709a22" dependencies: mdn-data "2.0.4" - source-map "^0.5.3" + source-map "^0.6.1" css-url-regex@^1.1.0: version "1.1.0" @@ -2895,6 +3032,12 @@ csso@^3.5.1: dependencies: css-tree "1.0.0-alpha.29" +csso@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/csso/-/csso-4.0.2.tgz#e5f81ab3a56b8eefb7f0092ce7279329f454de3d" + dependencies: + css-tree "1.0.0-alpha.37" + cssom@0.3.x, "cssom@>= 0.3.0 < 0.4.0": version "0.3.6" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.6.tgz#f85206cee04efa841f3c5982a74ba96ab20d65ad" @@ -3911,9 +4054,9 @@ flatten@^1.0.2: version "1.0.0" resolved "https://gist.github.com/3f49c8bd7a2b71429dcae28f2c2d1d97.git#6b8f373939221c750a128ba6e301283494e635d9" -flowgen@^1.9.2: - version "1.9.2" - resolved "https://registry.yarnpkg.com/flowgen/-/flowgen-1.9.2.tgz#bf4b6319b5455e8724094ab1d8ba2a3b6f3c3a13" +flowgen@^1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/flowgen/-/flowgen-1.10.0.tgz#a041ae31d543d22166e7ba7c296b8445deb3c2e4" dependencies: "@babel/code-frame" "^7.0.0" "@babel/highlight" "^7.0.0" @@ -3922,7 +4065,7 @@ flowgen@^1.9.2: paralleljs "^0.2.1" prettier "^1.16.4" shelljs "^0.8.3" - typescript "^3.3.3333" + typescript "^3.4" typescript-compiler "^1.4.1-2" flush-write-stream@^1.0.0: @@ -5354,9 +5497,9 @@ json5@^2.1.0: dependencies: minimist "^1.2.0" -json_typegen_wasm@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/json_typegen_wasm/-/json_typegen_wasm-0.3.3.tgz#42ef21dbb2f2815ea5e23ce866bd3b12eea93c70" +json_typegen_wasm@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/json_typegen_wasm/-/json_typegen_wasm-0.4.0.tgz#d671d14bc0006b528ef0fc9921798879a13b6b14" jsonfile@^4.0.0: version "4.0.0" @@ -5996,7 +6139,7 @@ monaco-editor-webpack-plugin@^1.7.0: dependencies: "@types/webpack" "^4.4.19" -monaco-editor@^0.17.1: +monaco-editor@0.17.1: version "0.17.1" resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.17.1.tgz#8fbe96ca54bfa75262706e044f8f780e904aa45c" @@ -6096,7 +6239,7 @@ next-tick@1, next-tick@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" -next@^9.1.1: +next@9.1.1: version "9.1.1" resolved "https://registry.yarnpkg.com/next/-/next-9.1.1.tgz#bede2e834548020bc4d3be0c46e3ed7edaac6d14" dependencies: @@ -7055,12 +7198,12 @@ postcss-initial@^3.0.0: lodash.template "^4.5.0" postcss "^7.0.2" -postcss-js@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/postcss-js/-/postcss-js-2.0.2.tgz#a5e75d3fb9d85b28e1d2bd57956c115665ea8542" +postcss-js@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/postcss-js/-/postcss-js-2.0.3.tgz#a96f0f23ff3d08cec7dc5b11bf11c5f8077cdab9" dependencies: camelcase-css "^2.0.1" - postcss "^7.0.17" + postcss "^7.0.18" postcss-lab-function@^2.0.1: version "2.0.1" @@ -7134,8 +7277,8 @@ postcss-modules-scope@^1.1.0: postcss "^6.0.1" postcss-modules-scope@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-2.1.0.tgz#ad3f5bf7856114f6fcab901b0502e2a2bc39d4eb" + version "2.1.1" + resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-2.1.1.tgz#33d4fc946602eb5e9355c4165d68a10727689dba" dependencies: postcss "^7.0.6" postcss-selector-parser "^6.0.0" @@ -7304,6 +7447,14 @@ postcss@^7.0.14, postcss@^7.0.16, postcss@^7.0.18, postcss@^7.0.19, postcss@^7.0 source-map "^0.6.1" supports-color "^6.1.0" +postcss@^7.0.26: + version "7.0.26" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.26.tgz#5ed615cfcab35ba9bbb82414a4fa88ea10429587" + dependencies: + chalk "^2.4.2" + source-map "^0.6.1" + supports-color "^6.1.0" + postinstall-postinstall@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.0.0.tgz#7ba6711b4420575c4f561638836a81faad47f43f" @@ -7570,14 +7721,14 @@ rdf-canonize@^1.0.2: node-forge "^0.8.1" semver "^5.6.0" -react-dom@^16.11.0: - version "16.11.0" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.11.0.tgz#7e7c4a5a85a569d565c2462f5d345da2dd849af5" +react-dom@^16.12.0: + version "16.12.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.12.0.tgz#0da4b714b8d13c2038c9396b54a92baea633fe11" dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" prop-types "^15.6.2" - scheduler "^0.17.0" + scheduler "^0.18.0" react-dom@~15.4.1: version "15.4.2" @@ -7612,9 +7763,9 @@ react-fast-compare@^2.0.1: version "2.0.4" resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-2.0.4.tgz#e84b4d455b0fec113e0402c329352715196f81f9" -react-ga@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/react-ga/-/react-ga-2.6.0.tgz#c3fe830ead2ad25117e1d33280d9698de9b28496" +react-ga@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/react-ga/-/react-ga-2.7.0.tgz#24328f157f31e8cffbf4de74a3396536679d8d7c" react-is@16.8.6, react-is@^16.7.0, react-is@^16.8.1: version "16.8.6" @@ -7648,9 +7799,9 @@ react-transition-group@^2.5.0: prop-types "^15.6.2" react-lifecycles-compat "^3.0.4" -react@^16.11.0: - version "16.11.0" - resolved "https://registry.yarnpkg.com/react/-/react-16.11.0.tgz#d294545fe62299ccee83363599bf904e4a07fdbb" +react@^16.12.0: + version "16.12.0" + resolved "https://registry.yarnpkg.com/react/-/react-16.12.0.tgz#0c0a9c6a142429e3614834d5a778e18aa78a0b83" dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -7760,7 +7911,7 @@ reflect.ownkeys@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460" -regenerate-unicode-properties@^8.0.2: +regenerate-unicode-properties@^8.0.2, regenerate-unicode-properties@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz#ef51e0f0ea4ad424b77bf7cb41f3e015c70a3f0e" dependencies: @@ -7791,10 +7942,6 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexp-tree@^0.1.6: - version "0.1.11" - resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.11.tgz#c9c7f00fcf722e0a56c7390983a7a63dd6c272f3" - regexpu-core@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-1.0.0.tgz#86a763f58ee4d7c2f6b102e4764050de7ed90c6b" @@ -7814,6 +7961,17 @@ regexpu-core@^4.5.4: unicode-match-property-ecmascript "^1.0.4" unicode-match-property-value-ecmascript "^1.1.0" +regexpu-core@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.6.0.tgz#2037c18b327cfce8a6fea2a4ec441f2432afb8b6" + dependencies: + regenerate "^1.4.0" + regenerate-unicode-properties "^8.1.0" + regjsgen "^0.5.0" + regjsparser "^0.6.0" + unicode-match-property-ecmascript "^1.0.4" + unicode-match-property-value-ecmascript "^1.1.0" + registry-auth-token@^3.0.1: version "3.4.0" resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.4.0.tgz#d7446815433f5d5ed6431cd5dca21048f66b397e" @@ -8010,9 +8168,9 @@ sax@^1.2.4, sax@~1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" -scheduler@^0.17.0: - version "0.17.0" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.17.0.tgz#7c9c673e4ec781fac853927916d1c426b6f3ddfe" +scheduler@^0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.18.0.tgz#5901ad6659bc1d8f3fdaf36eb7a67b0d6746b1c4" dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -8648,16 +8806,16 @@ svgo@^1.0.5: unquote "~1.1.1" util.promisify "~1.0.0" -svgo@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/svgo/-/svgo-1.3.0.tgz#bae51ba95ded9a33a36b7c46ce9c359ae9154313" +svgo@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/svgo/-/svgo-1.3.2.tgz#b6dc511c063346c9e415b81e43401145b96d4167" dependencies: chalk "^2.4.1" coa "^2.0.2" css-select "^2.0.0" css-select-base-adapter "^0.1.1" - css-tree "1.0.0-alpha.33" - csso "^3.5.1" + css-tree "1.0.0-alpha.37" + csso "^4.0.2" js-yaml "^3.13.1" mkdirp "~0.5.1" object.values "^1.1.0" @@ -8996,7 +9154,7 @@ typescript-compiler@^1.4.1-2: version "1.4.1-2" resolved "https://registry.yarnpkg.com/typescript-compiler/-/typescript-compiler-1.4.1-2.tgz#ba4f7db22d91534a1929d90009dce161eb72fd3f" -typescript@3.5.3, typescript@^3.3.3333: +typescript@3.5.3: version "3.5.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977" @@ -9004,6 +9162,10 @@ typescript@^2.3.2: version "2.9.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" +typescript@^3.4: + version "3.7.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.4.tgz#1743a5ec5fef6a1fa9f3e4708e33c81c73876c19" + ua-parser-js@^0.7.18: version "0.7.20" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.20.tgz#7527178b82f6a62a0f243d1f94fd30e3e3c21098" @@ -9529,11 +9691,11 @@ yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" -yaml@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.6.0.tgz#d8a985cfb26086dd73f91c637f6e6bc909fddd3c" +yaml@^1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.7.2.tgz#f26aabf738590ab61efaca502358e48dc9f348b2" dependencies: - "@babel/runtime" "^7.4.5" + "@babel/runtime" "^7.6.3" yargs-parser@^2.4.0: version "2.4.1"