Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

monaco-json

Package Overview
Dependencies
Maintainers
7
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

monaco-json - npm Package Compare versions

Comparing version 2.1.1 to 2.2.0

release/esm/_deps/vscode-json-languageservice/jsonLanguageTypes.js

16

package.json
{
"name": "monaco-json",
"version": "2.1.1",
"version": "2.2.0",
"description": "JSON plugin for the Monaco Editor",

@@ -22,12 +22,12 @@ "scripts": {

"devDependencies": {
"jsonc-parser": "2.0.0-next.1",
"monaco-editor-core": "0.12.0",
"monaco-languages": "1.0.0",
"jsonc-parser": "^2.0.1",
"monaco-editor-core": "0.14.1",
"monaco-languages": "1.4.0",
"monaco-plugin-helpers": "^1.0.2",
"requirejs": "^2.3.5",
"typescript": "2.7.2",
"uglify-js": "^3.3.14",
"vscode-json-languageservice": "3.1.0",
"vscode-languageserver-types": "3.6.1"
"typescript": "3.0.1",
"uglify-js": "^3.4.7",
"vscode-json-languageservice": "3.1.4",
"vscode-languageserver-types": "3.10.0"
}
}

@@ -33,3 +33,3 @@ /*---------------------------------------------------------------------------------------------

// empty document
if (value === void 0) {
if (value === void 0) { // delete
throw new Error('Can not delete in empty document');

@@ -42,3 +42,3 @@ }

if (existing !== void 0) {
if (value === void 0) {
if (value === void 0) { // delete
if (!existing.parent) {

@@ -71,3 +71,3 @@ throw new Error('Malformed AST');

else {
if (value === void 0) {
if (value === void 0) { // delete
return []; // property does not exist, nothing to do

@@ -144,3 +144,3 @@ }

var end = edit.offset + edit.content.length;
if (edit.length === 0 || edit.content.length === 0) {
if (edit.length === 0 || edit.content.length === 0) { // insert or remove
while (begin > 0 && !isEOL(newText, begin - 1)) {

@@ -147,0 +147,0 @@ begin--;

@@ -25,3 +25,3 @@ /*---------------------------------------------------------------------------------------------

formatText = documentText.substring(formatTextStart, endOffset);
initialIndentLevel = computeIndentLevel(formatText, 0, options);
initialIndentLevel = computeIndentLevel(formatText, options);
}

@@ -159,3 +159,3 @@ else {

}
function computeIndentLevel(content, offset, options) {
function computeIndentLevel(content, options) {
var i = 0;

@@ -162,0 +162,0 @@ var nChars = 0;

@@ -18,3 +18,4 @@ /*---------------------------------------------------------------------------------------------

length: 0,
type: 'object'
type: 'object',
parent: void 0
};

@@ -27,3 +28,3 @@ var isAtPropertyKey = false;

previousNodeInst.type = type;
previousNodeInst.columnOffset = void 0;
previousNodeInst.colonOffset = void 0;
previousNode = previousNodeInst;

@@ -86,3 +87,3 @@ }

if (sep === ':' && previousNode && previousNode.type === 'property') {
previousNode.columnOffset = offset;
previousNode.colonOffset = offset;
isAtPropertyKey = false;

@@ -182,3 +183,3 @@ previousNode = void 0;

if (errors === void 0) { errors = []; }
var currentParent = { type: 'array', offset: -1, length: -1, children: [] }; // artificial root
var currentParent = { type: 'array', offset: -1, length: -1, children: [], parent: void 0 }; // artificial root
function ensurePropertyComplete(endOffset) {

@@ -222,3 +223,3 @@ if (currentParent.type === 'property') {

if (sep === ':') {
currentParent.columnOffset = offset;
currentParent.colonOffset = offset;
}

@@ -279,17 +280,69 @@ else if (sep === ',') {

/**
* Gets the JSON path of the given JSON DOM node
*/
export function getNodePath(node) {
if (!node.parent || !node.parent.children) {
return [];
}
var path = getNodePath(node.parent);
if (node.parent.type === 'property') {
var key = node.parent.children[0].value;
path.push(key);
}
else if (node.parent.type === 'array') {
var index = node.parent.children.indexOf(node);
if (index !== -1) {
path.push(index);
}
}
return path;
}
/**
* Evaluates the JavaScript object of the given JSON DOM node
*/
export function getNodeValue(node) {
if (node.type === 'array') {
return node.children.map(getNodeValue);
switch (node.type) {
case 'array':
return node.children.map(getNodeValue);
case 'object':
var obj = Object.create(null);
for (var _i = 0, _a = node.children; _i < _a.length; _i++) {
var prop = _a[_i];
var valueNode = prop.children[1];
if (valueNode) {
obj[prop.children[0].value] = getNodeValue(valueNode);
}
}
return obj;
case 'null':
case 'string':
case 'number':
case 'boolean':
return node.value;
default:
return void 0;
}
else if (node.type === 'object') {
var obj = Object.create(null);
for (var _i = 0, _a = node.children; _i < _a.length; _i++) {
var prop = _a[_i];
obj[prop.children[0].value] = getNodeValue(prop.children[1]);
}
export function 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));
}
/**
* Finds the most inner node at the given offset. If includeRightBound is set, also finds nodes that end at the given offset.
*/
export function findNodeAtOffset(node, offset, includeRightBound) {
if (includeRightBound === void 0) { includeRightBound = false; }
if (contains(node, offset, includeRightBound)) {
var children = node.children;
if (Array.isArray(children)) {
for (var i = 0; i < children.length && children[i].offset <= offset; i++) {
var item = findNodeAtOffset(children[i], offset, includeRightBound);
if (item) {
return item;
}
}
}
return obj;
return node;
}
return node.value;
return void 0;
}

@@ -296,0 +349,0 @@ /**

@@ -315,2 +315,3 @@ /*---------------------------------------------------------------------------------------------

case 44 /* comma */:
case 47 /* slash */:
return false;

@@ -317,0 +318,0 @@ }

@@ -33,2 +33,10 @@ /*---------------------------------------------------------------------------------------------

/**
* Finds the most inner node at the given offset. If includeRightBound is set, also finds nodes that end at the given offset.
*/
export var findNodeAtOffset = parser.findNodeAtOffset;
/**
* Gets the JSON path of the given JSON DOM node
*/
export var getNodePath = parser.getNodePath;
/**
* Evaluates the JavaScript object of the given JSON DOM node

@@ -35,0 +43,0 @@ */

@@ -6,3 +6,3 @@ /*---------------------------------------------------------------------------------------------

'use strict';
import { TextDocument, Position, CompletionItem, CompletionList, Range, SymbolInformation, Diagnostic, TextEdit, FormattingOptions, MarkedString } from '../vscode-languageserver-types/main';
import { TextDocument, Position, CompletionItem, CompletionList, Hover, Range, SymbolInformation, Diagnostic, TextEdit, FormattingOptions, MarkedString } from '../vscode-languageserver-types/main';
import { JSONCompletion } from './services/jsonCompletion';

@@ -15,4 +15,6 @@ import { JSONHover } from './services/jsonHover';

import { JSONSchemaService } from './services/jsonSchemaService';
import { getFoldingRanges } from './services/jsonFolding';
import { format as formatJSON } from '../jsonc-parser/main';
export { TextDocument, Position, CompletionItem, CompletionList, Range, SymbolInformation, Diagnostic, TextEdit, FormattingOptions, MarkedString };
export * from './jsonLanguageTypes';
export { TextDocument, Position, CompletionItem, CompletionList, Hover, Range, SymbolInformation, Diagnostic, TextEdit, FormattingOptions, MarkedString };
export function getLanguageService(params) {

@@ -47,2 +49,3 @@ var promise = params.promiseConstructor || Promise;

doHover: jsonHover.doHover.bind(jsonHover),
getFoldingRanges: getFoldingRanges,
format: function (d, r, o) {

@@ -49,0 +52,0 @@ var range = void 0;

@@ -18,32 +18,9 @@ /*---------------------------------------------------------------------------------------------

import * as objects from '../utils/objects';
import { ErrorCode } from '../jsonLanguageTypes';
import * as nls from '../../../fillers/vscode-nls';
import Uri from '../../vscode-uri/index';
import { DiagnosticSeverity } from '../../vscode-languageserver-types/main';
import { Diagnostic, DiagnosticSeverity, Range } from '../../vscode-languageserver-types/main';
var localize = nls.loadMessageBundle();
export var ErrorCode;
(function (ErrorCode) {
ErrorCode[ErrorCode["Undefined"] = 0] = "Undefined";
ErrorCode[ErrorCode["EnumValueMismatch"] = 1] = "EnumValueMismatch";
ErrorCode[ErrorCode["UnexpectedEndOfComment"] = 257] = "UnexpectedEndOfComment";
ErrorCode[ErrorCode["UnexpectedEndOfString"] = 258] = "UnexpectedEndOfString";
ErrorCode[ErrorCode["UnexpectedEndOfNumber"] = 259] = "UnexpectedEndOfNumber";
ErrorCode[ErrorCode["InvalidUnicode"] = 260] = "InvalidUnicode";
ErrorCode[ErrorCode["InvalidEscapeCharacter"] = 261] = "InvalidEscapeCharacter";
ErrorCode[ErrorCode["InvalidCharacter"] = 262] = "InvalidCharacter";
ErrorCode[ErrorCode["PropertyExpected"] = 513] = "PropertyExpected";
ErrorCode[ErrorCode["CommaExpected"] = 514] = "CommaExpected";
ErrorCode[ErrorCode["ColonExpected"] = 515] = "ColonExpected";
ErrorCode[ErrorCode["ValueExpected"] = 516] = "ValueExpected";
ErrorCode[ErrorCode["CommaOrCloseBacketExpected"] = 517] = "CommaOrCloseBacketExpected";
ErrorCode[ErrorCode["CommaOrCloseBraceExpected"] = 518] = "CommaOrCloseBraceExpected";
ErrorCode[ErrorCode["TrailingComma"] = 519] = "TrailingComma";
})(ErrorCode || (ErrorCode = {}));
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,}))$/;
export var ProblemSeverity;
(function (ProblemSeverity) {
ProblemSeverity["Ignore"] = "ignore";
ProblemSeverity["Error"] = "error";
ProblemSeverity["Warning"] = "warning";
})(ProblemSeverity || (ProblemSeverity = {}));
var ASTNodeImpl = /** @class */ (function () {

@@ -73,2 +50,3 @@ function ASTNodeImpl(parent, offset, length) {

_this.type = 'null';
_this.value = null;
return _this;

@@ -190,4 +168,4 @@ }

SchemaCollector.prototype.merge = function (other) {
var _a;
(_a = this.schemas).push.apply(_a, other.schemas);
var _a;
};

@@ -278,48 +256,11 @@ SchemaCollector.prototype.include = function (node) {

export { ValidationResult };
function toProblemSeverity(diagnosticsSeverity) {
switch (diagnosticsSeverity) {
case DiagnosticSeverity.Error: return ProblemSeverity.Error;
case DiagnosticSeverity.Warning: return ProblemSeverity.Warning;
case DiagnosticSeverity.Information: return ProblemSeverity.Warning;
}
return ProblemSeverity.Ignore;
}
export function newJSONDocument(root, diagnostics) {
if (diagnostics === void 0) { diagnostics = []; }
return new JSONDocument(root, [], [], diagnostics);
return new JSONDocument(root, diagnostics, []);
}
export function getNodeValue(node) {
switch (node.type) {
case 'array':
return node.items.map(getNodeValue);
case 'object':
var obj = Object.create(null);
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var prop = _a[_i];
obj[prop.keyNode.value] = getNodeValue(prop.valueNode);
}
return obj;
case 'string':
case 'number':
case 'boolean':
return node.value;
}
return null;
return Json.getNodeValue(node);
}
export function getNodePath(node) {
if (!node.parent) {
return [];
}
var path = getNodePath(node.parent);
if (node.parent.type === 'property') {
var key = node.parent.keyNode.value;
path.push(key);
}
else if (node.parent.type === 'array') {
var index = node.parent.items.indexOf(node);
if (index !== -1) {
path.push(index);
}
}
return path;
return Json.getNodePath(node);
}

@@ -331,43 +272,16 @@ export function contains(node, offset, includeRightBound) {

var JSONDocument = /** @class */ (function () {
function JSONDocument(root, syntaxErrors, comments, externalDiagnostic) {
function JSONDocument(root, syntaxErrors, comments) {
if (syntaxErrors === void 0) { syntaxErrors = []; }
if (comments === void 0) { comments = []; }
if (externalDiagnostic === void 0) { externalDiagnostic = []; }
this.root = root;
this.syntaxErrors = syntaxErrors;
this.comments = comments;
this.externalDiagnostic = externalDiagnostic;
}
JSONDocument.prototype.getNodeFromOffset = function (offset) {
var findNode = function (node) {
if (offset >= node.offset && offset < (node.offset + node.length)) {
var children = node.children;
for (var i = 0; i < children.length && children[i].offset <= offset; i++) {
var item = findNode(children[i]);
if (item) {
return item;
}
}
return node;
}
return null;
};
return this.root && findNode(this.root);
JSONDocument.prototype.getNodeFromOffset = function (offset, includeRightBound) {
if (includeRightBound === void 0) { includeRightBound = false; }
if (this.root) {
return Json.findNodeAtOffset(this.root, offset, includeRightBound);
}
return void 0;
};
JSONDocument.prototype.getNodeFromOffsetEndInclusive = function (offset) {
var findNode = function (node) {
if (offset >= node.offset && offset <= (node.offset + node.length)) {
var children = node.children;
for (var i = 0; i < children.length && children[i].offset <= offset; i++) {
var item = findNode(children[i]);
if (item) {
return item;
}
}
return node;
}
return null;
};
return this.root && findNode(this.root);
};
JSONDocument.prototype.visit = function (visitor) {

@@ -378,4 +292,6 @@ if (this.root) {

var children = node.children;
for (var i = 0; i < children.length && ctn; i++) {
ctn = doVisit_1(children[i]);
if (Array.isArray(children)) {
for (var i = 0; i < children.length && ctn; i++) {
ctn = doVisit_1(children[i]);
}
}

@@ -387,7 +303,10 @@ return ctn;

};
JSONDocument.prototype.validate = function (schema) {
JSONDocument.prototype.validate = function (textDocument, schema) {
if (this.root && schema) {
var validationResult = new ValidationResult();
validate(this.root, schema, validationResult, NoOpSchemaCollector.instance);
return validationResult.problems;
return validationResult.problems.map(function (p) {
var range = 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);
});
}

@@ -438,3 +357,3 @@ return null;

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: schema.errorMessage || localize('typeArrayMismatchWarning', 'Incorrect type. Expected one of {0}.', schema.type.join(', '))

@@ -448,3 +367,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: schema.errorMessage || localize('typeMismatchWarning', 'Incorrect type. Expected "{0}".', schema.type)

@@ -467,3 +386,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: localize('notSchemaWarning', "Matches a schema that is not allowed.")

@@ -516,3 +435,3 @@ });

location: { offset: node.offset, length: 1 },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: localize('oneOfWarning', "Matches multiple schemas when only one must validate.")

@@ -550,3 +469,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
code: ErrorCode.EnumValueMismatch,

@@ -562,3 +481,3 @@ message: schema.errorMessage || localize('enumWarning', 'Value is not accepted. Valid values: {0}.', schema.enum.map(function (v) { return JSON.stringify(v); }).join(', '))

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
code: ErrorCode.EnumValueMismatch,

@@ -577,3 +496,3 @@ message: schema.errorMessage || localize('constWarning', 'Value must be {0}.', JSON.stringify(schema.const))

location: { offset: node.parent.offset, length: node.parent.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: schema.deprecationMessage

@@ -589,3 +508,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: localize('multipleOfWarning', 'Value is not divisible by {0}.', schema.multipleOf)

@@ -614,3 +533,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: localize('exclusiveMinimumWarning', 'Value is below the exclusive minimum of {0}.', exclusiveMinimum)

@@ -623,3 +542,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: localize('exclusiveMaximumWarning', 'Value is above the exclusive maximum of {0}.', exclusiveMaximum)

@@ -632,3 +551,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: localize('minimumWarning', 'Value is below the minimum of {0}.', minimum)

@@ -641,3 +560,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: localize('maximumWarning', 'Value is above the maximum of {0}.', maximum)

@@ -651,3 +570,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: localize('minLengthWarning', 'String is shorter than the minimum length of {0}.', schema.minLength)

@@ -659,3 +578,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: localize('maxLengthWarning', 'String is longer than the maximum length of {0}.', schema.maxLength)

@@ -669,3 +588,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: schema.patternErrorMessage || schema.errorMessage || localize('patternWarning', 'String does not match the pattern of "{0}".', schema.pattern)

@@ -698,3 +617,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: schema.patternErrorMessage || schema.errorMessage || localize('uriFormatWarning', 'String is not a URI: {0}', errorMessage)

@@ -710,3 +629,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: schema.patternErrorMessage || schema.errorMessage || localize('emailFormatWarning', 'String is not an e-mail address.')

@@ -722,3 +641,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: schema.patternErrorMessage || schema.errorMessage || localize('colorHexFormatWarning', 'Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.')

@@ -759,3 +678,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: localize('additionalItemsWarning', 'Array has too many items according to schema. Expected {0} or fewer.', subSchemas_1.length)

@@ -786,4 +705,4 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
message: schema.errorMessage || localize('requiredItemMissingWarning', 'Array does not contain required item.', schema.minItems)
severity: DiagnosticSeverity.Warning,
message: schema.errorMessage || localize('requiredItemMissingWarning', 'Array does not contain required item.')
});

@@ -795,3 +714,3 @@ }

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: localize('minItemsWarning', 'Array has too few items. Expected {0} or more.', schema.minItems)

@@ -803,4 +722,4 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
message: localize('maxItemsWarning', 'Array has too many items. Expected {0} or fewer.', schema.minItems)
severity: DiagnosticSeverity.Warning,
message: localize('maxItemsWarning', 'Array has too many items. Expected {0} or fewer.', schema.maxItems)
});

@@ -816,3 +735,3 @@ }

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: localize('uniqueItemsWarning', 'Array has duplicate items.')

@@ -838,3 +757,3 @@ });

location: location,
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: localize('MissingRequiredPropWarning', 'Missing property "{0}".', propertyName)

@@ -863,3 +782,3 @@ });

