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.3.0 to 2.4.0

release/esm/_deps/vscode-json-languageservice/services/jsonSelectionRanges.js

14

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

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

"devDependencies": {
"jsonc-parser": "^2.0.2",
"monaco-editor-core": "0.15.0",
"monaco-languages": "1.6.0",
"jsonc-parser": "^2.0.3",
"monaco-editor-core": "0.16.0",
"monaco-languages": "1.7.0",
"monaco-plugin-helpers": "^1.0.2",
"requirejs": "^2.3.6",
"typescript": "3.1.6",
"typescript": "3.3.3333",
"uglify-js": "^3.4.9",
"vscode-json-languageservice": "3.1.5",
"vscode-languageserver-types": "3.10.1"
"vscode-json-languageservice": "3.3.0-next.5",
"vscode-languageserver-types": "3.14.0"
}
}

@@ -60,3 +60,3 @@ define('vs/language/json/monaco.contribution',["require", "exports"], function (require, exports) {

function getMode() {
return monaco.Promise.wrap(new Promise(function (resolve_1, reject_1) { require(['./jsonMode'], resolve_1, reject_1); }));
return new Promise(function (resolve_1, reject_1) { require(['./jsonMode'], resolve_1, reject_1); });
}

@@ -63,0 +63,0 @@ monaco.languages.register({

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

export function setProperty(text, originalPath, value, formattingOptions, getInsertionIndex) {
var _a;
var path = originalPath.slice();

@@ -135,3 +136,2 @@ var errors = [];

}
var _a;
}

@@ -138,0 +138,0 @@ function withFormatting(text, edit, formattingOptions) {

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

import { createScanner } from './scanner';
var ParseOptions;
(function (ParseOptions) {
ParseOptions.DEFAULT = {
allowTrailingComma: false
};
})(ParseOptions || (ParseOptions = {}));
/**

@@ -133,2 +139,3 @@ * For a given offset, evaluate the location in the JSON document. Each segment in the location path is either a property name or an array index.

if (errors === void 0) { errors = []; }
if (options === void 0) { options = ParseOptions.DEFAULT; }
var currentProperty = null;

@@ -182,2 +189,3 @@ var currentParent = [];

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

@@ -350,2 +358,3 @@ function ensurePropertyComplete(endOffset) {

export function visit(text, visitor, options) {
if (options === void 0) { options = ParseOptions.DEFAULT; }
var _scanner = createScanner(text, false);

@@ -352,0 +361,0 @@ function toNoArgVisit(visitFunction) {

@@ -237,6 +237,7 @@ /*---------------------------------------------------------------------------------------------

pos += 2;
var safeLength = len - 1; // For lookahead.
var commentClosed = false;
while (pos < len) {
while (pos < safeLength) {
var ch = text.charCodeAt(pos);
if (ch === 42 /* asterisk */ && (pos + 1 < len) && text.charCodeAt(pos + 1) === 47 /* slash */) {
if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) {
pos += 2;

@@ -243,0 +244,0 @@ commentClosed = true;

@@ -54,2 +54,23 @@ /*---------------------------------------------------------------------------------------------

export var stripComments = parser.stripComments;
export function printParseErrorCode(code) {
switch (code) {
case 1 /* InvalidSymbol */: return 'InvalidSymbol';
case 2 /* InvalidNumberFormat */: return 'InvalidNumberFormat';
case 3 /* PropertyNameExpected */: return 'PropertyNameExpected';
case 4 /* ValueExpected */: return 'ValueExpected';
case 5 /* ColonExpected */: return 'ColonExpected';
case 6 /* CommaExpected */: return 'CommaExpected';
case 7 /* CloseBraceExpected */: return 'CloseBraceExpected';
case 8 /* CloseBracketExpected */: return 'CloseBracketExpected';
case 9 /* EndOfFileExpected */: return 'EndOfFileExpected';
case 10 /* InvalidCommentToken */: return 'InvalidCommentToken';
case 11 /* UnexpectedEndOfComment */: return 'UnexpectedEndOfComment';
case 12 /* UnexpectedEndOfString */: return 'UnexpectedEndOfString';
case 13 /* UnexpectedEndOfNumber */: return 'UnexpectedEndOfNumber';
case 14 /* InvalidUnicode */: return 'InvalidUnicode';
case 15 /* InvalidEscapeCharacter */: return 'InvalidEscapeCharacter';
case 16 /* InvalidCharacter */: return 'InvalidCharacter';
}
return '<unknown ParseErrorCode>';
}
/**

@@ -56,0 +77,0 @@ * Computes the edits needed to format a JSON document.

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

'use strict';
import { TextDocument, Position, CompletionItem, CompletionList, Hover, 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';

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

import { getFoldingRanges } from './services/jsonFolding';
import { format as formatJSON } from './../jsonc-parser/main';
import { getSelectionRanges } from './services/jsonSelectionRanges';
import { format as formatJSON } from '../jsonc-parser/main';
export * from './jsonLanguageTypes';

@@ -24,3 +25,3 @@ export { TextDocument, Position, CompletionItem, CompletionList, Hover, Range, SymbolInformation, Diagnostic, TextEdit, FormattingOptions, MarkedString };

jsonSchemaService.setSchemaContributions(schemaContributions);
var jsonCompletion = new JSONCompletion(jsonSchemaService, params.contributions, promise);
var jsonCompletion = new JSONCompletion(jsonSchemaService, params.contributions, promise, params.clientCapabilities);
var jsonHover = new JSONHover(jsonSchemaService, params.contributions, promise);

@@ -52,2 +53,3 @@ var jsonDocumentSymbols = new JSONDocumentSymbols(jsonSchemaService);

getFoldingRanges: getFoldingRanges,
getSelectionRanges: getSelectionRanges,
format: function (d, r, o) {

@@ -54,0 +56,0 @@ var range = void 0;

@@ -6,5 +6,27 @@ /*---------------------------------------------------------------------------------------------

'use strict';
import { Range, TextEdit, Color, ColorInformation, ColorPresentation, FoldingRange, FoldingRangeKind } from './../vscode-languageserver-types/main';
import { Range, TextEdit, Color, ColorInformation, ColorPresentation, FoldingRange, FoldingRangeKind, MarkupKind } from '../vscode-languageserver-types/main';
export { Range, TextEdit, Color, ColorInformation, ColorPresentation, FoldingRange, FoldingRangeKind };
// #region Proposed types, remove once added to vscode-languageserver-types
/**
* Enum of known selection range kinds
*/
export var SelectionRangeKind;
(function (SelectionRangeKind) {
/**
* Empty Kind.
*/
SelectionRangeKind["Empty"] = "";
/**
* The statment kind, its value is `statement`, possible extensions can be
* `statement.if` etc
*/
SelectionRangeKind["Statement"] = "statement";
/**
* The declaration kind, its value is `declaration`, possible extensions can be
* `declaration.function`, `declaration.class` etc.
*/
SelectionRangeKind["Declaration"] = "declaration";
})(SelectionRangeKind || (SelectionRangeKind = {}));
// #endregion
/**
* Error codes used by diagnostics

@@ -33,2 +55,14 @@ */

})(ErrorCode || (ErrorCode = {}));
export var ClientCapabilities;
(function (ClientCapabilities) {
ClientCapabilities.LATEST = {
textDocument: {
completion: {
completionItem: {
documentationFormat: [MarkupKind.Markdown, MarkupKind.PlainText]
}
}
}
};
})(ClientCapabilities || (ClientCapabilities = {}));
//# sourceMappingURL=jsonLanguageTypes.js.map

