(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[6],{

/***/ "../../packages/monaco-editor/esm/vs/language/typescript/languageFeatures.js":
/*!************************************************************************************************!*\
  !*** /mnt/vss/_work/1/s/packages/monaco-editor/esm/vs/language/typescript/languageFeatures.js ***!
  \************************************************************************************************/
/*! exports provided: flattenDiagnosticMessageText, Adapter, DiagnosticsAdapter, SuggestAdapter, SignatureHelpAdapter, QuickInfoAdapter, OccurrencesAdapter, DefinitionAdapter, ReferenceAdapter, OutlineAdapter, Kind, FormatHelper, FormatAdapter, FormatOnTypeAdapter, CodeActionAdaptor, RenameAdapter */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flattenDiagnosticMessageText\", function() { return flattenDiagnosticMessageText; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Adapter\", function() { return Adapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DiagnosticsAdapter\", function() { return DiagnosticsAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SuggestAdapter\", function() { return SuggestAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SignatureHelpAdapter\", function() { return SignatureHelpAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"QuickInfoAdapter\", function() { return QuickInfoAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OccurrencesAdapter\", function() { return OccurrencesAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DefinitionAdapter\", function() { return DefinitionAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ReferenceAdapter\", function() { return ReferenceAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OutlineAdapter\", function() { return OutlineAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Kind\", function() { return Kind; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormatHelper\", function() { return FormatHelper; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormatAdapter\", function() { return FormatAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FormatOnTypeAdapter\", function() { return FormatOnTypeAdapter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CodeActionAdaptor\", function() { return CodeActionAdaptor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RenameAdapter\", function() { return RenameAdapter; });\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nvar __extends = (undefined && undefined.__extends) || (function () {\r\n    var extendStatics = function (d, b) {\r\n        extendStatics = Object.setPrototypeOf ||\r\n            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n        return extendStatics(d, b);\r\n    };\r\n    return function (d, b) {\r\n        extendStatics(d, b);\r\n        function __() { this.constructor = d; }\r\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n    };\r\n})();\r\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n    return new (P || (P = Promise))(function (resolve, reject) {\r\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n    });\r\n};\r\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\r\n    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n    return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n    function verb(n) { return function (v) { return step([n, v]); }; }\r\n    function step(op) {\r\n        if (f) throw new TypeError(\"Generator is already executing.\");\r\n        while (_) try {\r\n            if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n            if (y = 0, t) op = [op[0] & 2, t.value];\r\n            switch (op[0]) {\r\n                case 0: case 1: t = op; break;\r\n                case 4: _.label++; return { value: op[1], done: false };\r\n                case 5: _.label++; y = op[1]; op = [0]; continue;\r\n                case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n                default:\r\n                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n                    if (t[2]) _.ops.pop();\r\n                    _.trys.pop(); continue;\r\n            }\r\n            op = body.call(thisArg, _);\r\n        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n    }\r\n};\r\nvar Uri = monaco.Uri;\r\nvar Range = monaco.Range;\r\n//#region utils copied from typescript to prevent loading the entire typescriptServices ---\r\nvar IndentStyle;\r\n(function (IndentStyle) {\r\n    IndentStyle[IndentStyle[\"None\"] = 0] = \"None\";\r\n    IndentStyle[IndentStyle[\"Block\"] = 1] = \"Block\";\r\n    IndentStyle[IndentStyle[\"Smart\"] = 2] = \"Smart\";\r\n})(IndentStyle || (IndentStyle = {}));\r\nfunction flattenDiagnosticMessageText(diag, newLine, indent) {\r\n    if (indent === void 0) { indent = 0; }\r\n    if (typeof diag === \"string\") {\r\n        return diag;\r\n    }\r\n    else if (diag === undefined) {\r\n        return \"\";\r\n    }\r\n    var result = \"\";\r\n    if (indent) {\r\n        result += newLine;\r\n        for (var i = 0; i < indent; i++) {\r\n            result += \"  \";\r\n        }\r\n    }\r\n    result += diag.messageText;\r\n    indent++;\r\n    if (diag.next) {\r\n        for (var _i = 0, _a = diag.next; _i < _a.length; _i++) {\r\n            var kid = _a[_i];\r\n            result += flattenDiagnosticMessageText(kid, newLine, indent);\r\n        }\r\n    }\r\n    return result;\r\n}\r\nfunction displayPartsToString(displayParts) {\r\n    if (displayParts) {\r\n        return displayParts.map(function (displayPart) { return displayPart.text; }).join(\"\");\r\n    }\r\n    return \"\";\r\n}\r\n//#endregion\r\nvar Adapter = /** @class */ (function () {\r\n    function Adapter(_worker) {\r\n        this._worker = _worker;\r\n    }\r\n    // protected _positionToOffset(model: monaco.editor.ITextModel, position: monaco.IPosition): number {\r\n    // \treturn model.getOffsetAt(position);\r\n    // }\r\n    // protected _offsetToPosition(model: monaco.editor.ITextModel, offset: number): monaco.IPosition {\r\n    // \treturn model.getPositionAt(offset);\r\n    // }\r\n    Adapter.prototype._textSpanToRange = function (model, span) {\r\n        var p1 = model.getPositionAt(span.start);\r\n        var p2 = model.getPositionAt(span.start + span.length);\r\n        var startLineNumber = p1.lineNumber, startColumn = p1.column;\r\n        var endLineNumber = p2.lineNumber, endColumn = p2.column;\r\n        return { startLineNumber: startLineNumber, startColumn: startColumn, endLineNumber: endLineNumber, endColumn: endColumn };\r\n    };\r\n    return Adapter;\r\n}());\r\n\r\n// --- diagnostics --- ---\r\nvar DiagnosticCategory;\r\n(function (DiagnosticCategory) {\r\n    DiagnosticCategory[DiagnosticCategory[\"Warning\"] = 0] = \"Warning\";\r\n    DiagnosticCategory[DiagnosticCategory[\"Error\"] = 1] = \"Error\";\r\n    DiagnosticCategory[DiagnosticCategory[\"Suggestion\"] = 2] = \"Suggestion\";\r\n    DiagnosticCategory[DiagnosticCategory[\"Message\"] = 3] = \"Message\";\r\n})(DiagnosticCategory || (DiagnosticCategory = {}));\r\nvar DiagnosticsAdapter = /** @class */ (function (_super) {\r\n    __extends(DiagnosticsAdapter, _super);\r\n    function DiagnosticsAdapter(_defaults, _selector, worker) {\r\n        var _this = _super.call(this, worker) || this;\r\n        _this._defaults = _defaults;\r\n        _this._selector = _selector;\r\n        _this._disposables = [];\r\n        _this._listener = Object.create(null);\r\n        var onModelAdd = function (model) {\r\n            if (model.getModeId() !== _selector) {\r\n                return;\r\n            }\r\n            var handle;\r\n            var changeSubscription = model.onDidChangeContent(function () {\r\n                clearTimeout(handle);\r\n                handle = setTimeout(function () { return _this._doValidate(model); }, 500);\r\n            });\r\n            _this._listener[model.uri.toString()] = {\r\n                dispose: function () {\r\n                    changeSubscription.dispose();\r\n                    clearTimeout(handle);\r\n                }\r\n            };\r\n            _this._doValidate(model);\r\n        };\r\n        var onModelRemoved = function (model) {\r\n            monaco.editor.setModelMarkers(model, _this._selector, []);\r\n            var key = model.uri.toString();\r\n            if (_this._listener[key]) {\r\n                _this._listener[key].dispose();\r\n                delete _this._listener[key];\r\n            }\r\n        };\r\n        _this._disposables.push(monaco.editor.onDidCreateModel(onModelAdd));\r\n        _this._disposables.push(monaco.editor.onWillDisposeModel(onModelRemoved));\r\n        _this._disposables.push(monaco.editor.onDidChangeModelLanguage(function (event) {\r\n            onModelRemoved(event.model);\r\n            onModelAdd(event.model);\r\n        }));\r\n        _this._disposables.push({\r\n            dispose: function () {\r\n                for (var _i = 0, _a = monaco.editor.getModels(); _i < _a.length; _i++) {\r\n                    var model = _a[_i];\r\n                    onModelRemoved(model);\r\n                }\r\n            }\r\n        });\r\n        var recomputeDiagostics = function () {\r\n            // redo diagnostics when options change\r\n            for (var _i = 0, _a = monaco.editor.getModels(); _i < _a.length; _i++) {\r\n                var model = _a[_i];\r\n                onModelRemoved(model);\r\n                onModelAdd(model);\r\n            }\r\n        };\r\n        _this._disposables.push(_this._defaults.onDidChange(recomputeDiagostics));\r\n        _this._disposables.push(_this._defaults.onDidExtraLibsChange(recomputeDiagostics));\r\n        monaco.editor.getModels().forEach(onModelAdd);\r\n        return _this;\r\n    }\r\n    DiagnosticsAdapter.prototype.dispose = function () {\r\n        this._disposables.forEach(function (d) { return d && d.dispose(); });\r\n        this._disposables = [];\r\n    };\r\n    DiagnosticsAdapter.prototype._doValidate = function (model) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var worker, promises, _a, noSyntaxValidation, noSemanticValidation, noSuggestionDiagnostics, diagnostics, markers;\r\n            var _this = this;\r\n            return __generator(this, function (_b) {\r\n                switch (_b.label) {\r\n                    case 0: return [4 /*yield*/, this._worker(model.uri)];\r\n                    case 1:\r\n                        worker = _b.sent();\r\n                        if (model.isDisposed()) {\r\n                            // model was disposed in the meantime\r\n                            return [2 /*return*/];\r\n                        }\r\n                        promises = [];\r\n                        _a = this._defaults.getDiagnosticsOptions(), noSyntaxValidation = _a.noSyntaxValidation, noSemanticValidation = _a.noSemanticValidation, noSuggestionDiagnostics = _a.noSuggestionDiagnostics;\r\n                        if (!noSyntaxValidation) {\r\n                            promises.push(worker.getSyntacticDiagnostics(model.uri.toString()));\r\n                        }\r\n                        if (!noSemanticValidation) {\r\n                            promises.push(worker.getSemanticDiagnostics(model.uri.toString()));\r\n                        }\r\n                        if (!noSuggestionDiagnostics) {\r\n                            promises.push(worker.getSuggestionDiagnostics(model.uri.toString()));\r\n                        }\r\n                        return [4 /*yield*/, Promise.all(promises)];\r\n                    case 2:\r\n                        diagnostics = _b.sent();\r\n                        if (!diagnostics || model.isDisposed()) {\r\n                            // model was disposed in the meantime\r\n                            return [2 /*return*/];\r\n                        }\r\n                        markers = diagnostics\r\n                            .reduce(function (p, c) { return c.concat(p); }, [])\r\n                            .filter(function (d) { return (_this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore || []).indexOf(d.code) === -1; })\r\n                            .map(function (d) { return _this._convertDiagnostics(model, d); });\r\n                        monaco.editor.setModelMarkers(model, this._selector, markers);\r\n                        return [2 /*return*/];\r\n                }\r\n            });\r\n        });\r\n    };\r\n    DiagnosticsAdapter.prototype._convertDiagnostics = function (model, diag) {\r\n        var diagStart = diag.start || 0;\r\n        var diagLength = diag.length || 1;\r\n        var _a = model.getPositionAt(diagStart), startLineNumber = _a.lineNumber, startColumn = _a.column;\r\n        var _b = model.getPositionAt(diagStart + diagLength), endLineNumber = _b.lineNumber, endColumn = _b.column;\r\n        return {\r\n            severity: this._tsDiagnosticCategoryToMarkerSeverity(diag.category),\r\n            startLineNumber: startLineNumber,\r\n            startColumn: startColumn,\r\n            endLineNumber: endLineNumber,\r\n            endColumn: endColumn,\r\n            message: flattenDiagnosticMessageText(diag.messageText, '\\n'),\r\n            code: diag.code.toString(),\r\n            tags: diag.reportsUnnecessary ? [monaco.MarkerTag.Unnecessary] : [],\r\n            relatedInformation: this._convertRelatedInformation(model, diag.relatedInformation),\r\n        };\r\n    };\r\n    DiagnosticsAdapter.prototype._convertRelatedInformation = function (model, relatedInformation) {\r\n        if (!relatedInformation) {\r\n            return;\r\n        }\r\n        var result = [];\r\n        relatedInformation.forEach(function (info) {\r\n            var relatedResource = model;\r\n            if (info.file) {\r\n                var relatedResourceUri = monaco.Uri.parse(info.file.fileName);\r\n                relatedResource = monaco.editor.getModel(relatedResourceUri);\r\n            }\r\n            if (!relatedResource) {\r\n                return;\r\n            }\r\n            var infoStart = info.start || 0;\r\n            var infoLength = info.length || 1;\r\n            var _a = relatedResource.getPositionAt(infoStart), startLineNumber = _a.lineNumber, startColumn = _a.column;\r\n            var _b = relatedResource.getPositionAt(infoStart + infoLength), endLineNumber = _b.lineNumber, endColumn = _b.column;\r\n            result.push({\r\n                resource: relatedResource.uri,\r\n                startLineNumber: startLineNumber,\r\n                startColumn: startColumn,\r\n                endLineNumber: endLineNumber,\r\n                endColumn: endColumn,\r\n                message: flattenDiagnosticMessageText(info.messageText, '\\n')\r\n            });\r\n        });\r\n        return result;\r\n    };\r\n    DiagnosticsAdapter.prototype._tsDiagnosticCategoryToMarkerSeverity = function (category) {\r\n        switch (category) {\r\n            case DiagnosticCategory.Error: return monaco.MarkerSeverity.Error;\r\n            case DiagnosticCategory.Message: return monaco.MarkerSeverity.Info;\r\n            case DiagnosticCategory.Warning: return monaco.MarkerSeverity.Warning;\r\n            case DiagnosticCategory.Suggestion: return monaco.MarkerSeverity.Hint;\r\n        }\r\n        return monaco.MarkerSeverity.Info;\r\n    };\r\n    return DiagnosticsAdapter;\r\n}(Adapter));\r\n\r\nvar SuggestAdapter = /** @class */ (function (_super) {\r\n    __extends(SuggestAdapter, _super);\r\n    function SuggestAdapter() {\r\n        return _super !== null && _super.apply(this, arguments) || this;\r\n    }\r\n    Object.defineProperty(SuggestAdapter.prototype, \"triggerCharacters\", {\r\n        get: function () {\r\n            return ['.'];\r\n        },\r\n        enumerable: true,\r\n        configurable: true\r\n    });\r\n    SuggestAdapter.prototype.provideCompletionItems = function (model, position, _context, token) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var wordInfo, wordRange, resource, offset, worker, info, suggestions;\r\n            return __generator(this, function (_a) {\r\n                switch (_a.label) {\r\n                    case 0:\r\n                        wordInfo = model.getWordUntilPosition(position);\r\n                        wordRange = new Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);\r\n                        resource = model.uri;\r\n                        offset = model.getOffsetAt(position);\r\n                        return [4 /*yield*/, this._worker(resource)];\r\n                    case 1:\r\n                        worker = _a.sent();\r\n                        return [4 /*yield*/, worker.getCompletionsAtPosition(resource.toString(), offset)];\r\n                    case 2:\r\n                        info = _a.sent();\r\n                        if (!info || model.isDisposed()) {\r\n                            return [2 /*return*/];\r\n                        }\r\n                        suggestions = info.entries.map(function (entry) {\r\n                            var range = wordRange;\r\n                            if (entry.replacementSpan) {\r\n                                var p1 = model.getPositionAt(entry.replacementSpan.start);\r\n                                var p2 = model.getPositionAt(entry.replacementSpan.start + entry.replacementSpan.length);\r\n                                range = new Range(p1.lineNumber, p1.column, p2.lineNumber, p2.column);\r\n                            }\r\n                            return {\r\n                                uri: resource,\r\n                                position: position,\r\n                                range: range,\r\n                                label: entry.name,\r\n                                insertText: entry.name,\r\n                                sortText: entry.sortText,\r\n                                kind: SuggestAdapter.convertKind(entry.kind)\r\n                            };\r\n                        });\r\n                        return [2 /*return*/, {\r\n                                suggestions: suggestions\r\n                            }];\r\n                }\r\n            });\r\n        });\r\n    };\r\n    SuggestAdapter.prototype.resolveCompletionItem = function (model, _position, item, token) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var myItem, resource, position, offset, worker, details;\r\n            return __generator(this, function (_a) {\r\n                switch (_a.label) {\r\n                    case 0:\r\n                        myItem = item;\r\n                        resource = myItem.uri;\r\n                        position = myItem.position;\r\n                        offset = model.getOffsetAt(position);\r\n                        return [4 /*yield*/, this._worker(resource)];\r\n                    case 1:\r\n                        worker = _a.sent();\r\n                        return [4 /*yield*/, worker.getCompletionEntryDetails(resource.toString(), offset, myItem.label)];\r\n                    case 2:\r\n                        details = _a.sent();\r\n                        if (!details || model.isDisposed()) {\r\n                            return [2 /*return*/, myItem];\r\n                        }\r\n                        return [2 /*return*/, {\r\n                                uri: resource,\r\n                                position: position,\r\n                                label: details.name,\r\n                                kind: SuggestAdapter.convertKind(details.kind),\r\n                                detail: displayPartsToString(details.displayParts),\r\n                                documentation: {\r\n                                    value: displayPartsToString(details.documentation)\r\n                                }\r\n                            }];\r\n                }\r\n            });\r\n        });\r\n    };\r\n    SuggestAdapter.convertKind = function (kind) {\r\n        switch (kind) {\r\n            case Kind.primitiveType:\r\n            case Kind.keyword:\r\n                return monaco.languages.CompletionItemKind.Keyword;\r\n            case Kind.variable:\r\n            case Kind.localVariable:\r\n                return monaco.languages.CompletionItemKind.Variable;\r\n            case Kind.memberVariable:\r\n            case Kind.memberGetAccessor:\r\n            case Kind.memberSetAccessor:\r\n                return monaco.languages.CompletionItemKind.Field;\r\n            case Kind.function:\r\n            case Kind.memberFunction:\r\n            case Kind.constructSignature:\r\n            case Kind.callSignature:\r\n            case Kind.indexSignature:\r\n                return monaco.languages.CompletionItemKind.Function;\r\n            case Kind.enum:\r\n                return monaco.languages.CompletionItemKind.Enum;\r\n            case Kind.module:\r\n                return monaco.languages.CompletionItemKind.Module;\r\n            case Kind.class:\r\n                return monaco.languages.CompletionItemKind.Class;\r\n            case Kind.interface:\r\n                return monaco.languages.CompletionItemKind.Interface;\r\n            case Kind.warning:\r\n                return monaco.languages.CompletionItemKind.File;\r\n        }\r\n        return monaco.languages.CompletionItemKind.Property;\r\n    };\r\n    return SuggestAdapter;\r\n}(Adapter));\r\n\r\nvar SignatureHelpAdapter = /** @class */ (function (_super) {\r\n    __extends(SignatureHelpAdapter, _super);\r\n    function SignatureHelpAdapter() {\r\n        var _this = _super !== null && _super.apply(this, arguments) || this;\r\n        _this.signatureHelpTriggerCharacters = ['(', ','];\r\n        return _this;\r\n    }\r\n    SignatureHelpAdapter.prototype.provideSignatureHelp = function (model, position, token) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var resource, offset, worker, info, ret;\r\n            return __generator(this, function (_a) {\r\n                switch (_a.label) {\r\n                    case 0:\r\n                        resource = model.uri;\r\n                        offset = model.getOffsetAt(position);\r\n                        return [4 /*yield*/, this._worker(resource)];\r\n                    case 1:\r\n                        worker = _a.sent();\r\n                        return [4 /*yield*/, worker.getSignatureHelpItems(resource.toString(), offset)];\r\n                    case 2:\r\n                        info = _a.sent();\r\n                        if (!info || model.isDisposed()) {\r\n                            return [2 /*return*/];\r\n                        }\r\n                        ret = {\r\n                            activeSignature: info.selectedItemIndex,\r\n                            activeParameter: info.argumentIndex,\r\n                            signatures: []\r\n                        };\r\n                        info.items.forEach(function (item) {\r\n                            var signature = {\r\n                                label: '',\r\n                                parameters: []\r\n                            };\r\n                            signature.documentation = displayPartsToString(item.documentation);\r\n                            signature.label += displayPartsToString(item.prefixDisplayParts);\r\n                            item.parameters.forEach(function (p, i, a) {\r\n                                var label = displayPartsToString(p.displayParts);\r\n                                var parameter = {\r\n                                    label: label,\r\n                                    documentation: displayPartsToString(p.documentation)\r\n                                };\r\n                                signature.label += label;\r\n                                signature.parameters.push(parameter);\r\n                                if (i < a.length - 1) {\r\n                                    signature.label += displayPartsToString(item.separatorDisplayParts);\r\n                                }\r\n                            });\r\n                            signature.label += displayPartsToString(item.suffixDisplayParts);\r\n                            ret.signatures.push(signature);\r\n                        });\r\n                        return [2 /*return*/, {\r\n                                value: ret,\r\n                                dispose: function () { }\r\n                            }];\r\n                }\r\n            });\r\n        });\r\n    };\r\n    return SignatureHelpAdapter;\r\n}(Adapter));\r\n\r\n// --- hover ------\r\nvar QuickInfoAdapter = /** @class */ (function (_super) {\r\n    __extends(QuickInfoAdapter, _super);\r\n    function QuickInfoAdapter() {\r\n        return _super !== null && _super.apply(this, arguments) || this;\r\n    }\r\n    QuickInfoAdapter.prototype.provideHover = function (model, position, token) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var resource, offset, worker, info, documentation, tags, contents;\r\n            return __generator(this, function (_a) {\r\n                switch (_a.label) {\r\n                    case 0:\r\n                        resource = model.uri;\r\n                        offset = model.getOffsetAt(position);\r\n                        return [4 /*yield*/, this._worker(resource)];\r\n                    case 1:\r\n                        worker = _a.sent();\r\n                        return [4 /*yield*/, worker.getQuickInfoAtPosition(resource.toString(), offset)];\r\n                    case 2:\r\n                        info = _a.sent();\r\n                        if (!info || model.isDisposed()) {\r\n                            return [2 /*return*/];\r\n                        }\r\n                        documentation = displayPartsToString(info.documentation);\r\n                        tags = info.tags ? info.tags.map(function (tag) {\r\n                            var label = \"*@\" + tag.name + \"*\";\r\n                            if (!tag.text) {\r\n                                return label;\r\n                            }\r\n                            return label + (tag.text.match(/\\r\\n|\\n/g) ? ' \\n' + tag.text : \" - \" + tag.text);\r\n                        }).join('  \\n\\n') : '';\r\n                        contents = displayPartsToString(info.displayParts);\r\n                        return [2 /*return*/, {\r\n                                range: this._textSpanToRange(model, info.textSpan),\r\n                                contents: [{\r\n                                        value: '```js\\n' + contents + '\\n```\\n'\r\n                                    }, {\r\n                                        value: documentation + (tags ? '\\n\\n' + tags : '')\r\n                                    }]\r\n                            }];\r\n                }\r\n            });\r\n        });\r\n    };\r\n    return QuickInfoAdapter;\r\n}(Adapter));\r\n\r\n// --- occurrences ------\r\nvar OccurrencesAdapter = /** @class */ (function (_super) {\r\n    __extends(OccurrencesAdapter, _super);\r\n    function OccurrencesAdapter() {\r\n        return _super !== null && _super.apply(this, arguments) || this;\r\n    }\r\n    OccurrencesAdapter.prototype.provideDocumentHighlights = function (model, position, token) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var resource, offset, worker, entries;\r\n            var _this = this;\r\n            return __generator(this, function (_a) {\r\n                switch (_a.label) {\r\n                    case 0:\r\n                        resource = model.uri;\r\n                        offset = model.getOffsetAt(position);\r\n                        return [4 /*yield*/, this._worker(resource)];\r\n                    case 1:\r\n                        worker = _a.sent();\r\n                        return [4 /*yield*/, worker.getOccurrencesAtPosition(resource.toString(), offset)];\r\n                    case 2:\r\n                        entries = _a.sent();\r\n                        if (!entries || model.isDisposed()) {\r\n                            return [2 /*return*/];\r\n                        }\r\n                        return [2 /*return*/, entries.map(function (entry) {\r\n                                return {\r\n                                    range: _this._textSpanToRange(model, entry.textSpan),\r\n                                    kind: entry.isWriteAccess ? monaco.languages.DocumentHighlightKind.Write : monaco.languages.DocumentHighlightKind.Text\r\n                                };\r\n                            })];\r\n                }\r\n            });\r\n        });\r\n    };\r\n    return OccurrencesAdapter;\r\n}(Adapter));\r\n\r\n// --- definition ------\r\nvar DefinitionAdapter = /** @class */ (function (_super) {\r\n    __extends(DefinitionAdapter, _super);\r\n    function DefinitionAdapter() {\r\n        return _super !== null && _super.apply(this, arguments) || this;\r\n    }\r\n    DefinitionAdapter.prototype.provideDefinition = function (model, position, token) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var resource, offset, worker, entries, result, _i, entries_1, entry, uri, refModel;\r\n            return __generator(this, function (_a) {\r\n                switch (_a.label) {\r\n                    case 0:\r\n                        resource = model.uri;\r\n                        offset = model.getOffsetAt(position);\r\n                        return [4 /*yield*/, this._worker(resource)];\r\n                    case 1:\r\n                        worker = _a.sent();\r\n                        return [4 /*yield*/, worker.getDefinitionAtPosition(resource.toString(), offset)];\r\n                    case 2:\r\n                        entries = _a.sent();\r\n                        if (!entries || model.isDisposed()) {\r\n                            return [2 /*return*/];\r\n                        }\r\n                        result = [];\r\n                        for (_i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\r\n                            entry = entries_1[_i];\r\n                            uri = Uri.parse(entry.fileName);\r\n                            refModel = monaco.editor.getModel(uri);\r\n                            if (refModel) {\r\n                                result.push({\r\n                                    uri: uri,\r\n                                    range: this._textSpanToRange(refModel, entry.textSpan)\r\n                                });\r\n                            }\r\n                        }\r\n                        return [2 /*return*/, result];\r\n                }\r\n            });\r\n        });\r\n    };\r\n    return DefinitionAdapter;\r\n}(Adapter));\r\n\r\n// --- references ------\r\nvar ReferenceAdapter = /** @class */ (function (_super) {\r\n    __extends(ReferenceAdapter, _super);\r\n    function ReferenceAdapter() {\r\n        return _super !== null && _super.apply(this, arguments) || this;\r\n    }\r\n    ReferenceAdapter.prototype.provideReferences = function (model, position, context, token) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var resource, offset, worker, entries, result, _i, entries_2, entry, uri, refModel;\r\n            return __generator(this, function (_a) {\r\n                switch (_a.label) {\r\n                    case 0:\r\n                        resource = model.uri;\r\n                        offset = model.getOffsetAt(position);\r\n                        return [4 /*yield*/, this._worker(resource)];\r\n                    case 1:\r\n                        worker = _a.sent();\r\n                        return [4 /*yield*/, worker.getReferencesAtPosition(resource.toString(), offset)];\r\n                    case 2:\r\n                        entries = _a.sent();\r\n                        if (!entries || model.isDisposed()) {\r\n                            return [2 /*return*/];\r\n                        }\r\n                        result = [];\r\n                        for (_i = 0, entries_2 = entries; _i < entries_2.length; _i++) {\r\n                            entry = entries_2[_i];\r\n                            uri = Uri.parse(entry.fileName);\r\n                            refModel = monaco.editor.getModel(uri);\r\n                            if (refModel) {\r\n                                result.push({\r\n                                    uri: uri,\r\n                                    range: this._textSpanToRange(refModel, entry.textSpan)\r\n                                });\r\n                            }\r\n                        }\r\n                        return [2 /*return*/, result];\r\n                }\r\n            });\r\n        });\r\n    };\r\n    return ReferenceAdapter;\r\n}(Adapter));\r\n\r\n// --- outline ------\r\nvar OutlineAdapter = /** @class */ (function (_super) {\r\n    __extends(OutlineAdapter, _super);\r\n    function OutlineAdapter() {\r\n        return _super !== null && _super.apply(this, arguments) || this;\r\n    }\r\n    OutlineAdapter.prototype.provideDocumentSymbols = function (model, token) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var resource, worker, items, convert, result;\r\n            var _this = this;\r\n            return __generator(this, function (_a) {\r\n                switch (_a.label) {\r\n                    case 0:\r\n                        resource = model.uri;\r\n                        return [4 /*yield*/, this._worker(resource)];\r\n                    case 1:\r\n                        worker = _a.sent();\r\n                        return [4 /*yield*/, worker.getNavigationBarItems(resource.toString())];\r\n                    case 2:\r\n                        items = _a.sent();\r\n                        if (!items || model.isDisposed()) {\r\n                            return [2 /*return*/];\r\n                        }\r\n                        convert = function (bucket, item, containerLabel) {\r\n                            var result = {\r\n                                name: item.text,\r\n                                detail: '',\r\n                                kind: (outlineTypeTable[item.kind] || monaco.languages.SymbolKind.Variable),\r\n                                range: _this._textSpanToRange(model, item.spans[0]),\r\n                                selectionRange: _this._textSpanToRange(model, item.spans[0]),\r\n                                tags: [],\r\n                                containerName: containerLabel\r\n                            };\r\n                            if (item.childItems && item.childItems.length > 0) {\r\n                                for (var _i = 0, _a = item.childItems; _i < _a.length; _i++) {\r\n                                    var child = _a[_i];\r\n                                    convert(bucket, child, result.name);\r\n                                }\r\n                            }\r\n                            bucket.push(result);\r\n                        };\r\n                        result = [];\r\n                        items.forEach(function (item) { return convert(result, item); });\r\n                        return [2 /*return*/, result];\r\n                }\r\n            });\r\n        });\r\n    };\r\n    return OutlineAdapter;\r\n}(Adapter));\r\n\r\nvar Kind = /** @class */ (function () {\r\n    function Kind() {\r\n    }\r\n    Kind.unknown = '';\r\n    Kind.keyword = 'keyword';\r\n    Kind.script = 'script';\r\n    Kind.module = 'module';\r\n    Kind.class = 'class';\r\n    Kind.interface = 'interface';\r\n    Kind.type = 'type';\r\n    Kind.enum = 'enum';\r\n    Kind.variable = 'var';\r\n    Kind.localVariable = 'local var';\r\n    Kind.function = 'function';\r\n    Kind.localFunction = 'local function';\r\n    Kind.memberFunction = 'method';\r\n    Kind.memberGetAccessor = 'getter';\r\n    Kind.memberSetAccessor = 'setter';\r\n    Kind.memberVariable = 'property';\r\n    Kind.constructorImplementation = 'constructor';\r\n    Kind.callSignature = 'call';\r\n    Kind.indexSignature = 'index';\r\n    Kind.constructSignature = 'construct';\r\n    Kind.parameter = 'parameter';\r\n    Kind.typeParameter = 'type parameter';\r\n    Kind.primitiveType = 'primitive type';\r\n    Kind.label = 'label';\r\n    Kind.alias = 'alias';\r\n    Kind.const = 'const';\r\n    Kind.let = 'let';\r\n    Kind.warning = 'warning';\r\n    return Kind;\r\n}());\r\n\r\nvar outlineTypeTable = Object.create(null);\r\noutlineTypeTable[Kind.module] = monaco.languages.SymbolKind.Module;\r\noutlineTypeTable[Kind.class] = monaco.languages.SymbolKind.Class;\r\noutlineTypeTable[Kind.enum] = monaco.languages.SymbolKind.Enum;\r\noutlineTypeTable[Kind.interface] = monaco.languages.SymbolKind.Interface;\r\noutlineTypeTable[Kind.memberFunction] = monaco.languages.SymbolKind.Method;\r\noutlineTypeTable[Kind.memberVariable] = monaco.languages.SymbolKind.Property;\r\noutlineTypeTable[Kind.memberGetAccessor] = monaco.languages.SymbolKind.Property;\r\noutlineTypeTable[Kind.memberSetAccessor] = monaco.languages.SymbolKind.Property;\r\noutlineTypeTable[Kind.variable] = monaco.languages.SymbolKind.Variable;\r\noutlineTypeTable[Kind.const] = monaco.languages.SymbolKind.Variable;\r\noutlineTypeTable[Kind.localVariable] = monaco.languages.SymbolKind.Variable;\r\noutlineTypeTable[Kind.variable] = monaco.languages.SymbolKind.Variable;\r\noutlineTypeTable[Kind.function] = monaco.languages.SymbolKind.Function;\r\noutlineTypeTable[Kind.localFunction] = monaco.languages.SymbolKind.Function;\r\n// --- formatting ----\r\nvar FormatHelper = /** @class */ (function (_super) {\r\n    __extends(FormatHelper, _super);\r\n    function FormatHelper() {\r\n        return _super !== null && _super.apply(this, arguments) || this;\r\n    }\r\n    FormatHelper._convertOptions = function (options) {\r\n        return {\r\n            ConvertTabsToSpaces: options.insertSpaces,\r\n            TabSize: options.tabSize,\r\n            IndentSize: options.tabSize,\r\n            IndentStyle: IndentStyle.Smart,\r\n            NewLineCharacter: '\\n',\r\n            InsertSpaceAfterCommaDelimiter: true,\r\n            InsertSpaceAfterSemicolonInForStatements: true,\r\n            InsertSpaceBeforeAndAfterBinaryOperators: true,\r\n            InsertSpaceAfterKeywordsInControlFlowStatements: true,\r\n            InsertSpaceAfterFunctionKeywordForAnonymousFunctions: true,\r\n            InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false,\r\n            InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false,\r\n            InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false,\r\n            PlaceOpenBraceOnNewLineForControlBlocks: false,\r\n            PlaceOpenBraceOnNewLineForFunctions: false\r\n        };\r\n    };\r\n    FormatHelper.prototype._convertTextChanges = function (model, change) {\r\n        return {\r\n            text: change.newText,\r\n            range: this._textSpanToRange(model, change.span)\r\n        };\r\n    };\r\n    return FormatHelper;\r\n}(Adapter));\r\n\r\nvar FormatAdapter = /** @class */ (function (_super) {\r\n    __extends(FormatAdapter, _super);\r\n    function FormatAdapter() {\r\n        return _super !== null && _super.apply(this, arguments) || this;\r\n    }\r\n    FormatAdapter.prototype.provideDocumentRangeFormattingEdits = function (model, range, options, token) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var resource, startOffset, endOffset, worker, edits;\r\n            var _this = this;\r\n            return __generator(this, function (_a) {\r\n                switch (_a.label) {\r\n                    case 0:\r\n                        resource = model.uri;\r\n                        startOffset = model.getOffsetAt({ lineNumber: range.startLineNumber, column: range.startColumn });\r\n                        endOffset = model.getOffsetAt({ lineNumber: range.endLineNumber, column: range.endColumn });\r\n                        return [4 /*yield*/, this._worker(resource)];\r\n                    case 1:\r\n                        worker = _a.sent();\r\n                        return [4 /*yield*/, worker.getFormattingEditsForRange(resource.toString(), startOffset, endOffset, FormatHelper._convertOptions(options))];\r\n                    case 2:\r\n                        edits = _a.sent();\r\n                        if (!edits || model.isDisposed()) {\r\n                            return [2 /*return*/];\r\n                        }\r\n                        return [2 /*return*/, edits.map(function (edit) { return _this._convertTextChanges(model, edit); })];\r\n                }\r\n            });\r\n        });\r\n    };\r\n    return FormatAdapter;\r\n}(FormatHelper));\r\n\r\nvar FormatOnTypeAdapter = /** @class */ (function (_super) {\r\n    __extends(FormatOnTypeAdapter, _super);\r\n    function FormatOnTypeAdapter() {\r\n        return _super !== null && _super.apply(this, arguments) || this;\r\n    }\r\n    Object.defineProperty(FormatOnTypeAdapter.prototype, \"autoFormatTriggerCharacters\", {\r\n        get: function () {\r\n            return [';', '}', '\\n'];\r\n        },\r\n        enumerable: true,\r\n        configurable: true\r\n    });\r\n    FormatOnTypeAdapter.prototype.provideOnTypeFormattingEdits = function (model, position, ch, options, token) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var resource, offset, worker, edits;\r\n            var _this = this;\r\n            return __generator(this, function (_a) {\r\n                switch (_a.label) {\r\n                    case 0:\r\n                        resource = model.uri;\r\n                        offset = model.getOffsetAt(position);\r\n                        return [4 /*yield*/, this._worker(resource)];\r\n                    case 1:\r\n                        worker = _a.sent();\r\n                        return [4 /*yield*/, worker.getFormattingEditsAfterKeystroke(resource.toString(), offset, ch, FormatHelper._convertOptions(options))];\r\n                    case 2:\r\n                        edits = _a.sent();\r\n                        if (!edits || model.isDisposed()) {\r\n                            return [2 /*return*/];\r\n                        }\r\n                        return [2 /*return*/, edits.map(function (edit) { return _this._convertTextChanges(model, edit); })];\r\n                }\r\n            });\r\n        });\r\n    };\r\n    return FormatOnTypeAdapter;\r\n}(FormatHelper));\r\n\r\n// --- code actions ------\r\nvar CodeActionAdaptor = /** @class */ (function (_super) {\r\n    __extends(CodeActionAdaptor, _super);\r\n    function CodeActionAdaptor() {\r\n        return _super !== null && _super.apply(this, arguments) || this;\r\n    }\r\n    CodeActionAdaptor.prototype.provideCodeActions = function (model, range, context, token) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var resource, start, end, formatOptions, errorCodes, worker, codeFixes, actions;\r\n            var _this = this;\r\n            return __generator(this, function (_a) {\r\n                switch (_a.label) {\r\n                    case 0:\r\n                        resource = model.uri;\r\n                        start = model.getOffsetAt({ lineNumber: range.startLineNumber, column: range.startColumn });\r\n                        end = model.getOffsetAt({ lineNumber: range.endLineNumber, column: range.endColumn });\r\n                        formatOptions = FormatHelper._convertOptions(model.getOptions());\r\n                        errorCodes = context.markers.filter(function (m) { return m.code; }).map(function (m) { return m.code; }).map(Number);\r\n                        return [4 /*yield*/, this._worker(resource)];\r\n                    case 1:\r\n                        worker = _a.sent();\r\n                        return [4 /*yield*/, worker.getCodeFixesAtPosition(resource.toString(), start, end, errorCodes, formatOptions)];\r\n                    case 2:\r\n                        codeFixes = _a.sent();\r\n                        if (!codeFixes || model.isDisposed()) {\r\n                            return [2 /*return*/];\r\n                        }\r\n                        actions = codeFixes.filter(function (fix) {\r\n                            // Removes any 'make a new file'-type code fix\r\n                            return fix.changes.filter(function (change) { return change.isNewFile; }).length === 0;\r\n                        }).map(function (fix) {\r\n                            return _this._tsCodeFixActionToMonacoCodeAction(model, context, fix);\r\n                        });\r\n                        return [2 /*return*/, {\r\n                                actions: actions,\r\n                                dispose: function () { }\r\n                            }];\r\n                }\r\n            });\r\n        });\r\n    };\r\n    CodeActionAdaptor.prototype._tsCodeFixActionToMonacoCodeAction = function (model, context, codeFix) {\r\n        var _this = this;\r\n        var edits = codeFix.changes.map(function (edit) { return ({\r\n            resource: model.uri,\r\n            edits: edit.textChanges.map(function (tc) { return ({\r\n                range: _this._textSpanToRange(model, tc.span),\r\n                text: tc.newText\r\n            }); })\r\n        }); });\r\n        var action = {\r\n            title: codeFix.description,\r\n            edit: { edits: edits },\r\n            diagnostics: context.markers,\r\n            kind: \"quickfix\"\r\n        };\r\n        return action;\r\n    };\r\n    return CodeActionAdaptor;\r\n}(FormatHelper));\r\n\r\n// --- rename ----\r\nvar RenameAdapter = /** @class */ (function (_super) {\r\n    __extends(RenameAdapter, _super);\r\n    function RenameAdapter() {\r\n        return _super !== null && _super.apply(this, arguments) || this;\r\n    }\r\n    RenameAdapter.prototype.provideRenameEdits = function (model, position, newName, token) {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var resource, fileName, offset, worker, renameInfo, renameLocations, fileNameToResourceTextEditMap, edits, _i, renameLocations_1, renameLocation, resourceTextEdit;\r\n            return __generator(this, function (_a) {\r\n                switch (_a.label) {\r\n                    case 0:\r\n                        resource = model.uri;\r\n                        fileName = resource.toString();\r\n                        offset = model.getOffsetAt(position);\r\n                        return [4 /*yield*/, this._worker(resource)];\r\n                    case 1:\r\n                        worker = _a.sent();\r\n                        return [4 /*yield*/, worker.getRenameInfo(fileName, offset, { allowRenameOfImportPath: false })];\r\n                    case 2:\r\n                        renameInfo = _a.sent();\r\n                        if (renameInfo.canRename === false) { // use explicit comparison so that the discriminated union gets resolved properly\r\n                            return [2 /*return*/, {\r\n                                    edits: [],\r\n                                    rejectReason: renameInfo.localizedErrorMessage\r\n                                }];\r\n                        }\r\n                        if (renameInfo.fileToRename !== undefined) {\r\n                            throw new Error(\"Renaming files is not supported.\");\r\n                        }\r\n                        return [4 /*yield*/, worker.findRenameLocations(fileName, offset, /*strings*/ false, /*comments*/ false, /*prefixAndSuffix*/ false)];\r\n                    case 3:\r\n                        renameLocations = _a.sent();\r\n                        if (!renameLocations || model.isDisposed()) {\r\n                            return [2 /*return*/];\r\n                        }\r\n                        fileNameToResourceTextEditMap = {};\r\n                        edits = [];\r\n                        for (_i = 0, renameLocations_1 = renameLocations; _i < renameLocations_1.length; _i++) {\r\n                            renameLocation = renameLocations_1[_i];\r\n                            if (!(renameLocation.fileName in fileNameToResourceTextEditMap)) {\r\n                                resourceTextEdit = {\r\n                                    edits: [],\r\n                                    resource: monaco.Uri.parse(renameLocation.fileName)\r\n                                };\r\n                                fileNameToResourceTextEditMap[renameLocation.fileName] = resourceTextEdit;\r\n                                edits.push(resourceTextEdit);\r\n                            }\r\n                            fileNameToResourceTextEditMap[renameLocation.fileName].edits.push({\r\n                                range: this._textSpanToRange(model, renameLocation.textSpan),\r\n                                text: newName\r\n                            });\r\n                        }\r\n                        return [2 /*return*/, { edits: edits }];\r\n                }\r\n            });\r\n        });\r\n    };\r\n    return RenameAdapter;\r\n}(Adapter));\r\n\r\n\n\n//# sourceURL=webpack:////mnt/vss/_work/1/s/packages/monaco-editor/esm/vs/language/typescript/languageFeatures.js?");

/***/ }),

