88 lines
254 KiB
JavaScript
88 lines
254 KiB
JavaScript
|
var df=Object.create,vn=Object.defineProperty,hf=Object.getPrototypeOf,pf=Object.prototype.hasOwnProperty,gf=Object.getOwnPropertyNames,mf=Object.getOwnPropertyDescriptor;var Ys=e=>vn(e,"__esModule",{value:!0});var W=(e,t)=>()=>(t||(t={exports:{}},e(t.exports,t)),t.exports),vf=(e,t)=>{Ys(e);for(var r in t)vn(e,r,{get:t[r],enumerable:!0})},yf=(e,t,r)=>{if(Ys(e),t&&typeof t=="object"||typeof t=="function")for(let n of gf(t))!pf.call(e,n)&&n!=="default"&&vn(e,n,{get:()=>t[n],enumerable:!(r=mf(t,n))||r.enumerable});return e},Ke=e=>e&&e.__esModule?e:yf(vn(e!=null?df(hf(e)):{},"default",{value:e,enumerable:!0}),e);var yn=W(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});function bf(e){return e===!0||e===!1}et.boolean=bf;function Zs(e){return typeof e=="string"||e instanceof String}et.string=Zs;function wf(e){return typeof e=="number"||e instanceof Number}et.number=wf;function Cf(e){return e instanceof Error}et.error=Cf;function Qs(e){return typeof e=="function"}et.func=Qs;function Ks(e){return Array.isArray(e)}et.array=Ks;function xf(e){return Ks(e)&&e.every(t=>Zs(t))}et.stringArray=xf;function Sf(e,t){return Array.isArray(e)&&e.every(t)}et.typedArray=Sf;function Tf(e){return e&&Qs(e.then)}et.thenable=Tf});var vt=W(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});var wi;function Ci(){if(wi===void 0)throw new Error("No runtime abstraction layer installed");return wi}(function(e){function t(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");wi=r}e.install=t})(Ci||(Ci={}));bi.default=Ci});var xi=W(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});var kf;(function(e){function t(r){return{dispose:r}}e.create=t})(kf=bn.Disposable||(bn.Disposable={}))});var sa=W(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});var _f=vt(),zt=xi(),Pf=require("util"),Ti=8192,ea=Buffer.from("\r","ascii")[0],ta=Buffer.from(`
|
|||
|
`,"ascii")[0],Rf=`\r
|
|||
|
`,ra=class{constructor(t="utf-8"){this._encoding=t,this.index=0,this.buffer=Buffer.allocUnsafe(Ti)}get encoding(){return this._encoding}append(t){let r;if(typeof t=="string"?r=Buffer.from(t,this._encoding):r=t,this.buffer.length-this.index>=r.length)this.buffer.set(r,this.index);else{var n=(Math.ceil((this.index+r.length)/Ti)+1)*Ti;this.index===0?(this.buffer=Buffer.allocUnsafe(n),this.buffer.set(r)):this.buffer=Buffer.concat([this.buffer.slice(0,this.index),r],n)}this.index+=r.length}tryReadHeaders(){let t=0;for(;t+3<this.index&&(this.buffer[t]!==ea||this.buffer[t+1]!==ta||this.buffer[t+2]!==ea||this.buffer[t+3]!==ta);)t++;if(t+3>=this.index)return;let r=new Map;this.buffer.toString("ascii",0,t).split(Rf).forEach(o=>{let s=o.indexOf(":");if(s===-1)throw new Error("Message header must separate key and value using :");let u=o.substr(0,s),l=o.substr(s+1).trim();r.set(u,l)});let i=t+4;return this.buffer=this.buffer.slice(i),this.index=this.index-i,r}tryReadBody(t){if(this.index<t)return;let r=Buffer.alloc(t);this.buffer.copy(r,0,0,t);let n=t;return this.buffer.copy(this.buffer,0,n),this.index=this.index-n,r}get numberOfBytes(){return this.index}},na=class{constructor(t){this.stream=t}onClose(t){return this.stream.on("close",t),zt.Disposable.create(()=>this.stream.off("close",t))}onError(t){return this.stream.on("error",t),zt.Disposable.create(()=>this.stream.off("error",t))}onEnd(t){return this.stream.on("end",t),zt.Disposable.create(()=>this.stream.off("end",t))}onData(t){return this.stream.on("data",t),zt.Disposable.create(()=>this.stream.off("data",t))}},ia=class{constructor(t){this.stream=t}onClose(t){return this.stream.on("close",t),zt.Disposable.create(()=>this.stream.off("close",t))}onError(t){return this.stream.on("error",t),zt.Disposable.create(()=>this.stream.off("error",t))}onEnd(t){return this.stream.on("end",t),zt.Disposable.create(()=>this.stream.off("end",t))}write(t,r){return new Promise((n,i)=>{let o=s=>{s==null?n():i(s)};typeof t=="string"?this.stream.write(t,r,o):this.stream.write(t,o)})}end(){this.stream.end()}},oa=Object.freeze({messageBuffer:Object.freeze({create:e=>new ra(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>Promise.resolve(Buffer.from(JSON.stringify(e,void 0,0),t.charset))}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>e instanceof Buffer?Promise.resolve(JSON.parse(e.toString(t.charset))):Promise.resolve(JSON.parse(new Pf.TextDecoder(t.charset).decode(e)))})}),stream:Object.freeze({asReadableStream:e=>new na(e),asWritableStream:e=>new ia(e)}),console,timer:Object.freeze({setTimeout(e,t,...r){return setTimeout(e,t,...r)},clearTimeout(e){clearTimeout(e)},setImmediate(e,...t){return setImmediate(e,...t)},clearImmediate(e){clearImmediate(e)}})});function ki(){return oa}(function(e){function t(){_f.default.install(oa)}e.install=t})(ki||(ki={}));Si.default=ki});var ar=W(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});function Ef(e){return e===!0||e===!1}yt.boolean=Ef;function aa(e){return typeof e=="string"||e instanceof String}yt.string=aa;function Of(e){return typeof e=="number"||e instanceof Number}yt.number=Of;function Nf(e){return e instanceof Error}yt.error=Nf;function Ff(e){return typeof e=="function"}yt.func=Ff;function ua(e){return Array.isArray(e)}yt.array=ua;function qf(e){return ua(e)&&e.every(t=>aa(t))}yt.stringArray=qf});var _i=W(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});var Bt=ar(),ca;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.serverErrorStart=-32099,e.serverErrorEnd=-32e3,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.RequestCancelled=-32800,e.ContentModified=-32801,e.MessageWriteError=1,e.MessageReadError=2})(ca=te.ErrorCodes||(te.ErrorCodes={}));var wn=class extends Error{constructor(t,r,n){super(r);this.code=Bt.number(t)?t:ca.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,wn.prototype)}toJson(){return{code:this.code,message:this.message,data:this.data}}};te.Respo
|
|||
|
`,Bf;(function(e){function t(r){let n=r;return n&&Hr.func(n.dispose)&&Hr.func(n.onClose)&&Hr.func(n.onError)&&Hr.func(n.write)}e.is=t})(Bf=fr.MessageWriter||(fr.MessageWriter={}));var ji=class{constructor(){this.errorEmitter=new Wa.Emitter,this.closeEmitter=new Wa.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(t,r,n){this.errorEmitter.fire([this.asError(t),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(t){return t instanceof Error?t:new Error(`Writer received error. Reason: ${Hr.string(t.message)?t.message:"unknown"}`)}};fr.AbstractMessageWriter=ji;var Di;(function(e){function t(r){var n,i;return r===void 0||typeof r=="string"?{charset:r!=null?r:"utf-8",contentTypeEncoder:La.default().applicationJson.encoder}:{charset:(n=r.charset)!==null&&n!==void 0?n:"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:(i=r.contentTypeEncoder)!==null&&i!==void 0?i:La.default().applicationJson.encoder}}e.fromOptions=t})(Di||(Di={}));var Va=class extends ji{constructor(t,r){super();this.writable=t,this.options=Di.fromOptions(r),this.errorCount=0,this.writeSemaphore=new Hf.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}async write(t){return this.options.contentTypeEncoder.encode(t,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(zf,n.byteLength.toString(),$a),i.push($a),this.doWrite(t,i,n)},n=>{throw this.fireError(n),n})}doWrite(t,r,n){return this.writeSemaphore.lock(async()=>{try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){this.handleError(i,t)}})}handleError(t,r){this.errorCount++,this.fireError(t,r,this.errorCount)}};fr.WriteableStreamMessageWriter=Va});var Ba=W(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});var qe;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(qe=dr.Touch||(dr.Touch={}));var Mi=class{constructor(){this[Symbol.toStringTag]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var t;return(t=this._head)===null||t===void 0?void 0:t.value}get last(){var t;return(t=this._tail)===null||t===void 0?void 0:t.value}has(t){return this._map.has(t)}get(t,r=qe.None){let n=this._map.get(t);if(!!n)return r!==qe.None&&this.touch(n,r),n.value}set(t,r,n=qe.None){let i=this._map.get(t);if(i)i.value=r,n!==qe.None&&this.touch(i,n);else{switch(i={key:t,value:r,next:void 0,previous:void 0},n){case qe.None:this.addItemLast(i);break;case qe.First:this.addItemFirst(i);break;case qe.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(t,i),this._size++}return this}delete(t){return!!this.remove(t)}remove(t){let r=this._map.get(t);if(!!r)return this._map.delete(t),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let t=this._head;return this._map.delete(t.key),this.removeItem(t),this._size--,t.value}forEach(t,r){let n=this._state,i=this._head;for(;i;){if(r?t.bind(r)(i.value,i.key,this):t(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let t=this,r=this._state,n=this._head,i={[Symbol.iterator](){return i},next(){if(t._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let o={value:n.key,done:!1};return n=n.next,o}else return{value:void 0,done:!0}}};return i}values(){let t=this,r=this._state,n=this._head,i={[Symbol.iterator](){return i},next(){if(t._state!==r)throw new Error("LinkedMap got modified during iteration.");if(n){let o={value:n.value,done:!1};return n=n.next,o}else return{value:void 0,done:!0}}};return i}entries(){let t=this,r=this._state,n=this._head,i={[Symbol.i
|
|||
|
${JSON.stringify(d.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let S=String(d.id),A=C[S];if(Lr(d,A),A){delete C[S];try{if(d.error){let j=d.error;A.reject(new ie.ResponseError(j.code,j.message,j.data))}else if(d.result!==void 0)A.resolve(d.result);else throw new Error("Should never happen.")}catch(j){j.message?i.error(`Response handler '${A.method}' failed with message: ${j.message}`):i.error(`Response handler '${A.method}' failed unexpectedly.`)}}}}function $t(d){if(Se())return;let S,A;if(d.method===Br.type.method)A=j=>{let z=j.id,de=p[String(z)];de&&de.cancel()};else{let j=m[d.method];j&&(A=j.handler,S=j.type)}if(A||c)try{or(d),d.params===void 0||S!==void 0&&S.numberOfParams===0?A?A():c(d.method):ve.array(d.params)&&(S===void 0||S.numberOfParams>1)?A?A(...d.params):c(d.method,...d.params):A?A(d.params):c(d.method,d.params)}catch(j){j.message?i.error(`Notification handler '${d.method}' failed with message: ${j.message}`):i.error(`Notification handler '${d.method}' failed unexpectedly.`)}else b.fire(d)}function Pt(d){if(!d){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
|
|||
|
${JSON.stringify(d,null,4)}`);let S=d;if(ve.string(S.id)||ve.number(S.id)){let A=String(S.id),j=C[A];j&&j.reject(new Error("The received response has neither a result nor an error property."))}}function ir(d){if(!(h===ye.Off||!O))if(g===tt.Text){let S;h===ye.Verbose&&d.params&&(S=`Params: ${JSON.stringify(d.params,null,4)}
|
|||
|
|
|||
|
`),O.log(`Sending request '${d.method} - (${d.id})'.`,S)}else Ze("send-request",d)}function Vt(d){if(!(h===ye.Off||!O))if(g===tt.Text){let S;h===ye.Verbose&&(d.params?S=`Params: ${JSON.stringify(d.params,null,4)}
|
|||
|
|
|||
|
`:S=`No parameters provided.
|
|||
|
|
|||
|
`),O.log(`Sending notification '${d.method}'.`,S)}else Ze("send-notification",d)}function gt(d,S,A){if(!(h===ye.Off||!O))if(g===tt.Text){let j;h===ye.Verbose&&(d.error&&d.error.data?j=`Error data: ${JSON.stringify(d.error.data,null,4)}
|
|||
|
|
|||
|
`:d.result?j=`Result: ${JSON.stringify(d.result,null,4)}
|
|||
|
|
|||
|
`:d.error===void 0&&(j=`No result returned.
|
|||
|
|
|||
|
`)),O.log(`Sending response '${S} - (${d.id})'. Processing request took ${Date.now()-A}ms`,j)}else Ze("send-response",d)}function Ht(d){if(!(h===ye.Off||!O))if(g===tt.Text){let S;h===ye.Verbose&&d.params&&(S=`Params: ${JSON.stringify(d.params,null,4)}
|
|||
|
|
|||
|
`),O.log(`Received request '${d.method} - (${d.id})'.`,S)}else Ze("receive-request",d)}function or(d){if(!(h===ye.Off||!O||d.method===Ii.type.method))if(g===tt.Text){let S;h===ye.Verbose&&(d.params?S=`Params: ${JSON.stringify(d.params,null,4)}
|
|||
|
|
|||
|
`:S=`No parameters provided.
|
|||
|
|
|||
|
`),O.log(`Received notification '${d.method}'.`,S)}else Ze("receive-notification",d)}function Lr(d,S){if(!(h===ye.Off||!O))if(g===tt.Text){let A;if(h===ye.Verbose&&(d.error&&d.error.data?A=`Error data: ${JSON.stringify(d.error.data,null,4)}
|
|||
|
|
|||
|
`:d.result?A=`Result: ${JSON.stringify(d.result,null,4)}
|
|||
|
|
|||
|
`:d.error===void 0&&(A=`No result returned.
|
|||
|
|
|||
|
`)),S){let j=d.error?` Request failed: ${d.error.message} (${d.error.code}).`:"";O.log(`Received response '${S.method} - (${d.id})' in ${Date.now()-S.timerStart}ms.${j}`,A)}else O.log(`Received response ${d.id} without active response promise.`,A)}else Ze("receive-response",d)}function Ze(d,S){if(!O||h===ye.Off)return;let A={isLSPMessage:!0,type:d,message:S,timestamp:Date.now()};O.log(A)}function Qe(){if(Me())throw new Jt(Tn.Closed,"Connection is closed.");if(Se())throw new Jt(Tn.Disposed,"Connection is disposed.")}function yi(){if(Pe())throw new Jt(Tn.AlreadyListening,"Connection is already listening")}function Re(){if(!Pe())throw new Error("Call listen() first.")}function Rt(d){return d===void 0?null:d}function N(d,S){let A,j=d.numberOfParams;switch(j){case 0:A=null;break;case 1:A=Rt(S[0]);break;default:A=[];for(let z=0;z<S.length&&z<j;z++)A.push(Rt(S[z]));if(S.length<j)for(let z=S.length;z<j;z++)A.push(null);break}return A}let M={sendNotification:(d,...S)=>{Qe();let A,j;if(ve.string(d))switch(A=d,S.length){case 0:j=null;break;case 1:j=S[0];break;default:j=S;break}else A=d.method,j=N(d,S);let z={jsonrpc:l,method:A,params:j};Vt(z),t.write(z)},onNotification:(d,S)=>{Qe(),ve.func(d)?c=d:S&&(ve.string(d)?m[d]={type:void 0,handler:S}:m[d.method]={type:d,handler:S})},onProgress:(d,S,A)=>{if(y.has(S))throw new Error(`Progress handler for token ${S} already registered`);return y.set(S,A),{dispose:()=>{y.delete(S)}}},sendProgress:(d,S,A)=>{M.sendNotification(Sn.type,{token:S,value:A})},onUnhandledProgress:v.event,sendRequest:(d,...S)=>{Qe(),Re();let A,j,z;if(ve.string(d))switch(A=d,S.length){case 0:j=null;break;case 1:xn.CancellationToken.is(S[0])?(j=null,z=S[0]):j=Rt(S[0]);break;default:let ee=S.length-1;xn.CancellationToken.is(S[ee])?(z=S[ee],S.length===2?j=Rt(S[0]):j=S.slice(0,ee).map(xe=>Rt(xe))):j=S.map(xe=>Rt(xe));break}else{A=d.method,j=N(d,S);let ee=d.numberOfParams;z=xn.CancellationToken.is(S[ee])?S[ee]:void 0}let de=o++,he;return z&&(he=z.onCancellationRequested(()=>{R.sender.sendCancellation(M,de)})),new Promise((ee,xe)=>{let le={jsonrpc:l,id:de,method:A,params:j},Fe=sr=>{ee(sr),R.sender.cleanup(de),he==null||he.dispose()},mt=sr=>{xe(sr),R.sender.cleanup(de),he==null||he.dispose()},mn={method:A,timerStart:Date.now(),resolve:Fe,reject:mt};ir(le);try{t.write(le)}catch(sr){mn.reject(new ie.ResponseError(ie.ErrorCodes.MessageWriteError,sr.message?sr.message:"Unknown reason")),mn=null}mn&&(C[String(de)]=mn)})},onRequest:(d,S)=>{Qe(),ve.func(d)?f=d:S&&(ve.string(d)?a[d]={type:void 0,handler:S}:a[d.method]={type:d,handler:S})},trace:(d,S,A)=>{let j=!1,z=tt.Text;A!==void 0&&(ve.boolean(A)?j=A:(j=A.sendNotification||!1,z=A.traceFormat||tt.Text)),h=d,g=z,h===ye.Off?O=void 0:O=S,j&&!Me()&&!Se()&&M.sendNotification(Xa.type,{value:ye.toString(d)})},onError:D.event,onClose:_.event,onUnhandledNotification:b.event,onDispose:w.event,dispose:()=>{if(Se())return;q=rt.Disposed,w.fire(void 0);let d=new Error("Connection got disposed.");Object.keys(C).forEach(S=>{C[S].reject(d)}),C=Object.create(null),p=Object.create(null),T=new Ua.LinkedMap,ve.func(t.dispose)&&t.dispose(),ve.func(e.dispose)&&e.dispose()},listen:()=>{Qe(),yi(),q=rt.Listening,e.listen(pt)},inspect:()=>{Ja.default().console.log("inspect")}};return M.onNotification(Ii.type,d=>{h===ye.Off||!O||O.log(d.message,h===ye.Verbose?d.verbose:void 0)}),M.onNotification(Sn.type,d=>{let S=y.get(d.token);S?S(d.value):v.fire(d)}),M}re.createMessageConnection=Uf});var zi=W(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});var ue=_i();H.RequestType=ue.RequestType;H.RequestType0=ue.RequestType0;H.RequestType1=ue.RequestType1;H.RequestType2=ue.RequestType2;H.RequestType3=ue.RequestType3;H.RequestType4=ue.RequestType4;H.RequestType5=ue.RequestType5;H.RequestType6=ue.RequestType6;H.RequestType7=ue.RequestType7;H.RequestType8=ue.RequestType8;H.RequestType9=ue.RequestType9;H.ResponseError=ue.ResponseError;H.ErrorCodes=ue.ErrorCodes;H.NotificationType=ue.NotificationType;H.NotificationType0=ue.NotificationType0;H.NotificationType1=ue.NotificationType1;H.NotificationType2=ue.Notifi
|
|||
|
`,`\r
|
|||
|
`,"\r"],Po;(function(e){function t(o,s,u,l){return new fd(o,s,u,l)}e.create=t;function r(o){var s=o;return!!(E.defined(s)&&E.string(s.uri)&&(E.undefined(s.languageId)||E.string(s.languageId))&&E.number(s.lineCount)&&E.func(s.getText)&&E.func(s.positionAt)&&E.func(s.offsetAt))}e.is=r;function n(o,s){for(var u=o.getText(),l=i(s,function(x,T){var C=x.range.start.line-T.range.start.line;return C===0?x.range.start.character-T.range.start.character:C}),f=u.length,a=l.length-1;a>=0;a--){var c=l[a],m=o.offsetAt(c.range.start),y=o.offsetAt(c.range.end);if(y<=f)u=u.substring(0,m)+c.newText+u.substring(y,u.length);else throw new Error("Overlapping edit");f=m}return u}e.applyEdits=n;function i(o,s){if(o.length<=1)return o;var u=o.length/2|0,l=o.slice(0,u),f=o.slice(u);i(l,s),i(f,s);for(var a=0,c=0,m=0;a<l.length&&c<f.length;){var y=s(l[a],f[c]);y<=0?o[m++]=l[a++]:o[m++]=f[c++]}for(;a<l.length;)o[m++]=l[a++];for(;c<f.length;)o[m++]=f[c++];return o}})(Po||(Po={}));var fd=function(){function e(t,r,n,i){this._uri=t,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}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(t){if(t){var r=this.offsetAt(t.start),n=this.offsetAt(t.end);return this._content.substring(r,n)}return this._content},e.prototype.update=function(t,r){this._content=t.text,this._version=r,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var t=[],r=this._content,n=!0,i=0;i<r.length;i++){n&&(t.push(i),n=!1);var o=r.charAt(i);n=o==="\r"||o===`
|
|||
|
`,o==="\r"&&i+1<r.length&&r.charAt(i+1)===`
|
|||
|
`&&i++}n&&r.length>0&&t.push(r.length),this._lineOffsets=t}return this._lineOffsets},e.prototype.positionAt=function(t){t=Math.max(Math.min(t,this._content.length),0);var r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return nt.create(0,t);for(;n<i;){var o=Math.floor((n+i)/2);r[o]>t?i=o:n=o+1}var s=n-1;return nt.create(s,t-r[s])},e.prototype.offsetAt=function(t){var r=this.getLineOffsets();if(t.line>=r.length)return this._content.length;if(t.line<0)return 0;var n=r[t.line],i=t.line+1<r.length?r[t.line+1]:this._content.length;return Math.max(Math.min(n+t.character,i),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),e}(),E;(function(e){var t=Object.prototype.toString;function r(a){return typeof a!="undefined"}e.defined=r;function n(a){return typeof a=="undefined"}e.undefined=n;function i(a){return a===!0||a===!1}e.boolean=i;function o(a){return t.call(a)==="[object String]"}e.string=o;function s(a){return t.call(a)==="[object Number]"}e.number=s;function u(a){return t.call(a)==="[object Function]"}e.func=u;function l(a){return a!==null&&typeof a=="object"}e.objectLiteral=l;function f(a,c){return Array.isArray(a)&&a.every(c)}e.typedArray=f})(E||(E={}))});var Le=W(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});var Fn=ze(),nu=class extends Fn.RequestType0{constructor(t){super(t)}};vr.ProtocolRequestType0=nu;var iu=class extends Fn.RequestType{constructor(t){super(t)}};vr.ProtocolRequestType=iu;var ou=class extends Fn.NotificationType{constructor(t){super(t)}};vr.ProtocolNotificationType=ou;var su=class extends Fn.NotificationType0{constructor(t){super(t)}};vr.ProtocolNotificationType0=su});var cu=W(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});function dd(e){return e===!0||e===!1}it.boolean=dd;function au(e){return typeof e=="string"||e instanceof String}it.string=au;function hd(e){return typeof e=="number"||e instanceof Number}it.number=hd;function pd(e){return e instanceof Error}it.error=pd;function gd(e){return typeof e=="function"}it.func=gd;function uu(e){return Array.isArray(e)}it.array=uu;function md(e){return uu(e)&&e.every(t=>au(t))}it.stringArray=md;function vd(e,t){return Array.isArray(e)&&e.every(t)}it.typedArray=vd;function yd(e){return e!==null&&typeof e=="object"}it.objectLiteral=yd});var lu=W(qn=>{"use strict";Object.defineProperty(qn,"__esModule",{value:!0});var bd=ze(),wd=Le(),Cd;(function(e){e.method="textDocument/implementation",e.type=new wd.ProtocolRequestType(e.method),e.resultType=new bd.ProgressType})(Cd=qn.ImplementationRequest||(qn.ImplementationRequest={}))});var fu=W(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});var xd=ze(),Sd=Le(),Td;(function(e){e.method="textDocument/typeDefinition",e.type=new Sd.ProtocolRequestType(e.method),e.resultType=new xd.ProgressType})(Td=An.TypeDefinitionRequest||(An.TypeDefinitionRequest={}))});var hu=W(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});var du=Le(),kd;(function(e){e.type=new du.ProtocolRequestType0("workspace/workspaceFolders")})(kd=yr.WorkspaceFoldersRequest||(yr.WorkspaceFoldersRequest={}));var _d;(function(e){e.type=new du.ProtocolNotificationType("workspace/didChangeWorkspaceFolders")})(_d=yr.DidChangeWorkspaceFoldersNotification||(yr.DidChangeWorkspaceFoldersNotification={}))});var pu=W(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});var Pd=Le(),Rd;(function(e){e.type=new Pd.ProtocolRequestType("workspace/configuration")})(Rd=jn.ConfigurationRequest||(jn.ConfigurationRequest={}))});var mu=W(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});var Ed=ze(),gu=Le(),Od;(function(e){e.method="textDocument/documentColor",e.type=new gu.ProtocolRequestType(e.method),e.resultType=new Ed.ProgressType})(Od=br.DocumentColorRequest||(br.DocumentColorRequest={}));var Nd;(function(e){e.type=new gu.ProtocolRequestType("textDocument/colorPresentation")})(Nd=br.ColorPresentationRequest||(br.ColorPresentationRequest={}))});var vu=W(wr=>{"use strict";Object.defineP
|
|||
|
: `+new Error("").stack);return}return Ve.format(e[t],n)}else{if(Tt(r))return console.warn("Message "+r+" didn't get externalized correctly."),Ve.format(r,n);console.error(`Broken localize call found. Stacktrace is
|
|||
|
: `+new Error("").stack)}}}function rg(e){var t;if(Z.cacheLanguageResolution&&t)t=t;else{if(Ve.isPseudo||!Z.language)t=".nls.json";else for(var r=Z.language;r;){var n=".nls."+r+".json";if(Ge.existsSync(e+n)){t=n;break}else{var i=r.lastIndexOf("-");i>0?r=r.substring(0,i):(t=".nls.json",r=null)}}Z.cacheLanguageResolution&&(t=t)}return e+t}function ng(e){for(var t=Z.language;t;){var r=at.join(e,"nls.bundle."+t+".json");if(Ge.existsSync(r))return r;var n=t.lastIndexOf("-");n>0?t=t.substring(0,n):t=void 0}if(t===void 0){var r=at.join(e,"nls.bundle.json");if(Ge.existsSync(r))return r}}function ig(e){var t=Er(at.join(e,"nls.metadata.json")),r=Object.create(null);for(var n in t){var i=t[n];r[n]=i.messages}return r}function og(e,t){var r=Z.translationsConfig[e.id];if(!!r){var n=Er(r).contents,i=Er(at.join(t,"nls.metadata.json")),o=Object.create(null);for(var s in i){var u=i[s],l=n[e.outDir+"/"+s];if(l){for(var f=[],a=0;a<u.keys.length;a++){var c=u.keys[a],m=Tt(c)?c:c.key,y=l[m];y===void 0&&(y=u.messages[a]),f.push(y)}o[s]=f}else o[s]=u.messages}return o}}function sg(e){var t=new Date;Ge.utimes(e,t,t,function(){})}function vs(e,t){return Zn[e]=t,t}function ag(e,t){var r,n=at.join(Z.cacheRoot,e.id+"-"+e.hash+".json"),i=!1,o=!1;try{return r=JSON.parse(Ge.readFileSync(n,{encoding:"utf8",flag:"r"})),sg(n),r}catch(s){if(s.code==="ENOENT")o=!0;else if(s instanceof SyntaxError)console.log("Syntax error parsing message bundle: "+s.message+"."),Ge.unlink(n,function(u){u&&console.error("Deleting corrupted bundle "+n+" failed.")}),i=!0;else throw s}if(r=og(e,t),!r||i)return r;if(o)try{Ge.writeFileSync(n,JSON.stringify(r),{encoding:"utf8",flag:"wx"})}catch(s){if(s.code==="EEXIST")return r;throw s}return r}function Pc(e){try{return ig(e)}catch(t){console.log("Generating default bundle from meta data failed.",t);return}}function ug(e,t){var r;if(tg())try{r=ag(e,t)}catch(i){console.log("Load or create bundle failed ",i)}if(!r){if(Z.languagePackSupport)return Pc(t);var n=ng(t);if(n)try{return Er(n)}catch(i){console.log("Loading in the box message bundle failed.",i)}r=Pc(t)}return r}function cg(e){for(var t,r=at.dirname(e);t=at.join(r,"nls.metadata.header.json"),!Ge.existsSync(t);){var n=at.dirname(r);if(n===r){t=void 0;break}else r=n}return t}function ys(e){if(!e)return Ve.localize;var t=at.extname(e);if(t&&(e=e.substr(0,e.length-t.length)),Z.messageFormat===Ve.MessageFormat.both||Z.messageFormat===Ve.MessageFormat.bundle){var r=cg(e);if(r){var n=at.dirname(r),i=Zn[n];if(i===void 0)try{var o=JSON.parse(Ge.readFileSync(r,"utf8"));try{var s=ug(o,n);i=vs(n,s?{header:o,nlsBundle:s}:null)}catch(a){console.error("Failed to load nls bundle",a),i=vs(n,null)}}catch(a){console.error("Failed to read header file",a),i=vs(n,null)}if(i){var u=e.substr(n.length+1).replace(/\\/g,"/"),l=i.nlsBundle[u];return l===void 0?(console.error("Messages for file "+e+" not found. See console for details."),function(){return"Messages not found."}):ms(l)}}}if(Z.messageFormat===Ve.MessageFormat.both||Z.messageFormat===Ve.MessageFormat.file)try{var f=Er(rg(e));return Array.isArray(f)?ms(f):Ve.isDefined(f.messages)&&Ve.isDefined(f.keys)?ms(f.messages):(console.error("String bundle '"+e+"' uses an unsupported format."),function(){return"File bundle has unsupported format. See console for details"})}catch(a){a.code!=="ENOENT"&&console.error("Failed to load single file bundle",a)}return console.error("Failed to load message bundle for file "+e),function(){return"Failed to load message bundle. See console for details."}}At.loadMessageBundle=ys;function Rc(e){return e&&(Tt(e.locale)&&(Z.locale=e.locale.toLowerCase(),Z.language=Z.locale,Zn=Object.create(null)),e.messageFormat!==void 0&&(Z.messageFormat=e.messageFormat),e.bundleFormat===Ve.BundleFormat.standalone&&Z.languagePackSupport===!0&&(Z.languagePackSupport=!1)),Ve.setPseudo(Z.locale==="pseudo"),ys}At.config=Rc;Zp.default.install(Object.freeze({loadMessageBundle:ys,config:Rc}))});var gl=W(()=>{"use strict";var hl=require("url"),Kt=require("https"),pl="__agent_base_https_request_patched__";Kt.request[pl]||(Kt.request=function(e)
|
|||
|
`).map(function(t){return t.trim()}).join(" ")};be.formatters.O=function(e){return this.inspectOpts.colors=this.useColors,ai.inspect(e,this.inspectOpts)};function pm(e){var t=this.namespace,r=this.useColors;if(r){var n=this.color,i="[3"+(n<8?n:"8;5;"+n),o=" "+i+";1m"+t+" [0m";e[0]=o+e[0].split(`
|
|||
|
`).join(`
|
|||
|
`+o),e.push(i+"m+"+be.humanize(this.diff)+"[0m")}else e[0]=vm()+t+" "+e[0]}function vm(){return be.inspectOpts.hideDate?"":new Date().toISOString()+" "}function hm(){return process.stderr.write(ai.format.apply(ai,arguments)+`
|
|||
|
`)}function gm(e){e==null?delete process.env.DEBUG:process.env.DEBUG=e}function Ol(){return process.env.DEBUG}function dm(e){e.inspectOpts={};for(var t=Object.keys(be.inspectOpts),r=0;r<t.length;r++)e.inspectOpts[t[r]]=be.inspectOpts[t[r]]}be.enable(Ol())});var Fl=W((u0,Ws)=>{typeof process=="undefined"||process.type==="renderer"?Ws.exports=Rl():Ws.exports=Nl()});var jl=W((c0,ql)=>{var ym=require("net"),bm=require("tls"),$s=require("url"),Al=Ds(),wm=require("util").inherits,ui=Fl()("http-proxy-agent");ql.exports=hn;function hn(e){if(!(this instanceof hn))return new hn(e);if(typeof e=="string"&&(e=$s.parse(e)),!e)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");ui("creating new HttpProxyAgent instance: %o",e),Al.call(this,e);var t=Object.assign({},e);this.secureProxy=t.protocol?/^https:?$/i.test(t.protocol):!1,t.host=t.hostname||t.host,t.port=+t.port||(this.secureProxy?443:80),t.host&&t.path&&(delete t.path,delete t.pathname),this.proxy=t}wm(hn,Al);hn.prototype.callback=function(t,r,n){var i=this.proxy,o=$s.parse(t.path);o.protocol==null&&(o.protocol="http:"),o.hostname==null&&(o.hostname=r.hostname||r.host),o.port==null&&(o.port=r.port),o.port==80&&delete o.port;var s=$s.format(o);t.path=s,i.auth&&t.setHeader("Proxy-Authorization","Basic "+Buffer.from(i.auth).toString("base64"));var u;if(this.secureProxy?u=bm.connect(i):u=ym.connect(i),t._header&&(ui("regenerating stored HTTP header string for request"),t._header=null,t._implicitHeader(),t.output&&t.output.length>0)){ui("patching connection write() output buffer with updated header");var l=t.output[0],f=l.indexOf(`\r
|
|||
|
\r
|
|||
|
`)+4;t.output[0]=t._header+l.substring(f),ui("output buffer: %o",t.output)}n(null,u)}});var Ml=W((l0,Dl)=>{var Fr=1e3,qr=Fr*60,Ar=qr*60,tr=Ar*24,Cm=tr*7,xm=tr*365.25;Dl.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return Sm(e);if(r==="number"&&isFinite(e))return t.long?km(e):Tm(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Sm(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!!t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*xm;case"weeks":case"week":case"w":return r*Cm;case"days":case"day":case"d":return r*tr;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Ar;case"minutes":case"minute":case"mins":case"min":case"m":return r*qr;case"seconds":case"second":case"secs":case"sec":case"s":return r*Fr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Tm(e){var t=Math.abs(e);return t>=tr?Math.round(e/tr)+"d":t>=Ar?Math.round(e/Ar)+"h":t>=qr?Math.round(e/qr)+"m":t>=Fr?Math.round(e/Fr)+"s":e+"ms"}function km(e){var t=Math.abs(e);return t>=tr?ci(e,t,tr,"day"):t>=Ar?ci(e,t,Ar,"hour"):t>=qr?ci(e,t,qr,"minute"):t>=Fr?ci(e,t,Fr,"second"):e+" ms"}function ci(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var Vs=W((f0,Il)=>{"use strict";function _m(e){r.debug=r,r.default=r,r.coerce=l,r.disable=s,r.enable=o,r.enabled=u,r.humanize=Ml(),Object.keys(e).forEach(function(f){r[f]=e[f]}),r.instances=[],r.names=[],r.skips=[],r.formatters={};function t(f){for(var a=0,c=0;c<f.length;c++)a=(a<<5)-a+f.charCodeAt(c),a|=0;return r.colors[Math.abs(a)%r.colors.length]}r.selectColor=t;function r(f){var a;function c(){if(!!c.enabled){for(var m=arguments.length,y=new Array(m),x=0;x<m;x++)y[x]=arguments[x];var T=c,C=Number(new Date),p=C-(a||C);T.diff=p,T.prev=a,T.curr=C,a=C,y[0]=r.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");var h=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,function(O,q){if(O==="%%")return O;h++;var D=r.formatters[q];if(typeof D=="function"){var _=y[h];O=D.call(T,_),y.splice(h,1),h--}return O}),r.formatArgs.call(T,y);var g=T.log||r.log;g.apply(T,y)}}return c.namespace=f,c.enabled=r.enabled(f),c.useColors=r.useColors(),c.color=t(f),c.destroy=n,c.extend=i,typeof r.init=="function"&&r.init(c),r.instances.push(c),c}function n(){var f=r.instances.indexOf(this);return f!==-1?(r.instances.splice(f,1),!0):!1}function i(f,a){return r(this.namespace+(typeof a=="undefined"?":":a)+f)}function o(f){r.save(f),r.names=[],r.skips=[];var a,c=(typeof f=="string"?f:"").split(/[\s,]+/),m=c.length;for(a=0;a<m;a++)!c[a]||(f=c[a].replace(/\*/g,".*?"),f[0]==="-"?r.skips.push(new RegExp("^"+f.substr(1)+"$")):r.names.push(new RegExp("^"+f+"$")));for(a=0;a<r.instances.length;a++){var y=r.instances[a];y.enabled=r.enabled(y.namespace)}}function s(){r.enable("")}function u(f){if(f[f.length-1]==="*")return!0;var a,c;for(a=0,c=r.skips.length;a<c;a++)if(r.skips[a].test(f))return!1;for(a=0,c=r.names.length;a<c;a++)if(r.names[a].test(f))return!0;return!1}function l(f){return f instanceof Error?f.stack||f.message:f}return r.enable(r.load()),r}Il.exports=_m});var Ll=W((Xe,li)=>{"use strict";function fi(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fi=function(r){return typeof r}:fi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},fi(e)}Xe.log=Pm;Xe.formatArgs=Rm;Xe.save=Em;Xe.load=Om;Xe.useColors=Nm;Xe.storage=Fm();Xe.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","
|
|||
|
`).join(`
|
|||
|
`+o),e.push(i+"m+"+di.exports.humanize(this.diff)+"[0m")}else e[0]=$m()+t+" "+e[0]}function $m(){return Oe.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Dm(){return process.stderr.write(hi.format.apply(hi,arguments)+`
|
|||
|
`)}function Im(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function Lm(){return process.env.DEBUG}function jm(e){e.inspectOpts={};for(var t=Object.keys(Oe.inspectOpts),r=0;r<t.length;r++)e.inspectOpts[t[r]]=Oe.inspectOpts[t[r]]}di.exports=Vs()(Oe);var Wl=di.exports.formatters;Wl.o=function(e){return this.inspectOpts.colors=this.useColors,hi.inspect(e,this.inspectOpts).split(`
|
|||
|
`).map(function(t){return t.trim()}).join(" ")};Wl.O=function(e){return this.inspectOpts.colors=this.useColors,hi.inspect(e,this.inspectOpts)}});var Vl=W((d0,Hs)=>{"use strict";typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?Hs.exports=Ll():Hs.exports=$l()});var Ul=W((h0,Hl)=>{var zl=require("net"),Bl=require("tls"),Vm=require("url"),Hm=require("assert"),Jl=Ds(),zm=require("util").inherits,rr=Vl()("https-proxy-agent");Hl.exports=pn;function pn(e){if(!(this instanceof pn))return new pn(e);if(typeof e=="string"&&(e=Vm.parse(e)),!e)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");rr("creating new HttpsProxyAgent instance: %o",e),Jl.call(this,e);var t=Object.assign({},e);this.secureProxy=t.protocol?/^https:?$/i.test(t.protocol):!1,t.host=t.hostname||t.host,t.port=+t.port||(this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in t)&&(t.ALPNProtocols=["http 1.1"]),t.host&&t.path&&(delete t.path,delete t.pathname),this.proxy=t,this.defaultPort=443}zm(pn,Jl);pn.prototype.callback=function(t,r,n){var i=this.proxy,o;this.secureProxy?o=Bl.connect(i):o=zl.connect(i);var s=[],u=0;function l(){var g=o.read();g?y(g):o.once("readable",l)}function f(){o.removeListener("end",c),o.removeListener("error",m),o.removeListener("close",a),o.removeListener("readable",l)}function a(g){rr("onclose had error %o",g)}function c(){rr("onend")}function m(g){f(),n(g)}function y(g){s.push(g),u+=g.length;var O=Buffer.concat(s,u),q=O.toString("ascii");if(!~q.indexOf(`\r
|
|||
|
\r
|
|||
|
`)){rr("have not received end of HTTP headers yet..."),l();return}var D=q.substring(0,q.indexOf(`\r
|
|||
|
`)),_=+D.split(" ")[1];if(rr("got proxy server response: %o",D),_==200){var b=o;s=O=null,r.secureEndpoint&&(rr("upgrading proxy-connected socket to TLS connection: %o",r.host),r.socket=o,r.servername=r.servername||r.host,r.host=null,r.hostname=null,r.port=null,b=Bl.connect(r)),f(),t.once("socket",Bm),n(null,b)}else f(),o.destroy(),o=new zl.Socket,o.readable=!0,s=O,t.once("socket",x),n(null,o)}function x(g){rr("replaying proxy buffer for failed request"),Hm(g.listenerCount("data")>0),g.push(s),s=null}o.on("error",m),o.on("close",a),o.on("end",c),l();var T=r.host+":"+r.port,C="CONNECT "+T+` HTTP/1.1\r
|
|||
|
`,p=Object.assign({},i.headers);i.auth&&(p["Proxy-Authorization"]="Basic "+Buffer.from(i.auth).toString("base64"));var h=r.host;Jm(r.port,r.secureEndpoint)||(h+=":"+r.port),p.Host=h,p.Connection="close",Object.keys(p).forEach(function(g){C+=g+": "+p[g]+`\r
|
|||
|
`}),o.write(C+`\r
|
|||
|
`)};function Bm(e){e.resume()}function Jm(e,t){return Boolean(!t&&e===80||t&&e===443)}});var ef=W(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});var ft=require("path"),Ye=require("fs"),Gl=Object.prototype.toString;function gi(e){return typeof e!="undefined"}function Um(e){return Gl.call(e)==="[object Number]"}function kt(e){return Gl.call(e)==="[object String]"}function Gm(e){return e===!0||e===!1}function jr(e){return JSON.parse(Ye.readFileSync(e,"utf8"))}var Dr;(function(e){e.file="file",e.bundle="bundle",e.both="both"})(Dr=Wt.MessageFormat||(Wt.MessageFormat={}));var Xl;(function(e){e.standalone="standalone",e.languagePack="languagePack"})(Xl=Wt.BundleFormat||(Wt.BundleFormat={}));var Yl;(function(e){function t(r){var n=r;return n&&gi(n.key)&&gi(n.comment)}e.is=t})(Yl||(Yl={}));var Zl,mi,Q,vi;function Xm(){if(Q={locale:void 0,language:void 0,languagePackSupport:!1,cacheLanguageResolution:!0,messageFormat:Dr.bundle},kt(process.env.VSCODE_NLS_CONFIG))try{var e=JSON.parse(process.env.VSCODE_NLS_CONFIG),t=void 0,r=void 0;if(e.availableLanguages){var n=e.availableLanguages["*"];kt(n)&&(t=n)}if(kt(e.locale)&&(Q.locale=e.locale.toLowerCase()),t===void 0?Q.language=Q.locale:t!=="en"&&(Q.language=t),Gm(e._languagePackSupport)&&(Q.languagePackSupport=e._languagePackSupport),kt(e._cacheRoot)&&(Q.cacheRoot=e._cacheRoot),kt(e._languagePackId)&&(Q.languagePackId=e._languagePackId),kt(e._translationsConfigFile)){Q.translationsConfigFile=e._translationsConfigFile;try{Q.translationsConfig=jr(Q.translationsConfigFile)}catch(o){if(e._corruptedFile){var i=ft.dirname(e._corruptedFile);Ye.exists(i,function(s){s&&Ye.writeFile(e._corruptedFile,"corrupted","utf8",function(u){console.error(u)})})}}}}catch(o){}vi=Q.locale==="pseudo",Zl=void 0,mi=Object.create(null)}Xm();function Ym(){return Q.languagePackSupport===!0&&Q.cacheRoot!==void 0&&Q.languagePackId!==void 0&&Q.translationsConfigFile!==void 0&&Q.translationsConfig!==void 0}function zs(e,t){var r;return vi&&(e="\uFF3B"+e.replace(/[aouei]/g,"$&$&")+"\uFF3D"),t.length===0?r=e:r=e.replace(/\{(\d+)\}/g,function(n,i){var o=i[0],s=t[o],u=n;return typeof s=="string"?u=s:(typeof s=="number"||typeof s=="boolean"||s===void 0||s===null)&&(u=String(s)),u}),r}function Bs(e){return function(t,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(Um(t)){if(t>=e.length){console.error(`Broken localize call found. Index out of bounds. Stacktrace is
|
|||
|
: `+new Error("").stack);return}return zs(e[t],n)}else{if(kt(r))return console.warn("Message "+r+" didn't get externalized correctly."),zs(r,n);console.error(`Broken localize call found. Stacktrace is
|
|||
|
: `+new Error("").stack)}}}function Zm(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return zs(t,r)}function Qm(e){var t;if(Q.cacheLanguageResolution&&t)t=t;else{if(vi||!Q.language)t=".nls.json";else for(var r=Q.language;r;){var n=".nls."+r+".json";if(Ye.existsSync(e+n)){t=n;break}else{var i=r.lastIndexOf("-");i>0?r=r.substring(0,i):(t=".nls.json",r=null)}}Q.cacheLanguageResolution&&(t=t)}return e+t}function Km(e){for(var t=Q.language;t;){var r=ft.join(e,"nls.bundle."+t+".json");if(Ye.existsSync(r))return r;var n=t.lastIndexOf("-");n>0?t=t.substring(0,n):t=void 0}if(t===void 0){var r=ft.join(e,"nls.bundle.json");if(Ye.existsSync(r))return r}}function ev(e){var t=jr(ft.join(e,"nls.metadata.json")),r=Object.create(null);for(var n in t){var i=t[n];r[n]=i.messages}return r}function tv(e,t){var r=Q.translationsConfig[e.id];if(!!r){var n=jr(r).contents,i=jr(ft.join(t,"nls.metadata.json")),o=Object.create(null);for(var s in i){var u=i[s],l=n[e.outDir+"/"+s];if(l){for(var f=[],a=0;a<u.keys.length;a++){var c=u.keys[a],m=kt(c)?c:c.key,y=l[m];y===void 0&&(y=u.messages[a]),f.push(y)}o[s]=f}else o[s]=u.messages}return o}}function rv(e){var t=new Date;Ye.utimes(e,t,t,function(){})}function Js(e,t){return mi[e]=t,t}function nv(e,t){var r,n=ft.join(Q.cacheRoot,e.id+"-"+e.hash+".json"),i=!1,o=!1;try{return r=JSON.parse(Ye.readFileSync(n,{encoding:"utf8",flag:"r"})),rv(n),r}catch(s){if(s.code==="ENOENT")o=!0;else if(s instanceof SyntaxError)console.log("Syntax error parsing message bundle: "+s.message+"."),Ye.unlink(n,function(u){u&&console.error("Deleting corrupted bundle "+n+" failed.")}),i=!0;else throw s}if(r=tv(e,t),!r||i)return r;if(o)try{Ye.writeFileSync(n,JSON.stringify(r),{encoding:"utf8",flag:"wx"})}catch(s){if(s.code==="EEXIST")return r;throw s}return r}function Ql(e){try{return ev(e)}catch(t){console.log("Generating default bundle from meta data failed.",t);return}}function iv(e,t){var r;if(Ym())try{r=nv(e,t)}catch(i){console.log("Load or create bundle failed ",i)}if(!r){if(Q.languagePackSupport)return Ql(t);var n=Km(t);if(n)try{return jr(n)}catch(i){console.log("Loading in the box message bundle failed.",i)}r=Ql(t)}return r}function ov(e){for(var t,r=ft.dirname(e);t=ft.join(r,"nls.metadata.header.json"),!Ye.existsSync(t);){var n=ft.dirname(r);if(n===r){t=void 0;break}else r=n}return t}function Kl(e){if(!e)return Zm;var t=ft.extname(e);if(t&&(e=e.substr(0,e.length-t.length)),Q.messageFormat===Dr.both||Q.messageFormat===Dr.bundle){var r=ov(e);if(r){var n=ft.dirname(r),i=mi[n];if(i===void 0)try{var o=JSON.parse(Ye.readFileSync(r,"utf8"));try{var s=iv(o,n);i=Js(n,s?{header:o,nlsBundle:s}:null)}catch(a){console.error("Failed to load nls bundle",a),i=Js(n,null)}}catch(a){console.error("Failed to read header file",a),i=Js(n,null)}if(i){var u=e.substr(n.length+1).replace(/\\/g,"/"),l=i.nlsBundle[u];return l===void 0?(console.error("Messages for file "+e+" not found. See console for details."),function(){return"Messages not found."}):Bs(l)}}}if(Q.messageFormat===Dr.both||Q.messageFormat===Dr.file)try{var f=jr(Qm(e));return Array.isArray(f)?Bs(f):gi(f.messages)&&gi(f.keys)?Bs(f.messages):(console.error("String bundle '"+e+"' uses an unsupported format."),function(){return"File bundle has unsupported format. See console for details"})}catch(a){a.code!=="ENOENT"&&console.error("Failed to load single file bundle",a)}return console.error("Failed to load message bundle for file "+e),function(){return"Failed to load message bundle. See console for details."}}Wt.loadMessageBundle=Kl;function sv(e){return e&&(kt(e.locale)&&(Q.locale=e.locale.toLowerCase(),Q.language=Q.locale,Zl=void 0,mi=Object.create(null)),e.messageFormat!==void 0&&(Q.messageFormat=e.messageFormat),e.bundleFormat===Xl.standalone&&Q.languagePackSupport===!0&&(Q.languagePackSupport=!1)),vi=Q.locale==="pseudo",Kl}Wt.config=sv});var uf=W(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});var Us=require("url"),av=require("https"),uv=require("http"),cv=jl(),lv=Ul(),tf=require("zlib"),rf=ef();process.env.VSCODE_NLS_CONFIG&&(nf=process.env.VSCODE
|
|||
|
${r.stack}`}else{if(typeof t=="string")return`${e}: ${t}`;if(t)return`${e}: ${t.toString()}`}return e}function nn(e,t,r,n){return new Promise(i=>{setImmediate(()=>(n.isCancellationRequested&&i(Un()),e().then(o=>{if(n.isCancellationRequested){i(Un());return}else i(o)},o=>{console.error(Sr(r,o)),i(t)})))})}function Tr(e,t,r,n){return new Promise(i=>{setImmediate(()=>{if(n.isCancellationRequested)i(Un());else try{let o=e();if(n.isCancellationRequested){i(Un());return}else i(o)}catch(o){console.error(Sr(r,o)),i(t)}})})}function Un(){return console.log("cancelled"),new Jn.ResponseError(Jn.ErrorCodes.RequestCancelled,"Request cancelled")}var je=Ke(Bn());"use strict";function _r(e,t){t===void 0&&(t=!1);var r=e.length,n=0,i="",o=0,s=16,u=0,l=0,f=0,a=0,c=0;function m(g,O){for(var q=0,D=0;q<g||!O;){var _=e.charCodeAt(n);if(_>=48&&_<=57)D=D*16+_-48;else if(_>=65&&_<=70)D=D*16+_-65+10;else if(_>=97&&_<=102)D=D*16+_-97+10;else break;n++,q++}return q<g&&(D=-1),D}function y(g){n=g,i="",o=0,s=16,c=0}function x(){var g=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&kr(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&kr(e.charCodeAt(n)))for(n++;n<e.length&&kr(e.charCodeAt(n));)n++;else return c=3,e.substring(g,n);var O=n;if(n<e.length&&(e.charCodeAt(n)===69||e.charCodeAt(n)===101))if(n++,(n<e.length&&e.charCodeAt(n)===43||e.charCodeAt(n)===45)&&n++,n<e.length&&kr(e.charCodeAt(n))){for(n++;n<e.length&&kr(e.charCodeAt(n));)n++;O=n}else c=3;return e.substring(g,O)}function T(){for(var g="",O=n;;){if(n>=r){g+=e.substring(O,n),c=2;break}var q=e.charCodeAt(n);if(q===34){g+=e.substring(O,n),n++;break}if(q===92){if(g+=e.substring(O,n),n++,n>=r){c=2;break}var D=e.charCodeAt(n++);switch(D){case 34:g+='"';break;case 92:g+="\\";break;case 47:g+="/";break;case 98:g+="\b";break;case 102:g+="\f";break;case 110:g+=`
|
|||
|
`;break;case 114:g+="\r";break;case 116:g+=" ";break;case 117:var _=m(4,!0);_>=0?g+=String.fromCharCode(_):c=4;break;default:c=5}O=n;continue}if(q>=0&&q<=31)if(on(q)){g+=e.substring(O,n),c=2;break}else c=6;n++}return g}function C(){if(i="",c=0,o=n,l=u,a=f,n>=r)return o=r,s=17;var g=e.charCodeAt(n);if(ns(g)){do n++,i+=String.fromCharCode(g),g=e.charCodeAt(n);while(ns(g));return s=15}if(on(g))return n++,i+=String.fromCharCode(g),g===13&&e.charCodeAt(n)===10&&(n++,i+=`
|
|||
|
`),u++,f=n,s=14;switch(g){case 123:return n++,s=1;case 125:return n++,s=2;case 91:return n++,s=3;case 93:return n++,s=4;case 58:return n++,s=6;case 44:return n++,s=5;case 34:return n++,i=T(),s=10;case 47:var O=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<r&&!on(e.charCodeAt(n));)n++;return i=e.substring(O,n),s=12}if(e.charCodeAt(n+1)===42){n+=2;for(var q=r-1,D=!1;n<q;){var _=e.charCodeAt(n);if(_===42&&e.charCodeAt(n+1)===47){n+=2,D=!0;break}n++,on(_)&&(_===13&&e.charCodeAt(n)===10&&n++,u++,f=n)}return D||(n++,c=1),i=e.substring(O,n),s=13}return i+=String.fromCharCode(g),n++,s=16;case 45:if(i+=String.fromCharCode(g),n++,n===r||!kr(e.charCodeAt(n)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=x(),s=11;default:for(;n<r&&p(g);)n++,g=e.charCodeAt(n);if(o!==n){switch(i=e.substring(o,n),i){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return i+=String.fromCharCode(g),n++,s=16}}function p(g){if(ns(g)||on(g))return!1;switch(g){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function h(){var g;do g=C();while(g>=12&&g<=15);return g}return{setPosition:y,getPosition:function(){return n},scan:t?h:C,getToken:function(){return s},getTokenValue:function(){return i},getTokenOffset:function(){return o},getTokenLength:function(){return n-o},getTokenStartLine:function(){return l},getTokenStartCharacter:function(){return o-a},getTokenError:function(){return c}}}function ns(e){return e===32||e===9||e===11||e===12||e===160||e===5760||e>=8192&&e<=8203||e===8239||e===8287||e===12288||e===65279}function on(e){return e===10||e===13||e===8232||e===8233}function kr(e){return e>=48&&e<=57}"use strict";function ss(e,t,r){var n,i,o,s,u;if(t){for(s=t.offset,u=s+t.length,o=s;o>0&&!os(e,o-1);)o--;for(var l=u;l<e.length&&!os(e,l);)l++;i=e.substring(o,l),n=Lp(i,r)}else i=e,n=0,o=0,s=0,u=e.length;var f=Wp(r,e),a=!1,c=0,m;r.insertSpaces?m=is(" ",r.tabSize||4):m=" ";var y=_r(i,!1),x=!1;function T(){return f+is(m,n+c)}function C(){var F=y.scan();for(a=!1;F===15||F===14;)a=a||F===14,F=y.scan();return x=F===16||y.getTokenError()!==0,F}var p=[];function h(F,L,$){!x&&(!t||L<u&&$>s)&&e.substring(L,$)!==F&&p.push({offset:L,length:$-L,content:F})}var g=C();if(g!==17){var O=y.getTokenOffset()+o,q=is(m,n);h(q,o,O)}for(;g!==17;){for(var D=y.getTokenOffset()+y.getTokenLength()+o,_=C(),b="",v=!1;!a&&(_===12||_===13);){var w=y.getTokenOffset()+o;h(" ",D,w),D=y.getTokenOffset()+y.getTokenLength()+o,v=_===12,b=v?T():"",_=C()}if(_===2)g!==1&&(c--,b=T());else if(_===4)g!==3&&(c--,b=T());else{switch(g){case 3:case 1:c++,b=T();break;case 5:case 12:b=T();break;case 13:a?b=T():v||(b=" ");break;case 6:v||(b=" ");break;case 10:if(_===6){v||(b="");break}case 7:case 8:case 9:case 11:case 2:case 4:_===12||_===13?v||(b=" "):_!==5&&_!==17&&(x=!0);break;case 16:x=!0;break}a&&(_===12||_===13)&&(b=T())}_===17&&(b=r.insertFinalNewline?f:"");var R=y.getTokenOffset()+o;h(b,D,R),g=_}return p}function is(e,t){for(var r="",n=0;n<t;n++)r+=e;return r}function Lp(e,t){for(var r=0,n=0,i=t.tabSize||4;r<e.length;){var o=e.charAt(r);if(o===" ")n++;else if(o===" ")n+=i;else break;r++}return Math.floor(n/i)}function Wp(e,t){for(var r=0;r<t.length;r++){var n=t.charAt(r);if(n==="\r")return r+1<t.length&&t.charAt(r+1)===`
|
|||
|
`?`\r
|
|||
|
`:"\r";if(n===`
|
|||
|
`)return`
|
|||
|
`}return e&&e.eol||`
|
|||
|
`}function os(e,t){return`\r
|
|||
|
`.indexOf(e.charAt(t))!==-1}"use strict";var Gn;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Gn||(Gn={}));function dc(e,t,r){t===void 0&&(t=[]),r===void 0&&(r=Gn.DEFAULT);var n=null,i=[],o=[];function s(l){Array.isArray(i)?i.push(l):n!==null&&(i[n]=l)}var u={onObjectBegin:function(){var l={};s(l),o.push(i),i=l,n=null},onObjectProperty:function(l){n=l},onObjectEnd:function(){i=o.pop()},onArrayBegin:function(){var l=[];s(l),o.push(i),i=l,n=null},onArrayEnd:function(){i=o.pop()},onLiteralValue:s,onError:function(l,f,a){t.push({error:l,offset:f,length:a})}};return fc(e,u,r),i[0]}function as(e){if(!e.parent||!e.parent.children)return[];var t=as(e.parent);if(e.parent.type==="property"){var r=e.parent.children[0].value;t.push(r)}else if(e.parent.type==="array"){var n=e.parent.children.indexOf(e);n!==-1&&t.push(n)}return t}function Xn(e){switch(e.type){case"array":return e.children.map(Xn);case"object":for(var t=Object.create(null),r=0,n=e.children;r<n.length;r++){var i=n[r],o=i.children[1];o&&(t[i.children[0].value]=Xn(o))}return t;case"null":case"string":case"number":case"boolean":return e.value;default:return}}function $p(e,t,r){return r===void 0&&(r=!1),t>=e.offset&&t<e.offset+e.length||r&&t===e.offset+e.length}function us(e,t,r){if(r===void 0&&(r=!1),$p(e,t,r)){var n=e.children;if(Array.isArray(n))for(var i=0;i<n.length&&n[i].offset<=t;i++){var o=us(n[i],t,r);if(o)return o}return e}}function fc(e,t,r){r===void 0&&(r=Gn.DEFAULT);var n=_r(e,!1);function i(v){return v?function(){return v(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:function(){return!0}}function o(v){return v?function(w){return v(w,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:function(){return!0}}var s=i(t.onObjectBegin),u=o(t.onObjectProperty),l=i(t.onObjectEnd),f=i(t.onArrayBegin),a=i(t.onArrayEnd),c=o(t.onLiteralValue),m=o(t.onSeparator),y=i(t.onComment),x=o(t.onError),T=r&&r.disallowComments,C=r&&r.allowTrailingComma;function p(){for(;;){var v=n.scan();switch(n.getTokenError()){case 4:h(14);break;case 5:h(15);break;case 3:h(13);break;case 1:T||h(11);break;case 2:h(12);break;case 6:h(16);break}switch(v){case 12:case 13:T?h(10):y();break;case 16:h(1);break;case 15:case 14:break;default:return v}}}function h(v,w,R){if(w===void 0&&(w=[]),R===void 0&&(R=[]),x(v),w.length+R.length>0)for(var F=n.getToken();F!==17;){if(w.indexOf(F)!==-1){p();break}else if(R.indexOf(F)!==-1)break;F=p()}}function g(v){var w=n.getTokenValue();return v?c(w):u(w),p(),!0}function O(){switch(n.getToken()){case 11:var v=n.getTokenValue(),w=Number(v);isNaN(w)&&(h(2),w=0),c(w);break;case 7:c(null);break;case 8:c(!0);break;case 9:c(!1);break;default:return!1}return p(),!0}function q(){return n.getToken()!==10?(h(3,[],[2,5]),!1):(g(!1),n.getToken()===6?(m(":"),p(),b()||h(4,[],[2,5])):h(5,[],[2,5]),!0)}function D(){s(),p();for(var v=!1;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(v||h(4,[],[]),m(","),p(),n.getToken()===2&&C)break}else v&&h(6,[],[]);q()||h(4,[],[2,5]),v=!0}return l(),n.getToken()!==2?h(7,[2],[]):p(),!0}function _(){f(),p();for(var v=!1;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(v||h(4,[],[]),m(","),p(),n.getToken()===4&&C)break}else v&&h(6,[],[]);b()||h(4,[],[4,5]),v=!0}return a(),n.getToken()!==4?h(8,[4],[]):p(),!0}function b(){switch(n.getToken()){case 3:return _();case 1:return D();case 10:return g(!0);default:return O()}}return p(),n.getToken()===17?r.allowEmptyContent?!0:(h(4,[],[]),!1):b()?(n.getToken()!==17&&h(9,[],[]),!0):(h(4,[],[]),!1)}"use strict";"use strict";var ht=_r;var hc=dc;var pc=us,gc=as,mc=Xn;function vc(e,t,r){return ss(e,t,r)}function Pr(e,t){if(e===t)return!0;if(e==null||t===null||t===void 0||typeof e!=typeof t||typeof e!="object"||Array.isArray(e)!==Array.isArray(t))return!1;var r,n;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(r=0;r<e.length;r++)if(!Pr(e[r],t[r]))return!1}else{var i=[];for(n in e)i.push(n);i.sort();var o=[];for(n in t)o.push(n);if(o.sort(),!Pr(i,o))return!1;for(r=0;r<i.length;r++)if(!Pr(e[i[r]],t[i[r
|
|||
|
`,o=0;o<e.length;o++)i+=n+Qn(e[o],n,r),o<e.length-1&&(i+=","),i+=`
|
|||
|
`;return i+=t+"]",i}else{var s=Object.keys(e);if(s.length===0)return"{}";for(var i=`{
|
|||
|
`,o=0;o<s.length;o++){var u=s[o];i+=n+JSON.stringify(u)+": "+Qn(e[u],n,r),o<s.length-1&&(i+=","),i+=`
|
|||
|
`}return i+=t+"}",i}}return r(e)}function jc(e,t){if(e.length<t.length)return!1;for(var r=0;r<t.length;r++)if(e[r]!==t[r])return!1;return!0}function jt(e,t){var r=e.length-t.length;return r>0?e.lastIndexOf(t)===r:r===0?e===t:!1}function Dc(e){return e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}var Mc=Ke(Or()),xs=Mc.loadMessageBundle(),vg=[",","}","]"],yg=[":"],Ic=function(){function e(t,r,n,i){r===void 0&&(r=[]),n===void 0&&(n=Promise),i===void 0&&(i={}),this.schemaService=t,this.contributions=r,this.promiseConstructor=n,this.clientCapabilities=i}return e.prototype.doResolve=function(t){for(var r=this.contributions.length-1;r>=0;r--){var n=this.contributions[r].resolveCompletion;if(n){var i=n(t);if(i)return i}}return this.promiseConstructor.resolve(t)},e.prototype.doComplete=function(t,r,n){var i=this,o={items:[],isIncomplete:!1},s=t.getText(),u=t.offsetAt(r),l=n.getNodeFromOffset(u,!0);if(this.isInComment(t,l?l.offset:0,u))return Promise.resolve(o);if(l&&u===l.offset+l.length&&u>0){var f=s[u-1];(l.type==="object"&&f==="}"||l.type==="array"&&f==="]")&&(l=l.parent)}var a=this.getCurrentWord(t,u),c;if(l&&(l.type==="string"||l.type==="number"||l.type==="boolean"||l.type==="null"))c=k.Range.create(t.positionAt(l.offset),t.positionAt(l.offset+l.length));else{var m=u-a.length;m>0&&s[m-1]==='"'&&m--,c=k.Range.create(t.positionAt(m),r)}var y=!1,x={},T={add:function(C){var p=C.label,h=x[p];if(h)h.documentation||(h.documentation=C.documentation),h.detail||(h.detail=C.detail);else{if(p=p.replace(/[\n]/g,"\u21B5"),p.length>60){var g=p.substr(0,57).trim()+"...";x[g]||(p=g)}c&&C.insertText!==void 0&&(C.textEdit=k.TextEdit.replace(c,C.insertText)),y&&(C.commitCharacters=C.kind===k.CompletionItemKind.Property?yg:vg),C.label=p,x[p]=C,o.items.push(C)}},setAsIncomplete:function(){o.isIncomplete=!0},error:function(C){console.error(C)},log:function(C){console.log(C)},getNumberOfProposals:function(){return o.items.length}};return this.schemaService.getSchemaForResource(t.uri,n).then(function(C){var p=[],h=!0,g="",O=void 0;if(l&&l.type==="string"){var q=l.parent;q&&q.type==="property"&&q.keyNode===l&&(h=!q.valueNode,O=q,g=s.substr(l.offset+1,l.length-2),q&&(l=q.parent))}if(l&&l.type==="object"){if(l.offset===u)return o;var D=l.properties;D.forEach(function(w){(!O||O!==w)&&(x[w.keyNode.value]=k.CompletionItem.create("__"))});var _="";h&&(_=i.evaluateSeparatorAfter(t,t.offsetAt(c.end))),C?i.getPropertyCompletions(C,n,l,h,_,T):i.getSchemaLessPropertyCompletions(n,l,g,T);var b=sn(l);i.contributions.forEach(function(w){var R=w.collectPropertyCompletions(t.uri,b,a,h,_==="",T);R&&p.push(R)}),!C&&a.length>0&&s.charAt(u-a.length-1)!=='"'&&(T.add({kind:k.CompletionItemKind.Property,label:i.getLabelForValue(a),insertText:i.getInsertTextForProperty(a,void 0,!1,_),insertTextFormat:k.InsertTextFormat.Snippet,documentation:""}),T.setAsIncomplete())}var v={};return C?i.getValueCompletions(C,n,l,u,t,T,v):i.getSchemaLessValueCompletions(n,l,u,t,T),i.contributions.length>0&&i.getContributedValueCompletions(n,l,u,t,T,p),i.promiseConstructor.all(p).then(function(){if(T.getNumberOfProposals()===0){var w=u;l&&(l.type==="string"||l.type==="number"||l.type==="boolean"||l.type==="null")&&(w=l.offset+l.length);var R=i.evaluateSeparatorAfter(t,w);i.addFillerValueCompletions(v,R,T)}return o})})},e.prototype.getPropertyCompletions=function(t,r,n,i,o,s){var u=this,l=r.getMatchingSchemas(t.schema,n.offset);l.forEach(function(f){if(f.node===n&&!f.inverted){var a=f.schema.properties;a&&Object.keys(a).forEach(function(T){var C=a[T];if(typeof C=="object"&&!C.deprecationMessage&&!C.doNotSuggest){var p={kind:k.CompletionItemKind.Property,label:T,insertText:u.getInsertTextForProperty(T,C,i,o),insertTextFormat:k.InsertTextFormat.Snippet,filterText:u.getFilterTextForValue(T),documentation:u.fromMarkup(C.markdownDescription)||C.description||""};C.suggestSortText!==void 0&&(p.sortText=C.suggestSortText),p.insertText&&jt(p.insertText,"$1"+o)&&(p.command={title:"Suggest",command:"editor.action.triggerSuggest"}),s.add(p)}});var c=f.schema.propertyNames;
|
|||
|
`,g=g+`
|
|||
|
`+O+"]",O+=" ",c="array";x=h+O+a.bodyText.split(`
|
|||
|
`).join(`
|
|||
|
`+O)+g+r,y=y||x,T=x.replace(/[\n]/g,"")}else return;n.add({kind:o.getSuggestionKind(c),label:y,documentation:o.fromMarkup(a.markdownDescription)||a.description,insertText:x,insertTextFormat:k.InsertTextFormat.Snippet,filterText:T}),s=!0}),!s&&typeof t.items=="object"&&!Array.isArray(t.items)&&i<5&&this.addDefaultValueCompletions(t.items,r,n,i+1)},e.prototype.addEnumValueCompletions=function(t,r,n){if(st(t.const)&&n.add({kind:this.getSuggestionKind(t.type),label:this.getLabelForValue(t.const),insertText:this.getInsertTextForValue(t.const,r),insertTextFormat:k.InsertTextFormat.Snippet,documentation:this.fromMarkup(t.markdownDescription)||t.description}),Array.isArray(t.enum))for(var i=0,o=t.enum.length;i<o;i++){var s=t.enum[i],u=this.fromMarkup(t.markdownDescription)||t.description;t.markdownEnumDescriptions&&i<t.markdownEnumDescriptions.length&&this.doesSupportMarkdown()?u=this.fromMarkup(t.markdownEnumDescriptions[i]):t.enumDescriptions&&i<t.enumDescriptions.length&&(u=t.enumDescriptions[i]),n.add({kind:this.getSuggestionKind(t.type),label:this.getLabelForValue(s),insertText:this.getInsertTextForValue(s,r),insertTextFormat:k.InsertTextFormat.Snippet,documentation:u})}},e.prototype.collectTypes=function(t,r){if(!(Array.isArray(t.enum)||st(t.const))){var n=t.type;Array.isArray(n)?n.forEach(function(i){return r[i]=!0}):n&&(r[n]=!0)}},e.prototype.addFillerValueCompletions=function(t,r,n){t.object&&n.add({kind:this.getSuggestionKind("object"),label:"{}",insertText:this.getInsertTextForGuessedValue({},r),insertTextFormat:k.InsertTextFormat.Snippet,detail:xs("defaults.object","New object"),documentation:""}),t.array&&n.add({kind:this.getSuggestionKind("array"),label:"[]",insertText:this.getInsertTextForGuessedValue([],r),insertTextFormat:k.InsertTextFormat.Snippet,detail:xs("defaults.array","New array"),documentation:""})},e.prototype.addBooleanValueCompletion=function(t,r,n){n.add({kind:this.getSuggestionKind("boolean"),label:t?"true":"false",insertText:this.getInsertTextForValue(t,r),insertTextFormat:k.InsertTextFormat.Snippet,documentation:""})},e.prototype.addNullValueCompletion=function(t,r){r.add({kind:this.getSuggestionKind("null"),label:"null",insertText:"null"+t,insertTextFormat:k.InsertTextFormat.Snippet,documentation:""})},e.prototype.addDollarSchemaCompletions=function(t,r){var n=this,i=this.schemaService.getRegisteredSchemaIds(function(o){return o==="http"||o==="https"});i.forEach(function(o){return r.add({kind:k.CompletionItemKind.Module,label:n.getLabelForValue(o),filterText:n.getFilterTextForValue(o),insertText:n.getInsertTextForValue(o,t),insertTextFormat:k.InsertTextFormat.Snippet,documentation:""})})},e.prototype.getLabelForValue=function(t){return JSON.stringify(t)},e.prototype.getFilterTextForValue=function(t){return JSON.stringify(t)},e.prototype.getFilterTextForSnippetValue=function(t){return JSON.stringify(t).replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")},e.prototype.getLabelForSnippetValue=function(t){var r=JSON.stringify(t);return r.replace(/\$\{\d+:([^}]+)\}|\$\d+/g,"$1")},e.prototype.getInsertTextForPlainText=function(t){return t.replace(/[\\\$\}]/g,"\\$&")},e.prototype.getInsertTextForValue=function(t,r){var n=JSON.stringify(t,null," ");return n==="{}"?"{$1}"+r:n==="[]"?"[$1]"+r:this.getInsertTextForPlainText(n+r)},e.prototype.getInsertTextForSnippetValue=function(t,r){var n=function(i){return typeof i=="string"&&i[0]==="^"?i.substr(1):JSON.stringify(i)};return Qn(t,"",n)+r},e.prototype.getInsertTextForGuessedValue=function(t,r){switch(typeof t){case"object":return t===null?"${1:null}"+r:this.getInsertTextForValue(t,r);case"string":var n=JSON.stringify(t);return n=n.substr(1,n.length-2),n=this.getInsertTextForPlainText(n),'"${1:'+n+'}"'+r;case"number":case"boolean":return"${1:"+JSON.stringify(t)+"}"+r}return this.getInsertTextForValue(t,r)},e.prototype.getSuggestionKind=function(t){if(Array.isArray(t)){var r=t;t=r.length>0?r[0]:void 0}if(!t)return k.CompletionItemKind.Value;switch(t){case"string":return k.CompletionItemKind.Value;case"object":return k.CompletionItemKind.Module;case"property":return k.Co
|
|||
|
\r\v":{[,]}`.indexOf(i.charAt(n))===-1;)n--;return i.substring(n+1,r)},e.prototype.evaluateSeparatorAfter=function(t,r){var n=ht(t.getText(),!0);n.setPosition(r);var i=n.scan();switch(i){case 5:case 2:case 4:case 17:return"";default:return","}},e.prototype.findItemAtOffset=function(t,r,n){for(var i=ht(r.getText(),!0),o=t.items,s=o.length-1;s>=0;s--){var u=o[s];if(n>u.offset+u.length){i.setPosition(u.offset+u.length);var l=i.scan();return l===5&&n>=i.getTokenOffset()+i.getTokenLength()?s+1:s}else if(n>=u.offset)return s}return 0},e.prototype.isInComment=function(t,r,n){var i=ht(t.getText(),!1);i.setPosition(r);for(var o=i.scan();o!==17&&i.getTokenOffset()+i.getTokenLength()<n;)o=i.scan();return(o===12||o===13)&&i.getTokenOffset()<=n},e.prototype.fromMarkup=function(t){if(t&&this.doesSupportMarkdown())return{kind:k.MarkupKind.Markdown,value:t}},e.prototype.doesSupportMarkdown=function(){if(!st(this.supportsMarkdown)){var t=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsMarkdown=t&&t.completionItem&&Array.isArray(t.completionItem.documentationFormat)&&t.completionItem.documentationFormat.indexOf(k.MarkupKind.Markdown)!==-1}return this.supportsMarkdown},e.prototype.doesSupportsCommitCharacters=function(){if(!st(this.supportsCommitCharacters)){var t=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsCommitCharacters=t&&t.completionItem&&!!t.completionItem.commitCharactersSupport}return this.supportsCommitCharacters},e}();var Lc=function(){function e(t,r,n){r===void 0&&(r=[]),this.schemaService=t,this.contributions=r,this.promise=n||Promise}return e.prototype.doHover=function(t,r,n){var i=t.offsetAt(r),o=n.getNodeFromOffset(i);if(!o||(o.type==="object"||o.type==="array")&&i>o.offset+1&&i<o.offset+o.length-1)return this.promise.resolve(null);var s=o;if(o.type==="string"){var u=o.parent;if(u&&u.type==="property"&&u.keyNode===o&&(o=u.valueNode,!o))return this.promise.resolve(null)}for(var l=k.Range.create(t.positionAt(s.offset),t.positionAt(s.offset+s.length)),f=function(x){var T={contents:x,range:l};return T},a=sn(o),c=this.contributions.length-1;c>=0;c--){var m=this.contributions[c],y=m.getInfoContribution(t.uri,a);if(y)return y.then(function(x){return f(x)})}return this.schemaService.getSchemaForResource(t.uri,n).then(function(x){if(x&&o){var T=n.getMatchingSchemas(x.schema,o.offset),C=void 0,p=void 0,h=void 0,g=void 0;T.every(function(q){if(q.node===o&&!q.inverted&&q.schema&&(C=C||q.schema.title,p=p||q.schema.markdownDescription||Ss(q.schema.description),q.schema.enum)){var D=q.schema.enum.indexOf(ut(o));q.schema.markdownEnumDescriptions?h=q.schema.markdownEnumDescriptions[D]:q.schema.enumDescriptions&&(h=Ss(q.schema.enumDescriptions[D])),h&&(g=q.schema.enum[D],typeof g!="string"&&(g=JSON.stringify(g)))}return!0});var O="";return C&&(O=Ss(C)),p&&(O.length>0&&(O+=`
|
|||
|
|
|||
|
`),O+=p),h&&(O.length>0&&(O+=`
|
|||
|
|
|||
|
`),O+="`"+bg(g)+"`: "+h),f([O])}return null})},e}();function Ss(e){if(e){var t=e.replace(/([^\n\r])(\r?\n)([^\n\r])/gm,`$1
|
|||
|
|
|||
|
$3`);return t.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}}function bg(e){return e.indexOf("`")!==-1?"`` "+e+" ``":e}"use strict";var wg=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),pe,an;typeof process=="object"?an=process.platform==="win32":typeof navigator=="object"&&(Wc=navigator.userAgent,an=Wc.indexOf("Windows")>=0);var Wc;var Cg=/^\w[\w\d+.-]*$/,xg=/^\//,Sg=/^\/\//;function Tg(e,t){if(!e.scheme&&t)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+e.authority+'", path: "'+e.path+'", query: "'+e.query+'", fragment: "'+e.fragment+'"}');if(e.scheme&&!Cg.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path){if(e.authority){if(!xg.test(e.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Sg.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function kg(e,t){return!e&&!t?"file":e}function _g(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==ct&&(t=ct+t):t=ct;break}return t}var oe="",ct="/",Pg=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,lt=function(){function e(t,r,n,i,o,s){s===void 0&&(s=!1),typeof t=="object"?(this.scheme=t.scheme||oe,this.authority=t.authority||oe,this.path=t.path||oe,this.query=t.query||oe,this.fragment=t.fragment||oe):(this.scheme=kg(t,s),this.authority=r||oe,this.path=_g(this.scheme,n||oe),this.query=i||oe,this.fragment=o||oe,Tg(this,s))}return e.isUri=function(t){return t instanceof e?!0:t?typeof t.authority=="string"&&typeof t.fragment=="string"&&typeof t.path=="string"&&typeof t.query=="string"&&typeof t.scheme=="string"&&typeof t.fsPath=="function"&&typeof t.with=="function"&&typeof t.toString=="function":!1},Object.defineProperty(e.prototype,"fsPath",{get:function(){return Vc(this,!1)},enumerable:!0,configurable:!0}),e.prototype.with=function(t){if(!t)return this;var r=t.scheme,n=t.authority,i=t.path,o=t.query,s=t.fragment;return r===void 0?r=this.scheme:r===null&&(r=oe),n===void 0?n=this.authority:n===null&&(n=oe),i===void 0?i=this.path:i===null&&(i=oe),o===void 0?o=this.query:o===null&&(o=oe),s===void 0?s=this.fragment:s===null&&(s=oe),r===this.scheme&&n===this.authority&&i===this.path&&o===this.query&&s===this.fragment?this:new Nr(r,n,i,o,s)},e.parse=function(t,r){r===void 0&&(r=!1);var n=Pg.exec(t);return n?new Nr(n[2]||oe,Kn(n[4]||oe),Kn(n[5]||oe),Kn(n[7]||oe),Kn(n[9]||oe),r):new Nr(oe,oe,oe,oe,oe)},e.file=function(t){var r=oe;if(an&&(t=t.replace(/\\/g,ct)),t[0]===ct&&t[1]===ct){var n=t.indexOf(ct,2);n===-1?(r=t.substring(2),t=ct):(r=t.substring(2,n),t=t.substring(n)||ct)}return new Nr("file",r,t,oe,oe)},e.from=function(t){return new Nr(t.scheme,t.authority,t.path,t.query,t.fragment)},e.prototype.toString=function(t){return t===void 0&&(t=!1),Ts(this,t)},e.prototype.toJSON=function(){return this},e.revive=function(t){if(t){if(t instanceof e)return t;var r=new Nr(t);return r._formatted=t.external,r._fsPath=t._sep===$c?t.fsPath:null,r}else return t},e}();var $c=an?1:void 0,Nr=function(e){wg(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r._formatted=null,r._fsPath=null,r}return Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=Vc(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),t.prototype.toString=function(r){return r===void 0&&(r=!1),r?Ts(this,!0):(this._formatted||(this._formatted=Ts(this,!1)),this._formatted)},t.prototype.toJSON=function(){var r={$mid:1};return this._fsPath&&(r.fsPath=this._fsPath,r._sep=$c),this._formatted&&(r.external=this._formatted),this.path&&(r.path=this.path),this.scheme&&(r.scheme=this.scheme),this.author
|
|||
|
`};return vc(u.getText(),a,y).map(function(x){return k.TextEdit.replace(k.Range.create(u.positionAt(x.offset),u.positionAt(x.offset+x.length)),x.content)})}}}function al(e,t,r){let n={},i=0,o;return t>0&&(o=setInterval(()=>{let s=Date.now()-t*1e3,u=Object.keys(n);for(let l of u)n[l].cTime<s&&(delete n[l],i--)},t*1e3)),{get(s){let u=s.version,l=s.languageId,f=n[s.uri];if(f&&f.version===u&&f.languageId===l)return f.cTime=Date.now(),f.languageModel;let a=r(s);if(n[s.uri]={languageModel:a,version:u,languageId:l,cTime:Date.now()},f||i++,i===e){let c=Number.MAX_VALUE,m=null;for(let y in n){let x=n[y];x.cTime<c&&(m=y,c=x.cTime)}m&&(delete n[m],i--)}return a},onDocumentRemoved(s){let u=s.uri;n[u]&&(delete n[u],i--)},dispose(){typeof o!="undefined"&&(clearInterval(o),o=void 0,n={},i=0)}}}function ul(e){let t=e.lastIndexOf("/");return e.substr(t+1)}var zg="/".charCodeAt(0),Rs=".".charCodeAt(0);function Bg(e){return e.charCodeAt(0)===zg}function ll(e,t){if(Bg(t)){let r=lt.parse(e),n=t.split("/");return r.with({path:cl(n)}).toString()}return Jg(e,t)}function cl(e){let t=[];for(let n of e)n.length===0||n.length===1&&n.charCodeAt(0)===Rs||(n.length===2&&n.charCodeAt(0)===Rs&&n.charCodeAt(1)===Rs?t.pop():t.push(n));e.length>1&&e[e.length-1].length===0&&t.push("");let r=t.join("/");return e[0].length===0&&(r="/"+r),r}function Jg(e,...t){let r=lt.parse(e),n=r.path.split("/");for(let i of t)n.push(...i.split("/"));return r.with({path:cl(n)}).toString()}var Es;(function(t){t.type=new je.NotificationType("json/schemaAssociations")})(Es||(Es={}));var Os;(function(t){t.type=new je.RequestType("vscode/content")})(Os||(Os={}));var Ns;(function(t){t.type=new je.NotificationType("json/schemaContent")})(Ns||(Ns={}));var Fs;(function(t){t.type=new je.NotificationType("json/resultLimitReached")})(Fs||(Fs={}));var qs;(function(t){t.type=new je.RequestType("json/validate")})(qs||(qs={}));var fl={resolveRelativePath:(e,t)=>{let r=t.substr(0,t.lastIndexOf("/")+1);return ll(r,e)}};function dl(e,t){function r(b=["https","http","file"]){let v={};for(let w of b)w==="file"?v[w]=t.file:(w==="http"||w==="https")&&(v[w]=t.http);return w=>{let R=w.substr(0,w.indexOf(":")),F=v[R];return F?F.getContent(w):e.sendRequest(Os.type,w).then(L=>L,L=>Promise.reject(L.message))}}let n=Ps({workspaceContext:fl,contributions:[],clientCapabilities:Yn.LATEST}),i=new je.TextDocuments(Rr);i.listen(e);let o=!1,s=!1,u=!1,l=Number.MAX_VALUE,f=Number.MAX_VALUE,a=Number.MAX_VALUE,c=Number.MAX_VALUE;e.onInitialize(b=>{var F,L,$,ne,K;let v=(F=b.initializationOptions)==null?void 0:F.handledSchemaProtocols;n=Ps({schemaRequestService:r(v),workspaceContext:fl,contributions:[],clientCapabilities:b.capabilities});function w(Pe,Me){let Se=Pe.split("."),we=b.capabilities;for(let se=0;we&&se<Se.length;se++){if(!we.hasOwnProperty(Se[se]))return Me;we=we[Se[se]]}return we}return o=w("textDocument.completion.completionItem.snippetSupport",!1),s=w("textDocument.rangeFormatting.dynamicRegistration",!1)&&typeof((L=b.initializationOptions)==null?void 0:L.provideFormatter)!="boolean",l=w("textDocument.foldingRange.rangeLimit",Number.MAX_VALUE),u=w("textDocument.documentSymbol.hierarchicalDocumentSymbolSupport",!1),c=((K=(ne=($=b.initializationOptions)==null?void 0:$.customCapabilities)==null?void 0:ne.rangeFormatting)==null?void 0:K.editLimit)||Number.MAX_VALUE,{capabilities:{textDocumentSync:je.TextDocumentSyncKind.Incremental,completionProvider:o?{resolveProvider:!1,triggerCharacters:['"',":"]}:void 0,hoverProvider:!0,documentSymbolProvider:!0,documentRangeFormattingProvider:b.initializationOptions.provideFormatter===!0,colorProvider:{},foldingRangeProvider:!0,selectionRangeProvider:!0,definitionProvider:!0}}});let m=function(){let b={};return{cancel(v){let w=b[v];w&&w.timeout&&(clearTimeout(w.timeout),delete b[v])},onResultLimitExceeded(v,w,R){return()=>{let F=b[v];if(F){if(!F.timeout)return;F.features[R]=R,F.timeout.refresh()}else F={features:{[R]:R}},F.timeout=setTimeout(()=>{e.sendNotification(Fs.type,`${ul(v)}: For performance reasons, ${Object.keys(F.features).join(" and ")} have been limited t
|
|||
|
/*!
|
|||
|
* @overview es6-promise - a tiny implementation of Promises/A+.
|
|||
|
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
|||
|
* @license Licensed under MIT license
|
|||
|
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
|
|||
|
* @version v4.2.8+1e68dce6
|
|||
|
*/
|
|||
|
//# sourceMappingURL=server.js.map
|