@@ -12,3 +12,3 @@ /*---------------------------------------------------------------------------------------------

return extendStatics(d, b);
}
};
return function (d, b) {

@@ -20,8 +20,8 @@ extendStatics(d, b);

})();
import * as Json from './../../jsonc-parser/main';
import * as objects from '../utils/objects';
import * as Json from '../../jsonc-parser/main';
import { isNumber, equals, isBoolean, isString, isDefined } from '../utils/objects';
import { ErrorCode } from '../jsonLanguageTypes';
import * as nls from './../../../fillers/vscode-nls';
import Uri from './../../vscode-uri/index';
import { Diagnostic, DiagnosticSeverity, Range } from './../../vscode-languageserver-types/main';
import * as nls from '../../../fillers/vscode-nls';
import Uri from '../../vscode-uri/index';
import { Diagnostic, DiagnosticSeverity, Range } from '../../vscode-languageserver-types/main';
var localize = nls.loadMessageBundle();

@@ -149,3 +149,3 @@ var colorHexPattern = /^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/;

export function asSchema(schema) {
if (typeof schema === 'boolean') {
if (isBoolean(schema)) {
return schema ? {} : { "not": {} };

@@ -211,6 +211,6 @@ }

ValidationResult.prototype.mergeAll = function (validationResults) {
var _this = this;
validationResults.forEach(function (validationResult) {
_this.merge(validationResult);
});
for (var _i = 0, validationResults_1 = validationResults; _i < validationResults_1.length; _i++) {
var validationResult = validationResults_1[_i];
this.merge(validationResult);
}
};

@@ -372,5 +372,6 @@ ValidationResult.prototype.merge = function (validationResult) {

if (Array.isArray(schema.allOf)) {
schema.allOf.forEach(function (subSchemaRef) {
for (var _i = 0, _a = schema.allOf; _i < _a.length; _i++) {
var subSchemaRef = _a[_i];
validate(node, asSchema(subSchemaRef), validationResult, matchingSchemas);
});
}
}

@@ -389,6 +390,7 @@ var notSchema = asSchema(schema.not);

}
subMatchingSchemas.schemas.forEach(function (ms) {
for (var _b = 0, _c = subMatchingSchemas.schemas; _b < _c.length; _b++) {
var ms = _c[_b];
ms.inverted = !ms.inverted;
matchingSchemas.add(ms);
});
}
}

@@ -399,3 +401,4 @@ var testAlternatives = function (alternatives, maxOneMatch) {

var bestMatch = null;
alternatives.forEach(function (subSchemaRef) {
for (var _i = 0, alternatives_1 = alternatives; _i < alternatives_1.length; _i++) {
var subSchemaRef = alternatives_1[_i];
var subSchema = asSchema(subSchemaRef);

@@ -431,3 +434,3 @@ var subValidationResult = new ValidationResult();

}
});
}
if (matches.length > 1 && maxOneMatch) {

@@ -455,6 +458,5 @@ validationResult.problems.push({

var testBranch = function (schema) {
var subSchema = asSchema(schema);
var subValidationResult = new ValidationResult();
var subMatchingSchemas = matchingSchemas.newSub();
validate(node, subSchema, subValidationResult, subMatchingSchemas);
validate(node, asSchema(schema), subValidationResult, subMatchingSchemas);
validationResult.merge(subValidationResult);

@@ -470,2 +472,3 @@ validationResult.propertiesMatches += subValidationResult.propertiesMatches;

validate(node, subSchema, subValidationResult, subMatchingSchemas);
matchingSchemas.merge(subMatchingSchemas);
if (!subValidationResult.hasProblems()) {

@@ -480,4 +483,5 @@ if (thenSchema) {

};
if (schema.if) {
testCondition(schema.if, schema.then, schema.else);
var ifSchema = asSchema(schema.if);
if (ifSchema) {
testCondition(ifSchema, asSchema(schema.then), asSchema(schema.else));
}

@@ -487,5 +491,5 @@ if (Array.isArray(schema.enum)) {

var enumValueMatch = false;
for (var _i = 0, _a = schema.enum; _i < _a.length; _i++) {
var e = _a[_i];
if (objects.equals(val, e)) {
for (var _d = 0, _e = schema.enum; _d < _e.length; _d++) {
var e = _e[_d];
if (equals(val, e)) {
enumValueMatch = true;

@@ -506,5 +510,5 @@ break;

}
if (schema.const) {
if (isDefined(schema.const)) {
var val = getNodeValue(node);
if (!objects.equals(val, schema.const)) {
if (!equals(val, schema.const)) {
validationResult.problems.push({

@@ -533,3 +537,3 @@ location: { offset: node.offset, length: node.length },

var val = node.value;
if (typeof schema.multipleOf === 'number') {
if (isNumber(schema.multipleOf)) {
if (val % schema.multipleOf !== 0) {

@@ -544,6 +548,6 @@ validationResult.problems.push({

function getExclusiveLimit(limit, exclusive) {
if (typeof exclusive === 'number') {
if (isNumber(exclusive)) {
return exclusive;
}
if (typeof exclusive === 'boolean' && exclusive) {
if (isBoolean(exclusive) && exclusive) {
return limit;

@@ -554,3 +558,3 @@ }

function getLimit(limit, exclusive) {
if (typeof exclusive !== 'boolean' || !exclusive) {
if (!isBoolean(exclusive) || !exclusive) {
return limit;

@@ -561,3 +565,3 @@ }

var exclusiveMinimum = getExclusiveLimit(schema.minimum, schema.exclusiveMinimum);
if (typeof exclusiveMinimum === 'number' && val <= exclusiveMinimum) {
if (isNumber(exclusiveMinimum) && val <= exclusiveMinimum) {
validationResult.problems.push({

@@ -570,3 +574,3 @@ location: { offset: node.offset, length: node.length },

var exclusiveMaximum = getExclusiveLimit(schema.maximum, schema.exclusiveMaximum);
if (typeof exclusiveMaximum === 'number' && val >= exclusiveMaximum) {
if (isNumber(exclusiveMaximum) && val >= exclusiveMaximum) {
validationResult.problems.push({

@@ -579,3 +583,3 @@ location: { offset: node.offset, length: node.length },

var minimum = getLimit(schema.minimum, schema.exclusiveMinimum);
if (typeof minimum === 'number' && val < minimum) {
if (isNumber(minimum) && val < minimum) {
validationResult.problems.push({

@@ -588,3 +592,3 @@ location: { offset: node.offset, length: node.length },

var maximum = getLimit(schema.maximum, schema.exclusiveMaximum);
if (typeof maximum === 'number' && val > maximum) {
if (isNumber(maximum) && val > maximum) {
validationResult.problems.push({

@@ -598,3 +602,3 @@ location: { offset: node.offset, length: node.length },

function _validateStringNode(node, schema, validationResult, matchingSchemas) {
if (schema.minLength && node.value.length < schema.minLength) {
if (isNumber(schema.minLength) && node.value.length < schema.minLength) {
validationResult.problems.push({

@@ -606,3 +610,3 @@ location: { offset: node.offset, length: node.length },

}
if (schema.maxLength && node.value.length > schema.maxLength) {
if (isNumber(schema.maxLength) && node.value.length > schema.maxLength) {
validationResult.problems.push({

@@ -614,3 +618,3 @@ location: { offset: node.offset, length: node.length },

}
if (schema.pattern) {
if (isString(schema.pattern)) {
var regex = new RegExp(schema.pattern);

@@ -682,4 +686,5 @@ if (!regex.test(node.value)) {

if (Array.isArray(schema.items)) {
var subSchemas_1 = schema.items;
subSchemas_1.forEach(function (subSchemaRef, index) {
var subSchemas = schema.items;
for (var index = 0; index < subSchemas.length; index++) {
var subSchemaRef = subSchemas[index];
var subSchema = asSchema(subSchemaRef);

@@ -692,9 +697,9 @@ var itemValidationResult = new ValidationResult();

}
else if (node.items.length >= subSchemas_1.length) {
else if (node.items.length >= subSchemas.length) {
validationResult.propertiesValueMatches++;
}
});
if (node.items.length > subSchemas_1.length) {
}
if (node.items.length > subSchemas.length) {
if (typeof schema.additionalItems === 'object') {
for (var i = subSchemas_1.length; i < node.items.length; i++) {
for (var i = subSchemas.length; i < node.items.length; i++) {
var itemValidationResult = new ValidationResult();

@@ -709,3 +714,3 @@ validate(node.items[i], schema.additionalItems, itemValidationResult, matchingSchemas);

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

@@ -716,9 +721,10 @@ }

else {
var itemSchema_1 = asSchema(schema.items);
if (itemSchema_1) {
node.items.forEach(function (item) {
var itemSchema = asSchema(schema.items);
if (itemSchema) {
for (var _i = 0, _a = node.items; _i < _a.length; _i++) {
var item = _a[_i];
var itemValidationResult = new ValidationResult();
validate(item, itemSchema_1, itemValidationResult, matchingSchemas);
validate(item, itemSchema, itemValidationResult, matchingSchemas);
validationResult.mergePropertyMatch(itemValidationResult);
});
}
}

@@ -741,3 +747,3 @@ }

}
if (schema.minItems && node.items.length < schema.minItems) {
if (isNumber(schema.minItems) && node.items.length < schema.minItems) {
validationResult.problems.push({

@@ -749,3 +755,3 @@ location: { offset: node.offset, length: node.length },

}
if (schema.maxItems && node.items.length > schema.maxItems) {
if (isNumber(schema.maxItems) && node.items.length > schema.maxItems) {
validationResult.problems.push({

@@ -774,9 +780,11 @@ location: { offset: node.offset, length: node.length },

var unprocessedProperties = [];
node.properties.forEach(function (node) {
var key = node.keyNode.value;
seenKeys[key] = node.valueNode;
for (var _i = 0, _a = node.properties; _i < _a.length; _i++) {
var propertyNode = _a[_i];
var key = propertyNode.keyNode.value;
seenKeys[key] = propertyNode.valueNode;
unprocessedProperties.push(key);
});
}
if (Array.isArray(schema.required)) {
schema.required.forEach(function (propertyName) {
for (var _b = 0, _c = schema.required; _b < _c.length; _b++) {
var propertyName = _c[_b];
if (!seenKeys[propertyName]) {

@@ -791,3 +799,3 @@ var keyNode = node.parent && node.parent.type === 'property' && node.parent.keyNode;

}
});
}
}

@@ -802,3 +810,4 @@ var propertyProcessed = function (prop) {

if (schema.properties) {
Object.keys(schema.properties).forEach(function (propertyName) {
for (var _d = 0, _e = Object.keys(schema.properties); _d < _e.length; _d++) {
var propertyName = _e[_d];
propertyProcessed(propertyName);

@@ -808,3 +817,3 @@ var propertySchema = schema.properties[propertyName];

if (child) {
if (typeof propertySchema === 'boolean') {
if (isBoolean(propertySchema)) {
if (!propertySchema) {

@@ -829,8 +838,10 @@ var propertyNode = child.parent;

}
});
}
}
if (schema.patternProperties) {
Object.keys(schema.patternProperties).forEach(function (propertyPattern) {
for (var _f = 0, _g = Object.keys(schema.patternProperties); _f < _g.length; _f++) {
var propertyPattern = _g[_f];
var regex = new RegExp(propertyPattern);
unprocessedProperties.slice(0).forEach(function (propertyName) {
for (var _h = 0, _j = unprocessedProperties.slice(0); _h < _j.length; _h++) {
var propertyName = _j[_h];
if (regex.test(propertyName)) {

@@ -841,3 +852,3 @@ propertyProcessed(propertyName);

var propertySchema = schema.patternProperties[propertyPattern];
if (typeof propertySchema === 'boolean') {
if (isBoolean(propertySchema)) {
if (!propertySchema) {

@@ -863,7 +874,8 @@ var propertyNode = child.parent;

}
});
});
}
}
}
if (typeof schema.additionalProperties === 'object') {
unprocessedProperties.forEach(function (propertyName) {
for (var _k = 0, unprocessedProperties_1 = unprocessedProperties; _k < unprocessedProperties_1.length; _k++) {
var propertyName = unprocessedProperties_1[_k];
var child = seenKeys[propertyName];

@@ -875,7 +887,8 @@ if (child) {

}
});
}
}
else if (schema.additionalProperties === false) {
if (unprocessedProperties.length > 0) {
unprocessedProperties.forEach(function (propertyName) {
for (var _l = 0, unprocessedProperties_2 = unprocessedProperties; _l < unprocessedProperties_2.length; _l++) {
var propertyName = unprocessedProperties_2[_l];
var child = seenKeys[propertyName];

@@ -890,6 +903,6 @@ if (child) {

}
});
}
}
}
if (schema.maxProperties) {
if (isNumber(schema.maxProperties)) {
if (node.properties.length > schema.maxProperties) {

@@ -903,3 +916,3 @@ validationResult.problems.push({

}
if (schema.minProperties) {
if (isNumber(schema.minProperties)) {
if (node.properties.length < schema.minProperties) {

@@ -914,3 +927,4 @@ validationResult.problems.push({

if (schema.dependencies) {
Object.keys(schema.dependencies).forEach(function (key) {
for (var _m = 0, _o = Object.keys(schema.dependencies); _m < _o.length; _m++) {
var key = _o[_m];
var prop = seenKeys[key];

@@ -920,3 +934,4 @@ if (prop) {

if (Array.isArray(propertyDep)) {
propertyDep.forEach(function (requiredProp) {
for (var _p = 0, propertyDep_1 = propertyDep; _p < propertyDep_1.length; _p++) {
var requiredProp = propertyDep_1[_p];
if (!seenKeys[requiredProp]) {

@@ -932,3 +947,3 @@ validationResult.problems.push({

}
});
}
}

@@ -944,7 +959,8 @@ else {

}
});
}
}
var propertyNames = asSchema(schema.propertyNames);
if (propertyNames) {
node.properties.forEach(function (f) {
for (var _q = 0, _r = node.properties; _q < _r.length; _q++) {
var f = _r[_q];
var key = f.keyNode;

@@ -954,3 +970,3 @@ if (key) {

}
});
}
}

@@ -1203,3 +1219,3 @@ }

var numberValue = JSON.parse(tokenValue);
if (typeof numberValue !== 'number') {
if (!isNumber(numberValue)) {
return _error(localize('InvalidNumberFormat', 'Invalid number format.'), ErrorCode.Undefined, node);

@@ -1206,0 +1222,0 @@ }

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

'use strict';
import * as nls from './../../../fillers/vscode-nls';
import * as nls from '../../../fillers/vscode-nls';
var localize = nls.loadMessageBundle();

@@ -20,3 +20,5 @@ export var schemaContributions = {

'minItems': 1,
'items': { '$ref': '#' }
'items': {
'$ref': '#'
}
},

@@ -28,11 +30,28 @@ 'positiveInteger': {

'positiveIntegerDefault0': {
'allOf': [{ '$ref': '#/definitions/positiveInteger' }, { 'default': 0 }]
'allOf': [
{
'$ref': '#/definitions/positiveInteger'
},
{
'default': 0
}
]
},
'simpleTypes': {
'type': 'string',
'enum': ['array', 'boolean', 'integer', 'null', 'number', 'object', 'string']
'enum': [
'array',
'boolean',
'integer',
'null',
'number',
'object',
'string'
]
},
'stringArray': {
'type': 'array',
'items': { 'type': 'string' },
'items': {
'type': 'string'
},
'minItems': 1,

@@ -46,138 +65,144 @@ 'uniqueItems': true

'type': 'string',
'format': 'uri',
'description': localize('schema.json.id', 'A unique identifier for the schema.')
'format': 'uri'
},
'$schema': {
'type': 'string',
'format': 'uri',
'description': localize('schema.json.$schema', 'The schema to verify this document against ')
'format': 'uri'
},
'title': {
'type': 'string',
'description': localize('schema.json.title', 'A descriptive title of the element')
'type': 'string'
},
'description': {
'type': 'string',
'description': localize('schema.json.description', 'A long description of the element. Used in hover menus and suggestions.')
'type': 'string'
},
'default': {
'description': localize('schema.json.default', 'A default value. Used by suggestions.')
},
'default': {},
'multipleOf': {
'type': 'number',
'minimum': 0,
'exclusiveMinimum': true,
'description': localize('schema.json.multipleOf', 'A number that should cleanly divide the current value (i.e. have no remainder)')
'exclusiveMinimum': true
},
'maximum': {
'type': 'number',
'description': localize('schema.json.maximum', 'The maximum numerical value, inclusive by default.')
'type': 'number'
},
'exclusiveMaximum': {
'type': 'boolean',
'default': false,
'description': localize('schema.json.exclusiveMaximum', 'Makes the maximum property exclusive.')
'default': false
},
'minimum': {
'type': 'number',
'description': localize('schema.json.minimum', 'The minimum numerical value, inclusive by default.')
'type': 'number'
},
'exclusiveMinimum': {
'type': 'boolean',
'default': false,
'description': localize('schema.json.exclusiveMininum', 'Makes the minimum property exclusive.')
'default': false
},
'maxLength': {
'allOf': [
{ '$ref': '#/definitions/positiveInteger' }
],
'description': localize('schema.json.maxLength', 'The maximum length of a string.')
{
'$ref': '#/definitions/positiveInteger'
}
]
},
'minLength': {
'allOf': [
{ '$ref': '#/definitions/positiveIntegerDefault0' }
],
'description': localize('schema.json.minLength', 'The minimum length of a string.')
{
'$ref': '#/definitions/positiveIntegerDefault0'
}
]
},
'pattern': {
'type': 'string',
'format': 'regex',
'description': localize('schema.json.pattern', 'A regular expression to match the string against. It is not implicitly anchored.')
'format': 'regex'
},
'additionalItems': {
'anyOf': [
{ 'type': 'boolean' },
{ '$ref': '#' }
{
'type': 'boolean'
},
{
'$ref': '#'
}
],
'default': {},
'description': localize('schema.json.additionalItems', 'For arrays, only when items is set as an array. If it is a schema, then this schema validates items after the ones specified by the items array. If it is false, then additional items will cause validation to fail.')
'default': {}
},
'items': {
'anyOf': [
{ '$ref': '#' },
{ '$ref': '#/definitions/schemaArray' }
{
'$ref': '#'
},
{
'$ref': '#/definitions/schemaArray'
}
],
'default': {},
'description': localize('schema.json.items', 'For arrays. Can either be a schema to validate every element against or an array of schemas to validate each item against in order (the first schema will validate the first element, the second schema will validate the second element, and so on.')
'default': {}
},
'maxItems': {
'allOf': [
{ '$ref': '#/definitions/positiveInteger' }
],
'description': localize('schema.json.maxItems', 'The maximum number of items that can be inside an array. Inclusive.')
{
'$ref': '#/definitions/positiveInteger'
}
]
},
'minItems': {
'allOf': [
{ '$ref': '#/definitions/positiveIntegerDefault0' }
],
'description': localize('schema.json.minItems', 'The minimum number of items that can be inside an array. Inclusive.')
{
'$ref': '#/definitions/positiveIntegerDefault0'
}
]
},
'uniqueItems': {
'type': 'boolean',
'default': false,
'description': localize('schema.json.uniqueItems', 'If all of the items in the array must be unique. Defaults to false.')
'default': false
},
'maxProperties': {
'allOf': [
{ '$ref': '#/definitions/positiveInteger' }
],
'description': localize('schema.json.maxProperties', 'The maximum number of properties an object can have. Inclusive.')
{
'$ref': '#/definitions/positiveInteger'
}
]
},
'minProperties': {
'allOf': [
{ '$ref': '#/definitions/positiveIntegerDefault0' },
],
'description': localize('schema.json.minProperties', 'The minimum number of properties an object can have. Inclusive.')
{
'$ref': '#/definitions/positiveIntegerDefault0'
}
]
},
'required': {
'allOf': [
{ '$ref': '#/definitions/stringArray' }
],
'description': localize('schema.json.required', 'An array of strings that lists the names of all properties required on this object.')
{
'$ref': '#/definitions/stringArray'
}
]
},
'additionalProperties': {
'anyOf': [
{ 'type': 'boolean' },
{ '$ref': '#' }
{
'type': 'boolean'
},
{
'$ref': '#'
}
],
'default': {},
'description': localize('schema.json.additionalProperties', 'Either a schema or a boolean. If a schema, then used to validate all properties not matched by \'properties\' or \'patternProperties\'. If false, then any properties not matched by either will cause this schema to fail.')
'default': {}
},
'definitions': {
'type': 'object',
'additionalProperties': { '$ref': '#' },
'default': {},
'description': localize('schema.json.definitions', 'Not used for validation. Place subschemas here that you wish to reference inline with $ref')
'additionalProperties': {
'$ref': '#'
},
'default': {}
},
'properties': {
'type': 'object',
'additionalProperties': { '$ref': '#' },
'default': {},
'description': localize('schema.json.properties', 'A map of property names to schemas for each property.')
'additionalProperties': {
'$ref': '#'
},
'default': {}
},
'patternProperties': {
'type': 'object',
'additionalProperties': { '$ref': '#' },
'default': {},
'description': localize('schema.json.patternProperties', 'A map of regular expressions on property names to schemas for matching properties.')
'additionalProperties': {
'$ref': '#'
},
'default': {}
},

@@ -188,7 +213,10 @@ 'dependencies': {

'anyOf': [
{ '$ref': '#' },
{ '$ref': '#/definitions/stringArray' }
{
'$ref': '#'
},
{
'$ref': '#/definitions/stringArray'
}
]
},
'description': localize('schema.json.dependencies', 'A map of property names to either an array of property names or a schema. An array of property names means the property named in the key depends on the properties in the array being present in the object in order to be valid. If the value is a schema, then the schema is only applied to the object if the property in the key exists on the object.')
}
},

@@ -198,16 +226,18 @@ 'enum': {

'minItems': 1,
'uniqueItems': true,
'description': localize('schema.json.enum', 'The set of literal values that are valid')
'uniqueItems': true
},
'type': {
'anyOf': [
{ '$ref': '#/definitions/simpleTypes' },
{
'$ref': '#/definitions/simpleTypes'
},
{
'type': 'array',
'items': { '$ref': '#/definitions/simpleTypes' },
'items': {
'$ref': '#/definitions/simpleTypes'
},
'minItems': 1,
'uniqueItems': true
}
],
'description': localize('schema.json.type', 'Either a string of one of the basic schema types (number, integer, null, array, object, boolean, string) or an array of strings specifying a subset of those types.')
]
},

@@ -218,5 +248,13 @@ 'format': {

'type': 'string',
'description': localize('schema.json.format', 'Describes the format expected for the value.'),
'enum': ['date-time', 'uri', 'email', 'hostname', 'ipv4', 'ipv6', 'regex']
}, {
'enum': [
'date-time',
'uri',
'email',
'hostname',
'ipv4',
'ipv6',
'regex'
]
},
{
'type': 'string'

@@ -228,33 +266,271 @@ }

'allOf': [
{ '$ref': '#/definitions/schemaArray' }
],
'description': localize('schema.json.allOf', 'An array of schemas, all of which must match.')
{
'$ref': '#/definitions/schemaArray'
}
]
},
'anyOf': {
'allOf': [
{ '$ref': '#/definitions/schemaArray' }
],
'description': localize('schema.json.anyOf', 'An array of schemas, where at least one must match.')
{
'$ref': '#/definitions/schemaArray'
}
]
},
'oneOf': {
'allOf': [
{ '$ref': '#/definitions/schemaArray' }
],
'description': localize('schema.json.oneOf', 'An array of schemas, exactly one of which must match.')
{
'$ref': '#/definitions/schemaArray'
}
]
},
'not': {
'allOf': [
{ '$ref': '#' }
],
'description': localize('schema.json.not', 'A schema which must not match.')
{
'$ref': '#'
}
]
}
},
'dependencies': {
'exclusiveMaximum': ['maximum'],
'exclusiveMinimum': ['minimum']
'exclusiveMaximum': [
'maximum'
],
'exclusiveMinimum': [
'minimum'
]
},
'default': {}
},
'http://json-schema.org/draft-07/schema#': {
'title': localize('schema.json', 'Describes a JSON file using a schema. See json-schema.org for more info.'),
'definitions': {
'schemaArray': {
'type': 'array',
'minItems': 1,
'items': { '$ref': '#' }
},
'nonNegativeInteger': {
'type': 'integer',
'minimum': 0
},
'nonNegativeIntegerDefault0': {
'allOf': [
{ '$ref': '#/definitions/nonNegativeInteger' },
{ 'default': 0 }
]
},
'simpleTypes': {
'enum': [
'array',
'boolean',
'integer',
'null',
'number',
'object',
'string'
]
},
'stringArray': {
'type': 'array',
'items': { 'type': 'string' },
'uniqueItems': true,
'default': []
}
},
'type': ['object', 'boolean'],
'properties': {
'$id': {
'type': 'string',
'format': 'uri-reference'
},
'$schema': {
'type': 'string',
'format': 'uri'
},
'$ref': {
'type': 'string',
'format': 'uri-reference'
},
'$comment': {
'type': 'string'
},
'title': {
'type': 'string'
},
'description': {
'type': 'string'
},
'default': true,
'readOnly': {
'type': 'boolean',
'default': false
},
'examples': {
'type': 'array',
'items': true
},
'multipleOf': {
'type': 'number',
'exclusiveMinimum': 0
},
'maximum': {
'type': 'number'
},
'exclusiveMaximum': {
'type': 'number'
},
'minimum': {
'type': 'number'
},
'exclusiveMinimum': {
'type': 'number'
},
'maxLength': { '$ref': '#/definitions/nonNegativeInteger' },
'minLength': { '$ref': '#/definitions/nonNegativeIntegerDefault0' },
'pattern': {
'type': 'string',
'format': 'regex'
},
'additionalItems': { '$ref': '#' },
'items': {
'anyOf': [
{ '$ref': '#' },
{ '$ref': '#/definitions/schemaArray' }
],
'default': true
},
'maxItems': { '$ref': '#/definitions/nonNegativeInteger' },
'minItems': { '$ref': '#/definitions/nonNegativeIntegerDefault0' },
'uniqueItems': {
'type': 'boolean',
'default': false
},
'contains': { '$ref': '#' },
'maxProperties': { '$ref': '#/definitions/nonNegativeInteger' },
'minProperties': { '$ref': '#/definitions/nonNegativeIntegerDefault0' },
'required': { '$ref': '#/definitions/stringArray' },
'additionalProperties': { '$ref': '#' },
'definitions': {
'type': 'object',
'additionalProperties': { '$ref': '#' },
'default': {}
},
'properties': {
'type': 'object',
'additionalProperties': { '$ref': '#' },
'default': {}
},
'patternProperties': {
'type': 'object',
'additionalProperties': { '$ref': '#' },
'propertyNames': { 'format': 'regex' },
'default': {}
},
'dependencies': {
'type': 'object',
'additionalProperties': {
'anyOf': [
{ '$ref': '#' },
{ '$ref': '#/definitions/stringArray' }
]
}
},
'propertyNames': { '$ref': '#' },
'const': true,
'enum': {
'type': 'array',
'items': true,
'minItems': 1,
'uniqueItems': true
},
'type': {
'anyOf': [
{ '$ref': '#/definitions/simpleTypes' },
{
'type': 'array',
'items': { '$ref': '#/definitions/simpleTypes' },
'minItems': 1,
'uniqueItems': true
}
]
},
'format': { 'type': 'string' },
'contentMediaType': { 'type': 'string' },
'contentEncoding': { 'type': 'string' },
'if': { '$ref': '#' },
'then': { '$ref': '#' },
'else': { '$ref': '#' },
'allOf': { '$ref': '#/definitions/schemaArray' },
'anyOf': { '$ref': '#/definitions/schemaArray' },
'oneOf': { '$ref': '#/definitions/schemaArray' },
'not': { '$ref': '#' }
},
'default': true
}
}
};
var descriptions = {
id: localize('schema.json.id', "A unique identifier for the schema."),
$schema: localize('schema.json.$schema', "The schema to verify this document against."),
title: localize('schema.json.title', "A descriptive title of the element."),
description: localize('schema.json.description', "A long description of the element. Used in hover menus and suggestions."),
default: localize('schema.json.default', "A default value. Used by suggestions."),
multipleOf: localize('schema.json.multipleOf', "A number that should cleanly divide the current value (i.e. have no remainder)."),
maximum: localize('schema.json.maximum', "The maximum numerical value, inclusive by default."),
exclusiveMaximum: localize('schema.json.exclusiveMaximum', "Makes the maximum property exclusive."),
minimum: localize('schema.json.minimum', "The minimum numerical value, inclusive by default."),
exclusiveMinimum: localize('schema.json.exclusiveMininum', "Makes the minimum property exclusive."),
maxLength: localize('schema.json.maxLength', "The maximum length of a string."),
minLength: localize('schema.json.minLength', "The minimum length of a string."),
pattern: localize('schema.json.pattern', "A regular expression to match the string against. It is not implicitly anchored."),
additionalItems: localize('schema.json.additionalItems', "For arrays, only when items is set as an array. If it is a schema, then this schema validates items after the ones specified by the items array. If it is false, then additional items will cause validation to fail."),
items: localize('schema.json.items', "For arrays. Can either be a schema to validate every element against or an array of schemas to validate each item against in order (the first schema will validate the first element, the second schema will validate the second element, and so on."),
maxItems: localize('schema.json.maxItems', "The maximum number of items that can be inside an array. Inclusive."),
minItems: localize('schema.json.minItems', "The minimum number of items that can be inside an array. Inclusive."),
uniqueItems: localize('schema.json.uniqueItems', "If all of the items in the array must be unique. Defaults to false."),
maxProperties: localize('schema.json.maxProperties', "The maximum number of properties an object can have. Inclusive."),
minProperties: localize('schema.json.minProperties', "The minimum number of properties an object can have. Inclusive."),
required: localize('schema.json.required', "An array of strings that lists the names of all properties required on this object."),
additionalProperties: localize('schema.json.additionalProperties', "Either a schema or a boolean. If a schema, then used to validate all properties not matched by 'properties' or 'patternProperties'. If false, then any properties not matched by either will cause this schema to fail."),
definitions: localize('schema.json.definitions', "Not used for validation. Place subschemas here that you wish to reference inline with $ref."),
properties: localize('schema.json.properties', "A map of property names to schemas for each property."),
patternProperties: localize('schema.json.patternProperties', "A map of regular expressions on property names to schemas for matching properties."),
dependencies: localize('schema.json.dependencies', "A map of property names to either an array of property names or a schema. An array of property names means the property named in the key depends on the properties in the array being present in the object in order to be valid. If the value is a schema, then the schema is only applied to the object if the property in the key exists on the object."),
enum: localize('schema.json.enum', "The set of literal values that are valid."),
type: localize('schema.json.type', "Either a string of one of the basic schema types (number, integer, null, array, object, boolean, string) or an array of strings specifying a subset of those types."),
format: localize('schema.json.format', "Describes the format expected for the value."),
allOf: localize('schema.json.allOf', "An array of schemas, all of which must match."),
anyOf: localize('schema.json.anyOf', "An array of schemas, where at least one must match."),
oneOf: localize('schema.json.oneOf', "An array of schemas, exactly one of which must match."),
not: localize('schema.json.not', "A schema which must not match."),
$id: localize('schema.json.$id', "A unique identifier for the schema."),
$ref: localize('schema.json.$ref', "Reference a definition hosted on any location."),
$comment: localize('schema.json.$comment', "Comments from schema authors to readers or maintainers of the schema."),
readOnly: localize('schema.json.readOnly', "Indicates that the value of the instance is managed exclusively by the owning authority."),
examples: localize('schema.json.examples', "Sample JSON values associated with a particular schema, for the purpose of illustrating usage."),
contains: localize('schema.json.contains', "An array instance is valid against \"contains\" if at least one of its elements is valid against the given schema."),
propertyNames: localize('schema.json.propertyNames', "If the instance is an object, this keyword validates if every property name in the instance validates against the provided schema."),
const: localize('schema.json.const', "An instance validates successfully against this keyword if its value is equal to the value of the keyword."),
contentMediaType: localize('schema.json.contentMediaType', "Describes the media type of a string property."),
contentEncoding: localize('schema.json.contentEncoding', "Describes the content encoding of a string property."),
if: localize('schema.json.if', "The validation outcome of the \"if\" subschema controls which of the \"then\" or \"else\" keywords are evaluated."),
then: localize('schema.json.then', "The \"if\" subschema is used for validation when the \"if\" subschema succeeds."),
else: localize('schema.json.else', "The \"else\" subschema is used for validation when the \"if\" subschema fails.")
};
for (var schemaName in schemaContributions.schemas) {
var schema = schemaContributions.schemas[schemaName];
for (var property in schema.properties) {
var propertyObject = schema.properties[property];
if (propertyObject === true) {
propertyObject = schema.properties[property] = {};
}
var description = descriptions[property];
if (description) {
propertyObject['description'] = description;
}
else {
console.log(property + ": localize('schema.json." + property + "', \"\")");
}
}
}
//# sourceMappingURL=configuration.js.map

@@ -7,15 +7,19 @@ /*---------------------------------------------------------------------------------------------

import * as Parser from '../parser/jsonParser';
import * as Json from './../../jsonc-parser/main';
import * as Json from '../../jsonc-parser/main';
import { stringifyObject } from '../utils/json';
import { endsWith } from '../utils/strings';
import { CompletionItem, CompletionItemKind, Range, TextEdit, InsertTextFormat } from './../../vscode-languageserver-types/main';
import * as nls from './../../../fillers/vscode-nls';
import { isDefined } from '../utils/objects';
import { CompletionItem, CompletionItemKind, Range, TextEdit, InsertTextFormat, MarkupKind } from '../../vscode-languageserver-types/main';
import * as nls from '../../../fillers/vscode-nls';
var localize = nls.loadMessageBundle();
var JSONCompletion = /** @class */ (function () {
function JSONCompletion(schemaService, contributions, promiseConstructor) {
function JSONCompletion(schemaService, contributions, promiseConstructor, clientCapabilities) {
if (contributions === void 0) { contributions = []; }
this.templateVarIdCounter = 0;
if (promiseConstructor === void 0) { promiseConstructor = Promise; }
if (clientCapabilities === void 0) { clientCapabilities = {}; }
this.schemaService = schemaService;
this.contributions = contributions;
this.promise = promiseConstructor || Promise;
this.promiseConstructor = promiseConstructor;
this.clientCapabilities = clientCapabilities;
this.templateVarIdCounter = 0;
}

@@ -31,3 +35,3 @@ JSONCompletion.prototype.doResolve = function (item) {

}
return this.promise.resolve(item);
return this.promiseConstructor.resolve(item);
};

@@ -140,4 +144,5 @@ JSONCompletion.prototype.doComplete = function (document, position, doc) {

insertText: _this.getInsertTextForProperty(currentWord, null, false, separatorAfter_1),
insertTextFormat: InsertTextFormat.Snippet, documentation: ''
insertTextFormat: InsertTextFormat.Snippet, documentation: '',
});
collector.setAsIncomplete();
}