location: { offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: schema.errorMessage || localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName)

@@ -895,3 +814,3 @@ });

location: { offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: schema.errorMessage || localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName)

@@ -933,3 +852,3 @@ });

location: { offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: schema.errorMessage || localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName)

@@ -945,3 +864,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: localize('MaxPropWarning', 'Object has more properties than limit of {0}.', schema.maxProperties)

@@ -955,3 +874,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: localize('MinPropWarning', 'Object has fewer properties than the required number of {0}', schema.minProperties)

@@ -971,3 +890,3 @@ });

location: { offset: node.offset, length: node.length },
severity: ProblemSeverity.Warning,
severity: DiagnosticSeverity.Warning,
message: localize('RequiredDependentPropWarning', 'Object is missing property {0} required by property {1}.', requiredProp, key)

@@ -1005,5 +924,6 @@ });

var problems = [];
var lastProblemOffset = -1;
var text = textDocument.getText();
var scanner = Json.createScanner(text, false);
var comments = config && config.collectComments ? [] : void 0;
var commentRanges = config && config.collectComments ? [] : void 0;
function _scanNext() {

@@ -1016,4 +936,4 @@ while (true) {

case 13 /* BlockCommentTrivia */:
if (Array.isArray(comments)) {
comments.push({ offset: scanner.getTokenOffset(), length: scanner.getTokenLength() });
if (Array.isArray(commentRanges)) {
commentRanges.push(Range.create(textDocument.positionAt(scanner.getTokenOffset()), textDocument.positionAt(scanner.getTokenOffset() + scanner.getTokenLength())));
}

@@ -1036,5 +956,8 @@ break;

}
function _errorAtRange(message, code, location) {
if (problems.length === 0 || problems[problems.length - 1].location.offset !== location.offset) {
problems.push({ message: message, location: location, code: code, severity: ProblemSeverity.Error });
function _errorAtRange(message, code, startOffset, endOffset, severity) {
if (severity === void 0) { severity = DiagnosticSeverity.Error; }
if (problems.length === 0 || startOffset !== lastProblemOffset) {
var range = Range.create(textDocument.positionAt(startOffset), textDocument.positionAt(endOffset));
problems.push(Diagnostic.create(range, message, severity, code, textDocument.languageId));
lastProblemOffset = startOffset;
}

@@ -1055,3 +978,3 @@ }

}
_errorAtRange(message, code, { offset: start, length: end - start });
_errorAtRange(message, code, start, end);
if (node) {

@@ -1122,3 +1045,3 @@ _finalize(node, false);

if (needsComma) {
_errorAtRange(localize('TrailingComma', 'Trailing comma'), ErrorCode.TrailingComma, { offset: commaOffset, length: 1 });
_errorAtRange(localize('TrailingComma', 'Trailing comma'), ErrorCode.TrailingComma, commaOffset, commaOffset + 1);
}

@@ -1164,5 +1087,5 @@ continue;

if (seen) {
problems.push({ location: { offset: node.keyNode.offset, length: node.keyNode.length }, message: localize('DuplicateKeyWarning', "Duplicate object key"), code: ErrorCode.Undefined, severity: ProblemSeverity.Warning });
_errorAtRange(localize('DuplicateKeyWarning', "Duplicate object key"), ErrorCode.DuplicateKey, node.keyNode.offset, node.keyNode.offset + node.keyNode.length, DiagnosticSeverity.Warning);
if (typeof seen === 'object') {
problems.push({ location: { offset: seen.keyNode.offset, length: seen.keyNode.length }, message: localize('DuplicateKeyWarning', "Duplicate object key"), code: ErrorCode.Undefined, severity: ProblemSeverity.Warning });
_errorAtRange(localize('DuplicateKeyWarning', "Duplicate object key"), ErrorCode.DuplicateKey, seen.keyNode.offset, seen.keyNode.offset + seen.keyNode.length, DiagnosticSeverity.Warning);
}

@@ -1210,3 +1133,3 @@ keysSeen[key.value] = true; // if the same key is duplicate again, avoid duplicate error reporting

if (needsComma) {
_errorAtRange(localize('TrailingComma', 'Trailing comma'), ErrorCode.TrailingComma, { offset: commaOffset, length: 1 });
_errorAtRange(localize('TrailingComma', 'Trailing comma'), ErrorCode.TrailingComma, commaOffset, commaOffset + 1);
}

@@ -1289,4 +1212,4 @@ continue;

}
return new JSONDocument(_root, problems, comments);
return new JSONDocument(_root, problems, commentRanges);
}
//# sourceMappingURL=jsonParser.js.map

@@ -39,3 +39,3 @@ /*---------------------------------------------------------------------------------------------

var offset = document.offsetAt(position);
var node = doc.getNodeFromOffsetEndInclusive(offset);
var node = doc.getNodeFromOffset(offset, true);
if (this.isInComment(document, node ? node.offset : 0, offset)) {

@@ -307,5 +307,4 @@ return Promise.resolve(result);

doc.visit(function (n) {
var p = n;
if (n.type === 'property' && p.keyNode.value === parentKey_3 && p.valueNode && p.valueNode.type === 'array') {
p.valueNode.items.forEach(collectSuggestionsForValues);
if (n.type === 'property' && n.keyNode.value === parentKey_3 && n.valueNode && n.valueNode.type === 'array') {
n.valueNode.items.forEach(collectSuggestionsForValues);
}

@@ -428,3 +427,3 @@ return true;

var hasProposals = false;
if (schema.default) {
if (isDefined(schema.default)) {
var type = schema.type;

@@ -452,3 +451,3 @@ var value = schema.default;

var filterText;
if (typeof value !== 'undefined') {
if (isDefined(value)) {
var type_1 = schema.type;

@@ -491,2 +490,11 @@ for (var i = arrayDepth; i > 0; i--) {

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: schema.description
});
}
if (Array.isArray(schema.enum)) {

@@ -510,3 +518,3 @@ for (var i = 0, length = schema.enum.length; i < length; i++) {

JSONCompletion.prototype.collectTypes = function (schema, types) {
if (Array.isArray(schema.enum)) {
if (Array.isArray(schema.enum) || isDefined(schema.const)) {
return;

@@ -685,3 +693,3 @@ }

var body = propertySchema.defaultSnippets[0].body;
if (typeof body !== 'undefined') {
if (isDefined(body)) {
value = this.getInsertTextForSnippetValue(body, '');

@@ -698,3 +706,3 @@ }

}
if (typeof propertySchema.default !== 'undefined') {
if (isDefined(propertySchema.default)) {
if (!value) {

@@ -798,2 +806,5 @@ value = this.getInsertTextForGuessedValue(propertySchema.default, '');

export { JSONCompletion };
function isDefined(val) {
return typeof val !== 'undefined';
}
//# sourceMappingURL=jsonCompletion.js.map

@@ -74,3 +74,3 @@ /*---------------------------------------------------------------------------------------------

return SymbolKind.Boolean;
default:// 'null'
default: // 'null'
return SymbolKind.Variable;

@@ -77,0 +77,0 @@ }

@@ -6,4 +6,4 @@ /*---------------------------------------------------------------------------------------------

'use strict';
import { ProblemSeverity, ErrorCode } from '../parser/jsonParser';
import { DiagnosticSeverity } from '../../vscode-languageserver-types/main';
import { Diagnostic, DiagnosticSeverity, Range } from '../../vscode-languageserver-types/main';
import { ErrorCode } from '../jsonLanguageTypes';
import * as nls from '../../../fillers/vscode-nls';

@@ -20,6 +20,6 @@ var localize = nls.loadMessageBundle();

this.validationEnabled = raw.validate;
this.commentSeverity = raw.allowComments ? ProblemSeverity.Ignore : ProblemSeverity.Error;
this.commentSeverity = raw.allowComments ? void 0 : DiagnosticSeverity.Error;
}
};
JSONValidation.prototype.doValidation = function (textDocument, jsonDocument, documentSettings) {
JSONValidation.prototype.doValidation = function (textDocument, jsonDocument, documentSettings, schema) {
var _this = this;

@@ -32,20 +32,12 @@ if (!this.validationEnabled) {

var addProblem = function (problem) {
if (problem.severity === ProblemSeverity.Ignore) {
return;
}
// remove duplicated messages
var signature = problem.location.offset + ' ' + problem.location.length + ' ' + problem.message;
var signature = problem.range.start.line + ' ' + problem.range.start.character + ' ' + problem.message;
if (!added[signature]) {
added[signature] = true;
var range = {
start: textDocument.positionAt(problem.location.offset),
end: textDocument.positionAt(problem.location.offset + problem.location.length)
};
var severity = problem.severity === ProblemSeverity.Error ? DiagnosticSeverity.Error : DiagnosticSeverity.Warning;
diagnostics.push({ severity: severity, range: range, message: problem.message });
diagnostics.push(problem);
}
};
return this.jsonSchemaService.getSchemaForResource(textDocument.uri, jsonDocument).then(function (schema) {
var trailingCommaSeverity = documentSettings ? documentSettings.trailingCommas : ProblemSeverity.Error;
var commentSeverity = documentSettings ? documentSettings.comments : _this.commentSeverity;
var getDiagnostics = function (schema) {
var trailingCommaSeverity = documentSettings ? toDiagnosticSeverity(documentSettings.trailingCommas) : DiagnosticSeverity.Error;
var commentSeverity = documentSettings ? toDiagnosticSeverity(documentSettings.comments) : _this.commentSeverity;
if (schema) {

@@ -57,10 +49,12 @@ if (schema.errors.length && jsonDocument.root) {

var node = property.valueNode || property;
addProblem({ location: { offset: node.offset, length: node.length }, message: schema.errors[0], severity: ProblemSeverity.Warning });
var range = Range.create(textDocument.positionAt(node.offset), textDocument.positionAt(node.offset + node.length));
addProblem(Diagnostic.create(range, schema.errors[0], DiagnosticSeverity.Warning, ErrorCode.SchemaResolveError));
}
else {
addProblem({ location: { offset: astRoot.offset, length: 1 }, message: schema.errors[0], severity: ProblemSeverity.Warning });
var range = 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(schema.schema);
var semanticErrors = jsonDocument.validate(textDocument, schema.schema);
if (semanticErrors) {

@@ -71,3 +65,3 @@ semanticErrors.forEach(addProblem);

if (schemaAllowsComments(schema.schema)) {
trailingCommaSeverity = commentSeverity = ProblemSeverity.Ignore;
trailingCommaSeverity = commentSeverity = void 0;
}

@@ -77,2 +71,5 @@ }

if (p.code === ErrorCode.TrailingComma) {
if (typeof commentSeverity !== 'number') {
return;
}
p.severity = trailingCommaSeverity;

@@ -82,10 +79,15 @@ }

});
diagnostics.push.apply(diagnostics, jsonDocument.externalDiagnostic);
if (commentSeverity !== ProblemSeverity.Ignore) {
if (typeof commentSeverity === 'number') {
var message_1 = localize('InvalidCommentToken', 'Comments are not permitted in JSON.');
jsonDocument.comments.forEach(function (c) {
addProblem({ location: c, severity: commentSeverity, message: message_1 });
addProblem(Diagnostic.create(c, message_1, commentSeverity, ErrorCode.CommentNotPermitted));
});
}
return diagnostics;
};
if (schema) {
return this.promise.resolve(getDiagnostics(schema));
}
return this.jsonSchemaService.getSchemaForResource(textDocument.uri, jsonDocument).then(function (schema) {
return getDiagnostics(schema);
});

@@ -107,2 +109,10 @@ };

}
function toDiagnosticSeverity(severityLevel) {
switch (severityLevel) {
case 'error': return DiagnosticSeverity.Error;
case 'warning': return DiagnosticSeverity.Warning;
case 'ignore': return void 0;
}
return void 0;
}
//# sourceMappingURL=jsonValidation.js.map

@@ -26,3 +26,3 @@ /* --------------------------------------------------------------------------------------------

var candidate = value;
return Is.defined(candidate) && Is.number(candidate.line) && Is.number(candidate.character);
return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character);
}

@@ -54,3 +54,3 @@ Position.is = is;

var candidate = value;
return Is.defined(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
}

@@ -84,4 +84,168 @@ Range.is = is;

/**
* The diagnostic's serverity.
* The Color namespace provides helper functions to work with
* [Color](#Color) literals.
*/
export 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.
*/
export 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.
*/
export 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
*/
export 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.
*/
export 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.
*/
export 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.
*/
export var DiagnosticSeverity;

@@ -115,3 +279,3 @@ (function (DiagnosticSeverity) {

*/
function create(range, message, severity, code, source) {
function create(range, message, severity, code, source, relatedInformation) {
var result = { range: range, message: message };

@@ -127,2 +291,5 @@ if (Is.defined(severity)) {

}
if (Is.defined(relatedInformation)) {
result.relatedInformation = relatedInformation;
}
return result;

@@ -141,3 +308,4 @@ }

&& (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))
&& (Is.string(candidate.source) || Is.undefined(candidate.source));
&& (Is.string(candidate.source) || Is.undefined(candidate.source))
&& (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
}

@@ -172,3 +340,3 @@ Diagnostic.is = is;

var candidate = value;
return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.title);
return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
}

@@ -209,2 +377,9 @@ Command.is = is;

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 = {}));

@@ -232,2 +407,12 @@ /**

})(TextDocumentEdit || (TextDocumentEdit = {}));
export var WorkspaceEdit;
(function (WorkspaceEdit) {
function is(value) {
var candidate = value;
return candidate &&
(candidate.changes !== void 0 || candidate.documentChanges !== void 0) &&
(candidate.documentChanges === void 0 || Is.typedArray(candidate.documentChanges, TextDocumentEdit.is));
}
WorkspaceEdit.is = is;
})(WorkspaceEdit || (WorkspaceEdit = {}));
var TextEditChangeImpl = /** @class */ (function () {

@@ -428,2 +613,23 @@ function TextEditChangeImpl(edits) {

})(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 = {}));
export 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 = {}));
/**

@@ -525,3 +731,24 @@ * The kind of a completion entry.

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 = {}));
export var Hover;
(function (Hover) {
/**
* Checks whether the given value conforms to the [Hover](#Hover) interface.
*/
function is(value) {
var candidate = value;
return 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 = {}));
/**

@@ -576,3 +803,3 @@ * The ParameterInformation namespace provides helper functions to work with

/**
* A textual occurrance.
* A textual occurrence.
*/

@@ -649,3 +876,3 @@ DocumentHighlightKind.Text = 1;

* @param uri The resource of the location of symbol, defaults to the current document.
* @param containerName The name of the symbol containg the symbol.
* @param containerName The name of the symbol containing the symbol.
*/

@@ -666,2 +893,112 @@ function create(name, kind, range, uri, containerName) {

/**
* 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;
}());
export { 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.string(candidate.detail) && Is.number(candidate.kind) &&
Range.is(candidate.range) && Range.is(candidate.selectionRange) &&
(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
*/
export 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

@@ -675,4 +1012,8 @@ * [CodeActionContext](#CodeActionContext) literals.

*/
function create(diagnostics) {
return { diagnostics: diagnostics };
function create(diagnostics, only) {
var result = { diagnostics: diagnostics };
if (only !== void 0 && only !== null) {
result.only = only;
}
return result;
}

@@ -685,6 +1026,33 @@ CodeActionContext.create = create;

var candidate = value;
return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is);
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 = {}));
export 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 = {}));
/**

@@ -755,4 +1123,4 @@ * The CodeLens namespace provides helper functions to work with

*/
function create(range, target) {
return { range: range, target: target };
function create(range, target, data) {
return { range: range, target: target, data: data };
}

@@ -798,3 +1166,3 @@ DocumentLink.create = create;

}
return 0;
return diff;
});