/***/ "../../packages/monaco-editor/esm/vs/language/typescript/tsMode.js":
/*!**************************************************************************************!*\
  !*** /mnt/vss/_work/1/s/packages/monaco-editor/esm/vs/language/typescript/tsMode.js ***!
  \**************************************************************************************/
/*! exports provided: setupTypeScript, setupJavaScript, getJavaScriptWorker, getTypeScriptWorker */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setupTypeScript\", function() { return setupTypeScript; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setupJavaScript\", function() { return setupJavaScript; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getJavaScriptWorker\", function() { return getJavaScriptWorker; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getTypeScriptWorker\", function() { return getTypeScriptWorker; });\n/* harmony import */ var _workerManager_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./workerManager.js */ \"../../packages/monaco-editor/esm/vs/language/typescript/workerManager.js\");\n/* harmony import */ var _languageFeatures_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./languageFeatures.js */ \"../../packages/monaco-editor/esm/vs/language/typescript/languageFeatures.js\");\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\n\r\n\r\nvar javaScriptWorker;\r\nvar typeScriptWorker;\r\nfunction setupTypeScript(defaults) {\r\n    typeScriptWorker = setupMode(defaults, 'typescript');\r\n}\r\nfunction setupJavaScript(defaults) {\r\n    javaScriptWorker = setupMode(defaults, 'javascript');\r\n}\r\nfunction getJavaScriptWorker() {\r\n    return new Promise(function (resolve, reject) {\r\n        if (!javaScriptWorker) {\r\n            return reject(\"JavaScript not registered!\");\r\n        }\r\n        resolve(javaScriptWorker);\r\n    });\r\n}\r\nfunction getTypeScriptWorker() {\r\n    return new Promise(function (resolve, reject) {\r\n        if (!typeScriptWorker) {\r\n            return reject(\"TypeScript not registered!\");\r\n        }\r\n        resolve(typeScriptWorker);\r\n    });\r\n}\r\nfunction setupMode(defaults, modeId) {\r\n    var client = new _workerManager_js__WEBPACK_IMPORTED_MODULE_0__[\"WorkerManager\"](modeId, defaults);\r\n    var worker = function (first) {\r\n        var more = [];\r\n        for (var _i = 1; _i < arguments.length; _i++) {\r\n            more[_i - 1] = arguments[_i];\r\n        }\r\n        return client.getLanguageServiceWorker.apply(client, [first].concat(more));\r\n    };\r\n    monaco.languages.registerCompletionItemProvider(modeId, new _languageFeatures_js__WEBPACK_IMPORTED_MODULE_1__[\"SuggestAdapter\"](worker));\r\n    monaco.languages.registerSignatureHelpProvider(modeId, new _languageFeatures_js__WEBPACK_IMPORTED_MODULE_1__[\"SignatureHelpAdapter\"](worker));\r\n    monaco.languages.registerHoverProvider(modeId, new _languageFeatures_js__WEBPACK_IMPORTED_MODULE_1__[\"QuickInfoAdapter\"](worker));\r\n    monaco.languages.registerDocumentHighlightProvider(modeId, new _languageFeatures_js__WEBPACK_IMPORTED_MODULE_1__[\"OccurrencesAdapter\"](worker));\r\n    monaco.languages.registerDefinitionProvider(modeId, new _languageFeatures_js__WEBPACK_IMPORTED_MODULE_1__[\"DefinitionAdapter\"](worker));\r\n    monaco.languages.registerReferenceProvider(modeId, new _languageFeatures_js__WEBPACK_IMPORTED_MODULE_1__[\"ReferenceAdapter\"](worker));\r\n    monaco.languages.registerDocumentSymbolProvider(modeId, new _languageFeatures_js__WEBPACK_IMPORTED_MODULE_1__[\"OutlineAdapter\"](worker));\r\n    monaco.languages.registerDocumentRangeFormattingEditProvider(modeId, new _languageFeatures_js__WEBPACK_IMPORTED_MODULE_1__[\"FormatAdapter\"](worker));\r\n    monaco.languages.registerOnTypeFormattingEditProvider(modeId, new _languageFeatures_js__WEBPACK_IMPORTED_MODULE_1__[\"FormatOnTypeAdapter\"](worker));\r\n    monaco.languages.registerCodeActionProvider(modeId, new _languageFeatures_js__WEBPACK_IMPORTED_MODULE_1__[\"CodeActionAdaptor\"](worker));\r\n    monaco.languages.registerRenameProvider(modeId, new _languageFeatures_js__WEBPACK_IMPORTED_MODULE_1__[\"RenameAdapter\"](worker));\r\n    new _languageFeatures_js__WEBPACK_IMPORTED_MODULE_1__[\"DiagnosticsAdapter\"](defaults, modeId, worker);\r\n    return worker;\r\n}\r\n\n\n//# sourceURL=webpack:////mnt/vss/_work/1/s/packages/monaco-editor/esm/vs/language/typescript/tsMode.js?");