@@ -158,3 +163,3 @@ }

}
return _this.promise.all(collectionPromises).then(function () {
return _this.promiseConstructor.all(collectionPromises).then(function () {
if (collector.getNumberOfProposals() === 0) {

@@ -184,7 +189,7 @@ var offsetForSeparator = offset;

kind: CompletionItemKind.Property,
label: key,
label: _this.sanitizeLabel(key),
insertText: _this.getInsertTextForProperty(key, propertySchema, addValue, separatorAfter),
insertTextFormat: InsertTextFormat.Snippet,
filterText: _this.getFilterTextForValue(key),
documentation: propertySchema.description || '',
documentation: _this.fromMarkup(propertySchema.markdownDescription) || propertySchema.description || '',
};

@@ -211,3 +216,3 @@ if (endsWith(proposal.insertText, "$1" + separatorAfter)) {

kind: CompletionItemKind.Property,
label: key,
label: _this.sanitizeLabel(key),
insertText: _this.getInsertTextForValue(key, ''),

@@ -443,6 +448,23 @@ insertTextFormat: InsertTextFormat.Snippet,

insertTextFormat: InsertTextFormat.Snippet,
detail: localize('json.suggest.default', 'Default value'),
detail: localize('json.suggest.default', 'Default value')
});
hasProposals = true;
}
if (Array.isArray(schema.examples)) {
schema.examples.forEach(function (example) {
var type = schema.type;
var value = example;
for (var i = arrayDepth; i > 0; i--) {
value = [value];
type = 'array';
}
collector.add({
kind: _this.getSuggestionKind(type),
label: _this.getLabelForValue(value),
insertText: _this.getInsertTextForValue(value, separatorAfter),
insertTextFormat: InsertTextFormat.Snippet
});
hasProposals = true;
});
}
if (Array.isArray(schema.defaultSnippets)) {

@@ -474,4 +496,4 @@ schema.defaultSnippets.forEach(function (s) {

insertText = prefix + indent + s.bodyText.split('\n').join('\n' + indent) + suffix + separatorAfter;
label = label || insertText;
filterText = insertText.replace(/[\n]/g, ''); // remove new lines
label = label || _this.sanitizeLabel(insertText),
filterText = insertText.replace(/[\n]/g, ''); // remove new lines
}

@@ -481,3 +503,3 @@ collector.add({

label: label,
documentation: s.description,
documentation: _this.fromMarkup(s.markdownDescription) || s.description,
insertText: insertText,

@@ -501,3 +523,3 @@ insertTextFormat: InsertTextFormat.Snippet,

insertTextFormat: InsertTextFormat.Snippet,
documentation: schema.description
documentation: this.fromMarkup(schema.markdownDescription) || schema.description
});

@@ -508,4 +530,7 @@ }

var enm = schema.enum[i];
var documentation = schema.description;
if (schema.enumDescriptions && i < schema.enumDescriptions.length) {
var documentation = this.fromMarkup(schema.markdownDescription) || schema.description;
if (schema.markdownEnumDescriptions && i < schema.markdownEnumDescriptions.length && this.doesSupportMarkdown()) {
documentation = this.fromMarkup(schema.markdownEnumDescriptions[i]);
}
else if (schema.enumDescriptions && i < schema.enumDescriptions.length) {
documentation = schema.enumDescriptions[i];

@@ -586,9 +611,12 @@ }

};
JSONCompletion.prototype.getLabelForValue = function (value) {
var label = JSON.stringify(value);
JSONCompletion.prototype.sanitizeLabel = function (label) {
label = label.replace(/[\n]/g, '↵');
if (label.length > 57) {
return label.substr(0, 57).trim() + '...';
label = label.substr(0, 57).trim() + '...';
}
return label;
};
JSONCompletion.prototype.getLabelForValue = function (value) {
return this.sanitizeLabel(JSON.stringify(value));
};
JSONCompletion.prototype.getFilterTextForValue = function (value) {

@@ -603,6 +631,3 @@ return JSON.stringify(value);

label = label.replace(/\$\{\d+:([^}]+)\}|\$\d+/g, '$1');
if (label.length > 57) {
return label.substr(0, 57).trim() + '...';
}
return label;
return this.sanitizeLabel(label);
};

@@ -615,6 +640,6 @@ JSONCompletion.prototype.getInsertTextForPlainText = function (text) {

if (text === '{}') {
return '{\n\t$1\n}' + separatorAfter;
return '{$1}' + separatorAfter;
}
else if (text === '[]') {
return '[\n\t$1\n]' + separatorAfter;
return '[$1]' + separatorAfter;
}

@@ -737,6 +762,6 @@ return this.getInsertTextForPlainText(text + separatorAfter);

case 'object':
value = '{\n\t$1\n}';
value = '{$1}';
break;
case 'array':
value = '[\n\t$1\n]';
value = '[$1]';
break;

@@ -810,8 +835,21 @@ case 'number':

};
JSONCompletion.prototype.fromMarkup = function (markupString) {
if (markupString && this.doesSupportMarkdown()) {
return {
kind: MarkupKind.Markdown,
value: markupString
};
}
return undefined;
};
JSONCompletion.prototype.doesSupportMarkdown = function () {
if (!isDefined(this.supportsMarkdown)) {
var completion = this.clientCapabilities.textDocument && this.clientCapabilities.textDocument.completion;
this.supportsMarkdown = completion && completion.completionItem && Array.isArray(completion.completionItem.documentationFormat) && completion.completionItem.documentationFormat.indexOf(MarkupKind.Markdown) !== -1;
}
return this.supportsMarkdown;
};
return JSONCompletion;
}());
export { JSONCompletion };
function isDefined(val) {
return typeof val !== 'undefined';
}
//# sourceMappingURL=jsonCompletion.js.map

@@ -9,5 +9,3 @@ /*---------------------------------------------------------------------------------------------

import { colorFromHex } from '../utils/colors';
import * as nls from './../../../fillers/vscode-nls';
import { SymbolKind, Range, Location, TextEdit } from './../../vscode-languageserver-types/main';
var localize = nls.loadMessageBundle();
import { SymbolKind, Range, Location, TextEdit } from '../../vscode-languageserver-types/main';
var JSONDocumentSymbols = /** @class */ (function () {

@@ -57,3 +55,3 @@ function JSONDocumentSymbols(schemaService) {

var childContainerName = containerName ? containerName + '.' + property.keyNode.value : property.keyNode.value;
result.push({ name: property.keyNode.value, kind: _this.getSymbolKind(valueNode.type), location: location, containerName: containerName });
result.push({ name: _this.getKeyLabel(property), kind: _this.getSymbolKind(valueNode.type), location: location, containerName: containerName });
collectOutlineEntries(result, valueNode, childContainerName);

@@ -115,5 +113,4 @@ }

var selectionRange = getRange(document, property.keyNode);
var name = property.keyNode.value;
var children = collectOutlineEntries([], valueNode);
result.push({ name: name, kind: _this.getSymbolKind(valueNode.type), range: range, selectionRange: selectionRange, children: children });
result.push({ name: _this.getKeyLabel(property), kind: _this.getSymbolKind(valueNode.type), range: range, selectionRange: selectionRange, children: children });
}

@@ -143,17 +140,11 @@ });

};
JSONDocumentSymbols.prototype.getSymbolDetail = function (nodeType) {
switch (nodeType) {
case 'object':
return localize('kind.object', 'object');
case 'string':
return localize('kind.string', 'string');
case 'number':
return localize('kind.number', 'number');
case 'array':
return localize('kind.array', 'array');
case 'boolean':
return localize('kind.boolean', 'boolean');
default: // 'null'
return localize('kind.null', 'null');
JSONDocumentSymbols.prototype.getKeyLabel = function (property) {
var name = property.keyNode.value;
if (name) {
name = name.replace(/[\n]/g, '↵');
}
if (name && name.trim()) {
return name;
}
return "\"" + name + "\"";
};

@@ -160,0 +151,0 @@ JSONDocumentSymbols.prototype.findDocumentColors = function (document, doc) {

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

'use strict';
import { Position } from './../../vscode-languageserver-types/main';
import { createScanner } from './../../jsonc-parser/main';
import { Position } from '../../vscode-languageserver-types/main';
import { createScanner } from '../../jsonc-parser/main';
import { FoldingRangeKind } from '../jsonLanguageTypes';

@@ -10,0 +10,0 @@ export function getFoldingRanges(document, context) {

@@ -7,3 +7,3 @@ /*---------------------------------------------------------------------------------------------

import * as Parser from '../parser/jsonParser';
import { Range } from './../../vscode-languageserver-types/main';
import { Range } from '../../vscode-languageserver-types/main';
var JSONHover = /** @class */ (function () {

@@ -26,3 +26,3 @@ function JSONHover(schemaService, contributions, promiseConstructor) {

var parent = node.parent;
if (parent.type === 'property' && parent.keyNode === node) {
if (parent && parent.type === 'property' && parent.keyNode === node) {
node = parent.valueNode;

@@ -29,0 +29,0 @@ if (!node) {

@@ -6,7 +6,7 @@ /*---------------------------------------------------------------------------------------------

'use strict';
import * as Json from './../../jsonc-parser/main';
import URI from './../../vscode-uri/index';
import * as Json from '../../jsonc-parser/main';
import URI from '../../vscode-uri/index';
import * as Strings from '../utils/strings';
import * as Parser from '../parser/jsonParser';
import * as nls from './../../../fillers/vscode-nls';
import * as nls from '../../../fillers/vscode-nls';
var localize = nls.loadMessageBundle();

@@ -39,2 +39,3 @@ var FilePatternAssociation = /** @class */ (function () {

this.url = url;
this.dependencies = {};
if (unresolvedSchemaContent) {

@@ -54,3 +55,3 @@ this.unresolvedSchema = this.service.promise.resolve(new UnresolvedSchema(unresolvedSchemaContent));

this.resolvedSchema = this.getUnresolvedSchema().then(function (unresolved) {
return _this.service.resolveSchemaContent(unresolved, _this.url);
return _this.service.resolveSchemaContent(unresolved, _this.url, _this.dependencies);
});

@@ -63,2 +64,3 @@ }

this.unresolvedSchema = null;
this.dependencies = {};
};

@@ -86,3 +88,2 @@ return SchemaHandle;

ResolvedSchema.prototype.getSectionRecursive = function (path, schema) {
var _this = this;
if (!schema || typeof schema === 'boolean' || path.length === 0) {

@@ -96,8 +97,9 @@ return schema;

else if (schema.patternProperties) {
Object.keys(schema.patternProperties).forEach(function (pattern) {
for (var _i = 0, _a = Object.keys(schema.patternProperties); _i < _a.length; _i++) {
var pattern = _a[_i];
var regex = new RegExp(pattern);
if (regex.test(next)) {
return _this.getSectionRecursive(path, schema.patternProperties[pattern]);
return this.getSectionRecursive(path, schema.patternProperties[pattern]);
}
});
}
}

@@ -155,9 +157,22 @@ else if (typeof schema.additionalProperties === 'object') {

JSONSchemaService.prototype.onResourceChange = function (uri) {
var _this = this;
var hasChanges = false;
uri = this.normalizeId(uri);
var schemaFile = this.schemasById[uri];
if (schemaFile) {
schemaFile.clearSchema();
return true;
var toWalk = [uri];
var all = Object.keys(this.schemasById).map(function (key) { return _this.schemasById[key]; });
while (toWalk.length) {
var curr = toWalk.pop();
for (var i = 0; i < all.length; i++) {
var handle = all[i];
if (handle && (handle.url === curr || handle.dependencies[curr])) {
if (handle.url !== curr) {
toWalk.push(handle.url);
}
handle.clearSchema();
all[i] = undefined;
hasChanges = true;
}
}
}
return false;
return hasChanges;
};

@@ -169,3 +184,2 @@ JSONSchemaService.prototype.normalizeId = function (id) {

JSONSchemaService.prototype.setSchemaContributions = function (schemaContributions) {
var _this = this;
if (schemaContributions.schemas) {

@@ -184,6 +198,7 @@ var schemas = schemaContributions.schemas;

var fpa = this.getOrAddFilePatternAssociation(pattern);
associations.forEach(function (schemaId) {
var id = _this.normalizeId(schemaId);
for (var _i = 0, associations_1 = associations; _i < associations_1.length; _i++) {
var schemaId = associations_1[_i];
var id = this.normalizeId(schemaId);
fpa.addSchema(id);
});
}
}

@@ -210,3 +225,2 @@ }

JSONSchemaService.prototype.registerExternalSchema = function (uri, filePatterns, unresolvedSchemaContent) {
var _this = this;
if (filePatterns === void 0) { filePatterns = null; }

@@ -216,5 +230,6 @@ var id = this.normalizeId(uri);

if (filePatterns) {
filePatterns.forEach(function (pattern) {
_this.getOrAddFilePatternAssociation(pattern).addSchema(id);
});
for (var _i = 0, filePatterns_1 = filePatterns; _i < filePatterns_1.length; _i++) {
var pattern = filePatterns_1[_i];
this.getOrAddFilePatternAssociation(pattern).addSchema(id);
}
}

@@ -224,3 +239,2 @@ return unresolvedSchemaContent ? this.addSchemaHandle(id, unresolvedSchemaContent) : this.getOrAddSchemaHandle(id);

JSONSchemaService.prototype.clearExternalSchemas = function () {
var _this = this;
this.schemasById = {};

@@ -236,6 +250,7 @@ this.filePatternAssociations = [];

var fpa = this.getOrAddFilePatternAssociation(pattern);
this.contributionAssociations[pattern].forEach(function (schemaId) {
var id = _this.normalizeId(schemaId);
for (var _i = 0, _a = this.contributionAssociations[pattern]; _i < _a.length; _i++) {
var schemaId = _a[_i];
var id = this.normalizeId(schemaId);
fpa.addSchema(id);
});
}
}

@@ -267,7 +282,12 @@ };

}, function (error) {
var errorMessage = localize('json.schema.unabletoload', 'Unable to load schema from \'{0}\': {1}', toDisplayString(url), error.toString());
var errorMessage = error.toString();
var errorSplit = error.toString().split('Error: ');
if (errorSplit.length > 1) {
// more concise error message, URL and context are attached by caller anyways
errorMessage = errorSplit[1];
}
return new UnresolvedSchema({}, [errorMessage]);
});
};
JSONSchemaService.prototype.resolveSchemaContent = function (schemaToResolve, schemaURL) {
JSONSchemaService.prototype.resolveSchemaContent = function (schemaToResolve, schemaURL, dependencies) {
var _this = this;

@@ -304,3 +324,3 @@ var resolveErrors = schemaToResolve.errors.slice(0);

};
var resolveExternalLink = function (node, uri, linkPath, parentSchemaURL) {
var resolveExternalLink = function (node, uri, linkPath, parentSchemaURL, parentSchemaDependencies) {
if (contextService && !/^\w+:\/\/.*/.test(uri)) {

@@ -310,3 +330,5 @@ uri = contextService.resolveRelativePath(uri, parentSchemaURL);

uri = _this.normalizeId(uri);
return _this.getOrAddSchemaHandle(uri).getUnresolvedSchema().then(function (unresolvedSchema) {
var referencedHandle = _this.getOrAddSchemaHandle(uri);
return referencedHandle.getUnresolvedSchema().then(function (unresolvedSchema) {
parentSchemaDependencies[uri] = true;
if (unresolvedSchema.errors.length) {

@@ -317,6 +339,6 @@ var loc = linkPath ? uri + '#' + linkPath : uri;

merge(node, unresolvedSchema.schema, uri, linkPath);
return resolveRefs(node, unresolvedSchema.schema, uri);
return resolveRefs(node, unresolvedSchema.schema, uri, referencedHandle.dependencies);
});
};
var resolveRefs = function (node, parentSchema, parentSchemaURL) {
var resolveRefs = function (node, parentSchema, parentSchemaURL, parentSchemaDependencies) {
if (!node || typeof node !== 'object') {

@@ -375,11 +397,16 @@ return Promise.resolve(null);

var handleRef = function (next) {
var seenRefs = [];
while (next.$ref) {
var segments = next.$ref.split('#', 2);
var ref = next.$ref;
var segments = ref.split('#', 2);
delete next.$ref;
if (segments[0].length > 0) {
openPromises.push(resolveExternalLink(next, segments[0], segments[1], parentSchemaURL));
openPromises.push(resolveExternalLink(next, segments[0], segments[1], parentSchemaURL, parentSchemaDependencies));
return;
}
else {
merge(next, parentSchema, parentSchemaURL, segments[1]); // can set next.$ref again
if (seenRefs.indexOf(ref) === -1) {
merge(next, parentSchema, parentSchemaURL, segments[1]); // can set next.$ref again, use seenRefs to avoid circle
seenRefs.push(ref);
}
}

@@ -401,3 +428,3 @@ }

};
return resolveRefs(schema, schema, schemaURL).then(function (_) { return new ResolvedSchema(schema, resolveErrors); });
return resolveRefs(schema, schema, schemaURL, dependencies).then(function (_) { return new ResolvedSchema(schema, resolveErrors); });
};

@@ -404,0 +431,0 @@ JSONSchemaService.prototype.getSchemaForResource = function (resource, document) {

@@ -6,5 +6,5 @@ /*---------------------------------------------------------------------------------------------

'use strict';
import { Diagnostic, DiagnosticSeverity, Range } 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';
import * as nls from '../../../fillers/vscode-nls';
var localize = nls.loadMessageBundle();

@@ -65,6 +65,7 @@ var JSONValidation = /** @class */ (function () {

}
jsonDocument.syntaxErrors.forEach(function (p) {
for (var _i = 0, _a = jsonDocument.syntaxErrors; _i < _a.length; _i++) {
var p = _a[_i];
if (p.code === ErrorCode.TrailingComma) {
if (typeof commentSeverity !== 'number') {
return;
if (typeof trailingCommaSeverity !== 'number') {
continue;
}

@@ -74,3 +75,3 @@ p.severity = trailingCommaSeverity;

addProblem(p);
});
}
if (typeof commentSeverity === 'number') {

@@ -77,0 +78,0 @@ var message_1 = localize('InvalidCommentToken', 'Comments are not permitted in JSON.');

@@ -55,2 +55,14 @@ /*---------------------------------------------------------------------------------------------

}
export function isNumber(val) {
return typeof val === 'number';
}
export function isDefined(val) {
return typeof val !== 'undefined';
}
export function isBoolean(val) {
return typeof val === 'boolean';
}
export function isString(val) {
return typeof val === 'string';
}
//# sourceMappingURL=objects.js.map

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

/**
* The LocationLink namespace provides helper functions to work with
* [LocationLink](#LocationLink) literals.
*/
export var LocationLink;
(function (LocationLink) {
/**
* Creates a LocationLink literal.
* @param targetUri The definition's uri.
* @param targetRange The full range of the definition.
* @param targetSelectionRange The span of the symbol definition at the target.
* @param originSelectionRange The span of the symbol being defined in the originating source file.
*/
function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };
}
LocationLink.create = create;
/**
* Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface.
*/
function is(value) {
var candidate = value;
return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)
&& (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange))
&& (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
}
LocationLink.is = is;
})(LocationLink || (LocationLink = {}));
/**
* The Color namespace provides helper functions to work with

@@ -400,2 +428,66 @@ * [Color](#Color) literals.

})(TextDocumentEdit || (TextDocumentEdit = {}));
export var CreateFile;
(function (CreateFile) {
function create(uri, options) {
var result = {
kind: 'create',
uri: uri
};
if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
result.options = options;
}
return result;
}
CreateFile.create = create;
function is(value) {
var candidate = value;
return candidate && candidate.kind === 'create' && Is.string(candidate.uri) &&
(candidate.options === void 0 ||
((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));
}
CreateFile.is = is;
})(CreateFile || (CreateFile = {}));
export var RenameFile;
(function (RenameFile) {
function create(oldUri, newUri, options) {
var result = {
kind: 'rename',
oldUri: oldUri,
newUri: newUri
};
if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
result.options = options;
}
return result;
}
RenameFile.create = create;
function is(value) {
var candidate = value;
return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) &&
(candidate.options === void 0 ||
((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))));
}
RenameFile.is = is;
})(RenameFile || (RenameFile = {}));
export var DeleteFile;
(function (DeleteFile) {
function create(uri, options) {
var result = {
kind: 'delete',
uri: uri
};
if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {
result.options = options;
}
return result;
}
DeleteFile.create = create;
function is(value) {
var candidate = value;
return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) &&
(candidate.options === void 0 ||
((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))));
}
DeleteFile.is = is;
})(DeleteFile || (DeleteFile = {}));
export var WorkspaceEdit;

@@ -407,3 +499,10 @@ (function (WorkspaceEdit) {

(candidate.changes !== void 0 || candidate.documentChanges !== void 0) &&
(candidate.documentChanges === void 0 || Is.typedArray(candidate.documentChanges, TextDocumentEdit.is));
(candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) {
if (Is.string(change.kind)) {
return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
}
else {
return TextDocumentEdit.is(change);
}
}));
}

@@ -446,5 +545,7 @@ WorkspaceEdit.is = is;

if (workspaceEdit.documentChanges) {
workspaceEdit.documentChanges.forEach(function (textDocumentEdit) {
var textEditChange = new TextEditChangeImpl(textDocumentEdit.edits);
_this._textEditChanges[textDocumentEdit.textDocument.uri] = textEditChange;
workspaceEdit.documentChanges.forEach(function (change) {
if (TextDocumentEdit.is(change)) {
var textEditChange = new TextEditChangeImpl(change.edits);
_this._textEditChanges[change.textDocument.uri] = textEditChange;
}
});

@@ -479,3 +580,3 @@ }

if (!this._workspaceEdit.documentChanges) {
throw new Error('Workspace edit is not configured for versioned document changes.');
throw new Error('Workspace edit is not configured for document changes.');
}

@@ -515,2 +616,19 @@ var textDocument = key;

};
WorkspaceChange.prototype.createFile = function (uri, options) {
this.checkDocumentChanges();
this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options));
};
WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) {
this.checkDocumentChanges();
this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options));
};
WorkspaceChange.prototype.deleteFile = function (uri, options) {
this.checkDocumentChanges();
this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options));
};
WorkspaceChange.prototype.checkDocumentChanges = function () {
if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) {
throw new Error('Workspace edit is not configured for document changes.');
}
};
return WorkspaceChange;

@@ -562,3 +680,3 @@ }());

var candidate = value;
return Is.defined(candidate) && Is.string(candidate.uri) && Is.number(candidate.version);
return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version));
}

@@ -744,3 +862,3 @@ VersionedTextDocumentIdentifier.is = is;

var candidate = value;
return Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||
return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||
MarkedString.is(candidate.contents) ||

@@ -1169,3 +1287,3 @@ Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));

else {
throw new Error('Ovelapping edit');
throw new Error('Overlapping edit');
}

@@ -1172,0 +1290,0 @@ lastModifiedOffset = startOffset;

@@ -77,3 +77,3 @@ /*---------------------------------------------------------------------------------------------

* Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.
* This class is a simple parser which creates the basic component paths
* This class is a simple parser which creates the basic component parts
* (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation

@@ -89,4 +89,2 @@ * and encoding.

* urn:example:animal:ferret:nose
*
*
*/

@@ -134,7 +132,28 @@ var URI = (function () {

* Returns a string representing the corresponding file system path of this URI.
* Will handle UNC paths and normalize windows drive letters to lower-case. Also
* uses the platform specific path separator. Will *not* validate the path for
* invalid characters and semantics. Will *not* look at the scheme of this URI.
* Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the
* platform specific path separator.
*
* * Will *not* validate the path for invalid characters and semantics.
* * Will *not* look at the scheme of this URI.
* * The result shall *not* be used for display purposes but for accessing a file on disk.
*
*
* The *difference* to `URI#path` is the use of the platform specific separator and the handling
* of UNC paths. See the below sample of a file-uri with an authority (UNC path).
*
* ```ts
const u = URI.parse('file://server/c$/folder/file.txt')
u.authority === 'server'
u.path === '/shares/c$/file.txt'
u.fsPath === '\\server\c$\folder\file.txt'
```
*
* Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,
* namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working
* with URIs that represent files on disk (`file` scheme).
*/
get: function () {
// if (this.scheme !== 'file') {
// console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`);
// }
return _makeFsPath(this);

@@ -191,2 +210,8 @@ },

// ---- parse & validate ------------------------
/**
* Creates a new URI from a string, e.g. `http://www.msft.com/some/path`,
* `file:///usr/home`, or `scheme:with/path`.
*
* @param value A string which represents an URI (see `URI#toString`).
*/
URI.parse = function (value) {

@@ -199,2 +224,24 @@ var match = _regexp.exec(value);

};
/**
* Creates a new URI from a file system path, e.g. `c:\my\files`,
* `/usr/home`, or `\\server\share\some\path`.
*
* The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument
* as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**
* `URI.parse('file://' + path)` because the path might contain characters that are
* interpreted (# and ?). See the following sample:
* ```ts
const good = URI.file('/coding/c#/project1');
good.scheme === 'file';
good.path === '/coding/c#/project1';
good.fragment === '';
const bad = URI.parse('file://' + '/coding/c#/project1');
bad.scheme === 'file';
bad.path === '/coding/c'; // path is now broken
bad.fragment === '/project1';
```
*
* @param path A file system path (see `URI#fsPath`)
*/
URI.file = function (path) {

@@ -228,3 +275,10 @@ var authority = _empty;

/**
* Creates a string presentation for this URI. It's guardeed that calling
* `URI.parse` with the result of this function creates an URI which is equal
* to this URI.
*
* * The result shall *not* be used for display purposes but for externalization or transport.
* * The result will be encoded using the percentage encoding and encoding happens mostly
* ignore the scheme-specific encoding rules.
*
* @param skipEncoding Do not encode the result, default is `false`

@@ -504,3 +558,3 @@ */

res += '#';
res += encoder(fragment, false);
res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment;
}

@@ -507,0 +561,0 @@ return res;

@@ -0,0 +0,0 @@ /*---------------------------------------------------------------------------------------------

@@ -0,0 +0,0 @@ /*---------------------------------------------------------------------------------------------

@@ -0,0 +0,0 @@ /*---------------------------------------------------------------------------------------------

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

'use strict';
var Promise = monaco.Promise;
import * as jsonService from './_deps/vscode-json-languageservice/jsonLanguageService';

@@ -16,3 +15,3 @@ import * as ls from './_deps/vscode-languageserver-types/main';

function PromiseAdapter(executor) {
this.wrapped = new monaco.Promise(executor);
this.wrapped = new Promise(executor);
}

@@ -27,9 +26,9 @@ PromiseAdapter.prototype.then = function (onfulfilled, onrejected) {

PromiseAdapter.resolve = function (v) {
return monaco.Promise.as(v);
return Promise.resolve(v);
};
PromiseAdapter.reject = function (v) {
return monaco.Promise.wrapError(v);
return Promise.reject(v);
};
PromiseAdapter.all = function (values) {
return monaco.Promise.join(values);
return Promise.all(values);
};

@@ -55,3 +54,3 @@ return PromiseAdapter;

}
return Promise.as([]);
return Promise.resolve([]);
};

@@ -74,6 +73,6 @@ JSONWorker.prototype.doComplete = function (uri, position) {

var textEdits = this._languageService.format(document, range, options);
return Promise.as(textEdits);
return Promise.resolve(textEdits);
};
JSONWorker.prototype.resetSchema = function (uri) {
return Promise.as(this._languageService.resetSchema(uri));
return Promise.resolve(this._languageService.resetSchema(uri));
};

@@ -84,3 +83,3 @@ JSONWorker.prototype.findDocumentSymbols = function (uri) {

var symbols = this._languageService.findDocumentSymbols(document, jsonDocument);
return Promise.as(symbols);
return Promise.resolve(symbols);
};

@@ -91,3 +90,3 @@ JSONWorker.prototype.findDocumentColors = function (uri) {

var colorSymbols = this._languageService.findDocumentColors(document, stylesheet);
return Promise.as(colorSymbols);
return Promise.resolve(colorSymbols);
};

@@ -98,3 +97,3 @@ JSONWorker.prototype.getColorPresentations = function (uri, color, range) {

var colorPresentations = this._languageService.getColorPresentations(document, stylesheet, color, range);
return Promise.as(colorPresentations);
return Promise.resolve(colorPresentations);
};

@@ -104,3 +103,3 @@ JSONWorker.prototype.provideFoldingRanges = function (uri, context) {

var ranges = this._languageService.getFoldingRanges(document, context);
return Promise.as(ranges);
return Promise.resolve(ranges);
};

@@ -107,0 +106,0 @@ JSONWorker.prototype._getTextDocument = function (uri) {

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

CompletionAdapter.prototype.provideCompletionItems = function (model, position, context, token) {
var wordInfo = model.getWordUntilPosition(position);
var resource = model.uri;

@@ -211,2 +210,4 @@ return this._worker(resource).then(function (worker) {

}
var wordInfo = model.getWordUntilPosition(position);
var wordRange = new Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);
var items = info.items.map(function (entry) {

@@ -220,2 +221,3 @@ var item = {

detail: entry.detail,
range: wordRange,
kind: toCompletionItemKind(entry.kind),

@@ -222,0 +224,0 @@ };

@@ -58,3 +58,3 @@ /*---------------------------------------------------------------------------------------------

function getMode() {
return monaco.Promise.wrap(import('./jsonMode'));
return import('./jsonMode');
}

@@ -61,0 +61,0 @@ monaco.languages.register({

@@ -0,0 +0,0 @@ /*---------------------------------------------------------------------------------------------

@@ -0,0 +0,0 @@ /*---------------------------------------------------------------------------------------------

/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* monaco-json version: 2.3.0(f70f178c030b18006bc3240fd791bd4aa41da141)
* monaco-json version: 2.4.0(20a7a9955776db2f5b8aad7675f302104f87e564)
* 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 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,enableSchemaRequest:this._defaults.diagnosticsOptions.enableSchemaRequest}}),this._client=this._worker.getProxy()),this._client},e.prototype.getLanguageServiceWorker=function(){for(var t,n=this,r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return this._getClient().then(function(e){t=e}).then(function(e){return n._worker.withSyncedResources(r)}).then(function(e){return t})},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,d,l,g,h,p,m,v,y,b,k,C,_,E,T,S;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))},(c=u=t.Color||(t.Color={})).create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},c.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)&&u.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)},(S=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 w,A,x,O,I,M,j,K,L,D,P,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,(w=t.TextDocumentIdentifier||(t.TextDocumentIdentifier={})).create=function(e){return{uri:e}},w.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,(D=t.InsertTextFormat||(t.InsertTextFormat={})).PlainText=1,D.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=P=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)||P.is(t.contents)||Z.typedArray(t.contents,P.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 q,U,B,H,z,J,Y=function(){};t.DocumentSymbol=Y,(q=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},q.is=function(e){var t=e;return t&&Z.string(t.name)&&Z.number(t.kind)&&r.is(t.range)&&r.is(t.selectionRange)&&(void 0===t.detail||Z.string(t.detail))&&(void 0===t.deprecated||Z.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))},t.DocumentSymbol=Y,(U=t.CodeActionKind||(t.CodeActionKind={})).QuickFix="quickfix",U.Refactor="refactor",U.RefactorExtract="refactor.extract",U.RefactorInline="refactor.inline",U.RefactorRewrite="refactor.rewrite",U.Source="source",U.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||S.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,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){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),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},(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 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){if(e)return{range:u(e.range),text:e.newText}}t.DiagnosticsAdapter=r;var o=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,r){e.getWordUntilPosition(t);var o=e.uri;return this._worker(o).then(function(e){return e.doComplete(o.toString(),a(t))}).then(function(e){if(e){var t=e.items.map(function(e){var t={label:e.label,insertText:e.insertText||e.label,sortText:e.sortText,filterText:e.filterText,documentation:e.documentation,detail:e.detail,kind:function(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}(e.kind)};return e.textEdit&&(t.range=u(e.textEdit.range),t.insertText=e.textEdit.newText),e.additionalTextEdits&&(t.additionalTextEdits=e.additionalTextEdits.map(c)),e.insertTextFormat===i.InsertTextFormat.Snippet&&(t.insertTextRules=monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet),t});return{isIncomplete:e.isIncomplete,suggestions:t}}})},e}();function f(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=o;var d=function(){function e(e){this._worker=e}return e.prototype.provideHover=function(e,t,n){var r=e.uri;return 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(f):[f(e)]}(e.contents)}})},e}();t.HoverAdapter=d;var l=function(){function e(e){this._worker=e}return e.prototype.provideDocumentSymbols=function(e,t){var n=e.uri;return 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:u(e.location.range),selectionRange:u(e.location.range)}})})},e}();function g(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}t.DocumentSymbolAdapter=l;var h=function(){function e(e){this._worker=e}return e.prototype.provideDocumentFormattingEdits=function(e,t,n){var r=e.uri;return this._worker(r).then(function(e){return e.format(r.toString(),null,g(t)).then(function(e){if(e&&0!==e.length)return e.map(c)})})},e}();t.DocumentFormattingEditProvider=h;var p=function(){function e(e){this._worker=e}return e.prototype.provideDocumentRangeFormattingEdits=function(e,t,n,r){var o=e.uri;return this._worker(o).then(function(e){return e.format(o.toString(),s(t),g(n)).then(function(e){if(e&&0!==e.length)return e.map(c)})})},e}();t.DocumentRangeFormattingEditProvider=p;var m=function(){function e(e){this._worker=e}return e.prototype.provideDocumentColors=function(e,t){var n=e.uri;return 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 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=c(e.textEdit)),e.additionalTextEdits&&(t.additionalTextEdits=e.additionalTextEdits.map(c)),t})})},e}();t.DocumentColorAdapter=m;var v=function(){function e(e){this._worker=e}return e.prototype.provideFoldingRanges=function(e,t,n){var r=e.uri;return 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}();t.FoldingRangeAdapter=v}),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,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(l(e)){for(;a++,r+=String.fromCharCode(e),l(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))return r+=String.fromCharCode(e),a++,u=16;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;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&&d(e);)a++,e=i.charCodeAt(a);if(s===a)return r+=String.fromCharCode(e),a++,u=16;switch(r=i.substring(s,a)){case"true":return u=8;case"false":return u=9;case"null":return u=7}return u=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="",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){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 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),d=!1,l=0;c=t.insertSpaces?S(" ",t.tabSize||4):"\t";var g=T.createScanner(o,!1),h=!1;function p(){return f+S(c,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(S(c,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=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 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),u=r(t.onObjectEnd),c=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(){c(),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 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)}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,u={value:{},offset:0,length:0,type:"object",parent:void 0},c=!1;function r(e,t,n,r){u.value=e,u.offset=t,u.length=n,u.type=r,u.colonOffset=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,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,c=!1,s=void 0;else if(","===e){var r=i[i.length-1];i[i.length-1]="number"==typeof r?r+1:(c=!0,""),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:[],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,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.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 c=e("./format"),C=e("./parser");function r(e,t,n,r,o){for(var i,a=t.slice(),s=C.parseTree(e,[]),u=void 0,c=void 0;0<a.length&&(c=a.pop(),void 0===(u=C.findNodeAtLocation(s,a))&&void 0!==n);)n="string"==typeof c?((i={})[c]=n,i):[n];if(u){if("object"===u.type&&"string"==typeof c&&Array.isArray(u.children)){var f=C.findNodeAtLocation(u,[c]);if(void 0!==f){if(void 0!==n)return _(e,{offset:f.offset,length:f.length,content:JSON.stringify(n)},r);if(!f.parent)throw new Error("Malformed AST");var d=u.children.indexOf(f.parent),l=void 0,g=f.parent.offset+f.parent.length;return 0<d?l=(b=u.children[d-1]).offset+b.length:(l=u.offset+1,1<u.children.length&&(g=u.children[1].offset)),_(e,{offset:l,length:g-l,content:""},r)}if(void 0===n)return[];var h=JSON.stringify(c)+": "+JSON.stringify(n),p=o?o(u.children.map(function(e){return e.children[0].value})):u.children.length,m=void 0;return _(e,m=0<p?{offset:(b=u.children[p-1]).offset+b.length,length:0,content:","+h}:0===u.children.length?{offset:u.offset+1,length:0,content:h}:{offset:u.offset+1,length:0,content:h+","},r)}if("array"===u.type&&"number"==typeof c&&Array.isArray(u.children)){if(-1===c){h=""+JSON.stringify(n),m=void 0;if(0===u.children.length)m={offset:u.offset+1,length:0,content:h};else m={offset:(b=u.children[u.children.length-1]).offset+b.length,length:0,content:","+h};return _(e,m,r)}if(void 0===n&&0<=u.children.length){var v=c,y=u.children[v];m=void 0;if(1===u.children.length)m={offset:u.offset+1,length:u.length-2,content:""};else if(u.children.length-1===v){var b,k=(b=u.children[v-1]).offset+b.length;m={offset:k,length:u.offset+u.length-2-k,content:""}}else m={offset:y.offset,length:u.children[v+1].offset-y.offset,content:""};return _(e,m,r)}throw new Error("Array modification not supported yet")}throw new Error("Can not add "+("number"!=typeof c?"index":"property")+" to parent of type "+u.type)}if(void 0===n)throw new Error("Can not delete in empty document");return _(e,{offset:s?s.offset:0,length:s?s.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.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,u,c=h.createScanner(t),f=n.lastWasColon;for(u={tokens:[],endState:n.clone()};;){var d=r+c.getPosition(),l="";if(17===(s=c.scan()))break;if(d===r+c.getPosition())throw new Error("Scanner did not advance, next 3 characters are: "+t.substr(c.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}u.endState=new p(n.getStateData(),c.getTokenError(),f),u.tokens.push({startIndex:d,scopes:l})}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))),t.push(monaco.languages.registerFoldingRangeProvider(o,new a.FoldingRangeAdapter(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 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,enableSchemaRequest:this._defaults.diagnosticsOptions.enableSchemaRequest}}),this._client=this._worker.getProxy()),this._client},e.prototype.getLanguageServiceWorker=function(){for(var t,n=this,r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return this._getClient().then(function(e){t=e}).then(function(e){return n._worker.withSyncedResources(r)}).then(function(e){return t})},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,p,h,m,v,b,y,k,C,E,_,w,x,T,S,A,O,I,L,M;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 ae.objectLiteral(t)&&ae.number(t.line)&&ae.number(t.character)},(o=r=t.Range||(t.Range={})).create=function(e,t,n,r){if(ae.number(e)&&ae.number(t)&&ae.number(n)&&ae.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 ae.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 ae.defined(t)&&r.is(t.range)&&(ae.string(t.uri)||ae.undefined(t.uri))},(c=t.LocationLink||(t.LocationLink={})).create=function(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}},c.is=function(e){var t=e;return ae.defined(t)&&r.is(t.targetRange)&&ae.string(t.targetUri)&&(r.is(t.targetSelectionRange)||ae.undefined(t.targetSelectionRange))&&(r.is(t.originSelectionRange)||ae.undefined(t.originSelectionRange))},(f=u=t.Color||(t.Color={})).create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},f.is=function(e){var t=e;return ae.number(t.red)&&ae.number(t.green)&&ae.number(t.blue)&&ae.number(t.alpha)},(d=t.ColorInformation||(t.ColorInformation={})).create=function(e,t){return{range:e,color:t}},d.is=function(e){var t=e;return r.is(t.range)&&u.is(t.color)},(l=t.ColorPresentation||(t.ColorPresentation={})).create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},l.is=function(e){var t=e;return ae.string(t.label)&&(ae.undefined(t.textEdit)||E.is(t))&&(ae.undefined(t.additionalTextEdits)||ae.typedArray(t.additionalTextEdits,E.is))},(g=t.FoldingRangeKind||(t.FoldingRangeKind={})).Comment="comment",g.Imports="imports",g.Region="region",(p=t.FoldingRange||(t.FoldingRange={})).create=function(e,t,n,r,o){var i={startLine:e,endLine:t};return ae.defined(n)&&(i.startCharacter=n),ae.defined(r)&&(i.endCharacter=r),ae.defined(o)&&(i.kind=o),i},p.is=function(e){var t=e;return ae.number(t.startLine)&&ae.number(t.startLine)&&(ae.undefined(t.startCharacter)||ae.number(t.startCharacter))&&(ae.undefined(t.endCharacter)||ae.number(t.endCharacter))&&(ae.undefined(t.kind)||ae.string(t.kind))},(m=h=t.DiagnosticRelatedInformation||(t.DiagnosticRelatedInformation={})).create=function(e,t){return{location:e,message:t}},m.is=function(e){var t=e;return ae.defined(t)&&i.is(t.location)&&ae.string(t.message)},(v=t.DiagnosticSeverity||(t.DiagnosticSeverity={})).Error=1,v.Warning=2,v.Information=3,v.Hint=4,(y=b=t.Diagnostic||(t.Diagnostic={})).create=function(e,t,n,r,o,i){var a={range:e,message:t};return ae.defined(n)&&(a.severity=n),ae.defined(r)&&(a.code=r),ae.defined(o)&&(a.source=o),ae.defined(i)&&(a.relatedInformation=i),a},y.is=function(e){var t=e;return ae.defined(t)&&r.is(t.range)&&ae.string(t.message)&&(ae.number(t.severity)||ae.undefined(t.severity))&&(ae.number(t.code)||ae.string(t.code)||ae.undefined(t.code))&&(ae.string(t.source)||ae.undefined(t.source))&&(ae.undefined(t.relatedInformation)||ae.typedArray(t.relatedInformation,h.is))},(C=k=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 ae.defined(n)&&0<n.length&&(o.arguments=n),o},C.is=function(e){var t=e;return ae.defined(t)&&ae.string(t.title)&&ae.string(t.command)},(_=E=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 ae.objectLiteral(t)&&ae.string(t.newText)&&r.is(t.range)},(x=w=t.TextDocumentEdit||(t.TextDocumentEdit={})).create=function(e,t){return{textDocument:e,edits:t}},x.is=function(e){var t=e;return ae.defined(t)&&D.is(t.textDocument)&&Array.isArray(t.edits)},(S=T=t.CreateFile||(t.CreateFile={})).create=function(e,t){var n={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(n.options=t),n},S.is=function(e){var t=e;return t&&"create"===t.kind&&ae.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||ae.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||ae.boolean(t.options.ignoreIfExists)))},(O=A=t.RenameFile||(t.RenameFile={})).create=function(e,t,n){var r={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(r.options=n),r},O.is=function(e){var t=e;return t&&"rename"===t.kind&&ae.string(t.oldUri)&&ae.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||ae.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||ae.boolean(t.options.ignoreIfExists)))},(L=I=t.DeleteFile||(t.DeleteFile={})).create=function(e,t){var n={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(n.options=t),n},L.is=function(e){var t=e;return t&&"delete"===t.kind&&ae.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||ae.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||ae.boolean(t.options.ignoreIfNotExists)))},(M=t.WorkspaceEdit||(t.WorkspaceEdit={})).is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every(function(e){return ae.string(e.kind)?T.is(e)||A.is(e)||I.is(e):w.is(e)}))};var j,D,K,N,P,R,F,V,U,W,B,q,H,z,J=function(){function e(e){this.edits=e}return e.prototype.insert=function(e,t){this.edits.push(E.insert(e,t))},e.prototype.replace=function(e,t){this.edits.push(E.replace(e,t))},e.prototype.delete=function(e){this.edits.push(E.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}(),Y=function(){function e(n){var r=this;this._textEditChanges=Object.create(null),n&&((this._workspaceEdit=n).documentChanges?n.documentChanges.forEach(function(e){if(w.is(e)){var t=new J(e.edits);r._textEditChanges[e.textDocument.uri]=t}}):n.changes&&Object.keys(n.changes).forEach(function(e){var t=new J(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(D.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t=e;if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:o=[]};this._workspaceEdit.documentChanges.push(n),r=new J(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 J(o),this._textEditChanges[e]=r}return r},e.prototype.createFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(T.create(e,t))},e.prototype.renameFile=function(e,t,n){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(A.create(e,t,n))},e.prototype.deleteFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(I.create(e,t))},e.prototype.checkDocumentChanges=function(){if(!this._workspaceEdit||!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.")},e}();t.WorkspaceChange=Y,(j=t.TextDocumentIdentifier||(t.TextDocumentIdentifier={})).create=function(e){return{uri:e}},j.is=function(e){var t=e;return ae.defined(t)&&ae.string(t.uri)},(K=D=t.VersionedTextDocumentIdentifier||(t.VersionedTextDocumentIdentifier={})).create=function(e,t){return{uri:e,version:t}},K.is=function(e){var t=e;return ae.defined(t)&&ae.string(t.uri)&&(null===t.version||ae.number(t.version))},(N=t.TextDocumentItem||(t.TextDocumentItem={})).create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},N.is=function(e){var t=e;return ae.defined(t)&&ae.string(t.uri)&&ae.string(t.languageId)&&ae.number(t.version)&&ae.string(t.text)},(R=P=t.MarkupKind||(t.MarkupKind={})).PlainText="plaintext",R.Markdown="markdown",(F=P=t.MarkupKind||(t.MarkupKind={})).is=function(e){var t=e;return t===F.PlainText||t===F.Markdown},(V=t.MarkupContent||(t.MarkupContent={})).is=function(e){var t=e;return ae.objectLiteral(e)&&P.is(t.kind)&&ae.string(t.value)},(U=t.CompletionItemKind||(t.CompletionItemKind={})).Text=1,U.Method=2,U.Function=3,U.Constructor=4,U.Field=5,U.Variable=6,U.Class=7,U.Interface=8,U.Module=9,U.Property=10,U.Unit=11,U.Value=12,U.Enum=13,U.Keyword=14,U.Snippet=15,U.Color=16,U.File=17,U.Reference=18,U.Folder=19,U.EnumMember=20,U.Constant=21,U.Struct=22,U.Event=23,U.Operator=24,U.TypeParameter=25,(W=t.InsertTextFormat||(t.InsertTextFormat={})).PlainText=1,W.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}},(q=B=t.MarkedString||(t.MarkedString={})).fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},q.is=function(e){var t=e;return ae.string(t)||ae.objectLiteral(t)&&ae.string(t.language)&&ae.string(t.value)},(t.Hover||(t.Hover={})).is=function(e){var t=e;return!!t&&ae.objectLiteral(t)&&(V.is(t.contents)||B.is(t.contents)||ae.typedArray(t.contents,B.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 ae.defined(t)&&(o.documentation=t),ae.defined(n)?o.parameters=n:o.parameters=[],o},(H=t.DocumentHighlightKind||(t.DocumentHighlightKind={})).Text=1,H.Read=2,H.Write=3,(t.DocumentHighlight||(t.DocumentHighlight={})).create=function(e,t){var n={range:e};return ae.number(t)&&(n.kind=t),n},(z=t.SymbolKind||(t.SymbolKind={})).File=1,z.Module=2,z.Namespace=3,z.Package=4,z.Class=5,z.Method=6,z.Property=7,z.Field=8,z.Constructor=9,z.Enum=10,z.Interface=11,z.Function=12,z.Variable=13,z.Constant=14,z.String=15,z.Number=16,z.Boolean=17,z.Array=18,z.Object=19,z.Key=20,z.Null=21,z.EnumMember=22,z.Struct=23,z.Event=24,z.Operator=25,z.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 G,$,Q,X,Z,ee,te=function(){};t.DocumentSymbol=te,(G=te=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},G.is=function(e){var t=e;return t&&ae.string(t.name)&&ae.number(t.kind)&&r.is(t.range)&&r.is(t.selectionRange)&&(void 0===t.detail||ae.string(t.detail))&&(void 0===t.deprecated||ae.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))},t.DocumentSymbol=te,($=t.CodeActionKind||(t.CodeActionKind={})).QuickFix="quickfix",$.Refactor="refactor",$.RefactorExtract="refactor.extract",$.RefactorInline="refactor.inline",$.RefactorRewrite="refactor.rewrite",$.Source="source",$.SourceOrganizeImports="source.organizeImports",(Q=t.CodeActionContext||(t.CodeActionContext={})).create=function(e,t){var n={diagnostics:e};return null!=t&&(n.only=t),n},Q.is=function(e){var t=e;return ae.defined(t)&&ae.typedArray(t.diagnostics,b.is)&&(void 0===t.only||ae.typedArray(t.only,ae.string))},(X=t.CodeAction||(t.CodeAction={})).create=function(e,t,n){var r={title:e};return k.is(t)?r.command=t:r.edit=t,void 0!==n&&(r.kind=n),r},X.is=function(e){var t=e;return t&&ae.string(t.title)&&(void 0===t.diagnostics||ae.typedArray(t.diagnostics,b.is))&&(void 0===t.kind||ae.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||k.is(t.command))&&(void 0===t.edit||M.is(t.edit))},(Z=t.CodeLens||(t.CodeLens={})).create=function(e,t){var n={range:e};return ae.defined(t)&&(n.data=t),n},Z.is=function(e){var t=e;return ae.defined(t)&&r.is(t.range)&&(ae.undefined(t.command)||k.is(t.command))},(ee=t.FormattingOptions||(t.FormattingOptions={})).create=function(e,t){return{tabSize:e,insertSpaces:t}},ee.is=function(e){var t=e;return ae.defined(t)&&ae.number(t.tabSize)&&ae.boolean(t.insertSpaces)};var ne,re,oe,ie=function(){};t.DocumentLink=ie,(ne=ie=t.DocumentLink||(t.DocumentLink={})).create=function(e,t,n){return{range:e,target:t,data:n}},ne.is=function(e){var t=e;return ae.defined(t)&&r.is(t.range)&&(ae.undefined(t.target)||ae.string(t.target))},t.DocumentLink=ie,t.EOL=["\n","\r\n","\r"],(re=t.TextDocument||(t.TextDocument={})).create=function(e,t,n,r){return new ue(e,t,n,r)},re.is=function(e){var t=e;return!!(ae.defined(t)&&ae.string(t.uri)&&(ae.undefined(t.languageId)||ae.string(t.languageId))&&ae.number(t.lineCount)&&ae.func(t.getText)&&ae.func(t.positionAt)&&ae.func(t.offsetAt))},re.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("Overlapping edit");n=n.substring(0,s)+a.newText+n.substring(c,n.length),o=s}return n},(oe=t.TextDocumentSaveReason||(t.TextDocumentSaveReason={})).Manual=1,oe.AfterDelay=2,oe.FocusOut=3;var ae,se,ce,ue=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}();se=ae||(ae={}),ce=Object.prototype.toString,se.defined=function(e){return void 0!==e},se.undefined=function(e){return void 0===e},se.boolean=function(e){return!0===e||!1===e},se.string=function(e){return"[object String]"===ce.call(e)},se.number=function(e){return"[object Number]"===ce.call(e)},se.func=function(e){return"[object Function]"===ce.call(e)},se.objectLiteral=function(e){return null!==e&&"object"==typeof e},se.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,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});monaco.Uri;var s=monaco.Range,n=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 a.DiagnosticSeverity.Error:return monaco.MarkerSeverity.Error;case a.DiagnosticSeverity.Warning:return monaco.MarkerSeverity.Warning;case a.DiagnosticSeverity.Information:return monaco.MarkerSeverity.Info;case a.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 c(e){if(e)return{character:e.column-1,line:e.lineNumber-1}}function i(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 s(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function f(e){if(e)return{range:u(e.range),text:e.newText}}t.DiagnosticsAdapter=n;var r=function(){function e(e){this._worker=e}return Object.defineProperty(e.prototype,"triggerCharacters",{get:function(){return[" ",":"]},enumerable:!0,configurable:!0}),e.prototype.provideCompletionItems=function(o,i,e,t){var n=o.uri;return this._worker(n).then(function(e){return e.doComplete(n.toString(),c(i))}).then(function(e){if(e){var t=o.getWordUntilPosition(i),n=new s(i.lineNumber,t.startColumn,i.lineNumber,t.endColumn),r=e.items.map(function(e){var t={label:e.label,insertText:e.insertText||e.label,sortText:e.sortText,filterText:e.filterText,documentation:e.documentation,detail:e.detail,range:n,kind:function(e){var t=monaco.languages.CompletionItemKind;switch(e){case a.CompletionItemKind.Text:return t.Text;case a.CompletionItemKind.Method:return t.Method;case a.CompletionItemKind.Function:return t.Function;case a.CompletionItemKind.Constructor:return t.Constructor;case a.CompletionItemKind.Field:return t.Field;case a.CompletionItemKind.Variable:return t.Variable;case a.CompletionItemKind.Class:return t.Class;case a.CompletionItemKind.Interface:return t.Interface;case a.CompletionItemKind.Module:return t.Module;case a.CompletionItemKind.Property:return t.Property;case a.CompletionItemKind.Unit:return t.Unit;case a.CompletionItemKind.Value:return t.Value;case a.CompletionItemKind.Enum:return t.Enum;case a.CompletionItemKind.Keyword:return t.Keyword;case a.CompletionItemKind.Snippet:return t.Snippet;case a.CompletionItemKind.Color:return t.Color;case a.CompletionItemKind.File:return t.File;case a.CompletionItemKind.Reference:return t.Reference}return t.Property}(e.kind)};return e.textEdit&&(t.range=u(e.textEdit.range),t.insertText=e.textEdit.newText),e.additionalTextEdits&&(t.additionalTextEdits=e.additionalTextEdits.map(f)),e.insertTextFormat===a.InsertTextFormat.Snippet&&(t.insertTextRules=monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet),t});return{isIncomplete:e.isIncomplete,suggestions:r}}})},e}();function o(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=r;var d=function(){function e(e){this._worker=e}return e.prototype.provideHover=function(e,t,n){var r=e.uri;return this._worker(r).then(function(e){return e.doHover(r.toString(),c(t))}).then(function(e){if(e)return{range:u(e.range),contents:function(e){if(e)return Array.isArray(e)?e.map(o):[o(e)]}(e.contents)}})},e}();t.HoverAdapter=d;var l=function(){function e(e){this._worker=e}return e.prototype.provideDocumentSymbols=function(e,t){var n=e.uri;return 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 a.SymbolKind.File:return t.Array;case a.SymbolKind.Module:return t.Module;case a.SymbolKind.Namespace:return t.Namespace;case a.SymbolKind.Package:return t.Package;case a.SymbolKind.Class:return t.Class;case a.SymbolKind.Method:return t.Method;case a.SymbolKind.Property:return t.Property;case a.SymbolKind.Field:return t.Field;case a.SymbolKind.Constructor:return t.Constructor;case a.SymbolKind.Enum:return t.Enum;case a.SymbolKind.Interface:return t.Interface;case a.SymbolKind.Function:return t.Function;case a.SymbolKind.Variable:return t.Variable;case a.SymbolKind.Constant:return t.Constant;case a.SymbolKind.String:return t.String;case a.SymbolKind.Number:return t.Number;case a.SymbolKind.Boolean:return t.Boolean;case a.SymbolKind.Array:return t.Array}return t.Function}(e.kind),range:u(e.location.range),selectionRange:u(e.location.range)}})})},e}();function g(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}t.DocumentSymbolAdapter=l;var p=function(){function e(e){this._worker=e}return e.prototype.provideDocumentFormattingEdits=function(e,t,n){var r=e.uri;return this._worker(r).then(function(e){return e.format(r.toString(),null,g(t)).then(function(e){if(e&&0!==e.length)return e.map(f)})})},e}();t.DocumentFormattingEditProvider=p;var h=function(){function e(e){this._worker=e}return e.prototype.provideDocumentRangeFormattingEdits=function(e,t,n,r){var o=e.uri;return this._worker(o).then(function(e){return e.format(o.toString(),i(t),g(n)).then(function(e){if(e&&0!==e.length)return e.map(f)})})},e}();t.DocumentRangeFormattingEditProvider=h;var m=function(){function e(e){this._worker=e}return e.prototype.provideDocumentColors=function(e,t){var n=e.uri;return 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 this._worker(r).then(function(e){return e.getColorPresentations(r.toString(),t.color,i(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}();t.DocumentColorAdapter=m;var v=function(){function e(e){this._worker=e}return e.prototype.provideFoldingRanges=function(e,t,n){var r=e.uri;return 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 a.FoldingRangeKind.Comment:return monaco.languages.FoldingRangeKind.Comment;case a.FoldingRangeKind.Imports:return monaco.languages.FoldingRangeKind.Imports;case a.FoldingRangeKind.Region:return monaco.languages.FoldingRangeKind.Region}return}(e.kind)),t})})},e}();t.FoldingRangeAdapter=v}),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 g(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 p(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,s="",c=0,u=16,f=0;function d(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(s="",f=0,o<=(c=a))return c=o,u=17;var e=i.charCodeAt(a);if(g(e)){for(;a++,s+=String.fromCharCode(e),g(e=i.charCodeAt(a)););return u=15}if(p(e))return a++,s+=String.fromCharCode(e),13===e&&10===i.charCodeAt(a)&&(a++,s+="\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++,s=function(){for(var e="",t=a;;){if(o<=a){e+=i.substring(t,a),f=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(p(n)){e+=i.substring(t,a),f=2;break}f=6}a++}else{if(e+=i.substring(t,a),o<=++a){f=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=d(4,!0);0<=r?e+=String.fromCharCode(r):f=4;break;default:f=5}t=a}}return e}(),u=10;case 47:var t=a-1;if(47===i.charCodeAt(a+1)){for(a+=2;a<o&&!p(i.charCodeAt(a));)a++;return s=i.substring(t,a),u=12}if(42!==i.charCodeAt(a+1))return s+=String.fromCharCode(e),a++,u=16;a+=2;for(var n=o-1,r=!1;a<n;){if(42===i.charCodeAt(a)&&47===i.charCodeAt(a+1)){a+=2,r=!0;break}a++}return r||(a++,f=1),s=i.substring(t,a),u=13;case 45:if(s+=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 s+=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 f=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 f=3;return i.substring(e,t)}(),u=11;default:for(;a<o&&l(e);)a++,e=i.charCodeAt(a);if(c===a)return s+=String.fromCharCode(e),a++,u=16;switch(s=i.substring(c,a)){case"true":return u=8;case"false":return u=9;case"null":return u=7}return u=16}}function l(e){if(g(e)||p(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,s="",u=16,f=c=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 s},getTokenOffset:function(){return c},getTokenLength:function(){return a-c},getTokenError:function(){return f}}}}),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 w=e("./scanner");function x(e,t){for(var n="",r=0;r<t;r++)n+=e;return n}function T(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&&!T(r,i-1);)i--;for(var c=s;c<r.length&&!T(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?x(" ",t.tabSize||4):"\t";var g=w.createScanner(o,!1),p=!1;function h(){return f+x(u,n+l)}function m(){var e=g.scan();for(d=!1;15===e||14===e;)d=d||14===e,e=g.scan();return p=16===e||0!==g.getTokenError(),e}var v=[];function b(e,t,n){!p&&t<s&&a<n&&r.substring(t,n)!==e&&v.push({offset:t,length:n-t,content:e})}var y=m();if(17!==y){var k=g.getTokenOffset()+i;b(x(u,n),i,k)}for(;17!==y;){for(var C=g.getTokenOffset()+g.getTokenLength()+i,E=m(),_="";!d&&(12===E||13===E);)b(" ",C,g.getTokenOffset()+i),C=g.getTokenOffset()+g.getTokenLength()+i,_=12===E?h():"",E=m();if(2===E)1!==y&&(l--,_=h());else if(4===E)3!==y&&(l--,_=h());else{switch(y){case 3:case 1:l++,_=h();break;case 5:case 12:_=h();break;case 13:_=d?h():" ";break;case 6:_=" ";break;case 10:if(6===E){_="";break}case 7:case 8:case 9:case 11:case 2:case 4:12===E||13===E?_=" ":5!==E&&17!==E&&(p=!0);break;case 16:p=!0}!d||12!==E&&13!==E||(_=h())}b(_,C,g.getTokenOffset()+i),y=E}return v},t.isEOL=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/impl/parser",["require","exports","./scanner"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var C,E=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){void 0===n&&(n=C.DEFAULT);var o=E.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),p=i(t.onError),h=n&&n.disallowComments,m=n&&n.allowTrailingComma;function v(){for(;;){var e=o.scan();switch(o.getTokenError()){case 4:b(14);break;case 5:b(15);break;case 3:b(13);break;case 1:h||b(11);break;case 2:b(12);break;case 6:b(16)}switch(e){case 12:case 13:h?b(10):g();break;case 16:b(1);break;case 15:case 14:break;default:return e}}}function b(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=[]),p(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 y(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||b(4,[],[]),l(","),v(),4===o.getToken()&&m)break}else e&&b(6,[],[]);k()||b(4,[],[4,5]),e=!0}return f(),4!==o.getToken()?b(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||b(4,[],[]),l(","),v(),2===o.getToken()&&m)break}else e&&b(6,[],[]);(10!==o.getToken()?(b(3,[],[2,5]),0):(y(!1),6===o.getToken()?(l(":"),v(),k()||b(4,[],[2,5])):b(5,[],[2,5]),1))||b(4,[],[2,5]),e=!0}return c(),2!==o.getToken()?b(7,[2],[]):v(),!0}();case 10:return y(!0);default:return function(){switch(o.getToken()){case 11:var e=0;try{"number"!=typeof(e=JSON.parse(o.getTokenValue()))&&(b(2),e=0)}catch(e){b(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()&&b(9,[],[]),!0):(b(4,[],[]),!1))}function d(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string";default:return"null"}}(C||(C={})).DEFAULT={allowTrailingComma:!1},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];i[i.length-1]="number"==typeof r?r+1:(u=!0,""),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=[]),void 0===t&&(t=C.DEFAULT);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=[]),void 0===t&&(t=C.DEFAULT);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=E.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"),C=e("./parser");function r(e,t,n,r,o){for(var i,a=t.slice(),s=C.parseTree(e,[]),c=void 0,u=void 0;0<a.length&&(u=a.pop(),void 0===(c=C.findNodeAtLocation(s,a))&&void 0!==n);)n="string"==typeof u?((i={})[u]=n,i):[n];if(c){if("object"===c.type&&"string"==typeof u&&Array.isArray(c.children)){var f=C.findNodeAtLocation(c,[u]);if(void 0!==f){if(void 0!==n)return E(e,{offset:f.offset,length:f.length,content:JSON.stringify(n)},r);if(!f.parent)throw new Error("Malformed AST");var d=c.children.indexOf(f.parent),l=void 0,g=f.parent.offset+f.parent.length;return 0<d?l=(y=c.children[d-1]).offset+y.length:(l=c.offset+1,1<c.children.length&&(g=c.children[1].offset)),E(e,{offset:l,length:g-l,content:""},r)}if(void 0===n)return[];var p=JSON.stringify(u)+": "+JSON.stringify(n),h=o?o(c.children.map(function(e){return e.children[0].value})):c.children.length,m=void 0;return E(e,m=0<h?{offset:(y=c.children[h-1]).offset+y.length,length:0,content:","+p}:0===c.children.length?{offset:c.offset+1,length:0,content:p}:{offset:c.offset+1,length:0,content:p+","},r)}if("array"===c.type&&"number"==typeof u&&Array.isArray(c.children)){if(-1===u){p=""+JSON.stringify(n),m=void 0;if(0===c.children.length)m={offset:c.offset+1,length:0,content:p};else m={offset:(y=c.children[c.children.length-1]).offset+y.length,length:0,content:","+p};return E(e,m,r)}if(void 0===n&&0<=c.children.length){var v=u,b=c.children[v];m=void 0;if(1===c.children.length)m={offset:c.offset+1,length:c.length-2,content:""};else if(c.children.length-1===v){var y,k=(y=c.children[v-1]).offset+y.length;m={offset:k,length:c.offset+c.length-2-k,content:""}}else m={offset:b.offset,length:c.children[v+1].offset-b.offset,content:""};return E(e,m,r)}throw new Error("Array modification not supported yet")}throw new Error("Can not add "+("number"!=typeof u?"index":"property")+" to parent of type "+c.type)}if(void 0===n)throw new Error("Can not delete in empty document");return E(e,{offset:s?s.offset:0,length:s?s.length:0,content:JSON.stringify(n)},r)}function E(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.printParseErrorCode=function(e){switch(e){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"},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,p){"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.createTokenizationSupport=function(o){return{getInitialState:function(){return new h(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=p.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 h(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 h=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.3.0(f70f178c030b18006bc3240fd791bd4aa41da141)
* monaco-json version: 2.4.0(20a7a9955776db2f5b8aad7675f302104f87e564)
* Released under the MIT license
* https://github.com/Microsoft/monaco-json/blob/master/LICENSE.md
*-----------------------------------------------------------------------------*/
define("vs/language/json/monaco.contribution",["require","exports"],function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=monaco.Emitter,n=function(){function e(e,n){this._onDidChange=new o,this._languageId=e,this.setDiagnosticsOptions(n)}return Object.defineProperty(e.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"diagnosticsOptions",{get:function(){return this._diagnosticsOptions},enumerable:!0,configurable:!0}),e.prototype.setDiagnosticsOptions=function(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)},e}(),i=new(e.LanguageServiceDefaultsImpl=n)("json",{validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1});monaco.languages.json={jsonDefaults:i},monaco.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc"],aliases:["JSON","json"],mimetypes:["application/json"]}),monaco.languages.onLanguage("json",function(){monaco.Promise.wrap(new Promise(function(e,n){t(["./jsonMode"],e,n)})).then(function(e){return e.setupMode(i)})})});
define("vs/language/json/monaco.contribution",["require","exports"],function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=monaco.Emitter,n=function(){function e(e,n){this._onDidChange=new o,this._languageId=e,this.setDiagnosticsOptions(n)}return Object.defineProperty(e.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"diagnosticsOptions",{get:function(){return this._diagnosticsOptions},enumerable:!0,configurable:!0}),e.prototype.setDiagnosticsOptions=function(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)},e}(),i=new(e.LanguageServiceDefaultsImpl=n)("json",{validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1});monaco.languages.json={jsonDefaults:i},monaco.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc"],aliases:["JSON","json"],mimetypes:["application/json"]}),monaco.languages.onLanguage("json",function(){new Promise(function(e,n){t(["./jsonMode"],e,n)}).then(function(e){return e.setupMode(i)})})});

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