@@ -1003,2 +1371,9 @@ var lastModifiedOffset = text.length;

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) {

@@ -1005,0 +1380,0 @@ return Array.isArray(value) && value.every(check);

@@ -6,12 +6,71 @@ /*---------------------------------------------------------------------------------------------

'use strict';
function _encode(ch) {
return '%' + ch.charCodeAt(0).toString(16).toUpperCase();
var __extends = (this && this.__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';
}
// see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
function encodeURIComponent2(str) {
return encodeURIComponent(str).replace(/[!'()*]/g, _encode);
else if (typeof navigator === 'object') {
var userAgent = navigator.userAgent;
isWindows = userAgent.indexOf('Windows') >= 0;
}
function encodeNoop(str) {
return str.replace(/[#?]/, _encode);
//#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 = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
/**

@@ -34,10 +93,24 @@ * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.

var URI = (function () {
function URI() {
this._scheme = URI._empty;
this._authority = URI._empty;
this._path = URI._empty;
this._query = URI._empty;
this._fragment = URI._empty;
this._formatted = null;
this._fsPath = null;
/**
* @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);
}
}

@@ -57,54 +130,2 @@ URI.isUri = function (thing) {

};
Object.defineProperty(URI.prototype, "scheme", {
/**
* scheme is the 'http' part of 'http://www.msft.com/some/path?query#fragment'.
* The part before the first colon.
*/
get: function () {
return this._scheme;
},
enumerable: true,
configurable: true
});
Object.defineProperty(URI.prototype, "authority", {
/**
* authority is the 'www.msft.com' part of 'http://www.msft.com/some/path?query#fragment'.
* The part between the first double slashes and the next slash.
*/
get: function () {
return this._authority;
},
enumerable: true,
configurable: true
});
Object.defineProperty(URI.prototype, "path", {
/**
* path is the '/some/path' part of 'http://www.msft.com/some/path?query#fragment'.
*/
get: function () {
return this._path;
},
enumerable: true,
configurable: true
});
Object.defineProperty(URI.prototype, "query", {
/**
* query is the 'query' part of 'http://www.msft.com/some/path?query#fragment'.
*/
get: function () {
return this._query;
},
enumerable: true,
configurable: true
});
Object.defineProperty(URI.prototype, "fragment", {
/**
* fragment is the 'fragment' part of 'http://www.msft.com/some/path?query#fragment'.
*/
get: function () {
return this._fragment;
},
enumerable: true,
configurable: true
});
Object.defineProperty(URI.prototype, "fsPath", {

@@ -119,22 +140,3 @@ // ---- filesystem path -----------------------

get: function () {
if (!this._fsPath) {
var value;
if (this._authority && this._path && this.scheme === 'file') {
// unc path: file://shares/c$/far/boo
value = "//" + this._authority + this._path;
}
else if (URI._driveLetterPath.test(this._path)) {
// windows drive letter: file:///c:/far/boo
value = this._path[1].toLowerCase() + this._path.substr(2);
}
else {
// other path
value = this._path;
}
if (isWindows) {
value = value.replace(/\//g, '\\');
}
this._fsPath = value;
}
return this._fsPath;
return _makeFsPath(this);
},

@@ -154,3 +156,3 @@ enumerable: true,

else if (scheme === null) {
scheme = '';
scheme = _empty;
}

@@ -161,3 +163,3 @@ if (authority === void 0) {

else if (authority === null) {
authority = '';
authority = _empty;
}

@@ -168,3 +170,3 @@ if (path === void 0) {

else if (path === null) {
path = '';
path = _empty;
}

@@ -175,3 +177,3 @@ if (query === void 0) {

else if (query === null) {
query = '';
query = _empty;
}

@@ -182,3 +184,3 @@ if (fragment === void 0) {

else if (fragment === null) {
fragment = '';
fragment = _empty;
}

@@ -192,100 +194,38 @@ if (scheme === this.scheme

}
var ret = new URI();
ret._scheme = scheme;
ret._authority = authority;
ret._path = path;
ret._query = query;
ret._fragment = fragment;
URI._validate(ret);
return ret;
return new _URI(scheme, authority, path, query, fragment);
};
// ---- parse & validate ------------------------
URI.parse = function (value) {
var ret = new URI();
var data = URI._parseComponents(value);
ret._scheme = data.scheme;
ret._authority = decodeURIComponent(data.authority);
ret._path = decodeURIComponent(data.path);
ret._query = decodeURIComponent(data.query);
ret._fragment = decodeURIComponent(data.fragment);
URI._validate(ret);
return ret;
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));
};
URI.file = function (path) {
var ret = new URI();
ret._scheme = 'file';
var authority = _empty;
// normalize to fwd-slashes on windows,
// on other systems bwd-slaches are valid
// on other systems bwd-slashes are valid
// filename character, eg /f\oo/ba\r.txt
if (isWindows) {
path = path.replace(/\\/g, URI._slash);
path = path.replace(/\\/g, _slash);
}
// check for authority as used in UNC shares
// or use the path as given
if (path[0] === URI._slash && path[0] === path[1]) {
var idx = path.indexOf(URI._slash, 2);
if (path[0] === _slash && path[1] === _slash) {
var idx = path.indexOf(_slash, 2);
if (idx === -1) {
ret._authority = path.substring(2);
authority = path.substring(2);
path = _slash;
}
else {
ret._authority = path.substring(2, idx);
ret._path = path.substring(idx);
authority = path.substring(2, idx);
path = path.substring(idx) || _slash;
}
}
else {
ret._path = path;
}
// Ensure that path starts with a slash
// or that it is at least a slash
if (ret._path[0] !== URI._slash) {
ret._path = URI._slash + ret._path;
}
URI._validate(ret);
return ret;
return new _URI('file', authority, path, _empty, _empty);
};
URI._parseComponents = function (value) {
var ret = {
scheme: URI._empty,
authority: URI._empty,
path: URI._empty,
query: URI._empty,
fragment: URI._empty,
};
var match = URI._regexp.exec(value);
if (match) {
ret.scheme = match[2] || ret.scheme;
ret.authority = match[4] || ret.authority;
ret.path = match[5] || ret.path;
ret.query = match[7] || ret.query;
ret.fragment = match[9] || ret.fragment;
}
return ret;
};
URI.from = function (components) {
return new URI().with(components);
return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment);
};
URI._validate = function (ret) {
// scheme, https://tools.ietf.org/html/rfc3986#section-3.1
// ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
if (ret.scheme && !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 (!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 (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 ("//")');
}
}
}
};
// ---- printing/externalize ---------------------------

@@ -298,5 +238,48 @@ /**

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;
}());
export 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 = URI._asFormatted(this, false);
this._formatted = _asFormatted(this, false);
}

@@ -307,68 +290,17 @@ return this._formatted;

// we don't cache that
return URI._asFormatted(this, true);
return _asFormatted(this, true);
}
};
URI._asFormatted = function (uri, skipEncoding) {
var encoder = !skipEncoding
? encodeURIComponent2
: encodeNoop;
var parts = [];
var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment;
if (scheme) {
parts.push(scheme, ':');
}
if (authority || scheme === 'file') {
parts.push('//');
}
if (authority) {
authority = authority.toLowerCase();
var idx = authority.indexOf(':');
if (idx === -1) {
parts.push(encoder(authority));
}
else {
parts.push(encoder(authority.substr(0, idx)), authority.substr(idx));
}
}
if (path) {
// lower-case windows drive letters in /C:/fff or C:/fff
var m = URI._upperCaseDrive.exec(path);
if (m) {
if (m[1]) {
path = '/' + m[2].toLowerCase() + path.substr(3); // "/c:".length === 3
}
else {
path = m[2].toLowerCase() + path.substr(2); // // "c:".length === 2
}
}
// encode every segement but not slashes
// make sure that # and ? are always encoded
// when occurring in paths - otherwise the result
// cannot be parsed back again
var lastIdx = 0;
while (true) {
var idx = path.indexOf(URI._slash, lastIdx);
if (idx === -1) {
parts.push(encoder(path.substring(lastIdx)));
break;
}
parts.push(encoder(path.substring(lastIdx, idx)), URI._slash);
lastIdx = idx + 1;
}
;
}
if (query) {
parts.push('?', encoder(query));
}
if (fragment) {
parts.push('#', encoder(fragment));
}
return parts.join(URI._empty);
};
URI.prototype.toJSON = function () {
_URI.prototype.toJSON = function () {
var res = {
fsPath: this.fsPath,
external: this.toString(),
$mid: 1
};
// cached state
if (this._fsPath) {
res.fsPath = this._fsPath;
}
if (this._formatted) {
res.external = this._formatted;
}
// uri components
if (this.path) {

@@ -391,32 +323,193 @@ res.path = this.path;

};
URI.revive = function (data) {
var result = new URI();
result._scheme = data.scheme || URI._empty;
result._authority = data.authority || URI._empty;
result._path = data.path || URI._empty;
result._query = data.query || URI._empty;
result._fragment = data.fragment || URI._empty;
result._fsPath = data.fsPath;
result._formatted = data.external;
URI._validate(result);
return result;
};
return URI;
}());
export default URI;
URI._empty = '';
URI._slash = '/';
URI._regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
URI._driveLetterPath = /^\/[a-zA-z]:/;
URI._upperCaseDrive = /^(\/)?([A-Z]:)/;
URI._schemePattern = /^\w[\w\d+.-]*$/;
URI._singleSlashStart = /^\//;
URI._doubleSlashStart = /^\/\//;
var isWindows;
if (typeof process === 'object') {
isWindows = process.platform === 'win32';
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;
}
else if (typeof navigator === 'object') {
var userAgent = navigator.userAgent;
isWindows = userAgent.indexOf('Windows') >= 0;
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) {
// <user>@<auth>
var userinfo = authority.substr(0, idx);
authority = authority.substr(idx + 1);
idx = userinfo.indexOf(':');
if (idx === -1) {
res += encoder(userinfo, false);
}
else {
// <user>:<pass>@<auth>
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 {
// <auth>:<port>
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 += encoder(fragment, false);
}
return res;
}
var _a;

@@ -30,2 +30,3 @@ /*---------------------------------------------------------------------------------------------

disposables.push(monaco.languages.registerColorProvider(languageId, new languageFeatures.DocumentColorAdapter(worker)));
disposables.push(monaco.languages.registerFoldingRangeProvider(languageId, new languageFeatures.FoldingRangeAdapter(worker)));
}

@@ -32,0 +33,0 @@ var richEditConfiguration = {

@@ -89,2 +89,7 @@ /*---------------------------------------------------------------------------------------------

};
JSONWorker.prototype.provideFoldingRanges = function (uri, context) {
var document = this._getTextDocument(uri);
var ranges = this._languageService.getFoldingRanges(document, context);
return Promise.as(ranges);
};
JSONWorker.prototype._getTextDocument = function (uri) {

@@ -91,0 +96,0 @@ var models = this._ctx.getMirrorModels();

@@ -375,5 +375,7 @@ /*---------------------------------------------------------------------------------------------

name: item.name,
detail: '',
containerName: item.containerName,
kind: toSymbolKind(item.kind),
location: toLocation(item.location)
range: toRange(item.location.range),
selectionRange: toRange(item.location.range)
}); });

@@ -466,2 +468,35 @@ }));

export { DocumentColorAdapter };
var FoldingRangeAdapter = /** @class */ (function () {
function FoldingRangeAdapter(_worker) {
this._worker = _worker;
}
FoldingRangeAdapter.prototype.provideFoldingRanges = function (model, context, token) {
var resource = model.uri;
return wireCancellationToken(token, this._worker(resource).then(function (worker) { return worker.provideFoldingRanges(resource.toString(), context); }).then(function (ranges) {
if (!ranges) {
return;
}
return ranges.map(function (range) {
var result = {
start: range.startLine + 1,
end: range.endLine + 1
};
if (typeof range.kind !== 'undefined') {
result.kind = toFoldingRangeKind(range.kind);
}
return result;
});
}));
};
return FoldingRangeAdapter;
}());
export { FoldingRangeAdapter };
function toFoldingRangeKind(kind) {
switch (kind) {
case ls.FoldingRangeKind.Comment: return monaco.languages.FoldingRangeKind.Comment;
case ls.FoldingRangeKind.Imports: return monaco.languages.FoldingRangeKind.Imports;
case ls.FoldingRangeKind.Region: return monaco.languages.FoldingRangeKind.Region;
}
return void 0;
}
/**

@@ -468,0 +503,0 @@ * Hook a cancellation token to a WinJS Promise

/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* monaco-json version: 2.1.1(0e6ea95f4f4e093db9201c502e8d401391803233)
* monaco-json version: 2.2.0(370169f666a52e1b91623841799be4eab9204094)
* Released under the MIT license
* https://github.com/Microsoft/monaco-json/blob/master/LICENSE.md
*-----------------------------------------------------------------------------*/
define("vs/language/json/workerManager",["require","exports"],function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u=monaco.Promise,n=function(){function e(e){var t=this;this._defaults=e,this._worker=null,this._idleCheckInterval=setInterval(function(){return t._checkIfIdle()},3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(function(){return t._stopWorker()})}return e.prototype._stopWorker=function(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null},e.prototype.dispose=function(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()},e.prototype._checkIfIdle=function(){this._worker&&(12e4<Date.now()-this._lastUsedTime&&this._stopWorker())},e.prototype._getClient=function(){return this._lastUsedTime=Date.now(),this._client||(this._worker=monaco.editor.createWebWorker({moduleId:"vs/language/json/jsonWorker",label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client},e.prototype.getLanguageServiceWorker=function(){for(var t,e,n,r,o,i=this,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return e=this._getClient().then(function(e){t=e}).then(function(e){return i._worker.withSyncedResources(a)}).then(function(e){return t}),o=new u(function(e,t){n=e,r=t},function(){}),e.then(n,r),o},e}();t.WorkerManager=n}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-languageserver-types/main",["require","exports"],e)}(function(e,t){"use strict";var a,n,r,o,i,s,u,c,f,l,d,g,h;Object.defineProperty(t,"__esModule",{value:!0}),(n=a=t.Position||(t.Position={})).create=function(e,t){return{line:e,character:t}},n.is=function(e){var t=e;return K.defined(t)&&K.number(t.line)&&K.number(t.character)},(o=r=t.Range||(t.Range={})).create=function(e,t,n,r){if(K.number(e)&&K.number(t)&&K.number(n)&&K.number(r))return{start:a.create(e,t),end:a.create(n,r)};if(a.is(e)&&a.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments["+e+", "+t+", "+n+", "+r+"]")},o.is=function(e){var t=e;return K.defined(t)&&a.is(t.start)&&a.is(t.end)},(i=t.Location||(t.Location={})).create=function(e,t){return{uri:e,range:t}},i.is=function(e){var t=e;return K.defined(t)&&r.is(t.range)&&(K.string(t.uri)||K.undefined(t.uri))},(s=t.DiagnosticSeverity||(t.DiagnosticSeverity={})).Error=1,s.Warning=2,s.Information=3,s.Hint=4,(c=u=t.Diagnostic||(t.Diagnostic={})).create=function(e,t,n,r,o){var i={range:e,message:t};return K.defined(n)&&(i.severity=n),K.defined(r)&&(i.code=r),K.defined(o)&&(i.source=o),i},c.is=function(e){var t=e;return K.defined(t)&&r.is(t.range)&&K.string(t.message)&&(K.number(t.severity)||K.undefined(t.severity))&&(K.number(t.code)||K.string(t.code)||K.undefined(t.code))&&(K.string(t.source)||K.undefined(t.source))},(l=f=t.Command||(t.Command={})).create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o={title:e,command:t};return K.defined(n)&&0<n.length&&(o.arguments=n),o},l.is=function(e){var t=e;return K.defined(t)&&K.string(t.title)&&K.string(t.title)},(g=d=t.TextEdit||(t.TextEdit={})).replace=function(e,t){return{range:e,newText:t}},g.insert=function(e,t){return{range:{start:e,end:e},newText:t}},g.del=function(e){return{range:e,newText:""}},(h=t.TextDocumentEdit||(t.TextDocumentEdit={})).create=function(e,t){return{textDocument:e,edits:t}},h.is=function(e){var t=e;return K.defined(t)&&m.is(t.textDocument)&&Array.isArray(t.edits)};var p,m,v,y,b,k,_,C,E,T,S,w,O=function(){function e(e){this.edits=e}return e.prototype.insert=function(e,t){this.edits.push(d.insert(e,t))},e.prototype.replace=function(e,t){this.edits.push(d.replace(e,t))},e.prototype.delete=function(e){this.edits.push(d.del(e))},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}(),x=function(){function e(n){var r=this;this._textEditChanges=Object.create(null),n&&((this._workspaceEdit=n).documentChanges?n.documentChanges.forEach(function(e){var t=new O(e.edits);r._textEditChanges[e.textDocument.uri]=t}):n.changes&&Object.keys(n.changes).forEach(function(e){var t=new O(n.changes[e]);r._textEditChanges[e]=t}))}return Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(e){if(m.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for versioned document changes.");var t=e;if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:o=[]};this._workspaceEdit.documentChanges.push(n),r=new O(o),this._textEditChanges[t.uri]=r}return r}if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var o=[];this._workspaceEdit.changes[e]=o,r=new O(o),this._textEditChanges[e]=r}return r},e}();t.WorkspaceChange=x,(p=t.TextDocumentIdentifier||(t.TextDocumentIdentifier={})).create=function(e){return{uri:e}},p.is=function(e){var t=e;return K.defined(t)&&K.string(t.uri)},(v=m=t.VersionedTextDocumentIdentifier||(t.VersionedTextDocumentIdentifier={})).create=function(e,t){return{uri:e,version:t}},v.is=function(e){var t=e;return K.defined(t)&&K.string(t.uri)&&K.number(t.version)},(y=t.TextDocumentItem||(t.TextDocumentItem={})).create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},y.is=function(e){var t=e;return K.defined(t)&&K.string(t.uri)&&K.string(t.languageId)&&K.number(t.version)&&K.string(t.text)},(b=t.MarkupKind||(t.MarkupKind={})).PlainText="plaintext",b.Markdown="markdown",(k=t.CompletionItemKind||(t.CompletionItemKind={})).Text=1,k.Method=2,k.Function=3,k.Constructor=4,k.Field=5,k.Variable=6,k.Class=7,k.Interface=8,k.Module=9,k.Property=10,k.Unit=11,k.Value=12,k.Enum=13,k.Keyword=14,k.Snippet=15,k.Color=16,k.File=17,k.Reference=18,k.Folder=19,k.EnumMember=20,k.Constant=21,k.Struct=22,k.Event=23,k.Operator=24,k.TypeParameter=25,(_=t.InsertTextFormat||(t.InsertTextFormat={})).PlainText=1,_.Snippet=2,(t.CompletionItem||(t.CompletionItem={})).create=function(e){return{label:e}},(t.CompletionList||(t.CompletionList={})).create=function(e,t){return{items:e||[],isIncomplete:!!t}},(t.MarkedString||(t.MarkedString={})).fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},(t.ParameterInformation||(t.ParameterInformation={})).create=function(e,t){return t?{label:e,documentation:t}:{label:e}},(t.SignatureInformation||(t.SignatureInformation={})).create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o={label:e};return K.defined(t)&&(o.documentation=t),K.defined(n)?o.parameters=n:o.parameters=[],o},(C=t.DocumentHighlightKind||(t.DocumentHighlightKind={})).Text=1,C.Read=2,C.Write=3,(t.DocumentHighlight||(t.DocumentHighlight={})).create=function(e,t){var n={range:e};return K.number(t)&&(n.kind=t),n},(E=t.SymbolKind||(t.SymbolKind={})).File=1,E.Module=2,E.Namespace=3,E.Package=4,E.Class=5,E.Method=6,E.Property=7,E.Field=8,E.Constructor=9,E.Enum=10,E.Interface=11,E.Function=12,E.Variable=13,E.Constant=14,E.String=15,E.Number=16,E.Boolean=17,E.Array=18,E.Object=19,E.Key=20,E.Null=21,E.EnumMember=22,E.Struct=23,E.Event=24,E.Operator=25,E.TypeParameter=26,(t.SymbolInformation||(t.SymbolInformation={})).create=function(e,t,n,r,o){var i={name:e,kind:t,location:{uri:r,range:n}};return o&&(i.containerName=o),i},(T=t.CodeActionContext||(t.CodeActionContext={})).create=function(e){return{diagnostics:e}},T.is=function(e){var t=e;return K.defined(t)&&K.typedArray(t.diagnostics,u.is)},(S=t.CodeLens||(t.CodeLens={})).create=function(e,t){var n={range:e};return K.defined(t)&&(n.data=t),n},S.is=function(e){var t=e;return K.defined(t)&&r.is(t.range)&&(K.undefined(t.command)||f.is(t.command))},(w=t.FormattingOptions||(t.FormattingOptions={})).create=function(e,t){return{tabSize:e,insertSpaces:t}},w.is=function(e){var t=e;return K.defined(t)&&K.number(t.tabSize)&&K.boolean(t.insertSpaces)};var A,I,M,j=function(){};t.DocumentLink=j,(A=j=t.DocumentLink||(t.DocumentLink={})).create=function(e,t){return{range:e,target:t}},A.is=function(e){var t=e;return K.defined(t)&&r.is(t.range)&&(K.undefined(t.target)||K.string(t.target))},t.DocumentLink=j,t.EOL=["\n","\r\n","\r"],(I=t.TextDocument||(t.TextDocument={})).create=function(e,t,n,r){return new P(e,t,n,r)},I.is=function(e){var t=e;return!!(K.defined(t)&&K.string(t.uri)&&(K.undefined(t.languageId)||K.string(t.languageId))&&K.number(t.lineCount)&&K.func(t.getText)&&K.func(t.positionAt)&&K.func(t.offsetAt))},I.applyEdits=function(e,t){for(var n=e.getText(),r=function e(t,n){if(t.length<=1)return t;var r=t.length/2|0,o=t.slice(0,r),i=t.slice(r);e(o,n),e(i,n);for(var a=0,s=0,u=0;a<o.length&&s<i.length;){var c=n(o[a],i[s]);t[u++]=c<=0?o[a++]:i[s++]}for(;a<o.length;)t[u++]=o[a++];for(;s<i.length;)t[u++]=i[s++];return t}(t,function(e,t){return 0==e.range.start.line-t.range.start.line?e.range.start.character-t.range.start.character:0}),o=n.length,i=r.length-1;0<=i;i--){var a=r[i],s=e.offsetAt(a.range.start),u=e.offsetAt(a.range.end);if(!(u<=o))throw new Error("Ovelapping edit");n=n.substring(0,s)+a.newText+n.substring(u,n.length),o=s}return n},(M=t.TextDocumentSaveReason||(t.TextDocumentSaveReason={})).Manual=1,M.AfterDelay=2,M.FocusOut=3;var K,L,D,P=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=null}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=null},e.prototype.getLineOffsets=function(){if(null===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r<t.length;r++){n&&(e.push(r),n=!1);var o=t.charAt(r);n="\r"===o||"\n"===o,"\r"===o&&r+1<t.length&&"\n"===t.charAt(r+1)&&r++}n&&0<t.length&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return a.create(0,e);for(;n<r;){var o=Math.floor((n+r)/2);t[o]>e?r=o:n=o+1}var i=n-1;return a.create(i,e-t[i])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),e}();L=K||(K={}),D=Object.prototype.toString,L.defined=function(e){return void 0!==e},L.undefined=function(e){return void 0===e},L.boolean=function(e){return!0===e||!1===e},L.string=function(e){return"[object String]"===D.call(e)},L.number=function(e){return"[object Number]"===D.call(e)},L.func=function(e){return"[object Function]"===D.call(e)},L.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}}),define("vscode-languageserver-types",["vscode-languageserver-types/main"],function(e){return e}),define("vs/language/json/languageFeatures",["require","exports","vscode-languageserver-types"],function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=monaco.Uri,n=monaco.Range,o=function(){function e(e,t,n){var r=this;this._languageId=e,this._worker=t,this._disposables=[],this._listener=Object.create(null);var o=function(e){var t,n=e.getModeId();n===r._languageId&&(r._listener[e.uri.toString()]=e.onDidChangeContent(function(){clearTimeout(t),t=setTimeout(function(){return r._doValidate(e.uri,n)},500)}),r._doValidate(e.uri,n))},i=function(e){monaco.editor.setModelMarkers(e,r._languageId,[]);var t=e.uri.toString(),n=r._listener[t];n&&(n.dispose(),delete r._listener[t])};this._disposables.push(monaco.editor.onDidCreateModel(o)),this._disposables.push(monaco.editor.onWillDisposeModel(function(e){i(e),r._resetSchema(e.uri)})),this._disposables.push(monaco.editor.onDidChangeModelLanguage(function(e){i(e.model),o(e.model),r._resetSchema(e.model.uri)})),this._disposables.push(n.onDidChange(function(e){monaco.editor.getModels().forEach(function(e){e.getModeId()===r._languageId&&(i(e),o(e))})})),this._disposables.push({dispose:function(){for(var e in monaco.editor.getModels().forEach(i),r._listener)r._listener[e].dispose()}}),monaco.editor.getModels().forEach(o)}return e.prototype.dispose=function(){this._disposables.forEach(function(e){return e&&e.dispose()}),this._disposables=[]},e.prototype._resetSchema=function(t){this._worker().then(function(e){e.resetSchema(t.toString())})},e.prototype._doValidate=function(r,o){this._worker(r).then(function(e){return e.doValidation(r.toString()).then(function(e){var t=e.map(function(e){return n="number"==typeof(t=e).code?String(t.code):t.code,{severity:function(e){switch(e){case i.DiagnosticSeverity.Error:return monaco.MarkerSeverity.Error;case i.DiagnosticSeverity.Warning:return monaco.MarkerSeverity.Warning;case i.DiagnosticSeverity.Information:return monaco.MarkerSeverity.Info;case i.DiagnosticSeverity.Hint:return monaco.MarkerSeverity.Hint;default:return monaco.MarkerSeverity.Info}}(t.severity),startLineNumber:t.range.start.line+1,startColumn:t.range.start.character+1,endLineNumber:t.range.end.line+1,endColumn:t.range.end.character+1,message:t.message,code:n,source:t.source};var t,n}),n=monaco.editor.getModel(r);n.getModeId()===o&&monaco.editor.setModelMarkers(n,o,t)})}).then(void 0,function(e){console.error(e)})},e}();function a(e){if(e)return{character:e.column-1,line:e.lineNumber-1}}function s(e){if(e)return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function u(e){if(e)return new n(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function c(e){var t=monaco.languages.CompletionItemKind;switch(e){case i.CompletionItemKind.Text:return t.Text;case i.CompletionItemKind.Method:return t.Method;case i.CompletionItemKind.Function:return t.Function;case i.CompletionItemKind.Constructor:return t.Constructor;case i.CompletionItemKind.Field:return t.Field;case i.CompletionItemKind.Variable:return t.Variable;case i.CompletionItemKind.Class:return t.Class;case i.CompletionItemKind.Interface:return t.Interface;case i.CompletionItemKind.Module:return t.Module;case i.CompletionItemKind.Property:return t.Property;case i.CompletionItemKind.Unit:return t.Unit;case i.CompletionItemKind.Value:return t.Value;case i.CompletionItemKind.Enum:return t.Enum;case i.CompletionItemKind.Keyword:return t.Keyword;case i.CompletionItemKind.Snippet:return t.Snippet;case i.CompletionItemKind.Color:return t.Color;case i.CompletionItemKind.File:return t.File;case i.CompletionItemKind.Reference:return t.Reference}return t.Property}function f(e){if(e)return{range:u(e.range),text:e.newText}}t.DiagnosticsAdapter=o;var l=function(){function e(e){this._worker=e}return Object.defineProperty(e.prototype,"triggerCharacters",{get:function(){return[" ",":"]},enumerable:!0,configurable:!0}),e.prototype.provideCompletionItems=function(e,t,n){e.getWordUntilPosition(t);var r=e.uri;return b(n,this._worker(r).then(function(e){return e.doComplete(r.toString(),a(t))}).then(function(e){if(e){var t=e.items.map(function(e){var t={label:e.label,insertText:e.insertText,sortText:e.sortText,filterText:e.filterText,documentation:e.documentation,detail:e.detail,kind:c(e.kind)};return e.textEdit&&(t.range=u(e.textEdit.range),t.insertText=e.textEdit.newText),e.insertTextFormat===i.InsertTextFormat.Snippet&&(t.insertText={value:t.insertText}),t});return{isIncomplete:e.isIncomplete,items:t}}}))},e}();function d(e){return"string"==typeof e?{value:e}:(t=e)&&"object"==typeof t&&"string"==typeof t.kind?"plaintext"===e.kind?{value:e.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:e.value}:{value:"```"+e.language+"\n"+e.value+"\n```\n"};var t}t.CompletionAdapter=l;var g=function(){function e(e){this._worker=e}return e.prototype.provideHover=function(e,t,n){var r=e.uri;return b(n,this._worker(r).then(function(e){return e.doHover(r.toString(),a(t))}).then(function(e){if(e)return{range:u(e.range),contents:function(e){if(e)return Array.isArray(e)?e.map(d):[d(e)]}(e.contents)}}))},e}();t.HoverAdapter=g;var h=function(){function e(e){this._worker=e}return e.prototype.provideDocumentSymbols=function(e,t){var n=e.uri;return b(t,this._worker(n).then(function(e){return e.findDocumentSymbols(n.toString())}).then(function(e){if(e)return e.map(function(e){return{name:e.name,containerName:e.containerName,kind:function(e){var t=monaco.languages.SymbolKind;switch(e){case i.SymbolKind.File:return t.Array;case i.SymbolKind.Module:return t.Module;case i.SymbolKind.Namespace:return t.Namespace;case i.SymbolKind.Package:return t.Package;case i.SymbolKind.Class:return t.Class;case i.SymbolKind.Method:return t.Method;case i.SymbolKind.Property:return t.Property;case i.SymbolKind.Field:return t.Field;case i.SymbolKind.Constructor:return t.Constructor;case i.SymbolKind.Enum:return t.Enum;case i.SymbolKind.Interface:return t.Interface;case i.SymbolKind.Function:return t.Function;case i.SymbolKind.Variable:return t.Variable;case i.SymbolKind.Constant:return t.Constant;case i.SymbolKind.String:return t.String;case i.SymbolKind.Number:return t.Number;case i.SymbolKind.Boolean:return t.Boolean;case i.SymbolKind.Array:return t.Array}return t.Function}(e.kind),location:(t=e.location,{uri:r.parse(t.uri),range:u(t.range)})};var t})}))},e}();function p(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}t.DocumentSymbolAdapter=h;var m=function(){function e(e){this._worker=e}return e.prototype.provideDocumentFormattingEdits=function(e,t,n){var r=e.uri;return b(n,this._worker(r).then(function(e){return e.format(r.toString(),null,p(t)).then(function(e){if(e&&0!==e.length)return e.map(f)})}))},e}();t.DocumentFormattingEditProvider=m;var v=function(){function e(e){this._worker=e}return e.prototype.provideDocumentRangeFormattingEdits=function(e,t,n,r){var o=e.uri;return b(r,this._worker(o).then(function(e){return e.format(o.toString(),s(t),p(n)).then(function(e){if(e&&0!==e.length)return e.map(f)})}))},e}();t.DocumentRangeFormattingEditProvider=v;var y=function(){function e(e){this._worker=e}return e.prototype.provideDocumentColors=function(e,t){var n=e.uri;return b(t,this._worker(n).then(function(e){return e.findDocumentColors(n.toString())}).then(function(e){if(e)return e.map(function(e){return{color:e.color,range:u(e.range)}})}))},e.prototype.provideColorPresentations=function(e,t,n){var r=e.uri;return b(n,this._worker(r).then(function(e){return e.getColorPresentations(r.toString(),t.color,s(t.range))}).then(function(e){if(e)return e.map(function(e){var t={label:e.label};return e.textEdit&&(t.textEdit=f(e.textEdit)),e.additionalTextEdits&&(t.additionalTextEdits=e.additionalTextEdits.map(f)),t})}))},e}();function b(e,t){return t.cancel&&e.onCancellationRequested(function(){return t.cancel()}),t}t.DocumentColorAdapter=y}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("jsonc-parser/impl/scanner",["require","exports"],e)}(function(e,t){"use strict";function d(e){return 32===e||9===e||11===e||12===e||160===e||5760===e||8192<=e&&e<=8203||8239===e||8287===e||12288===e||65279===e}function g(e){return 10===e||13===e||8232===e||8233===e}function h(e){return 48<=e&&e<=57}Object.defineProperty(t,"__esModule",{value:!0}),t.createScanner=function(i,e){void 0===e&&(e=!1);var a=0,o=i.length,r="",s=0,u=16,c=0;function f(e,t){for(var n=0,r=0;n<e||!t;){var o=i.charCodeAt(a);if(48<=o&&o<=57)r=16*r+o-48;else if(65<=o&&o<=70)r=16*r+o-65+10;else{if(!(97<=o&&o<=102))break;r=16*r+o-97+10}a++,n++}return n<e&&(r=-1),r}function t(){if(r="",c=0,o<=(s=a))return s=o,u=17;var e=i.charCodeAt(a);if(d(e)){for(;a++,r+=String.fromCharCode(e),d(e=i.charCodeAt(a)););return u=15}if(g(e))return a++,r+=String.fromCharCode(e),13===e&&10===i.charCodeAt(a)&&(a++,r+="\n"),u=14;switch(e){case 123:return a++,u=1;case 125:return a++,u=2;case 91:return a++,u=3;case 93:return a++,u=4;case 58:return a++,u=6;case 44:return a++,u=5;case 34:return a++,r=function(){for(var e="",t=a;;){if(o<=a){e+=i.substring(t,a),c=2;break}var n=i.charCodeAt(a);if(34===n){e+=i.substring(t,a),a++;break}if(92!==n){if(0<=n&&n<=31){if(g(n)){e+=i.substring(t,a),c=2;break}c=6}a++}else{if(e+=i.substring(t,a),o<=++a){c=2;break}switch(n=i.charCodeAt(a++)){case 34:e+='"';break;case 92:e+="\\";break;case 47:e+="/";break;case 98:e+="\b";break;case 102:e+="\f";break;case 110:e+="\n";break;case 114:e+="\r";break;case 116:e+="\t";break;case 117:var r=f(4,!0);0<=r?e+=String.fromCharCode(r):c=4;break;default:c=5}t=a}}return e}(),u=10;case 47:var t=a-1;if(47===i.charCodeAt(a+1)){for(a+=2;a<o&&!g(i.charCodeAt(a));)a++;return r=i.substring(t,a),u=12}if(42===i.charCodeAt(a+1)){a+=2;for(var n=!1;a<o;){if(42===i.charCodeAt(a)&&a+1<o&&47===i.charCodeAt(a+1)){a+=2,n=!0;break}a++}return n||(a++,c=1),r=i.substring(t,a),u=13}return r+=String.fromCharCode(e),a++,u=16;case 45:if(r+=String.fromCharCode(e),++a===o||!h(i.charCodeAt(a)))return u=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return r+=function(){var e=a;if(48===i.charCodeAt(a))a++;else for(a++;a<i.length&&h(i.charCodeAt(a));)a++;if(a<i.length&&46===i.charCodeAt(a)){if(!(++a<i.length&&h(i.charCodeAt(a))))return c=3,i.substring(e,a);for(a++;a<i.length&&h(i.charCodeAt(a));)a++}var t=a;if(a<i.length&&(69===i.charCodeAt(a)||101===i.charCodeAt(a)))if((++a<i.length&&43===i.charCodeAt(a)||45===i.charCodeAt(a))&&a++,a<i.length&&h(i.charCodeAt(a))){for(a++;a<i.length&&h(i.charCodeAt(a));)a++;t=a}else c=3;return i.substring(e,t)}(),u=11;default:for(;a<o&&l(e);)a++,e=i.charCodeAt(a);if(s!==a){switch(r=i.substring(s,a)){case"true":return u=8;case"false":return u=9;case"null":return u=7}return u=16}return r+=String.fromCharCode(e),a++,u=16}}function l(e){if(d(e)||g(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:return!1}return!0}return{setPosition:function(e){a=e,r="",u=16,c=s=0},getPosition:function(){return a},scan:e?function(){for(var e;12<=(e=t())&&e<=15;);return e}:t,getToken:function(){return u},getTokenValue:function(){return r},getTokenOffset:function(){return s},getTokenLength:function(){return a-s},getTokenError:function(){return c}}}}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("jsonc-parser/impl/format",["require","exports","./scanner"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var T=e("./scanner");function S(e,t){for(var n="",r=0;r<t;r++)n+=e;return n}function w(e,t){return-1!=="\r\n".indexOf(e.charAt(t))}t.format=function(r,e,t){var n,o,i,a,s;if(e){for(a=e.offset,s=a+e.length,i=a;0<i&&!w(r,i-1);)i--;for(var u=s;u<r.length&&!w(r,u);)u++;o=r.substring(i,u),n=function(e,t,n){for(var r=0,o=0,i=n.tabSize||4;r<e.length;){var a=e.charAt(r);if(" "===a)o++;else{if("\t"!==a)break;o+=i}r++}return Math.floor(o/i)}(o,0,t)}else a=i=n=0,s=(o=r).length;var c,f=function(e,t){for(var n=0;n<t.length;n++){var r=t.charAt(n);if("\r"===r)return n+1<t.length&&"\n"===t.charAt(n+1)?"\r\n":"\r";if("\n"===r)return"\n"}return e&&e.eol||"\n"}(t,r),l=!1,d=0;c=t.insertSpaces?S(" ",t.tabSize||4):"\t";var g=T.createScanner(o,!1),h=!1;function p(){return f+S(c,n+d)}function m(){var e=g.scan();for(l=!1;15===e||14===e;)l=l||14===e,e=g.scan();return h=16===e||0!==g.getTokenError(),e}var v=[];function y(e,t,n){!h&&t<s&&a<n&&r.substring(t,n)!==e&&v.push({offset:t,length:n-t,content:e})}var b=m();if(17!==b){var k=g.getTokenOffset()+i;y(S(c,n),i,k)}for(;17!==b;){for(var _=g.getTokenOffset()+g.getTokenLength()+i,C=m(),E="";!l&&(12===C||13===C);)y(" ",_,g.getTokenOffset()+i),_=g.getTokenOffset()+g.getTokenLength()+i,E=12===C?p():"",C=m();if(2===C)1!==b&&(d--,E=p());else if(4===C)3!==b&&(d--,E=p());else{switch(b){case 3:case 1:d++,E=p();break;case 5:case 12:E=p();break;case 13:E=l?p():" ";break;case 6:E=" ";break;case 10:if(6===C){E="";break}case 7:case 8:case 9:case 11:case 2:case 4:12===C||13===C?E=" ":5!==C&&17!==C&&(h=!0);break;case 16:h=!0}!l||12!==C&&13!==C||(E=p())}y(E,_,g.getTokenOffset()+i),b=C}return v},t.isEOL=w}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("jsonc-parser/impl/parser",["require","exports","./scanner"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var _=e("./scanner");function f(e,t,n){var o=_.createScanner(e,!1);function r(e){return e?function(){return e(o.getTokenOffset(),o.getTokenLength())}:function(){return!0}}function i(t){return t?function(e){return t(e,o.getTokenOffset(),o.getTokenLength())}:function(){return!0}}var a=r(t.onObjectBegin),s=i(t.onObjectProperty),u=r(t.onObjectEnd),c=r(t.onArrayBegin),f=r(t.onArrayEnd),l=i(t.onLiteralValue),d=i(t.onSeparator),g=r(t.onComment),h=i(t.onError),p=n&&n.disallowComments,m=n&&n.allowTrailingComma;function v(){for(;;){var e=o.scan();switch(o.getTokenError()){case 4:y(14);break;case 5:y(15);break;case 3:y(13);break;case 1:p||y(11);break;case 2:y(12);break;case 6:y(16)}switch(e){case 12:case 13:p?y(10):g();break;case 16:y(1);break;case 15:case 14:break;default:return e}}}function y(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=[]),h(e),0<t.length+n.length)for(var r=o.getToken();17!==r;){if(-1!==t.indexOf(r)){v();break}if(-1!==n.indexOf(r))break;r=v()}}function b(e){var t=o.getTokenValue();return e?l(t):s(t),v(),!0}function k(){switch(o.getToken()){case 3:return function(){c(),v();for(var e=!1;4!==o.getToken()&&17!==o.getToken();){if(5===o.getToken()){if(e||y(4,[],[]),d(","),v(),4===o.getToken()&&m)break}else e&&y(6,[],[]);k()||y(4,[],[4,5]),e=!0}return f(),4!==o.getToken()?y(8,[4],[]):v(),!0}();case 1:return function(){a(),v();for(var e=!1;2!==o.getToken()&&17!==o.getToken();){if(5===o.getToken()){if(e||y(4,[],[]),d(","),v(),2===o.getToken()&&m)break}else e&&y(6,[],[]);(10!==o.getToken()?(y(3,[],[2,5]),0):(b(!1),6===o.getToken()?(d(":"),v(),k()||y(4,[],[2,5])):y(5,[],[2,5]),1))||y(4,[],[2,5]),e=!0}return u(),2!==o.getToken()?y(7,[2],[]):v(),!0}();case 10:return b(!0);default:return function(){switch(o.getToken()){case 11:var e=0;try{"number"!=typeof(e=JSON.parse(o.getTokenValue()))&&(y(2),e=0)}catch(e){y(2)}l(e);break;case 7:l(null);break;case 8:l(!0);break;case 9:l(!1);break;default:return!1}return v(),!0}()}}return v(),17===o.getToken()||(k()?(17!==o.getToken()&&y(9,[],[]),!0):(y(4,[],[]),!1))}function l(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string";default:return"null"}}t.getLocation=function(e,o){var i=[],a=new Object,s=void 0,u={value:{},offset:0,length:0,type:"object"},c=!1;function r(e,t,n,r){u.value=e,u.offset=t,u.length=n,u.type=r,u.columnOffset=void 0,s=u}try{f(e,{onObjectBegin:function(e,t){if(o<=e)throw a;s=void 0,c=e<o,i.push("")},onObjectProperty:function(e,t,n){if(o<t)throw a;if(r(e,t,n,"property"),i[i.length-1]=e,o<=t+n)throw a},onObjectEnd:function(e,t){if(o<=e)throw a;s=void 0,i.pop()},onArrayBegin:function(e,t){if(o<=e)throw a;s=void 0,i.push(0)},onArrayEnd:function(e,t){if(o<=e)throw a;s=void 0,i.pop()},onLiteralValue:function(e,t,n){if(o<t)throw a;if(r(e,t,n,l(e)),o<=t+n)throw a},onSeparator:function(e,t,n){if(o<=t)throw a;if(":"===e&&s&&"property"===s.type)s.columnOffset=t,c=!1,s=void 0;else if(","===e){var r=i[i.length-1];"number"==typeof r?i[i.length-1]=r+1:(c=!0,i[i.length-1]=""),s=void 0}}})}catch(e){if(e!==a)throw e}return{path:i,previousNode:s,isAtPropertyKey:c,matches:function(e){for(var t=0,n=0;t<e.length&&n<i.length;n++)if(e[t]===i[n]||"*"===e[t])t++;else if("**"!==e[t])return!1;return t===e.length}}},t.parse=function(e,r,t){void 0===r&&(r=[]);var n=null,o=[],i=[];function a(e){Array.isArray(o)?o.push(e):n&&(o[n]=e)}return f(e,{onObjectBegin:function(){var e={};a(e),i.push(o),o=e,n=null},onObjectProperty:function(e){n=e},onObjectEnd:function(){o=i.pop()},onArrayBegin:function(){var e=[];a(e),i.push(o),o=e,n=null},onArrayEnd:function(){o=i.pop()},onLiteralValue:a,onError:function(e,t,n){r.push({error:e,offset:t,length:n})}},t),o[0]},t.parseTree=function(e,r,t){void 0===r&&(r=[]);var o={type:"array",offset:-1,length:-1,children:[]};function i(e){"property"===o.type&&(o.length=e-o.offset,o=o.parent)}function a(e){return o.children.push(e),e}f(e,{onObjectBegin:function(e){o=a({type:"object",offset:e,length:-1,parent:o,children:[]})},onObjectProperty:function(e,t,n){(o=a({type:"property",offset:t,length:-1,parent:o,children:[]})).children.push({type:"string",value:e,offset:t,length:n,parent:o})},onObjectEnd:function(e,t){o.length=e+t-o.offset,o=o.parent,i(e+t)},onArrayBegin:function(e,t){o=a({type:"array",offset:e,length:-1,parent:o,children:[]})},onArrayEnd:function(e,t){o.length=e+t-o.offset,o=o.parent,i(e+t)},onLiteralValue:function(e,t,n){a({type:l(e),offset:t,length:n,parent:o,value:e}),i(t+n)},onSeparator:function(e,t,n){"property"===o.type&&(":"===e?o.columnOffset=t:","===e&&i(t))},onError:function(e,t,n){r.push({error:e,offset:t,length:n})}},t);var n=o.children[0];return n&&delete n.parent,n},t.findNodeAtLocation=function(e,t){if(e){for(var n=e,r=0,o=t;r<o.length;r++){var i=o[r];if("string"==typeof i){if("object"!==n.type||!Array.isArray(n.children))return;for(var a=!1,s=0,u=n.children;s<u.length;s++){var c=u[s];if(Array.isArray(c.children)&&c.children[0].value===i){n=c.children[1],a=!0;break}}if(!a)return}else{var f=i;if("array"!==n.type||f<0||!Array.isArray(n.children)||f>=n.children.length)return;n=n.children[f]}}return n}},t.getNodeValue=function e(t){if("array"===t.type)return t.children.map(e);if("object"===t.type){for(var n=Object.create(null),r=0,o=t.children;r<o.length;r++){var i=o[r];n[i.children[0].value]=e(i.children[1])}return n}return t.value},t.visit=f,t.stripComments=function(e,t){var n,r,o=_.createScanner(e),i=[],a=0;do{switch(r=o.getPosition(),n=o.scan()){case 12:case 13:case 17:a!==r&&i.push(e.substring(a,r)),void 0!==t&&i.push(o.getTokenValue().replace(/[^\r\n]/g,t)),a=o.getPosition()}}while(17!==n);return i.join("")}}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("jsonc-parser/impl/edit",["require","exports","./format","./parser"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var c=e("./format"),k=e("./parser");function r(e,t,n,r,o){for(var i,a=k.parseTree(e,[]),s=void 0,u=void 0;0<t.length&&(u=t.pop(),void 0===(s=k.findNodeAtLocation(a,t))&&void 0!==n);)"string"==typeof u?((i={})[u]=n,n=i):n=[n];if(s){if("object"===s.type&&"string"==typeof u&&Array.isArray(s.children)){var c=k.findNodeAtLocation(s,[u]);if(void 0!==c){if(void 0===n){if(!c.parent)throw new Error("Malformed AST");var f=s.children.indexOf(c.parent),l=void 0,d=c.parent.offset+c.parent.length;if(0<f)l=(y=s.children[f-1]).offset+y.length;else if(l=s.offset+1,1<s.children.length)d=s.children[1].offset;return _(e,{offset:l,length:d-l,content:""},r)}return _(e,{offset:c.offset,length:c.length,content:JSON.stringify(n)},r)}if(void 0===n)return[];var g=JSON.stringify(u)+": "+JSON.stringify(n),h=o?o(s.children.map(function(e){return e.children[0].value})):s.children.length,p=void 0;return _(e,p=0<h?{offset:(y=s.children[h-1]).offset+y.length,length:0,content:","+g}:0===s.children.length?{offset:s.offset+1,length:0,content:g}:{offset:s.offset+1,length:0,content:g+","},r)}if("array"===s.type&&"number"==typeof u&&Array.isArray(s.children)){if(-1===u){g=""+JSON.stringify(n),p=void 0;if(0===s.children.length)p={offset:s.offset+1,length:0,content:g};else p={offset:(y=s.children[s.children.length-1]).offset+y.length,length:0,content:","+g};return _(e,p,r)}if(void 0===n&&0<=s.children.length){var m=u,v=s.children[m];p=void 0;if(1===s.children.length)p={offset:s.offset+1,length:s.length-2,content:""};else if(s.children.length-1===m){var y,b=(y=s.children[m-1]).offset+y.length;p={offset:b,length:s.offset+s.length-2-b,content:""}}else p={offset:v.offset,length:s.children[m+1].offset-v.offset,content:""};return _(e,p,r)}throw new Error("Array modification not supported yet")}throw new Error("Can not add "+("number"!=typeof u?"index":"property")+" to parent of type "+s.type)}if(void 0===n)throw new Error("Can not delete in empty document");return _(e,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(n)},r)}function _(e,t,n){var r=f(e,t),o=t.offset,i=t.offset+t.content.length;if(0===t.length||0===t.content.length){for(;0<o&&!c.isEOL(r,o-1);)o--;for(;i<r.length&&!c.isEOL(r,i);)i++}for(var a=c.format(r,{offset:o,length:i-o},n),s=a.length-1;0<=s;s--){var u=a[s];r=f(r,u),o=Math.min(o,u.offset),i=Math.max(i,u.offset+u.length),i+=u.content.length-u.length}return[{offset:o,length:e.length-(r.length-i)-o,content:r.substring(o,i)}]}function f(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}t.removeProperty=function(e,t,n){return r(e,t,void 0,n)},t.setProperty=r,t.applyEdit=f,t.isWS=function(e,t){return-1!=="\r\n \t".indexOf(e.charAt(t))}}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("jsonc-parser/main",["require","exports","./impl/format","./impl/edit","./impl/scanner","./impl/parser"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=e("./impl/format"),o=e("./impl/edit"),n=e("./impl/scanner"),i=e("./impl/parser");t.createScanner=n.createScanner,t.getLocation=i.getLocation,t.parse=i.parse,t.parseTree=i.parseTree,t.findNodeAtLocation=i.findNodeAtLocation,t.getNodeValue=i.getNodeValue,t.visit=i.visit,t.stripComments=i.stripComments,t.format=function(e,t,n){return r.format(e,t,n)},t.modify=function(e,t,n,r){return o.setProperty(e,t,n,r.formattingOptions,r.getInsertionIndex)},t.applyEdits=function(e,t){for(var n=t.length-1;0<=n;n--)e=o.applyEdit(e,t[n]);return e}}),define("jsonc-parser",["jsonc-parser/main"],function(e){return e}),define("vs/language/json/tokenization",["require","exports","jsonc-parser"],function(e,g,h){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.createTokenizationSupport=function(o){return{getInitialState:function(){return new p(null,null,!1)},tokenize:function(e,t,n,r){return function(e,t,n,r,o){void 0===r&&(r=0);var i=0,a=!1;switch(n.scanError){case 2:t='"'+t,i=1;break;case 1:t="/*"+t,i=2}var s,u,c=h.createScanner(t),f=n.lastWasColon;for(u={tokens:[],endState:n.clone()};;){var l=r+c.getPosition(),d="";if(17===(s=c.scan()))break;if(l===r+c.getPosition())throw new Error("Scanner did not advance, next 3 characters are: "+t.substr(c.getPosition(),3));switch(a&&(l-=i),a=0<i,s){case 1:case 2:d=g.TOKEN_DELIM_OBJECT,f=!1;break;case 3:case 4:d=g.TOKEN_DELIM_ARRAY,f=!1;break;case 6:d=g.TOKEN_DELIM_COLON,f=!0;break;case 5:d=g.TOKEN_DELIM_COMMA,f=!1;break;case 8:case 9:d=g.TOKEN_VALUE_BOOLEAN,f=!1;break;case 7:d=g.TOKEN_VALUE_NULL,f=!1;break;case 10:d=f?g.TOKEN_VALUE_STRING:g.TOKEN_PROPERTY_NAME,f=!1;break;case 11:d=g.TOKEN_VALUE_NUMBER,f=!1}if(e)switch(s){case 12:d=g.TOKEN_COMMENT_LINE;break;case 13:d=g.TOKEN_COMMENT_BLOCK}u.endState=new p(n.getStateData(),c.getTokenError(),f),u.tokens.push({startIndex:l,scopes:d})}return u}(o,e,t,n)}}},g.TOKEN_DELIM_OBJECT="delimiter.bracket.json",g.TOKEN_DELIM_ARRAY="delimiter.array.json",g.TOKEN_DELIM_COLON="delimiter.colon.json",g.TOKEN_DELIM_COMMA="delimiter.comma.json",g.TOKEN_VALUE_BOOLEAN="keyword.json",g.TOKEN_VALUE_NULL="keyword.json",g.TOKEN_VALUE_STRING="string.value.json",g.TOKEN_VALUE_NUMBER="number.json",g.TOKEN_PROPERTY_NAME="string.key.json",g.TOKEN_COMMENT_BLOCK="comment.block.json",g.TOKEN_COMMENT_LINE="comment.line.json";var p=function(){function t(e,t,n){this._state=e,this.scanError=t,this.lastWasColon=n}return t.prototype.clone=function(){return new t(this._state,this.scanError,this.lastWasColon)},t.prototype.equals=function(e){return e===this||!!(e&&e instanceof t)&&(this.scanError===e.scanError&&this.lastWasColon===e.lastWasColon)},t.prototype.getStateData=function(){return this._state},t.prototype.setStateData=function(e){this._state=e},t}()}),define("vs/language/json/jsonMode",["require","exports","./workerManager","./languageFeatures","./tokenization"],function(e,t,i,a,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupMode=function(e){var t=[],n=new i.WorkerManager(e);t.push(n);var r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.getLanguageServiceWorker.apply(n,e)},o=e.languageId;t.push(monaco.languages.registerCompletionItemProvider(o,new a.CompletionAdapter(r))),t.push(monaco.languages.registerHoverProvider(o,new a.HoverAdapter(r))),t.push(monaco.languages.registerDocumentSymbolProvider(o,new a.DocumentSymbolAdapter(r))),t.push(monaco.languages.registerDocumentFormattingEditProvider(o,new a.DocumentFormattingEditProvider(r))),t.push(monaco.languages.registerDocumentRangeFormattingEditProvider(o,new a.DocumentRangeFormattingEditProvider(r))),t.push(new a.DiagnosticsAdapter(o,r,e)),t.push(monaco.languages.setTokensProvider(o,s.createTokenizationSupport(!0))),t.push(monaco.languages.setLanguageConfiguration(o,u)),t.push(monaco.languages.registerColorProvider(o,new a.DocumentColorAdapter(r)))};var u={wordPattern:/(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string"]},{open:"[",close:"]",notIn:["string"]},{open:'"',close:'"',notIn:["string"]}]}});
define("vs/language/json/workerManager",["require","exports"],function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var c=monaco.Promise,n=function(){function e(e){var t=this;this._defaults=e,this._worker=null,this._idleCheckInterval=setInterval(function(){return t._checkIfIdle()},3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(function(){return t._stopWorker()})}return e.prototype._stopWorker=function(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null},e.prototype.dispose=function(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()},e.prototype._checkIfIdle=function(){this._worker&&(12e4<Date.now()-this._lastUsedTime&&this._stopWorker())},e.prototype._getClient=function(){return this._lastUsedTime=Date.now(),this._client||(this._worker=monaco.editor.createWebWorker({moduleId:"vs/language/json/jsonWorker",label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId}}),this._client=this._worker.getProxy()),this._client},e.prototype.getLanguageServiceWorker=function(){for(var t,e,n,r,o,i=this,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return e=this._getClient().then(function(e){t=e}).then(function(e){return i._worker.withSyncedResources(a)}).then(function(e){return t}),o=new c(function(e,t){n=e,r=t},function(){}),e.then(n,r),o},e}();t.WorkerManager=n}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("vscode-languageserver-types/main",["require","exports"],e)}(function(e,t){"use strict";var a,n,r,o,i,s,c,u,f,d,l,g,h,p,m,v,y,b,k,C,_,E,T,w;Object.defineProperty(t,"__esModule",{value:!0}),(n=a=t.Position||(t.Position={})).create=function(e,t){return{line:e,character:t}},n.is=function(e){var t=e;return Z.objectLiteral(t)&&Z.number(t.line)&&Z.number(t.character)},(o=r=t.Range||(t.Range={})).create=function(e,t,n,r){if(Z.number(e)&&Z.number(t)&&Z.number(n)&&Z.number(r))return{start:a.create(e,t),end:a.create(n,r)};if(a.is(e)&&a.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments["+e+", "+t+", "+n+", "+r+"]")},o.is=function(e){var t=e;return Z.objectLiteral(t)&&a.is(t.start)&&a.is(t.end)},(s=i=t.Location||(t.Location={})).create=function(e,t){return{uri:e,range:t}},s.is=function(e){var t=e;return Z.defined(t)&&r.is(t.range)&&(Z.string(t.uri)||Z.undefined(t.uri))},(u=c=t.Color||(t.Color={})).create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},u.is=function(e){var t=e;return Z.number(t.red)&&Z.number(t.green)&&Z.number(t.blue)&&Z.number(t.alpha)},(f=t.ColorInformation||(t.ColorInformation={})).create=function(e,t){return{range:e,color:t}},f.is=function(e){var t=e;return r.is(t.range)&&c.is(t.color)},(d=t.ColorPresentation||(t.ColorPresentation={})).create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},d.is=function(e){var t=e;return Z.string(t.label)&&(Z.undefined(t.textEdit)||C.is(t))&&(Z.undefined(t.additionalTextEdits)||Z.typedArray(t.additionalTextEdits,C.is))},(l=t.FoldingRangeKind||(t.FoldingRangeKind={})).Comment="comment",l.Imports="imports",l.Region="region",(g=t.FoldingRange||(t.FoldingRange={})).create=function(e,t,n,r,o){var i={startLine:e,endLine:t};return Z.defined(n)&&(i.startCharacter=n),Z.defined(r)&&(i.endCharacter=r),Z.defined(o)&&(i.kind=o),i},g.is=function(e){var t=e;return Z.number(t.startLine)&&Z.number(t.startLine)&&(Z.undefined(t.startCharacter)||Z.number(t.startCharacter))&&(Z.undefined(t.endCharacter)||Z.number(t.endCharacter))&&(Z.undefined(t.kind)||Z.string(t.kind))},(p=h=t.DiagnosticRelatedInformation||(t.DiagnosticRelatedInformation={})).create=function(e,t){return{location:e,message:t}},p.is=function(e){var t=e;return Z.defined(t)&&i.is(t.location)&&Z.string(t.message)},(m=t.DiagnosticSeverity||(t.DiagnosticSeverity={})).Error=1,m.Warning=2,m.Information=3,m.Hint=4,(y=v=t.Diagnostic||(t.Diagnostic={})).create=function(e,t,n,r,o,i){var a={range:e,message:t};return Z.defined(n)&&(a.severity=n),Z.defined(r)&&(a.code=r),Z.defined(o)&&(a.source=o),Z.defined(i)&&(a.relatedInformation=i),a},y.is=function(e){var t=e;return Z.defined(t)&&r.is(t.range)&&Z.string(t.message)&&(Z.number(t.severity)||Z.undefined(t.severity))&&(Z.number(t.code)||Z.string(t.code)||Z.undefined(t.code))&&(Z.string(t.source)||Z.undefined(t.source))&&(Z.undefined(t.relatedInformation)||Z.typedArray(t.relatedInformation,h.is))},(k=b=t.Command||(t.Command={})).create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o={title:e,command:t};return Z.defined(n)&&0<n.length&&(o.arguments=n),o},k.is=function(e){var t=e;return Z.defined(t)&&Z.string(t.title)&&Z.string(t.command)},(_=C=t.TextEdit||(t.TextEdit={})).replace=function(e,t){return{range:e,newText:t}},_.insert=function(e,t){return{range:{start:e,end:e},newText:t}},_.del=function(e){return{range:e,newText:""}},_.is=function(e){var t=e;return Z.objectLiteral(t)&&Z.string(t.newText)&&r.is(t.range)},(T=E=t.TextDocumentEdit||(t.TextDocumentEdit={})).create=function(e,t){return{textDocument:e,edits:t}},T.is=function(e){var t=e;return Z.defined(t)&&A.is(t.textDocument)&&Array.isArray(t.edits)},(w=t.WorkspaceEdit||(t.WorkspaceEdit={})).is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||Z.typedArray(t.documentChanges,E.is))};var S,A,x,O,I,M,j,K,L,P,D,N,R,F,V=function(){function e(e){this.edits=e}return e.prototype.insert=function(e,t){this.edits.push(C.insert(e,t))},e.prototype.replace=function(e,t){this.edits.push(C.replace(e,t))},e.prototype.delete=function(e){this.edits.push(C.del(e))},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}(),W=function(){function e(n){var r=this;this._textEditChanges=Object.create(null),n&&((this._workspaceEdit=n).documentChanges?n.documentChanges.forEach(function(e){var t=new V(e.edits);r._textEditChanges[e.textDocument.uri]=t}):n.changes&&Object.keys(n.changes).forEach(function(e){var t=new V(n.changes[e]);r._textEditChanges[e]=t}))}return Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(e){if(A.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for versioned document changes.");var t=e;if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:o=[]};this._workspaceEdit.documentChanges.push(n),r=new V(o),this._textEditChanges[t.uri]=r}return r}if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var o=[];this._workspaceEdit.changes[e]=o,r=new V(o),this._textEditChanges[e]=r}return r},e}();t.WorkspaceChange=W,(S=t.TextDocumentIdentifier||(t.TextDocumentIdentifier={})).create=function(e){return{uri:e}},S.is=function(e){var t=e;return Z.defined(t)&&Z.string(t.uri)},(x=A=t.VersionedTextDocumentIdentifier||(t.VersionedTextDocumentIdentifier={})).create=function(e,t){return{uri:e,version:t}},x.is=function(e){var t=e;return Z.defined(t)&&Z.string(t.uri)&&Z.number(t.version)},(O=t.TextDocumentItem||(t.TextDocumentItem={})).create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},O.is=function(e){var t=e;return Z.defined(t)&&Z.string(t.uri)&&Z.string(t.languageId)&&Z.number(t.version)&&Z.string(t.text)},(M=I=t.MarkupKind||(t.MarkupKind={})).PlainText="plaintext",M.Markdown="markdown",(j=I=t.MarkupKind||(t.MarkupKind={})).is=function(e){var t=e;return t===j.PlainText||t===j.Markdown},(K=t.MarkupContent||(t.MarkupContent={})).is=function(e){var t=e;return Z.objectLiteral(e)&&I.is(t.kind)&&Z.string(t.value)},(L=t.CompletionItemKind||(t.CompletionItemKind={})).Text=1,L.Method=2,L.Function=3,L.Constructor=4,L.Field=5,L.Variable=6,L.Class=7,L.Interface=8,L.Module=9,L.Property=10,L.Unit=11,L.Value=12,L.Enum=13,L.Keyword=14,L.Snippet=15,L.Color=16,L.File=17,L.Reference=18,L.Folder=19,L.EnumMember=20,L.Constant=21,L.Struct=22,L.Event=23,L.Operator=24,L.TypeParameter=25,(P=t.InsertTextFormat||(t.InsertTextFormat={})).PlainText=1,P.Snippet=2,(t.CompletionItem||(t.CompletionItem={})).create=function(e){return{label:e}},(t.CompletionList||(t.CompletionList={})).create=function(e,t){return{items:e||[],isIncomplete:!!t}},(N=D=t.MarkedString||(t.MarkedString={})).fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},N.is=function(e){var t=e;return Z.string(t)||Z.objectLiteral(t)&&Z.string(t.language)&&Z.string(t.value)},(t.Hover||(t.Hover={})).is=function(e){var t=e;return Z.objectLiteral(t)&&(K.is(t.contents)||D.is(t.contents)||Z.typedArray(t.contents,D.is))&&(void 0===e.range||r.is(e.range))},(t.ParameterInformation||(t.ParameterInformation={})).create=function(e,t){return t?{label:e,documentation:t}:{label:e}},(t.SignatureInformation||(t.SignatureInformation={})).create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o={label:e};return Z.defined(t)&&(o.documentation=t),Z.defined(n)?o.parameters=n:o.parameters=[],o},(R=t.DocumentHighlightKind||(t.DocumentHighlightKind={})).Text=1,R.Read=2,R.Write=3,(t.DocumentHighlight||(t.DocumentHighlight={})).create=function(e,t){var n={range:e};return Z.number(t)&&(n.kind=t),n},(F=t.SymbolKind||(t.SymbolKind={})).File=1,F.Module=2,F.Namespace=3,F.Package=4,F.Class=5,F.Method=6,F.Property=7,F.Field=8,F.Constructor=9,F.Enum=10,F.Interface=11,F.Function=12,F.Variable=13,F.Constant=14,F.String=15,F.Number=16,F.Boolean=17,F.Array=18,F.Object=19,F.Key=20,F.Null=21,F.EnumMember=22,F.Struct=23,F.Event=24,F.Operator=25,F.TypeParameter=26,(t.SymbolInformation||(t.SymbolInformation={})).create=function(e,t,n,r,o){var i={name:e,kind:t,location:{uri:r,range:n}};return o&&(i.containerName=o),i};var U,q,B,H,z,J,Y=function(){};t.DocumentSymbol=Y,(U=Y=t.DocumentSymbol||(t.DocumentSymbol={})).create=function(e,t,n,r,o,i){var a={name:e,detail:t,kind:n,range:r,selectionRange:o};return void 0!==i&&(a.children=i),a},U.is=function(e){var t=e;return t&&Z.string(t.name)&&Z.string(t.detail)&&Z.number(t.kind)&&r.is(t.range)&&r.is(t.selectionRange)&&(void 0===t.deprecated||Z.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))},t.DocumentSymbol=Y,(q=t.CodeActionKind||(t.CodeActionKind={})).QuickFix="quickfix",q.Refactor="refactor",q.RefactorExtract="refactor.extract",q.RefactorInline="refactor.inline",q.RefactorRewrite="refactor.rewrite",q.Source="source",q.SourceOrganizeImports="source.organizeImports",(B=t.CodeActionContext||(t.CodeActionContext={})).create=function(e,t){var n={diagnostics:e};return null!=t&&(n.only=t),n},B.is=function(e){var t=e;return Z.defined(t)&&Z.typedArray(t.diagnostics,v.is)&&(void 0===t.only||Z.typedArray(t.only,Z.string))},(H=t.CodeAction||(t.CodeAction={})).create=function(e,t,n){var r={title:e};return b.is(t)?r.command=t:r.edit=t,void 0!==n&&(r.kind=n),r},H.is=function(e){var t=e;return t&&Z.string(t.title)&&(void 0===t.diagnostics||Z.typedArray(t.diagnostics,v.is))&&(void 0===t.kind||Z.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||b.is(t.command))&&(void 0===t.edit||w.is(t.edit))},(z=t.CodeLens||(t.CodeLens={})).create=function(e,t){var n={range:e};return Z.defined(t)&&(n.data=t),n},z.is=function(e){var t=e;return Z.defined(t)&&r.is(t.range)&&(Z.undefined(t.command)||b.is(t.command))},(J=t.FormattingOptions||(t.FormattingOptions={})).create=function(e,t){return{tabSize:e,insertSpaces:t}},J.is=function(e){var t=e;return Z.defined(t)&&Z.number(t.tabSize)&&Z.boolean(t.insertSpaces)};var G,$,Q,X=function(){};t.DocumentLink=X,(G=X=t.DocumentLink||(t.DocumentLink={})).create=function(e,t,n){return{range:e,target:t,data:n}},G.is=function(e){var t=e;return Z.defined(t)&&r.is(t.range)&&(Z.undefined(t.target)||Z.string(t.target))},t.DocumentLink=X,t.EOL=["\n","\r\n","\r"],($=t.TextDocument||(t.TextDocument={})).create=function(e,t,n,r){return new ne(e,t,n,r)},$.is=function(e){var t=e;return!!(Z.defined(t)&&Z.string(t.uri)&&(Z.undefined(t.languageId)||Z.string(t.languageId))&&Z.number(t.lineCount)&&Z.func(t.getText)&&Z.func(t.positionAt)&&Z.func(t.offsetAt))},$.applyEdits=function(e,t){for(var n=e.getText(),r=function e(t,n){if(t.length<=1)return t;var r=t.length/2|0,o=t.slice(0,r),i=t.slice(r);e(o,n),e(i,n);for(var a=0,s=0,c=0;a<o.length&&s<i.length;){var u=n(o[a],i[s]);t[c++]=u<=0?o[a++]:i[s++]}for(;a<o.length;)t[c++]=o[a++];for(;s<i.length;)t[c++]=i[s++];return t}(t,function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n}),o=n.length,i=r.length-1;0<=i;i--){var a=r[i],s=e.offsetAt(a.range.start),c=e.offsetAt(a.range.end);if(!(c<=o))throw new Error("Ovelapping edit");n=n.substring(0,s)+a.newText+n.substring(c,n.length),o=s}return n},(Q=t.TextDocumentSaveReason||(t.TextDocumentSaveReason={})).Manual=1,Q.AfterDelay=2,Q.FocusOut=3;var Z,ee,te,ne=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=null}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=null},e.prototype.getLineOffsets=function(){if(null===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r<t.length;r++){n&&(e.push(r),n=!1);var o=t.charAt(r);n="\r"===o||"\n"===o,"\r"===o&&r+1<t.length&&"\n"===t.charAt(r+1)&&r++}n&&0<t.length&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return a.create(0,e);for(;n<r;){var o=Math.floor((n+r)/2);t[o]>e?r=o:n=o+1}var i=n-1;return a.create(i,e-t[i])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),e}();ee=Z||(Z={}),te=Object.prototype.toString,ee.defined=function(e){return void 0!==e},ee.undefined=function(e){return void 0===e},ee.boolean=function(e){return!0===e||!1===e},ee.string=function(e){return"[object String]"===te.call(e)},ee.number=function(e){return"[object Number]"===te.call(e)},ee.func=function(e){return"[object Function]"===te.call(e)},ee.objectLiteral=function(e){return null!==e&&"object"==typeof e},ee.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}}),define("vscode-languageserver-types",["vscode-languageserver-types/main"],function(e){return e}),define("vs/language/json/languageFeatures",["require","exports","vscode-languageserver-types"],function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});monaco.Uri;var n=monaco.Range,r=function(){function e(e,t,n){var r=this;this._languageId=e,this._worker=t,this._disposables=[],this._listener=Object.create(null);var o=function(e){var t,n=e.getModeId();n===r._languageId&&(r._listener[e.uri.toString()]=e.onDidChangeContent(function(){clearTimeout(t),t=setTimeout(function(){return r._doValidate(e.uri,n)},500)}),r._doValidate(e.uri,n))},i=function(e){monaco.editor.setModelMarkers(e,r._languageId,[]);var t=e.uri.toString(),n=r._listener[t];n&&(n.dispose(),delete r._listener[t])};this._disposables.push(monaco.editor.onDidCreateModel(o)),this._disposables.push(monaco.editor.onWillDisposeModel(function(e){i(e),r._resetSchema(e.uri)})),this._disposables.push(monaco.editor.onDidChangeModelLanguage(function(e){i(e.model),o(e.model),r._resetSchema(e.model.uri)})),this._disposables.push(n.onDidChange(function(e){monaco.editor.getModels().forEach(function(e){e.getModeId()===r._languageId&&(i(e),o(e))})})),this._disposables.push({dispose:function(){for(var e in monaco.editor.getModels().forEach(i),r._listener)r._listener[e].dispose()}}),monaco.editor.getModels().forEach(o)}return e.prototype.dispose=function(){this._disposables.forEach(function(e){return e&&e.dispose()}),this._disposables=[]},e.prototype._resetSchema=function(t){this._worker().then(function(e){e.resetSchema(t.toString())})},e.prototype._doValidate=function(r,o){this._worker(r).then(function(e){return e.doValidation(r.toString()).then(function(e){var t=e.map(function(e){return n="number"==typeof(t=e).code?String(t.code):t.code,{severity:function(e){switch(e){case i.DiagnosticSeverity.Error:return monaco.MarkerSeverity.Error;case i.DiagnosticSeverity.Warning:return monaco.MarkerSeverity.Warning;case i.DiagnosticSeverity.Information:return monaco.MarkerSeverity.Info;case i.DiagnosticSeverity.Hint:return monaco.MarkerSeverity.Hint;default:return monaco.MarkerSeverity.Info}}(t.severity),startLineNumber:t.range.start.line+1,startColumn:t.range.start.character+1,endLineNumber:t.range.end.line+1,endColumn:t.range.end.character+1,message:t.message,code:n,source:t.source};var t,n}),n=monaco.editor.getModel(r);n.getModeId()===o&&monaco.editor.setModelMarkers(n,o,t)})}).then(void 0,function(e){console.error(e)})},e}();function o(e){if(e)return{character:e.column-1,line:e.lineNumber-1}}function a(e){if(e)return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function s(e){if(e)return new n(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function c(e){var t=monaco.languages.CompletionItemKind;switch(e){case i.CompletionItemKind.Text:return t.Text;case i.CompletionItemKind.Method:return t.Method;case i.CompletionItemKind.Function:return t.Function;case i.CompletionItemKind.Constructor:return t.Constructor;case i.CompletionItemKind.Field:return t.Field;case i.CompletionItemKind.Variable:return t.Variable;case i.CompletionItemKind.Class:return t.Class;case i.CompletionItemKind.Interface:return t.Interface;case i.CompletionItemKind.Module:return t.Module;case i.CompletionItemKind.Property:return t.Property;case i.CompletionItemKind.Unit:return t.Unit;case i.CompletionItemKind.Value:return t.Value;case i.CompletionItemKind.Enum:return t.Enum;case i.CompletionItemKind.Keyword:return t.Keyword;case i.CompletionItemKind.Snippet:return t.Snippet;case i.CompletionItemKind.Color:return t.Color;case i.CompletionItemKind.File:return t.File;case i.CompletionItemKind.Reference:return t.Reference}return t.Property}function u(e){if(e)return{range:s(e.range),text:e.newText}}t.DiagnosticsAdapter=r;var f=function(){function e(e){this._worker=e}return Object.defineProperty(e.prototype,"triggerCharacters",{get:function(){return[" ",":"]},enumerable:!0,configurable:!0}),e.prototype.provideCompletionItems=function(e,t,n){e.getWordUntilPosition(t);var r=e.uri;return b(n,this._worker(r).then(function(e){return e.doComplete(r.toString(),o(t))}).then(function(e){if(e){var t=e.items.map(function(e){var t={label:e.label,insertText:e.insertText,sortText:e.sortText,filterText:e.filterText,documentation:e.documentation,detail:e.detail,kind:c(e.kind)};return e.textEdit&&(t.range=s(e.textEdit.range),t.insertText=e.textEdit.newText),e.insertTextFormat===i.InsertTextFormat.Snippet&&(t.insertText={value:t.insertText}),t});return{isIncomplete:e.isIncomplete,items:t}}}))},e}();function d(e){return"string"==typeof e?{value:e}:(t=e)&&"object"==typeof t&&"string"==typeof t.kind?"plaintext"===e.kind?{value:e.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:e.value}:{value:"```"+e.language+"\n"+e.value+"\n```\n"};var t}t.CompletionAdapter=f;var l=function(){function e(e){this._worker=e}return e.prototype.provideHover=function(e,t,n){var r=e.uri;return b(n,this._worker(r).then(function(e){return e.doHover(r.toString(),o(t))}).then(function(e){if(e)return{range:s(e.range),contents:function(e){if(e)return Array.isArray(e)?e.map(d):[d(e)]}(e.contents)}}))},e}();t.HoverAdapter=l;var g=function(){function e(e){this._worker=e}return e.prototype.provideDocumentSymbols=function(e,t){var n=e.uri;return b(t,this._worker(n).then(function(e){return e.findDocumentSymbols(n.toString())}).then(function(e){if(e)return e.map(function(e){return{name:e.name,detail:"",containerName:e.containerName,kind:function(e){var t=monaco.languages.SymbolKind;switch(e){case i.SymbolKind.File:return t.Array;case i.SymbolKind.Module:return t.Module;case i.SymbolKind.Namespace:return t.Namespace;case i.SymbolKind.Package:return t.Package;case i.SymbolKind.Class:return t.Class;case i.SymbolKind.Method:return t.Method;case i.SymbolKind.Property:return t.Property;case i.SymbolKind.Field:return t.Field;case i.SymbolKind.Constructor:return t.Constructor;case i.SymbolKind.Enum:return t.Enum;case i.SymbolKind.Interface:return t.Interface;case i.SymbolKind.Function:return t.Function;case i.SymbolKind.Variable:return t.Variable;case i.SymbolKind.Constant:return t.Constant;case i.SymbolKind.String:return t.String;case i.SymbolKind.Number:return t.Number;case i.SymbolKind.Boolean:return t.Boolean;case i.SymbolKind.Array:return t.Array}return t.Function}(e.kind),range:s(e.location.range),selectionRange:s(e.location.range)}})}))},e}();function h(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}t.DocumentSymbolAdapter=g;var p=function(){function e(e){this._worker=e}return e.prototype.provideDocumentFormattingEdits=function(e,t,n){var r=e.uri;return b(n,this._worker(r).then(function(e){return e.format(r.toString(),null,h(t)).then(function(e){if(e&&0!==e.length)return e.map(u)})}))},e}();t.DocumentFormattingEditProvider=p;var m=function(){function e(e){this._worker=e}return e.prototype.provideDocumentRangeFormattingEdits=function(e,t,n,r){var o=e.uri;return b(r,this._worker(o).then(function(e){return e.format(o.toString(),a(t),h(n)).then(function(e){if(e&&0!==e.length)return e.map(u)})}))},e}();t.DocumentRangeFormattingEditProvider=m;var v=function(){function e(e){this._worker=e}return e.prototype.provideDocumentColors=function(e,t){var n=e.uri;return b(t,this._worker(n).then(function(e){return e.findDocumentColors(n.toString())}).then(function(e){if(e)return e.map(function(e){return{color:e.color,range:s(e.range)}})}))},e.prototype.provideColorPresentations=function(e,t,n){var r=e.uri;return b(n,this._worker(r).then(function(e){return e.getColorPresentations(r.toString(),t.color,a(t.range))}).then(function(e){if(e)return e.map(function(e){var t={label:e.label};return e.textEdit&&(t.textEdit=u(e.textEdit)),e.additionalTextEdits&&(t.additionalTextEdits=e.additionalTextEdits.map(u)),t})}))},e}();t.DocumentColorAdapter=v;var y=function(){function e(e){this._worker=e}return e.prototype.provideFoldingRanges=function(e,t,n){var r=e.uri;return b(n,this._worker(r).then(function(e){return e.provideFoldingRanges(r.toString(),t)}).then(function(e){if(e)return e.map(function(e){var t={start:e.startLine+1,end:e.endLine+1};return void 0!==e.kind&&(t.kind=function(e){switch(e){case i.FoldingRangeKind.Comment:return monaco.languages.FoldingRangeKind.Comment;case i.FoldingRangeKind.Imports:return monaco.languages.FoldingRangeKind.Imports;case i.FoldingRangeKind.Region:return monaco.languages.FoldingRangeKind.Region}return}(e.kind)),t})}))},e}();function b(e,t){return t.cancel&&e.onCancellationRequested(function(){return t.cancel()}),t}t.FoldingRangeAdapter=y}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("jsonc-parser/impl/scanner",["require","exports"],e)}(function(e,t){"use strict";function l(e){return 32===e||9===e||11===e||12===e||160===e||5760===e||8192<=e&&e<=8203||8239===e||8287===e||12288===e||65279===e}function g(e){return 10===e||13===e||8232===e||8233===e}function h(e){return 48<=e&&e<=57}Object.defineProperty(t,"__esModule",{value:!0}),t.createScanner=function(i,e){void 0===e&&(e=!1);var a=0,o=i.length,r="",s=0,c=16,u=0;function f(e,t){for(var n=0,r=0;n<e||!t;){var o=i.charCodeAt(a);if(48<=o&&o<=57)r=16*r+o-48;else if(65<=o&&o<=70)r=16*r+o-65+10;else{if(!(97<=o&&o<=102))break;r=16*r+o-97+10}a++,n++}return n<e&&(r=-1),r}function t(){if(r="",u=0,o<=(s=a))return s=o,c=17;var e=i.charCodeAt(a);if(l(e)){for(;a++,r+=String.fromCharCode(e),l(e=i.charCodeAt(a)););return c=15}if(g(e))return a++,r+=String.fromCharCode(e),13===e&&10===i.charCodeAt(a)&&(a++,r+="\n"),c=14;switch(e){case 123:return a++,c=1;case 125:return a++,c=2;case 91:return a++,c=3;case 93:return a++,c=4;case 58:return a++,c=6;case 44:return a++,c=5;case 34:return a++,r=function(){for(var e="",t=a;;){if(o<=a){e+=i.substring(t,a),u=2;break}var n=i.charCodeAt(a);if(34===n){e+=i.substring(t,a),a++;break}if(92!==n){if(0<=n&&n<=31){if(g(n)){e+=i.substring(t,a),u=2;break}u=6}a++}else{if(e+=i.substring(t,a),o<=++a){u=2;break}switch(n=i.charCodeAt(a++)){case 34:e+='"';break;case 92:e+="\\";break;case 47:e+="/";break;case 98:e+="\b";break;case 102:e+="\f";break;case 110:e+="\n";break;case 114:e+="\r";break;case 116:e+="\t";break;case 117:var r=f(4,!0);0<=r?e+=String.fromCharCode(r):u=4;break;default:u=5}t=a}}return e}(),c=10;case 47:var t=a-1;if(47===i.charCodeAt(a+1)){for(a+=2;a<o&&!g(i.charCodeAt(a));)a++;return r=i.substring(t,a),c=12}if(42===i.charCodeAt(a+1)){a+=2;for(var n=!1;a<o;){if(42===i.charCodeAt(a)&&a+1<o&&47===i.charCodeAt(a+1)){a+=2,n=!0;break}a++}return n||(a++,u=1),r=i.substring(t,a),c=13}return r+=String.fromCharCode(e),a++,c=16;case 45:if(r+=String.fromCharCode(e),++a===o||!h(i.charCodeAt(a)))return c=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return r+=function(){var e=a;if(48===i.charCodeAt(a))a++;else for(a++;a<i.length&&h(i.charCodeAt(a));)a++;if(a<i.length&&46===i.charCodeAt(a)){if(!(++a<i.length&&h(i.charCodeAt(a))))return u=3,i.substring(e,a);for(a++;a<i.length&&h(i.charCodeAt(a));)a++}var t=a;if(a<i.length&&(69===i.charCodeAt(a)||101===i.charCodeAt(a)))if((++a<i.length&&43===i.charCodeAt(a)||45===i.charCodeAt(a))&&a++,a<i.length&&h(i.charCodeAt(a))){for(a++;a<i.length&&h(i.charCodeAt(a));)a++;t=a}else u=3;return i.substring(e,t)}(),c=11;default:for(;a<o&&d(e);)a++,e=i.charCodeAt(a);if(s!==a){switch(r=i.substring(s,a)){case"true":return c=8;case"false":return c=9;case"null":return c=7}return c=16}return r+=String.fromCharCode(e),a++,c=16}}function d(e){if(l(e)||g(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}return{setPosition:function(e){a=e,r="",c=16,u=s=0},getPosition:function(){return a},scan:e?function(){for(var e;12<=(e=t())&&e<=15;);return e}:t,getToken:function(){return c},getTokenValue:function(){return r},getTokenOffset:function(){return s},getTokenLength:function(){return a-s},getTokenError:function(){return u}}}}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("jsonc-parser/impl/format",["require","exports","./scanner"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var T=e("./scanner");function w(e,t){for(var n="",r=0;r<t;r++)n+=e;return n}function S(e,t){return-1!=="\r\n".indexOf(e.charAt(t))}t.format=function(r,e,t){var n,o,i,a,s;if(e){for(a=e.offset,s=a+e.length,i=a;0<i&&!S(r,i-1);)i--;for(var c=s;c<r.length&&!S(r,c);)c++;o=r.substring(i,c),n=function(e,t){for(var n=0,r=0,o=t.tabSize||4;n<e.length;){var i=e.charAt(n);if(" "===i)r++;else{if("\t"!==i)break;r+=o}n++}return Math.floor(r/o)}(o,t)}else a=i=n=0,s=(o=r).length;var u,f=function(e,t){for(var n=0;n<t.length;n++){var r=t.charAt(n);if("\r"===r)return n+1<t.length&&"\n"===t.charAt(n+1)?"\r\n":"\r";if("\n"===r)return"\n"}return e&&e.eol||"\n"}(t,r),d=!1,l=0;u=t.insertSpaces?w(" ",t.tabSize||4):"\t";var g=T.createScanner(o,!1),h=!1;function p(){return f+w(u,n+l)}function m(){var e=g.scan();for(d=!1;15===e||14===e;)d=d||14===e,e=g.scan();return h=16===e||0!==g.getTokenError(),e}var v=[];function y(e,t,n){!h&&t<s&&a<n&&r.substring(t,n)!==e&&v.push({offset:t,length:n-t,content:e})}var b=m();if(17!==b){var k=g.getTokenOffset()+i;y(w(u,n),i,k)}for(;17!==b;){for(var C=g.getTokenOffset()+g.getTokenLength()+i,_=m(),E="";!d&&(12===_||13===_);)y(" ",C,g.getTokenOffset()+i),C=g.getTokenOffset()+g.getTokenLength()+i,E=12===_?p():"",_=m();if(2===_)1!==b&&(l--,E=p());else if(4===_)3!==b&&(l--,E=p());else{switch(b){case 3:case 1:l++,E=p();break;case 5:case 12:E=p();break;case 13:E=d?p():" ";break;case 6:E=" ";break;case 10:if(6===_){E="";break}case 7:case 8:case 9:case 11:case 2:case 4:12===_||13===_?E=" ":5!==_&&17!==_&&(h=!0);break;case 16:h=!0}!d||12!==_&&13!==_||(E=p())}y(E,C,g.getTokenOffset()+i),b=_}return v},t.isEOL=S}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("jsonc-parser/impl/parser",["require","exports","./scanner"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var C=e("./scanner");function s(e,t,n){return void 0===n&&(n=!1),t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}function f(e,t,n){var o=C.createScanner(e,!1);function r(e){return e?function(){return e(o.getTokenOffset(),o.getTokenLength())}:function(){return!0}}function i(t){return t?function(e){return t(e,o.getTokenOffset(),o.getTokenLength())}:function(){return!0}}var a=r(t.onObjectBegin),s=i(t.onObjectProperty),c=r(t.onObjectEnd),u=r(t.onArrayBegin),f=r(t.onArrayEnd),d=i(t.onLiteralValue),l=i(t.onSeparator),g=r(t.onComment),h=i(t.onError),p=n&&n.disallowComments,m=n&&n.allowTrailingComma;function v(){for(;;){var e=o.scan();switch(o.getTokenError()){case 4:y(14);break;case 5:y(15);break;case 3:y(13);break;case 1:p||y(11);break;case 2:y(12);break;case 6:y(16)}switch(e){case 12:case 13:p?y(10):g();break;case 16:y(1);break;case 15:case 14:break;default:return e}}}function y(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=[]),h(e),0<t.length+n.length)for(var r=o.getToken();17!==r;){if(-1!==t.indexOf(r)){v();break}if(-1!==n.indexOf(r))break;r=v()}}function b(e){var t=o.getTokenValue();return e?d(t):s(t),v(),!0}function k(){switch(o.getToken()){case 3:return function(){u(),v();for(var e=!1;4!==o.getToken()&&17!==o.getToken();){if(5===o.getToken()){if(e||y(4,[],[]),l(","),v(),4===o.getToken()&&m)break}else e&&y(6,[],[]);k()||y(4,[],[4,5]),e=!0}return f(),4!==o.getToken()?y(8,[4],[]):v(),!0}();case 1:return function(){a(),v();for(var e=!1;2!==o.getToken()&&17!==o.getToken();){if(5===o.getToken()){if(e||y(4,[],[]),l(","),v(),2===o.getToken()&&m)break}else e&&y(6,[],[]);(10!==o.getToken()?(y(3,[],[2,5]),0):(b(!1),6===o.getToken()?(l(":"),v(),k()||y(4,[],[2,5])):y(5,[],[2,5]),1))||y(4,[],[2,5]),e=!0}return c(),2!==o.getToken()?y(7,[2],[]):v(),!0}();case 10:return b(!0);default:return function(){switch(o.getToken()){case 11:var e=0;try{"number"!=typeof(e=JSON.parse(o.getTokenValue()))&&(y(2),e=0)}catch(e){y(2)}d(e);break;case 7:d(null);break;case 8:d(!0);break;case 9:d(!1);break;default:return!1}return v(),!0}()}}return v(),17===o.getToken()||(k()?(17!==o.getToken()&&y(9,[],[]),!0):(y(4,[],[]),!1))}function d(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string";default:return"null"}}t.getLocation=function(e,o){var i=[],a=new Object,s=void 0,c={value:{},offset:0,length:0,type:"object",parent:void 0},u=!1;function r(e,t,n,r){c.value=e,c.offset=t,c.length=n,c.type=r,c.colonOffset=void 0,s=c}try{f(e,{onObjectBegin:function(e,t){if(o<=e)throw a;s=void 0,u=e<o,i.push("")},onObjectProperty:function(e,t,n){if(o<t)throw a;if(r(e,t,n,"property"),i[i.length-1]=e,o<=t+n)throw a},onObjectEnd:function(e,t){if(o<=e)throw a;s=void 0,i.pop()},onArrayBegin:function(e,t){if(o<=e)throw a;s=void 0,i.push(0)},onArrayEnd:function(e,t){if(o<=e)throw a;s=void 0,i.pop()},onLiteralValue:function(e,t,n){if(o<t)throw a;if(r(e,t,n,d(e)),o<=t+n)throw a},onSeparator:function(e,t,n){if(o<=t)throw a;if(":"===e&&s&&"property"===s.type)s.colonOffset=t,u=!1,s=void 0;else if(","===e){var r=i[i.length-1];"number"==typeof r?i[i.length-1]=r+1:(u=!0,i[i.length-1]=""),s=void 0}}})}catch(e){if(e!==a)throw e}return{path:i,previousNode:s,isAtPropertyKey:u,matches:function(e){for(var t=0,n=0;t<e.length&&n<i.length;n++)if(e[t]===i[n]||"*"===e[t])t++;else if("**"!==e[t])return!1;return t===e.length}}},t.parse=function(e,r,t){void 0===r&&(r=[]);var n=null,o=[],i=[];function a(e){Array.isArray(o)?o.push(e):n&&(o[n]=e)}return f(e,{onObjectBegin:function(){var e={};a(e),i.push(o),o=e,n=null},onObjectProperty:function(e){n=e},onObjectEnd:function(){o=i.pop()},onArrayBegin:function(){var e=[];a(e),i.push(o),o=e,n=null},onArrayEnd:function(){o=i.pop()},onLiteralValue:a,onError:function(e,t,n){r.push({error:e,offset:t,length:n})}},t),o[0]},t.parseTree=function(e,r,t){void 0===r&&(r=[]);var o={type:"array",offset:-1,length:-1,children:[],parent:void 0};function i(e){"property"===o.type&&(o.length=e-o.offset,o=o.parent)}function a(e){return o.children.push(e),e}f(e,{onObjectBegin:function(e){o=a({type:"object",offset:e,length:-1,parent:o,children:[]})},onObjectProperty:function(e,t,n){(o=a({type:"property",offset:t,length:-1,parent:o,children:[]})).children.push({type:"string",value:e,offset:t,length:n,parent:o})},onObjectEnd:function(e,t){o.length=e+t-o.offset,o=o.parent,i(e+t)},onArrayBegin:function(e,t){o=a({type:"array",offset:e,length:-1,parent:o,children:[]})},onArrayEnd:function(e,t){o.length=e+t-o.offset,o=o.parent,i(e+t)},onLiteralValue:function(e,t,n){a({type:d(e),offset:t,length:n,parent:o,value:e}),i(t+n)},onSeparator:function(e,t,n){"property"===o.type&&(":"===e?o.colonOffset=t:","===e&&i(t))},onError:function(e,t,n){r.push({error:e,offset:t,length:n})}},t);var n=o.children[0];return n&&delete n.parent,n},t.findNodeAtLocation=function(e,t){if(e){for(var n=e,r=0,o=t;r<o.length;r++){var i=o[r];if("string"==typeof i){if("object"!==n.type||!Array.isArray(n.children))return;for(var a=!1,s=0,c=n.children;s<c.length;s++){var u=c[s];if(Array.isArray(u.children)&&u.children[0].value===i){n=u.children[1],a=!0;break}}if(!a)return}else{var f=i;if("array"!==n.type||f<0||!Array.isArray(n.children)||f>=n.children.length)return;n=n.children[f]}}return n}},t.getNodePath=function e(t){if(!t.parent||!t.parent.children)return[];var n=e(t.parent);if("property"===t.parent.type){var r=t.parent.children[0].value;n.push(r)}else if("array"===t.parent.type){var o=t.parent.children.indexOf(t);-1!==o&&n.push(o)}return n},t.getNodeValue=function e(t){switch(t.type){case"array":return t.children.map(e);case"object":for(var n=Object.create(null),r=0,o=t.children;r<o.length;r++){var i=o[r],a=i.children[1];a&&(n[i.children[0].value]=e(a))}return n;case"null":case"string":case"number":case"boolean":return t.value;default:return}},t.contains=s,t.findNodeAtOffset=function e(t,n,r){if(void 0===r&&(r=!1),s(t,n,r)){var o=t.children;if(Array.isArray(o))for(var i=0;i<o.length&&o[i].offset<=n;i++){var a=e(o[i],n,r);if(a)return a}return t}},t.visit=f,t.stripComments=function(e,t){var n,r,o=C.createScanner(e),i=[],a=0;do{switch(r=o.getPosition(),n=o.scan()){case 12:case 13:case 17:a!==r&&i.push(e.substring(a,r)),void 0!==t&&i.push(o.getTokenValue().replace(/[^\r\n]/g,t)),a=o.getPosition()}}while(17!==n);return i.join("")}}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("jsonc-parser/impl/edit",["require","exports","./format","./parser"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u=e("./format"),k=e("./parser");function r(e,t,n,r,o){for(var i,a=k.parseTree(e,[]),s=void 0,c=void 0;0<t.length&&(c=t.pop(),void 0===(s=k.findNodeAtLocation(a,t))&&void 0!==n);)"string"==typeof c?((i={})[c]=n,n=i):n=[n];if(s){if("object"===s.type&&"string"==typeof c&&Array.isArray(s.children)){var u=k.findNodeAtLocation(s,[c]);if(void 0!==u){if(void 0===n){if(!u.parent)throw new Error("Malformed AST");var f=s.children.indexOf(u.parent),d=void 0,l=u.parent.offset+u.parent.length;if(0<f)d=(y=s.children[f-1]).offset+y.length;else if(d=s.offset+1,1<s.children.length)l=s.children[1].offset;return C(e,{offset:d,length:l-d,content:""},r)}return C(e,{offset:u.offset,length:u.length,content:JSON.stringify(n)},r)}if(void 0===n)return[];var g=JSON.stringify(c)+": "+JSON.stringify(n),h=o?o(s.children.map(function(e){return e.children[0].value})):s.children.length,p=void 0;return C(e,p=0<h?{offset:(y=s.children[h-1]).offset+y.length,length:0,content:","+g}:0===s.children.length?{offset:s.offset+1,length:0,content:g}:{offset:s.offset+1,length:0,content:g+","},r)}if("array"===s.type&&"number"==typeof c&&Array.isArray(s.children)){if(-1===c){g=""+JSON.stringify(n),p=void 0;if(0===s.children.length)p={offset:s.offset+1,length:0,content:g};else p={offset:(y=s.children[s.children.length-1]).offset+y.length,length:0,content:","+g};return C(e,p,r)}if(void 0===n&&0<=s.children.length){var m=c,v=s.children[m];p=void 0;if(1===s.children.length)p={offset:s.offset+1,length:s.length-2,content:""};else if(s.children.length-1===m){var y,b=(y=s.children[m-1]).offset+y.length;p={offset:b,length:s.offset+s.length-2-b,content:""}}else p={offset:v.offset,length:s.children[m+1].offset-v.offset,content:""};return C(e,p,r)}throw new Error("Array modification not supported yet")}throw new Error("Can not add "+("number"!=typeof c?"index":"property")+" to parent of type "+s.type)}if(void 0===n)throw new Error("Can not delete in empty document");return C(e,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(n)},r)}function C(e,t,n){var r=f(e,t),o=t.offset,i=t.offset+t.content.length;if(0===t.length||0===t.content.length){for(;0<o&&!u.isEOL(r,o-1);)o--;for(;i<r.length&&!u.isEOL(r,i);)i++}for(var a=u.format(r,{offset:o,length:i-o},n),s=a.length-1;0<=s;s--){var c=a[s];r=f(r,c),o=Math.min(o,c.offset),i=Math.max(i,c.offset+c.length),i+=c.content.length-c.length}return[{offset:o,length:e.length-(r.length-i)-o,content:r.substring(o,i)}]}function f(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}t.removeProperty=function(e,t,n){return r(e,t,void 0,n)},t.setProperty=r,t.applyEdit=f,t.isWS=function(e,t){return-1!=="\r\n \t".indexOf(e.charAt(t))}}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("jsonc-parser/main",["require","exports","./impl/format","./impl/edit","./impl/scanner","./impl/parser"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=e("./impl/format"),o=e("./impl/edit"),n=e("./impl/scanner"),i=e("./impl/parser");t.createScanner=n.createScanner,t.getLocation=i.getLocation,t.parse=i.parse,t.parseTree=i.parseTree,t.findNodeAtLocation=i.findNodeAtLocation,t.findNodeAtOffset=i.findNodeAtOffset,t.getNodePath=i.getNodePath,t.getNodeValue=i.getNodeValue,t.visit=i.visit,t.stripComments=i.stripComments,t.format=function(e,t,n){return r.format(e,t,n)},t.modify=function(e,t,n,r){return o.setProperty(e,t,n,r.formattingOptions,r.getInsertionIndex)},t.applyEdits=function(e,t){for(var n=t.length-1;0<=n;n--)e=o.applyEdit(e,t[n]);return e}}),define("jsonc-parser",["jsonc-parser/main"],function(e){return e}),define("vs/language/json/tokenization",["require","exports","jsonc-parser"],function(e,g,h){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.createTokenizationSupport=function(o){return{getInitialState:function(){return new p(null,null,!1)},tokenize:function(e,t,n,r){return function(e,t,n,r,o){void 0===r&&(r=0);var i=0,a=!1;switch(n.scanError){case 2:t='"'+t,i=1;break;case 1:t="/*"+t,i=2}var s,c,u=h.createScanner(t),f=n.lastWasColon;for(c={tokens:[],endState:n.clone()};;){var d=r+u.getPosition(),l="";if(17===(s=u.scan()))break;if(d===r+u.getPosition())throw new Error("Scanner did not advance, next 3 characters are: "+t.substr(u.getPosition(),3));switch(a&&(d-=i),a=0<i,s){case 1:case 2:l=g.TOKEN_DELIM_OBJECT,f=!1;break;case 3:case 4:l=g.TOKEN_DELIM_ARRAY,f=!1;break;case 6:l=g.TOKEN_DELIM_COLON,f=!0;break;case 5:l=g.TOKEN_DELIM_COMMA,f=!1;break;case 8:case 9:l=g.TOKEN_VALUE_BOOLEAN,f=!1;break;case 7:l=g.TOKEN_VALUE_NULL,f=!1;break;case 10:l=f?g.TOKEN_VALUE_STRING:g.TOKEN_PROPERTY_NAME,f=!1;break;case 11:l=g.TOKEN_VALUE_NUMBER,f=!1}if(e)switch(s){case 12:l=g.TOKEN_COMMENT_LINE;break;case 13:l=g.TOKEN_COMMENT_BLOCK}c.endState=new p(n.getStateData(),u.getTokenError(),f),c.tokens.push({startIndex:d,scopes:l})}return c}(o,e,t,n)}}},g.TOKEN_DELIM_OBJECT="delimiter.bracket.json",g.TOKEN_DELIM_ARRAY="delimiter.array.json",g.TOKEN_DELIM_COLON="delimiter.colon.json",g.TOKEN_DELIM_COMMA="delimiter.comma.json",g.TOKEN_VALUE_BOOLEAN="keyword.json",g.TOKEN_VALUE_NULL="keyword.json",g.TOKEN_VALUE_STRING="string.value.json",g.TOKEN_VALUE_NUMBER="number.json",g.TOKEN_PROPERTY_NAME="string.key.json",g.TOKEN_COMMENT_BLOCK="comment.block.json",g.TOKEN_COMMENT_LINE="comment.line.json";var p=function(){function t(e,t,n){this._state=e,this.scanError=t,this.lastWasColon=n}return t.prototype.clone=function(){return new t(this._state,this.scanError,this.lastWasColon)},t.prototype.equals=function(e){return e===this||!!(e&&e instanceof t)&&(this.scanError===e.scanError&&this.lastWasColon===e.lastWasColon)},t.prototype.getStateData=function(){return this._state},t.prototype.setStateData=function(e){this._state=e},t}()}),define("vs/language/json/jsonMode",["require","exports","./workerManager","./languageFeatures","./tokenization"],function(e,t,i,a,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupMode=function(e){var t=[],n=new i.WorkerManager(e);t.push(n);var r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.getLanguageServiceWorker.apply(n,e)},o=e.languageId;t.push(monaco.languages.registerCompletionItemProvider(o,new a.CompletionAdapter(r))),t.push(monaco.languages.registerHoverProvider(o,new a.HoverAdapter(r))),t.push(monaco.languages.registerDocumentSymbolProvider(o,new a.DocumentSymbolAdapter(r))),t.push(monaco.languages.registerDocumentFormattingEditProvider(o,new a.DocumentFormattingEditProvider(r))),t.push(monaco.languages.registerDocumentRangeFormattingEditProvider(o,new a.DocumentRangeFormattingEditProvider(r))),t.push(new a.DiagnosticsAdapter(o,r,e)),t.push(monaco.languages.setTokensProvider(o,s.createTokenizationSupport(!0))),t.push(monaco.languages.setLanguageConfiguration(o,c)),t.push(monaco.languages.registerColorProvider(o,new a.DocumentColorAdapter(r))),t.push(monaco.languages.registerFoldingRangeProvider(o,new a.FoldingRangeAdapter(r)))};var c={wordPattern:/(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"]],autoClosingPairs:[{open:"{",close:"}",notIn:["string"]},{open:"[",close:"]",notIn:["string"]},{open:'"',close:'"',notIn:["string"]}]}});
/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* monaco-json version: 2.1.1(0e6ea95f4f4e093db9201c502e8d401391803233)
* monaco-json version: 2.2.0(370169f666a52e1b91623841799be4eab9204094)
* Released under the MIT license

@@ -5,0 +5,0 @@ * https://github.com/Microsoft/monaco-json/blob/master/LICENSE.md

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc