/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * monaco-json version: 1.2.2(5618dbdb4f72c31da0555b463daa3b053decf40a) * Released under the MIT license * https://github.com/Microsoft/monaco-json/blob/master/LICENSE.md *-----------------------------------------------------------------------------*/ !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){var n;!function(e){function t(e,t){return{line:e,character:t}}function n(e){var t=e;return V.defined(t)&&V.number(t.line)&&V.number(t.character)}e.create=t,e.is=n}(n=t.Position||(t.Position={}));var r;!function(e){function t(e,t,r,i){if(V.number(e)&&V.number(t)&&V.number(r)&&V.number(i))return{start:n.create(e,t),end:n.create(r,i)};if(n.is(e)&&n.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments["+e+", "+t+", "+r+", "+i+"]")}function r(e){var t=e;return V.defined(t)&&n.is(t.start)&&n.is(t.end)}e.create=t,e.is=r}(r=t.Range||(t.Range={}));var i;!function(e){function t(e,t){return{uri:e,range:t}}function n(e){var t=e;return V.defined(t)&&r.is(t.range)&&(V.string(t.uri)||V.undefined(t.uri))}e.create=t,e.is=n}(i=t.Location||(t.Location={}));var o;!function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(o=t.DiagnosticSeverity||(t.DiagnosticSeverity={}));var a;!function(e){function t(e,t,n,r,i){var o={range:e,message:t};return V.defined(n)&&(o.severity=n),V.defined(r)&&(o.code=r),V.defined(i)&&(o.source=i),o}function n(e){var t=e;return V.defined(t)&&r.is(t.range)&&V.string(t.message)&&(V.number(t.severity)||V.undefined(t.severity))&&(V.number(t.code)||V.string(t.code)||V.undefined(t.code))&&(V.string(t.source)||V.undefined(t.source))}e.create=t,e.is=n}(a=t.Diagnostic||(t.Diagnostic={}));var s;!function(e){function t(e,t){for(var n=[],r=2;r0&&(i.arguments=n),i}function n(e){var t=e;return V.defined(t)&&V.string(t.title)&&V.string(t.title)}e.create=t,e.is=n}(s=t.Command||(t.Command={}));var c;!function(e){function t(e,t){return{range:e,newText:t}}function n(e,t){return{range:{start:e,end:e},newText:t}}function r(e){return{range:e,newText:""}}e.replace=t,e.insert=n,e.del=r}(c=t.TextEdit||(t.TextEdit={}));var u;!function(e){function t(e,t){return{textDocument:e,edits:t}}function n(e){var t=e;return V.defined(t)&&d.is(t.textDocument)&&Array.isArray(t.edits)}e.create=t,e.is=n}(u=t.TextDocumentEdit||(t.TextDocumentEdit={}));var l=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}(),f=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),e?(this._workspaceEdit=e,e.changes.forEach(function(e){var n=new l(e.edits);t._textEditChanges[e.textDocument.uri]=n})):this._workspaceEdit={changes:[]}}return Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(e){if(d.is(e)){var t=e,n=this._textEditChanges[t.uri];if(!n){var r=[],i={textDocument:t,edits:r};this._workspaceEdit.changes.push(i),n=new l(r),this._textEditChanges[t.uri]=n}return n}return this._textEditChanges[e]},e}();t.WorkspaceChange=f;var p;!function(e){function t(e){return{uri:e}}function n(e){var t=e;return V.defined(t)&&V.string(t.uri)}e.create=t,e.is=n}(p=t.TextDocumentIdentifier||(t.TextDocumentIdentifier={}));var d;!function(e){function t(e,t){return{uri:e,version:t}}function n(e){var t=e;return V.defined(t)&&V.string(t.uri)&&V.number(t.version)}e.create=t,e.is=n}(d=t.VersionedTextDocumentIdentifier||(t.VersionedTextDocumentIdentifier={}));var h;!function(e){function t(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}}function n(e){var t=e;return V.defined(t)&&V.string(t.uri)&&V.string(t.languageId)&&V.number(t.version)&&V.string(t.text)}e.create=t,e.is=n}(h=t.TextDocumentItem||(t.TextDocumentItem={}));var m;!function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18}(m=t.CompletionItemKind||(t.CompletionItemKind={}));var g;!function(e){e.PlainText=1,e.Snippet=2}(g=t.InsertTextFormat||(t.InsertTextFormat={}));var v;!function(e){function t(e){return{label:e}}e.create=t}(v=t.CompletionItem||(t.CompletionItem={}));var y;!function(e){function t(e,t){return{items:e?e:[],isIncomplete:!!t}}e.create=t}(y=t.CompletionList||(t.CompletionList={}));var x;!function(e){function t(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=t}(x=t.MarkedString||(t.MarkedString={}));var b;!function(e){function t(e,t){return t?{label:e,documentation:t}:{label:e}}e.create=t}(b=t.ParameterInformation||(t.ParameterInformation={}));var S;!function(e){function t(e,t){for(var n=[],r=2;r0&&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(),r=0,i=t.length;if(0===i)return n.create(0,e);for(;re?i=o:r=o+1}var a=r-1;return n.create(a,e-t[a])},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=48&&o<=57)i=16*i+o-48;else if(o>=65&&o<=70)i=16*i+o-65+10;else{if(!(o>=97&&o<=102))break;i=16*i+o-97+10}p++,r++}return r=d){t+=e.substring(r,p),x=m.UnexpectedEndOfString;break}var o=e.charCodeAt(p);if(34===o){t+=e.substring(r,p),p++;break}if(92!==o){if(i(o)){t+=e.substring(r,p),x=m.UnexpectedEndOfString;break}p++}else{if(t+=e.substring(r,p),p++,p>=d){x=m.UnexpectedEndOfString;break}switch(o=e.charCodeAt(p++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="\t";break;case 117:var a=n(4,!0);a>=0?t+=String.fromCharCode(a):x=m.InvalidUnicode;break;default:x=m.InvalidEscapeCharacter}r=p}}return t}function u(){if(h="",x=m.None,g=p,p>=d)return g=d,v=y.EOF;var t=e.charCodeAt(p);if(r(t)){do p++,h+=String.fromCharCode(t),t=e.charCodeAt(p);while(r(t));return v=y.Trivia}if(i(t))return p++,h+=String.fromCharCode(t),13===t&&10===e.charCodeAt(p)&&(p++,h+="\n"),v=y.LineBreakTrivia;switch(t){case 123:return p++,v=y.OpenBraceToken;case 125:return p++,v=y.CloseBraceToken;case 91:return p++,v=y.OpenBracketToken;case 93:return p++,v=y.CloseBracketToken;case 58:return p++,v=y.ColonToken;case 44:return p++,v=y.CommaToken;case 34:return p++,h=c(),v=y.StringLiteral;case 47:var n=p-1;if(47===e.charCodeAt(p+1)){for(p+=2;p=y.LineCommentTrivia&&e<=y.Trivia);return e}void 0===t&&(t=!1);var p=0,d=e.length,h="",g=0,v=y.Unknown,x=m.None;return{setPosition:a,getPosition:function(){return p},scan:t?f:u,getToken:function(){return v},getTokenValue:function(){return h},getTokenOffset:function(){return g},getTokenLength:function(){return p-g},getTokenError:function(){return x}}}function r(e){return 32===e||9===e||11===e||12===e||160===e||5760===e||e>=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function i(e){return 10===e||13===e||8232===e||8233===e}function o(e){return e>=48&&e<=57}function a(e,t){var r,i,o=n(e),a=[],s=0;do switch(i=o.getPosition(),r=o.scan()){case y.LineCommentTrivia:case y.BlockCommentTrivia:case y.EOF:s!==i&&a.push(e.substring(s,i)),void 0!==t&&a.push(o.getTokenValue().replace(/[^\r\n]/g,t)),s=o.getPosition()}while(r!==y.EOF);return a.join("")}function s(e){switch(e){case x.InvalidSymbol:return v("error.invalidSymbol","Invalid symbol");case x.InvalidNumberFormat:return v("error.invalidNumberFormat","Invalid number format");case x.PropertyNameExpected:return v("error.propertyNameExpected","Property name expected");case x.ValueExpected:return v("error.valueExpected","Value expected");case x.ColonExpected:return v("error.colonExpected","Colon expected");case x.CommaExpected:return v("error.commaExpected","Comma expected");case x.CloseBraceExpected:return v("error.closeBraceExpected","Closing brace expected");case x.CloseBracketExpected:return v("error.closeBracketExpected","Closing bracket expected");case x.EndOfFileExpected:return v("error.endOfFileExpected","End of file expected");default:return""}}function c(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string";default:return"null"}}function u(e,t){function n(e,t,n,r){a.value=e,a.offset=t,a.length=n,a.type=r,a.columnOffset=void 0,o=a}var r=[],i=new Object,o=void 0,a={value:void 0,offset:void 0,length:void 0,type:void 0},s=!1;try{h(e,{onObjectBegin:function(e,n){if(t<=e)throw i;o=void 0,s=t>e,r.push("")},onObjectProperty:function(e,o,a){if(t=n.children.length)return;n=n.children[l]}}return n}}function d(e){if("array"===e.type)return e.children.map(d);if("object"===e.type){for(var t={},n=0,r=e.children;n0)for(var r=h.getToken();r!==y.EOF;){if(t.indexOf(r)!==-1){a();break}if(n.indexOf(r)!==-1)break;r=a()}}function c(e){var t=h.getTokenValue();return e?T(t):g(t),a(),!0}function u(){switch(h.getToken()){case y.NumericLiteral:var e=0;try{e=JSON.parse(h.getTokenValue()),"number"!=typeof e&&(s(x.InvalidNumberFormat),e=0)}catch(t){s(x.InvalidNumberFormat)}T(e);break;case y.NullKeyword:T(null);break;case y.TrueKeyword:T(!0);break;case y.FalseKeyword:T(!1);break;default:return!1}return a(),!0}function l(){return h.getToken()!==y.StringLiteral?(s(x.PropertyNameExpected,[],[y.CloseBraceToken,y.CommaToken]),!1):(c(!1),h.getToken()===y.ColonToken?(k(":"),a(),d()||s(x.ValueExpected,[],[y.CloseBraceToken,y.CommaToken])):s(x.ColonExpected,[],[y.CloseBraceToken,y.CommaToken]),!0)}function f(){m(),a();for(var e=!1;h.getToken()!==y.CloseBraceToken&&h.getToken()!==y.EOF;)h.getToken()===y.CommaToken?(e||s(x.ValueExpected,[],[]),k(","),a()):e&&s(x.CommaExpected,[],[]),l()||s(x.ValueExpected,[],[y.CloseBraceToken,y.CommaToken]),e=!0;return v(),h.getToken()!==y.CloseBraceToken?s(x.CloseBraceExpected,[y.CloseBraceToken],[]):a(),!0}function p(){b(),a();for(var e=!1;h.getToken()!==y.CloseBracketToken&&h.getToken()!==y.EOF;)h.getToken()===y.CommaToken?(e||s(x.ValueExpected,[],[]),k(","),a()):e&&s(x.CommaExpected,[],[]),d()||s(x.ValueExpected,[],[y.CloseBracketToken,y.CommaToken]),e=!0;return S(),h.getToken()!==y.CloseBracketToken?s(x.CloseBracketExpected,[y.CloseBracketToken],[]):a(),!0}function d(){switch(h.getToken()){case y.OpenBracketToken:return p();case y.OpenBraceToken:return f();case y.StringLiteral:return c(!0);default:return u()}}var h=n(e,!1),m=i(t.onObjectBegin),g=o(t.onObjectProperty),v=i(t.onObjectEnd),b=i(t.onArrayBegin),S=i(t.onArrayEnd),T=o(t.onLiteralValue),k=o(t.onSeparator),C=o(t.onError),O=r&&r.disallowComments;return a(),h.getToken()===y.EOF||(d()?(h.getToken()!==y.EOF&&s(x.EndOfFileExpected,[],[]),!0):(s(x.ValueExpected,[],[]),!1))}var m,g=e("vscode-nls"),v=g.loadMessageBundle();!function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter"}(m=t.ScanError||(t.ScanError={}));var y;!function(e){e[e.Unknown=0]="Unknown",e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.EOF=16]="EOF"}(y=t.SyntaxKind||(t.SyntaxKind={})),t.createScanner=n,t.stripComments=a;var x;!function(e){e[e.InvalidSymbol=0]="InvalidSymbol",e[e.InvalidNumberFormat=1]="InvalidNumberFormat",e[e.PropertyNameExpected=2]="PropertyNameExpected",e[e.ValueExpected=3]="ValueExpected",e[e.ColonExpected=4]="ColonExpected",e[e.CommaExpected=5]="CommaExpected",e[e.CloseBraceExpected=6]="CloseBraceExpected",e[e.CloseBracketExpected=7]="CloseBracketExpected",e[e.EndOfFileExpected=8]="EndOfFileExpected"}(x=t.ParseErrorCode||(t.ParseErrorCode={})),t.getParseErrorMessage=s,t.getLocation=u,t.parse=l,t.parseTree=f,t.findNodeAtLocation=p,t.getNodeValue=d,t.visit=h}),define("jsonc-parser",["jsonc-parser/main"],function(e){return e}),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-json-languageservice/utils/json",["require","exports"],e)}(function(e,t){function n(e,t,r){if(null!==e&&"object"==typeof e){var i=t+"\t";if(Array.isArray(e)){if(0===e.length)return"[]";for(var o="[\n",a=0;a=0;t--)if(this.contributions[t].resolveCompletion){var n=this.contributions[t].resolveCompletion(e);if(n)return n}return this.promise.resolve(e)},e.prototype.doComplete=function(e,t,n){var r=this,o={items:[],isIncomplete:!1},a=e.offsetAt(t),s=n.getNodeFromOffsetEndInclusive(a);if(this.isInComment(e,s?s.start:0,a))return Promise.resolve(o);var c=this.getCurrentWord(e,a),u=null;u=!s||"string"!==s.type&&"number"!==s.type&&"boolean"!==s.type&&"null"!==s.type?i.Range.create(e.positionAt(a-c.length),t):i.Range.create(e.positionAt(s.start),e.positionAt(s.end));var l={},f={add:function(e){var t=l[e.label];t?t.documentation||(t.documentation=e.documentation):(l[e.label]=e,u&&(e.textEdit=i.TextEdit.replace(u,e.insertText)),o.items.push(e))},setAsIncomplete:function(){o.isIncomplete=!0},error:function(e){console.error(e)},log:function(e){console.log(e)},getNumberOfProposals:function(){return o.items.length}};return this.schemaService.getSchemaForResource(e.uri,n).then(function(t){var p=[],d=!0,h="",m=null;if(s&&"string"===s.type){var g=s;g.isKey&&(d=!(s.parent&&s.parent.value),m=s.parent?s.parent:null,h=e.getText().substring(s.start+1,s.end-1),s.parent&&(s=s.parent.parent))}if(s&&"object"===s.type){if(s.start===a)return o;var v=s.properties;v.forEach(function(e){m&&m===e||(l[e.key.value]=i.CompletionItem.create("__"))});var y="";d&&(y=r.evaluateSeparatorAfter(e,e.offsetAt(u.end))),t?r.getPropertyCompletions(t,n,s,d,y,f):r.getSchemaLessPropertyCompletions(n,s,h,f);var x=s.getPath();r.contributions.forEach(function(t){var n=t.collectPropertyCompletions(e.uri,x,c,d,""===y,f);n&&p.push(n)}),!t&&c.length>0&&'"'!==e.getText().charAt(a-c.length-1)&&f.add({kind:i.CompletionItemKind.Property,label:r.getLabelForValue(c),insertText:r.getInsertTextForProperty(c,null,!1,y),insertTextFormat:i.InsertTextFormat.Snippet,documentation:""})}var b=a;!s||"string"!==s.type&&"number"!==s.type&&"boolean"!==s.type&&"null"!==s.type||(b=s.end,s=s.parent);var S="";s&&(S=r.evaluateSeparatorAfter(e,b));var T={};if(t?r.getValueCompletions(t,n,s,a,S,f,T):r.getSchemaLessValueCompletions(n,s,a,S,e,f),s){if("property"===s.type&&a>s.colonOffset){var k=s.key.value,C=s.value;if(!C||a<=C.end){var O=s.parent.getPath();r.contributions.forEach(function(t){var n=t.collectValueCompletions(e.uri,O,k,f);n&&p.push(n)})}}}else r.contributions.forEach(function(t){var n=t.collectDefaultCompletions(e.uri,f);n&&p.push(n)});return r.promise.all(p).then(function(){return 0===f.getNumberOfProposals()&&r.addFillerValueCompletions(T,S,f),o})})},e.prototype.getPropertyCompletions=function(e,t,n,r,o,a){var s=this,c=[];t.validate(e.schema,c,n.start),c.forEach(function(e){if(e.node===n&&!e.inverted){var t=e.schema.properties;t&&Object.keys(t).forEach(function(e){var n=t[e];n.deprecationMessage||a.add({kind:i.CompletionItemKind.Property,label:e,insertText:s.getInsertTextForProperty(e,n,r,o),insertTextFormat:i.InsertTextFormat.Snippet,filterText:s.getFilterTextForValue(e),documentation:n.description||""})})}})},e.prototype.getSchemaLessPropertyCompletions=function(e,t,n,r){var o=this,a=function(e){e.properties.forEach(function(e){var t=e.key.value;r.add({kind:i.CompletionItemKind.Property,label:t,insertText:o.getInsertTextForValue(t,""),insertTextFormat:i.InsertTextFormat.Snippet,filterText:o.getFilterTextForValue(t),documentation:""})})};if(t.parent)if("property"===t.parent.type){var s=t.parent.key.value;e.visit(function(e){var n=e;return"property"===e.type&&e!==t.parent&&n.key.value===s&&n.value&&"object"===n.value.type&&a(n.value),!0})}else"array"===t.parent.type&&t.parent.items.forEach(function(e){"object"===e.type&&e!==t&&a(e)});else"object"===t.type&&r.add({kind:i.CompletionItemKind.Property,label:"$schema",insertText:this.getInsertTextForProperty("$schema",null,!0,""),insertTextFormat:i.InsertTextFormat.Snippet,documentation:"",filterText:this.getFilterTextForValue("$schema")})},e.prototype.getSchemaLessValueCompletions=function(e,t,n,r,o,a){var s=this,c=function(e){e.parent.contains(n,!0)||a.add({kind:s.getSuggestionKind(e.type),label:s.getLabelTextForMatchingNode(e,o),insertText:s.getInsertTextForMatchingNode(e,o,r),insertTextFormat:i.InsertTextFormat.Snippet,documentation:""}),"boolean"===e.type&&s.addBooleanValueCompletion(!e.getValue(),r,a)};if(t){if("property"===t.type){var u=t;if(n>u.colonOffset){var l=u.value;if(l&&(n>l.end||"object"===l.type||"array"===l.type))return;var f=u.key.value;e.visit(function(e){var t=e;return"property"===e.type&&t.key.value===f&&t.value&&c(t.value),!0}),"$schema"===f&&t.parent&&!t.parent.parent&&this.addDollarSchemaCompletions(r,a)}}if("array"===t.type)if(t.parent&&"property"===t.parent.type){var p=t.parent.key.value;e.visit(function(e){var t=e;return"property"===e.type&&t.key.value===p&&t.value&&"array"===t.value.type&&t.value.items.forEach(function(e){c(e)}),!0})}else t.items.forEach(function(e){c(e)})}else a.add({kind:this.getSuggestionKind("object"),label:"Empty object",insertText:this.getInsertTextForValue({},""),insertTextFormat:i.InsertTextFormat.Snippet,documentation:""}),a.add({kind:this.getSuggestionKind("array"),label:"Empty array",insertText:this.getInsertTextForValue([],""),insertTextFormat:i.InsertTextFormat.Snippet,documentation:""})},e.prototype.getValueCompletions=function(e,t,n,r,i,o,a){var s=this;if(n){var c=null;if("property"===n.type&&r>n.colonOffset){var u=n.value;if(u&&r>u.end)return;c=n.key.value,n=n.parent}if(n&&(null!==c||"array"===n.type)){var l=[];t.validate(e.schema,l,n.start),l.forEach(function(e){if(e.node===n&&!e.inverted&&e.schema&&(e.schema.items&&s.addSchemaValueCompletions(e.schema.items,i,o,a),e.schema.properties)){var t=e.schema.properties[c];t&&s.addSchemaValueCompletions(t,i,o,a)}}),"$schema"!==c||n.parent||this.addDollarSchemaCompletions(i,o),a["boolean"]&&(this.addBooleanValueCompletion(!0,i,o),this.addBooleanValueCompletion(!1,i,o)),a["null"]&&this.addNullValueCompletion(i,o)}}else this.addSchemaValueCompletions(e.schema,"",o,a)},e.prototype.addSchemaValueCompletions=function(e,t,n,r){var i=this;this.addDefaultValueCompletions(e,t,n),this.addEnumValueCompletions(e,t,n),this.collectTypes(e,r),Array.isArray(e.allOf)&&e.allOf.forEach(function(e){return i.addSchemaValueCompletions(e,t,n,r)}),Array.isArray(e.anyOf)&&e.anyOf.forEach(function(e){return i.addSchemaValueCompletions(e,t,n,r)}),Array.isArray(e.oneOf)&&e.oneOf.forEach(function(e){return i.addSchemaValueCompletions(e,t,n,r)})},e.prototype.addDefaultValueCompletions=function(e,t,n,r){var o=this;void 0===r&&(r=0);var s=!1;if(e["default"]){for(var c=e.type,u=e["default"],l=r;l>0;l--)u=[u],c="array";n.add({kind:this.getSuggestionKind(c),label:this.getLabelForValue(u),insertText:this.getInsertTextForValue(u,t),insertTextFormat:i.InsertTextFormat.Snippet,detail:a("json.suggest.default","Default value")}),s=!0}Array.isArray(e.defaultSnippets)&&e.defaultSnippets.forEach(function(a){var c,u=e.type,l=a.body,f=a.label;if(l){for(var p=e.type,d=r;d>0;d--)l=[l],p="array";c=o.getInsertTextForSnippetValue(l,t),f=f||o.getLabelForSnippetValue(l)}else if(a.bodyText){for(var h="",m="",g="",d=r;d>0;d--)h=h+g+"[\n",m=m+"\n"+g+"]",g+="\t",u="array";c=h+g+a.bodyText.split("\n").join("\n"+g)+m+t,f=f||c}n.add({kind:o.getSuggestionKind(u),label:f,documentation:a.description,insertText:c,insertTextFormat:i.InsertTextFormat.Snippet,filterText:c}),s=!0}),s||!e.items||Array.isArray(e.items)||this.addDefaultValueCompletions(e.items,t,n,r+1)},e.prototype.addEnumValueCompletions=function(e,t,n){if(Array.isArray(e["enum"]))for(var r=0,o=e["enum"].length;r57?t.substr(0,57).trim()+"...":t},e.prototype.getFilterTextForValue=function(e){return JSON.stringify(e)},e.prototype.getLabelForSnippetValue=function(e){var t=JSON.stringify(e);return t=t.replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1"),t.length>57?t.substr(0,57).trim()+"...":t},e.prototype.getInsertTextForPlainText=function(e){return e.replace(/[\\\$\}]/g,"\\$&")},e.prototype.getInsertTextForValue=function(e,t){var n=JSON.stringify(e,null,"\t");return"{}"===n?"{\n\t$1\n}"+t:"[]"===n?"[\n\t$1\n]"+t:this.getInsertTextForPlainText(n+t)},e.prototype.getInsertTextForSnippetValue=function(e,t){var n=function(e){return"string"==typeof e&&"^"===e[0]?e.substr(1):JSON.stringify(e)};return r.stringifyObject(e,"",n)+t},e.prototype.getInsertTextForGuessedValue=function(e,t){switch(typeof e){case"object":return null===e?"${1:null}"+t:this.getInsertTextForValue(e,t);case"string":var n=JSON.stringify(e);return n=n.substr(1,n.length-2),n=this.getInsertTextForPlainText(n),'"${1:'+n+'}"'+t;case"number":case"integer":case"boolean":return"${1:"+JSON.stringify(e)+"}"+t}return this.getInsertTextForValue(e,t)},e.prototype.getSuggestionKind=function(e){if(Array.isArray(e)){var t=e;e=t.length>0?t[0]:null}if(!e)return i.CompletionItemKind.Value;switch(e){case"string":return i.CompletionItemKind.Value;case"object":return i.CompletionItemKind.Module;case"property":return i.CompletionItemKind.Property;default:return i.CompletionItemKind.Value}},e.prototype.getLabelTextForMatchingNode=function(e,t){switch(e.type){case"array":return"[]";case"object":return"{}";default:var n=t.getText().substr(e.start,e.end-e.start);return n}},e.prototype.getInsertTextForMatchingNode=function(e,t,n){switch(e.type){case"array":return this.getInsertTextForValue([],n);case"object":return this.getInsertTextForValue({},n);default:var r=t.getText().substr(e.start,e.end-e.start)+n;return this.getInsertTextForPlainText(r)}},e.prototype.getInsertTextForProperty=function(e,t,n,r){var i=this.getInsertTextForValue(e,"");if(!n)return i;var o=i+": ";if(t){var a=t["default"];if("undefined"!=typeof a)o+=this.getInsertTextForGuessedValue(a,"");else if(t["enum"]&&t["enum"].length>0)o+=this.getInsertTextForGuessedValue(t["enum"][0],"");else{var s=Array.isArray(t.type)?t.type[0]:t.type;switch(s||(t.properties?s="object":t.items&&(s="array")),s){case"boolean":o+="${1:false}";break;case"string":o+='"$1"';break;case"object":o+="{\n\t$1\n}";break;case"array":o+="[\n\t$1\n]";break;case"number":case"integer":o+="${1:0}";break;case"null":o+="${1:null}";break;default:return i}}}else o+="$1";return o+=r},e.prototype.getCurrentWord=function(e,t){for(var n=t-1,r=e.getText();n>=0&&' \t\n\r\x0B":{[,]}'.indexOf(r.charAt(n))===-1;)n--;return r.substring(n+1,t)},e.prototype.evaluateSeparatorAfter=function(e,t){var r=n.createScanner(e.getText(),!0);r.setPosition(t);var i=r.scan();switch(i){case n.SyntaxKind.CommaToken:case n.SyntaxKind.CloseBraceToken:case n.SyntaxKind.CloseBracketToken:case n.SyntaxKind.EOF:return"";default:return","}},e.prototype.isInComment=function(e,t,r){var i=n.createScanner(e.getText(),!1);i.setPosition(t);for(var o=i.scan();o!==n.SyntaxKind.EOF&&i.getTokenOffset()+i.getTokenLength()o.start+1&&i=0;p--){var d=this.contributions[p],h=d.getInfoContribution(e.uri,f);if(h)return h.then(function(e){return l(e)})}return this.schemaService.getSchemaForResource(e.uri,r).then(function(e){if(e){var t=[];r.validate(e.schema,t,o.start);var i=null,a=null;if(t.every(function(e){if(e.node===o&&!e.inverted&&e.schema&&(i=i||e.schema.description,e.schema["enum"]&&e.schema.enumDescriptions)){var t=e.schema["enum"].indexOf(o.getValue());a=e.schema.enumDescriptions[t]}return!0}),i)return a&&(i=i+"\n\n"+a),l([n.MarkedString.fromPlainText(i)])}})},e}();t.JSONHover=r}),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-json-languageservice/services/jsonValidation",["require","exports","vscode-languageserver-types"],e)}(function(e,t){var n=e("vscode-languageserver-types"),r=function(){function e(e,t){this.jsonSchemaService=e,this.promise=t,this.validationEnabled=!0}return e.prototype.configure=function(e){e&&(this.validationEnabled=e.validate)},e.prototype.doValidation=function(e,t){return this.validationEnabled?this.jsonSchemaService.getSchemaForResource(e.uri,t).then(function(r){if(r)if(r.errors.length&&t.root){var i=t.root,o="object"===i.type?i.getFirstProperty("$schema"):null;if(o){var a=o.value||o;t.warnings.push({location:{start:a.start,end:a.end},message:r.errors[0]})}else t.warnings.push({location:{start:i.start,end:i.start+1},message:r.errors[0]})}else t.validate(r.schema);var s=[],c={};return t.errors.concat(t.warnings).forEach(function(r,i){var o=r.location.start+" "+r.location.end+" "+r.message;if(!c[o]){c[o]=!0;var a={start:e.positionAt(r.location.start),end:e.positionAt(r.location.end)};s.push({severity:i>=t.errors.length?n.DiagnosticSeverity.Warning:n.DiagnosticSeverity.Error,range:a,message:r.message})}}),s}):this.promise.resolve([])},e}();t.JSONValidation=r}),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-json-languageservice/utils/strings",["require","exports"],e)}(function(e,t){function n(e,t){if(e.length0?e.lastIndexOf(t)===n:0===n&&e===t}function i(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}t.startsWith=n,t.endsWith=r,t.convertSimple2RegExpPattern=i}),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-json-languageservice/services/jsonDocumentSymbols",["require","exports","../utils/strings","vscode-languageserver-types"],e)}(function(e,t){var n=e("../utils/strings"),r=e("vscode-languageserver-types"),i=function(){function e(){}return e.prototype.findDocumentSymbols=function(e,t){var i=this,o=t.root;if(!o)return null;var a=e.uri;if(("vscode://defaultsettings/keybindings.json"===a||n.endsWith(a.toLowerCase(),"/user/keybindings.json"))&&"array"===o.type){var s=[];return o.items.forEach(function(t){if("object"===t.type){var n=t.getFirstProperty("key");if(n&&n.value){var i=r.Location.create(e.uri,r.Range.create(e.positionAt(t.start),e.positionAt(t.end)));s.push({name:n.value.getValue(),kind:r.SymbolKind.Function,location:i})}}}),s}var c=function(t,n,o){if("array"===n.type)n.items.forEach(function(e){c(t,e,o)});else if("object"===n.type){var a=n;a.properties.forEach(function(n){var a=r.Location.create(e.uri,r.Range.create(e.positionAt(n.start),e.positionAt(n.end))),s=n.value;if(s){var u=o?o+"."+n.key.value:n.key.value;t.push({name:n.key.getValue(),kind:i.getSymbolKind(s.type),location:a,containerName:o}),c(t,s,u)}})}return t},u=c([],o,void 0);return u},e.prototype.getSymbolKind=function(e){switch(e){case"object":return r.SymbolKind.Module;case"string":return r.SymbolKind.String;case"number":return r.SymbolKind.Number;case"array":return r.SymbolKind.Array;case"boolean":return r.SymbolKind.Boolean;default:return r.SymbolKind.Variable}},e}();t.JSONDocumentSymbols=i});var __extends=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new 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-json-languageservice/parser/jsonParser",["require","exports","jsonc-parser","vscode-nls"],e)}(function(e,t){function n(e,t){function n(){for(;;){var e=O.scan();switch(e){case i.SyntaxKind.LineCommentTrivia:case i.SyntaxKind.BlockCommentTrivia:E&&o(a("InvalidCommentTokem","Comments are not allowed"));break;case i.SyntaxKind.Trivia:case i.SyntaxKind.LineBreakTrivia:break;default:return e}}}function r(e){return O.getToken()===e&&(n(),!0)}function o(e,t,r,o){if(void 0===t&&(t=null),void 0===r&&(r=[]),void 0===o&&(o=[]),0===C.errors.length||C.errors[0].location.start!==O.getTokenOffset()){var a={message:e,location:{start:O.getTokenOffset(),end:O.getTokenOffset()+O.getTokenLength()}};C.errors.push(a)}if(t&&m(t,!1),r.length+o.length>0)for(var s=O.getToken();s!==i.SyntaxKind.EOF;){if(r.indexOf(s)!==-1){n();break}if(o.indexOf(s)!==-1)break;s=n()}return t}function s(){switch(O.getTokenError()){case i.ScanError.InvalidUnicode:return o(a("InvalidUnicode","Invalid unicode sequence in string")),!0;case i.ScanError.InvalidEscapeCharacter:return o(a("InvalidEscapeCharacter","Invalid escape character in string")),!0;case i.ScanError.UnexpectedEndOfNumber:return o(a("UnexpectedEndOfNumber","Unexpected end of number")),!0;case i.ScanError.UnexpectedEndOfComment:return o(a("UnexpectedEndOfComment","Unexpected end of comment")),!0;case i.ScanError.UnexpectedEndOfString:return o(a("UnexpectedEndOfString","Unexpected end of string")),!0}return!1}function m(e,t){return e.end=O.getTokenOffset()+O.getTokenLength(),t&&n(),e}function v(e,t){if(O.getToken()!==i.SyntaxKind.OpenBracketToken)return null;var s=new l(e,t,O.getTokenOffset());n();var c=0;if(s.addItem(k(s,c++)))for(;r(i.SyntaxKind.CommaToken);)s.addItem(k(s,c++))||j||o(a("ValueExpected","Value expected"));return O.getToken()!==i.SyntaxKind.CloseBracketToken?o(a("ExpectedCloseBracket","Expected comma or closing bracket"),s):m(s,!0)}function y(e,t){var r=b(null,null,!0);if(!r){if(O.getToken()===i.SyntaxKind.Unknown){var s=O.getTokenValue();s.match(/^['\w]/)&&o(a("DoubleQuotesExpected","Property keys must be doublequoted"))}return null}var c=new d(e,r);return t[r.value]&&C.warnings.push({location:{start:c.key.start,end:c.key.end},message:a("DuplicateKeyWarning","Duplicate object key")}),t[r.value]=!0,O.getToken()!==i.SyntaxKind.ColonToken?o(a("ColonExpected","Colon expected"),c,[],[i.SyntaxKind.CloseBraceToken,i.SyntaxKind.CommaToken]):(c.colonOffset=O.getTokenOffset(),n(),c.setValue(k(c,r.value))?(c.end=c.value.end,c):o(a("ValueExpected","Value expected"),c,[],[i.SyntaxKind.CloseBraceToken,i.SyntaxKind.CommaToken]))}function x(e,t){if(O.getToken()!==i.SyntaxKind.OpenBraceToken)return null;var s=new h(e,t,O.getTokenOffset());n();var c=Object.create(null);if(s.addProperty(y(s,c)))for(;r(i.SyntaxKind.CommaToken);)s.addProperty(y(s,c))||j||o(a("PropertyExpected","Property expected"));return O.getToken()!==i.SyntaxKind.CloseBraceToken?o(a("ExpectedCloseBrace","Expected comma or closing brace"),s):m(s,!0)}function b(e,t,n){if(O.getToken()!==i.SyntaxKind.StringLiteral)return null;var r=new p(e,t,n,O.getTokenOffset());return r.value=O.getTokenValue(),s(),m(r,!0)}function S(e,t){if(O.getToken()!==i.SyntaxKind.NumericLiteral)return null;var n=new f(e,t,O.getTokenOffset());if(!s()){var r=O.getTokenValue();try{var c=JSON.parse(r);if("number"!=typeof c)return o(a("InvalidNumberFormat","Invalid number format"),n);n.value=c}catch(u){return o(a("InvalidNumberFormat","Invalid number format"),n)}n.isInteger=r.indexOf(".")===-1}return m(n,!0)}function T(e,t){var n;switch(O.getToken()){case i.SyntaxKind.NullKeyword:n=new c(e,t,O.getTokenOffset());break;case i.SyntaxKind.TrueKeyword:n=new u(e,t,(!0),O.getTokenOffset());break;case i.SyntaxKind.FalseKeyword:n=new u(e,t,(!1),O.getTokenOffset());break;default:return null}return m(n,!0)}function k(e,t){return v(e,t)||x(e,t)||b(e,t,!1)||S(e,t)||T(e,t)}var C=new g(t),O=i.createScanner(e,!1),E=t&&t.disallowComments,j=t&&t.ignoreDanglingComma;return n(),C.root=k(null,null),C.root?O.getToken()!==i.SyntaxKind.EOF&&o(a("End of file expected","End of file expected")):o(a("Invalid symbol","Expected a JSON object, array or literal")),C}var r,i=e("jsonc-parser"),o=e("vscode-nls"),a=o.loadMessageBundle();!function(e){e[e.EnumValueMismatch=1]="EnumValueMismatch"}(r=t.ErrorCode||(t.ErrorCode={}));var s=function(){function e(e,t,n,r,i){this.type=t,this.location=n,this.start=r,this.end=i,this.parent=e}return e.prototype.getPath=function(){var e=this.parent?this.parent.getPath():[];return null!==this.location&&e.push(this.location),e},e.prototype.getChildNodes=function(){return[]},e.prototype.getLastChild=function(){return null},e.prototype.getValue=function(){},e.prototype.contains=function(e,t){return void 0===t&&(t=!1),e>=this.start&&e=n.start&&e=n.start&&e<=n.end){for(var r=n.getChildNodes(),i=0;i0?s={schema:e,validationResult:t,matchingSchemas:n}:0===a&&(s.matchingSchemas.push.apply(s.matchingSchemas,n),s.validationResult.mergeEnumValueMismatch(t))}else s.matchingSchemas.push.apply(s.matchingSchemas,n),s.validationResult.propertiesMatches+=t.propertiesMatches,s.validationResult.propertiesValueMatches+=t.propertiesValueMatches;else s={schema:e,validationResult:t,matchingSchemas:n}}),i.length>1&&r&&t.warnings.push({location:{start:o.start,end:o.start+1},message:a("oneOfWarning","Matches multiple schemas when only one must validate.")}),null!==s&&(t.merge(s.validationResult),t.propertiesMatches+=s.validationResult.propertiesMatches,t.propertiesValueMatches+=s.validationResult.propertiesValueMatches,n&&n.push.apply(n,s.matchingSchemas)),i.length};Array.isArray(e.anyOf)&&u(e.anyOf,!1),Array.isArray(e.oneOf)&&u(e.oneOf,!0),Array.isArray(e["enum"])&&(e["enum"].indexOf(this.getValue())===-1?(t.warnings.push({location:{start:this.start,end:this.end},code:r.EnumValueMismatch,message:e.errorMessage||a("enumWarning","Value is not accepted. Valid values: {0}",JSON.stringify(e["enum"]))}),t.mismatchedEnumValues=e["enum"]):t.enumValueMatch=!0),e.deprecationMessage&&t.warnings.push({location:{start:this.start,end:this.end},message:e.deprecationMessage}),null!==n&&n.push({node:this,schema:e})}},e}();t.ASTNode=s;var c=function(e){function t(t,n,r,i){return e.call(this,t,"null",n,r,i)||this}return __extends(t,e),t.prototype.getValue=function(){return null},t}(s);t.NullASTNode=c;var u=function(e){function t(t,n,r,i,o){var a=e.call(this,t,"boolean",n,i,o)||this;return a.value=r,a}return __extends(t,e),t.prototype.getValue=function(){return this.value},t}(s);t.BooleanASTNode=u;var l=function(e){function t(t,n,r,i){var o=e.call(this,t,"array",n,r,i)||this;return o.items=[],o}return __extends(t,e),t.prototype.getChildNodes=function(){return this.items},t.prototype.getLastChild=function(){return this.items[this.items.length-1]},t.prototype.getValue=function(){return this.items.map(function(e){return e.getValue()})},t.prototype.addItem=function(e){return!!e&&(this.items.push(e),!0)},t.prototype.visit=function(e){for(var t=e(this),n=0;n=s.length&&n.propertiesValueMatches++}),t.additionalItems===!1&&this.items.length>s.length?n.warnings.push({location:{start:this.start,end:this.end},message:a("additionalItemsWarning","Array has too many items according to schema. Expected {0} or fewer",s.length)}):this.items.length>=s.length&&(n.propertiesValueMatches+=this.items.length-s.length)}else t.items&&this.items.forEach(function(e){var o=new m;e.validate(t.items,o,r,i),n.mergePropertyMatch(o)});if(t.minItems&&this.items.lengtht.maxItems&&n.warnings.push({location:{start:this.start,end:this.end},message:a("maxItemsWarning","Array has too many items. Expected {0} or fewer",t.minItems)}),t.uniqueItems===!0){var c=this.items.map(function(e){return e.getValue()}),u=c.some(function(e,t){return t!==c.lastIndexOf(e)});u&&n.warnings.push({location:{start:this.start,end:this.end},message:a("uniqueItemsWarning","Array has duplicate items")})}}},t}(s);t.ArrayASTNode=l;var f=function(e){function t(t,n,r,i){var o=e.call(this,t,"number",n,r,i)||this;return o.isInteger=!0,o.value=Number.NaN,o}return __extends(t,e),t.prototype.getValue=function(){return this.value},t.prototype.validate=function(t,n,r,i){if(void 0===i&&(i=-1),i===-1||this.contains(i)){var o=!1;("integer"===t.type||Array.isArray(t.type)&&t.type.indexOf("integer")!==-1)&&(o=!0),o&&this.isInteger===!0&&(this.type="integer"),e.prototype.validate.call(this,t,n,r,i),this.type="number";var s=this.getValue();"number"==typeof t.multipleOf&&s%t.multipleOf!==0&&n.warnings.push({location:{start:this.start,end:this.end},message:a("multipleOfWarning","Value is not divisible by {0}",t.multipleOf)}),"number"==typeof t.minimum&&(t.exclusiveMinimum&&s<=t.minimum&&n.warnings.push({location:{start:this.start,end:this.end},message:a("exclusiveMinimumWarning","Value is below the exclusive minimum of {0}",t.minimum)}),!t.exclusiveMinimum&&s=t.maximum&&n.warnings.push({location:{start:this.start,end:this.end},message:a("exclusiveMaximumWarning","Value is above the exclusive maximum of {0}",t.maximum)}),!t.exclusiveMaximum&&s>t.maximum&&n.warnings.push({location:{start:this.start,end:this.end},message:a("maximumWarning","Value is above the maximum of {0}",t.maximum)}))}},t}(s);t.NumberASTNode=f;var p=function(e){function t(t,n,r,i,o){var a=e.call(this,t,"string",n,i,o)||this;return a.isKey=r,a.value="",a}return __extends(t,e),t.prototype.getValue=function(){return this.value},t.prototype.validate=function(t,n,r,i){if(void 0===i&&(i=-1),(i===-1||this.contains(i))&&(e.prototype.validate.call(this,t,n,r,i),t.minLength&&this.value.lengtht.maxLength&&n.warnings.push({location:{start:this.start,end:this.end},message:a("maxLengthWarning","String is shorter than the maximum length of ",t.maxLength)}),t.pattern)){var o=new RegExp(t.pattern);o.test(this.value)||n.warnings.push({location:{start:this.start,end:this.end},message:t.errorMessage||a("patternWarning",'String does not match the pattern of "{0}"',t.pattern)})}},t}(s);t.StringASTNode=p;var d=function(e){function t(t,n){var r=e.call(this,t,"property",null,n.start)||this;return r.key=n,n.parent=r,n.location=n.value,r.colonOffset=-1,r}return __extends(t,e),t.prototype.getChildNodes=function(){return this.value?[this.key,this.value]:[this.key]},t.prototype.getLastChild=function(){return this.value},t.prototype.setValue=function(e){return this.value=e,null!==e},t.prototype.visit=function(e){return e(this)&&this.key.visit(e)&&this.value&&this.value.visit(e)},t.prototype.validate=function(e,t,n,r){void 0===r&&(r=-1),(r===-1||this.contains(r))&&this.value&&this.value.validate(e,t,n,r)},t}(s);t.PropertyASTNode=d;var h=function(e){function t(t,n,r,i){var o=e.call(this,t,"object",n,r,i)||this;return o.properties=[],o}return __extends(t,e),t.prototype.getChildNodes=function(){return this.properties},t.prototype.getLastChild=function(){return this.properties[this.properties.length-1]},t.prototype.addProperty=function(e){return!!e&&(this.properties.push(e),!0)},t.prototype.getFirstProperty=function(e){for(var t=0;t=0;)c.splice(t,1),t=c.indexOf(e)};t.properties&&Object.keys(t.properties).forEach(function(e){u(e);var o=t.properties[e],a=s[e];if(a){var c=new m;a.validate(o,c,r,i),n.mergePropertyMatch(c)}}),t.patternProperties&&Object.keys(t.patternProperties).forEach(function(e){var o=new RegExp(e);c.slice(0).forEach(function(a){if(o.test(a)){u(a);var c=s[a];if(c){var l=new m;c.validate(t.patternProperties[e],l,r,i),n.mergePropertyMatch(l)}}})}),t.additionalProperties?c.forEach(function(e){var o=s[e];if(o){var a=new m;o.validate(t.additionalProperties,a,r,i),n.mergePropertyMatch(a)}}):t.additionalProperties===!1&&c.length>0&&c.forEach(function(e){var r=s[e];if(r){var i=r.parent;n.warnings.push({location:{start:i.key.start,end:i.key.end},message:t.errorMessage||a("DisallowedExtraPropWarning","Property {0} is not allowed",e)})}}),t.maxProperties&&this.properties.length>t.maxProperties&&n.warnings.push({location:{start:this.start,end:this.end},message:a("MaxPropWarning","Object has more properties than limit of {0}",t.maxProperties)}),t.minProperties&&this.properties.length=0}}),define("vscode-uri",["vscode-uri/index"],function(e){return e}),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-json-languageservice/services/jsonSchemaService",["require","exports","jsonc-parser","vscode-uri","../utils/strings","vscode-nls"],e)}(function(e,t){function n(e){try{var t=i["default"].parse(e);if("file"===t.scheme)return t.fsPath}catch(n){}return e}var r=e("jsonc-parser"),i=e("vscode-uri"),o=e("../utils/strings"),a=e("vscode-nls"),s=a.loadMessageBundle(),c=function(){function e(e){this.combinedSchemaId="schemaservice://combinedSchema/"+encodeURIComponent(e);try{this.patternRegExp=new RegExp(o.convertSimple2RegExpPattern(e)+"$")}catch(t){this.patternRegExp=null}this.schemas=[],this.combinedSchema=null}return e.prototype.addSchema=function(e){this.schemas.push(e),this.combinedSchema=null},e.prototype.matchesPattern=function(e){return this.patternRegExp&&this.patternRegExp.test(e)},e.prototype.getCombinedSchema=function(e){return this.combinedSchema||(this.combinedSchema=e.createCombinedSchema(this.combinedSchemaId,this.schemas)),this.combinedSchema},e}(),u=function(){function e(e,t,n){this.service=e,this.url=t,n&&(this.unresolvedSchema=this.service.promise.resolve(new l(n)))}return e.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||(this.unresolvedSchema=this.service.loadSchema(this.url)),this.unresolvedSchema},e.prototype.getResolvedSchema=function(){var e=this;return this.resolvedSchema||(this.resolvedSchema=this.getUnresolvedSchema().then(function(t){return e.service.resolveSchemaContent(t,e.url)})),this.resolvedSchema},e.prototype.clearSchema=function(){this.resolvedSchema=null,this.unresolvedSchema=null},e}(),l=function(){function e(e,t){void 0===t&&(t=[]),this.schema=e,this.errors=t}return e}();t.UnresolvedSchema=l;var f=function(){function e(e,t){void 0===t&&(t=[]),this.schema=e,this.errors=t}return e.prototype.getSection=function(e){return this.getSectionRecursive(e,this.schema)},e.prototype.getSectionRecursive=function(e,t){var n=this;if(!t||0===e.length)return t;var r=e.shift();if(t.properties&&t.properties[r])return this.getSectionRecursive(e,t.properties[r]);if(t.patternProperties)Object.keys(t.patternProperties).forEach(function(i){var o=new RegExp(i);if(o.test(r))return n.getSectionRecursive(e,t.patternProperties[i])});else{if(t.additionalProperties)return this.getSectionRecursive(e,t.additionalProperties);if(r.match("[0-9]+")){if(t.items)return this.getSectionRecursive(e,t.items);if(Array.isArray(t.items))try{var i=parseInt(r,10);return t.items[i]?this.getSectionRecursive(e,t.items[i]):null}catch(o){return null}}}return null},e}();t.ResolvedSchema=f;var p=function(){function e(e,t,n){this.contextService=t,this.requestService=e,this.promiseConstructor=n||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations={},this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={}}return e.prototype.getRegisteredSchemaIds=function(e){return Object.keys(this.registeredSchemasIds).filter(function(t){var n=i["default"].parse(t).scheme;return"schemaservice"!==n&&(!e||e(n))})},Object.defineProperty(e.prototype,"promise",{get:function(){return this.promiseConstructor},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()},e.prototype.onResourceChange=function(e){e=this.normalizeId(e);var t=this.schemasById[e];return!!t&&(t.clearSchema(),!0)},e.prototype.normalizeId=function(e){return i["default"].parse(e).toString()},e.prototype.setSchemaContributions=function(e){var t=this;if(e.schemas){var n=e.schemas;for(var r in n){var i=this.normalizeId(r);this.contributionSchemas[i]=this.addSchemaHandle(i,n[r])}}if(e.schemaAssociations){var o=e.schemaAssociations;for(var a in o){var s=o[a];this.contributionAssociations[a]=s;var c=this.getOrAddFilePatternAssociation(a);s.forEach(function(e){var n=t.normalizeId(e);c.addSchema(n)})}}},e.prototype.addSchemaHandle=function(e,t){var n=new u(this,e,t);return this.schemasById[e]=n,n},e.prototype.getOrAddSchemaHandle=function(e,t){return this.schemasById[e]||this.addSchemaHandle(e,t)},e.prototype.getOrAddFilePatternAssociation=function(e){var t=this.filePatternAssociationById[e];return t||(t=new c(e),this.filePatternAssociationById[e]=t,this.filePatternAssociations.push(t)),t},e.prototype.registerExternalSchema=function(e,t,n){var r=this;void 0===t&&(t=null);var i=this.normalizeId(e);return this.registeredSchemasIds[i]=!0,t&&t.forEach(function(e){r.getOrAddFilePatternAssociation(e).addSchema(i)}),n?this.addSchemaHandle(i,n):this.getOrAddSchemaHandle(i)},e.prototype.clearExternalSchemas=function(){var e=this;this.schemasById={},this.filePatternAssociations=[],this.filePatternAssociationById={},this.registeredSchemasIds={};for(var t in this.contributionSchemas)this.schemasById[t]=this.contributionSchemas[t],this.registeredSchemasIds[t]=!0;for(var n in this.contributionAssociations){var r=this.getOrAddFilePatternAssociation(n);this.contributionAssociations[n].forEach(function(t){var n=e.normalizeId(t);r.addSchema(n)})}},e.prototype.getResolvedSchema=function(e){var t=this.normalizeId(e),n=this.schemasById[t];return n?n.getResolvedSchema():this.promise.resolve(null)},e.prototype.loadSchema=function(e){if(!this.requestService){var t=s("json.schema.norequestservice","Unable to load schema from '{0}'. No schema request service available",n(e));return this.promise.resolve(new l({},[t]))}return this.requestService(e).then(function(t){if(!t){var i=s("json.schema.nocontent","Unable to load schema from '{0}': No content.",n(e));return new l({},[i])}var o={},a=[];o=r.parse(t,a);var c=a.length?[s("json.schema.invalidFormat","Unable to parse content from '{0}': {1}.",n(e),r.getParseErrorMessage(a[0]))]:[];return new l(o,c)},function(t){var r=s("json.schema.unabletoload","Unable to load schema from '{0}': {1}",n(e),t.toString());return new l({},[r])})},e.prototype.resolveSchemaContent=function(e,t){var n=this,r=e.errors.slice(0),i=e.schema,o=this.contextService,a=function(e,t){if(!t)return e;var n=e;return"/"===t[0]&&(t=t.substr(1)),t.split("/").some(function(e){return n=n[e],!n}),n},c=function(e,t,n){var i=a(t,n);if(i)for(var o in i)i.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&(e[o]=i[o]);else r.push(s("json.schema.invalidref","$ref '{0}' in {1} can not be resolved.",n,t.id));delete e.$ref},u=function(e,t,i,a){return o&&!/^\w+:\/\/.*/.test(t)&&(t=o.resolveRelativePath(t,a)),t=n.normalizeId(t),n.getOrAddSchemaHandle(t).getUnresolvedSchema().then(function(n){if(n.errors.length){var o=i?t+"#"+i:t;r.push(s("json.schema.problemloadingref","Problems loading reference '{0}': {1}",o,n.errors[0]))}return c(e,n.schema,i),l(e,n.schema,t)})},l=function(e,t,r){for(var i=[e],o=[],a=[],s=function(){for(var e=[],t=0;t=0)){if(o.push(p),p.$ref){var d=p.$ref.split("#",2);if(d[0].length>0){a.push(u(p,d[0],d[1],r));continue}c(p,t,d[1])}s(p.items,p.additionalProperties,p.not),l(p.definitions,p.properties,p.patternProperties,p.dependencies),f(p.anyOf,p.allOf,p.oneOf,p.items)}}return n.promise.all(a)};return l(i,i,t).then(function(e){return new f(i,r)})},e.prototype.getSchemaForResource=function(e,t){if(t&&t.root&&"object"===t.root.type){var n=t.root.properties.filter(function(e){return"$schema"===e.key.value&&!!e.value});if(n.length>0){var r=n[0].value.getValue();if(o.startsWith(r,".")&&this.contextService&&(r=this.contextService.resolveRelativePath(r,e)),r){var i=this.normalizeId(r);return this.getOrAddSchemaHandle(i).getResolvedSchema()}}}for(var a=this.filePatternAssociations.length-1;a>=0;a--){var s=this.filePatternAssociations[a];if(s.matchesPattern(e))return s.getCombinedSchema(this).getResolvedSchema()}return this.promise.resolve(null)},e.prototype.createCombinedSchema=function(e,t){if(1===t.length)return this.getOrAddSchemaHandle(t[0]);var n={allOf:t.map(function(e){return{$ref:e}})};return this.addSchemaHandle(e,n)},e}();t.JSONSchemaService=p}),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-json-languageservice/services/jsonFormatter",["require","exports","jsonc-parser","vscode-languageserver-types"],e)}(function(e,t){function n(e,t,n){function u(){return T+r(S,p+C)}function l(){var e=O.scan();for(k=!1;e===s.SyntaxKind.Trivia||e===s.SyntaxKind.LineBreakTrivia;)k=k||e===s.SyntaxKind.LineBreakTrivia,e=O.scan();return e}function f(t,n,r){if(nm&&v.substring(n,r)!==t){var i=c.Range.create(e.positionAt(n),e.positionAt(r));E.push(c.TextEdit.replace(i,t))}}var p,d,h,m,g,v=e.getText();if(t){m=e.offsetAt(t.start),g=e.offsetAt(t.end);var y=c.Position.create(t.start.line,0);h=e.offsetAt(y);for(var x=e.offsetAt(c.Position.create(t.end.line+1,0)),b=e.offsetAt(c.Position.create(t.end.line,0));x>b&&a(v,x-1);)x--;t=c.Range.create(y,e.positionAt(x)),d=v.substring(h,x),p=i(d,0,n)}else d=v,t=c.Range.create(c.Position.create(0,0),e.positionAt(d.length)),p=0,h=0,m=0,g=v.length;var S,T=o(e),k=!1,C=0;S=n.insertSpaces?r(" ",n.tabSize):"\t";var O=s.createScanner(d,!1),E=[],j=l();if(j!==s.SyntaxKind.EOF){var I=O.getTokenOffset()+h,w=r(S,p);f(w,h,I)}for(;j!==s.SyntaxKind.EOF;){for(var A=O.getTokenOffset()+O.getTokenLength()+h,P=l(),V="";!k&&(P===s.SyntaxKind.LineCommentTrivia||P===s.SyntaxKind.BlockCommentTrivia);){var F=O.getTokenOffset()+h;f(" ",A,F),A=O.getTokenOffset()+O.getTokenLength()+h,V=P===s.SyntaxKind.LineCommentTrivia?u():"",P=l()}if(P===s.SyntaxKind.CloseBraceToken)j!==s.SyntaxKind.OpenBraceToken&&(C--,V=u());else if(P===s.SyntaxKind.CloseBracketToken)j!==s.SyntaxKind.OpenBracketToken&&(C--,V=u());else{switch(j){case s.SyntaxKind.OpenBracketToken:case s.SyntaxKind.OpenBraceToken:C++,V=u();break;case s.SyntaxKind.CommaToken:case s.SyntaxKind.LineCommentTrivia:V=u();break;case s.SyntaxKind.BlockCommentTrivia:V=k?u():" ";break;case s.SyntaxKind.ColonToken:V=" ";break;case s.SyntaxKind.NullKeyword:case s.SyntaxKind.TrueKeyword:case s.SyntaxKind.FalseKeyword:case s.SyntaxKind.NumericLiteral:P!==s.SyntaxKind.NullKeyword&&P!==s.SyntaxKind.FalseKeyword&&P!==s.SyntaxKind.NumericLiteral||(V=" ")}!k||P!==s.SyntaxKind.LineCommentTrivia&&P!==s.SyntaxKind.BlockCommentTrivia||(V=u())}var _=O.getTokenOffset()+h;f(V,A,_),j=P}return E}function r(e,t){for(var n="",r=0;r1){for(var n=e.offsetAt(c.Position.create(1,0)),r=n;r>0&&a(t,r-1);)r--;return t.substr(r,n-r)}return"\n"}function a(e,t){return"\r\n".indexOf(e.charAt(t))!==-1}var s=e("jsonc-parser"),c=e("vscode-languageserver-types");t.format=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-json-languageservice/jsonLanguageService",["require","exports","vscode-languageserver-types","./services/jsonCompletion","./services/jsonHover","./services/jsonValidation","./services/jsonDocumentSymbols","./parser/jsonParser","./services/configuration","./services/jsonSchemaService","./services/jsonFormatter"],e)}(function(e,t){function n(e){var t=e.promiseConstructor||Promise,n=new l.JSONSchemaService(e.schemaRequestService,e.workspaceContext,t);n.setSchemaContributions(u.schemaContributions);var r=new i.JSONCompletion(n,e.contributions,t),p=new o.JSONHover(n,e.contributions,t),d=new s.JSONDocumentSymbols,h=new a.JSONValidation(n,t),m=!1;return{configure:function(e){n.clearExternalSchemas(),e.schemas&&e.schemas.forEach(function(e){n.registerExternalSchema(e.uri,e.fileMatch,e.schema)}),h.configure(e),m=e&&!e.allowComments},resetSchema:function(e){return n.onResourceChange(e)},doValidation:h.doValidation.bind(h),parseJSONDocument:function(e){return c.parse(e.getText(),{disallowComments:m})},doResolve:r.doResolve.bind(r),doComplete:r.doComplete.bind(r),findDocumentSymbols:d.findDocumentSymbols.bind(d),doHover:p.doHover.bind(p),format:f.format}}var r=e("vscode-languageserver-types");t.TextDocument=r.TextDocument,t.Position=r.Position,t.CompletionItem=r.CompletionItem,t.CompletionList=r.CompletionList,t.Range=r.Range,t.SymbolInformation=r.SymbolInformation,t.Diagnostic=r.Diagnostic,t.TextEdit=r.TextEdit,t.FormattingOptions=r.FormattingOptions,t.MarkedString=r.MarkedString;var i=e("./services/jsonCompletion"),o=e("./services/jsonHover"),a=e("./services/jsonValidation"),s=e("./services/jsonDocumentSymbols"),c=e("./parser/jsonParser"),u=e("./services/configuration"),l=e("./services/jsonSchemaService"),f=e("./services/jsonFormatter");t.getLanguageService=n}),define("vscode-json-languageservice",["vscode-json-languageservice/jsonLanguageService"],function(e){return e}),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("vs/language/json/jsonWorker",["require","exports","vscode-json-languageservice","vscode-languageserver-types"],e)}(function(e,t){function n(e,t){return new s(e,t)}var r=monaco.Promise,i=e("vscode-json-languageservice"),o=e("vscode-languageserver-types"),a=function(){function e(e){this.wrapped=new monaco.Promise(e)}return e.prototype.then=function(e,t){return this.wrapped.then(e,t)},e.prototype.getWrapped=function(){return this.wrapped},e.prototype.cancel=function(){this.wrapped.cancel()},e.resolve=function(e){return monaco.Promise.as(e)},e.reject=function(e){return monaco.Promise.wrapError(e)},e.all=function(e){return monaco.Promise.join(e)},e}(),s=function(){function e(e,t){this._ctx=e,this._languageSettings=t.languageSettings,this._languageId=t.languageId,this._languageService=i.getLanguageService({promiseConstructor:a}),this._languageService.configure(this._languageSettings)}return e.prototype.doValidation=function(e){var t=this._getTextDocument(e),n=this._languageService.parseJSONDocument(t);return this._languageService.doValidation(t,n)},e.prototype.doComplete=function(e,t){var n=this._getTextDocument(e),r=this._languageService.parseJSONDocument(n);return this._languageService.doComplete(n,t,r)},e.prototype.doResolve=function(e){return this._languageService.doResolve(e)},e.prototype.doHover=function(e,t){var n=this._getTextDocument(e),r=this._languageService.parseJSONDocument(n);return this._languageService.doHover(n,t,r)},e.prototype.format=function(e,t,n){var i=this._getTextDocument(e),o=this._languageService.format(i,t,n);return r.as(o)},e.prototype.resetSchema=function(e){return r.as(this._languageService.resetSchema(e))},e.prototype.findDocumentSymbols=function(e){var t=this._getTextDocument(e),n=this._languageService.parseJSONDocument(t),i=this._languageService.findDocumentSymbols(t,n);return r.as(i)},e.prototype._getTextDocument=function(e){for(var t=this._ctx.getMirrorModels(),n=0,r=t;n