/***/ }),

/***/ "../../packages/monaco-editor/esm/vs/language/typescript/workerManager.js":
/*!*********************************************************************************************!*\
  !*** /mnt/vss/_work/1/s/packages/monaco-editor/esm/vs/language/typescript/workerManager.js ***!
  \*********************************************************************************************/
/*! exports provided: WorkerManager */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WorkerManager\", function() { return WorkerManager; });\n/*---------------------------------------------------------------------------------------------\r\n *  Copyright (c) Microsoft Corporation. All rights reserved.\r\n *  Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\r\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n    return new (P || (P = Promise))(function (resolve, reject) {\r\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n    });\r\n};\r\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\r\n    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n    return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n    function verb(n) { return function (v) { return step([n, v]); }; }\r\n    function step(op) {\r\n        if (f) throw new TypeError(\"Generator is already executing.\");\r\n        while (_) try {\r\n            if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n            if (y = 0, t) op = [op[0] & 2, t.value];\r\n            switch (op[0]) {\r\n                case 0: case 1: t = op; break;\r\n                case 4: _.label++; return { value: op[1], done: false };\r\n                case 5: _.label++; y = op[1]; op = [0]; continue;\r\n                case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n                default:\r\n                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n                    if (t[2]) _.ops.pop();\r\n                    _.trys.pop(); continue;\r\n            }\r\n            op = body.call(thisArg, _);\r\n        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n    }\r\n};\r\nvar WorkerManager = /** @class */ (function () {\r\n    function WorkerManager(modeId, defaults) {\r\n        var _this = this;\r\n        this._modeId = modeId;\r\n        this._defaults = defaults;\r\n        this._worker = null;\r\n        this._client = null;\r\n        this._configChangeListener = this._defaults.onDidChange(function () { return _this._stopWorker(); });\r\n        this._updateExtraLibsToken = 0;\r\n        this._extraLibsChangeListener = this._defaults.onDidExtraLibsChange(function () { return _this._updateExtraLibs(); });\r\n    }\r\n    WorkerManager.prototype._stopWorker = function () {\r\n        if (this._worker) {\r\n            this._worker.dispose();\r\n            this._worker = null;\r\n        }\r\n        this._client = null;\r\n    };\r\n    WorkerManager.prototype.dispose = function () {\r\n        this._configChangeListener.dispose();\r\n        this._extraLibsChangeListener.dispose();\r\n        this._stopWorker();\r\n    };\r\n    WorkerManager.prototype._updateExtraLibs = function () {\r\n        return __awaiter(this, void 0, void 0, function () {\r\n            var myToken, proxy;\r\n            return __generator(this, function (_a) {\r\n                switch (_a.label) {\r\n                    case 0:\r\n                        if (!this._worker) {\r\n                            return [2 /*return*/];\r\n                        }\r\n                        myToken = ++this._updateExtraLibsToken;\r\n                        return [4 /*yield*/, this._worker.getProxy()];\r\n                    case 1:\r\n                        proxy = _a.sent();\r\n                        if (this._updateExtraLibsToken !== myToken) {\r\n                            // avoid multiple calls\r\n                            return [2 /*return*/];\r\n                        }\r\n                        proxy.updateExtraLibs(this._defaults.getExtraLibs());\r\n                        return [2 /*return*/];\r\n                }\r\n            });\r\n        });\r\n    };\r\n    WorkerManager.prototype._getClient = function () {\r\n        var _this = this;\r\n        if (!this._client) {\r\n            this._worker = monaco.editor.createWebWorker({\r\n                // module that exports the create() method and returns a `TypeScriptWorker` instance\r\n                moduleId: 'vs/language/typescript/tsWorker',\r\n                label: this._modeId,\r\n                keepIdleModels: true,\r\n                // passed in to the create() method\r\n                createData: {\r\n                    compilerOptions: this._defaults.getCompilerOptions(),\r\n                    extraLibs: this._defaults.getExtraLibs()\r\n                }\r\n            });\r\n            var p = this._worker.getProxy();\r\n            if (this._defaults.getEagerModelSync()) {\r\n                p = p.then(function (worker) {\r\n                    if (_this._worker) {\r\n                        return _this._worker.withSyncedResources(monaco.editor.getModels()\r\n                            .filter(function (model) { return model.getModeId() === _this._modeId; })\r\n                            .map(function (model) { return model.uri; }));\r\n                    }\r\n                    return worker;\r\n                });\r\n            }\r\n            this._client = p;\r\n        }\r\n        return this._client;\r\n    };\r\n    WorkerManager.prototype.getLanguageServiceWorker = function () {\r\n        var _this = this;\r\n        var resources = [];\r\n        for (var _i = 0; _i < arguments.length; _i++) {\r\n            resources[_i] = arguments[_i];\r\n        }\r\n        var _client;\r\n        return this._getClient().then(function (client) {\r\n            _client = client;\r\n        }).then(function (_) {\r\n            if (_this._worker) {\r\n                return _this._worker.withSyncedResources(resources);\r\n            }\r\n        }).then(function (_) { return _client; });\r\n    };\r\n    return WorkerManager;\r\n}());\r\n\r\n\n\n//# sourceURL=webpack:////mnt/vss/_work/1/s/packages/monaco-editor/esm/vs/language/typescript/workerManager.js?");

/***/ })

}]);