astro-vscode 0.24.1 → 0.24.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # astro-vscode
2
2
 
3
+ ## 0.24.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 96957ac: Fix extension not working properly inside the browser
8
+
9
+ ## 0.24.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 7390abe: We're in deploy hell, but this time it'll work
14
+
15
+ ## 0.24.2
16
+
17
+ ### Patch Changes
18
+
19
+ - 6b2ca00: Retry deploy again
20
+
3
21
  ## 0.24.1
4
22
 
5
23
  ### Patch Changes
@@ -36,4 +36,4 @@ globstar while`,i,m,e,R,_),this.matchOne(i.slice(m),e.slice(R),t))return this.de
36
36
  >>> no match, partial?`,i,m,e,R),m===a))}var T;if(typeof d=="string"?(T=h===d,this.debug("string match",d,h,T)):(T=h.match(d),this.debug("pattern match",d,h,T)),!T)return!1}if(r===a&&o===c)return!0;if(r===a)return t;if(o===c)return r===a-1&&i[r]==="";throw new Error("wtf?")};function Fm(i){return i.replace(/\\(.)/g,"$1")}function Em(i){return i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var oa=I(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.DiagnosticFeature=sn.DiagnosticPullMode=sn.vsdiag=void 0;var Om=Tr(),ae=require("vscode"),Le=X(),Im=Ee(),Xs=ue();function qr(i,e){return i[e]===void 0&&(i[e]={}),i[e]}var Yt;(function(i){let e;(function(t){t.full="full",t.unChanged="unChanged"})(e=i.DocumentDiagnosticReportKind||(i.DocumentDiagnosticReportKind={}))})(Yt=sn.vsdiag||(sn.vsdiag={}));var Ys;(function(i){i.onType="onType",i.onSave="onSave"})(Ys=sn.DiagnosticPullMode||(sn.DiagnosticPullMode={}));var at;(function(i){i.active="open",i.reschedule="reschedule",i.outDated="drop"})(at||(at={}));var Zs=class{constructor(){this.open=new Set;let e=()=>{this.open.clear();for(let t of ae.window.tabGroups.all)for(let n of t.tabs){let r=n.input;r instanceof ae.TabInputText?this.open.add(r.uri.toString()):r instanceof ae.TabInputTextDiff&&this.open.add(r.modified.toString())}};e(),ae.window.tabGroups.onDidChangeTabGroups!==void 0?this.disposable=ae.window.tabGroups.onDidChangeTabGroups(e):this.disposable={dispose:()=>{}}}dispose(){this.disposable.dispose()}isActive(e){return e instanceof ae.Uri?ae.window.activeTextEditor?.document.uri===e:ae.window.activeTextEditor?.document===e}isVisible(e){let t=e instanceof ae.Uri?e:e.uri;return this.open.has(t.toString())}getTabResources(){let e=[];for(let t of ae.window.tabGroups.all)for(let n of t.tabs){let r=n.input;r instanceof ae.TabInputText?e.push(r.uri):r instanceof ae.TabInputTextDiff&&e.push(r.modified)}return e}},_t;(function(i){i[i.document=1]="document",i[i.workspace=2]="workspace"})(_t||(_t={}));var ea=class{constructor(){this.documentPullStates=new Map,this.workspacePullStates=new Map}track(e,t,n){let r=e===_t.document?this.documentPullStates:this.workspacePullStates,[o,a,c]=t instanceof ae.Uri?[t.toString(),t,n]:[t.uri.toString(),t.uri,t.version],d=r.get(o);return d===void 0&&(d={document:a,pulledVersion:c,resultId:void 0},r.set(o,d)),d}update(e,t,n,r){let o=e===_t.document?this.documentPullStates:this.workspacePullStates,[a,c,d,h]=t instanceof ae.Uri?[t.toString(),t,n,r]:[t.uri.toString(),t.uri,t.version,n],m=o.get(a);m===void 0?(m={document:c,pulledVersion:d,resultId:h},o.set(a,m)):(m.pulledVersion=d,m.resultId=h)}unTrack(e,t){let n=t instanceof ae.Uri?t.toString():t.uri.toString();(e===_t.document?this.documentPullStates:this.workspacePullStates).delete(n)}tracks(e,t){let n=t instanceof ae.Uri?t.toString():t.uri.toString();return(e===_t.document?this.documentPullStates:this.workspacePullStates).has(n)}getResultId(e,t){let n=t instanceof ae.Uri?t.toString():t.uri.toString();return(e===_t.document?this.documentPullStates:this.workspacePullStates).get(n)?.resultId}getAllResultIds(){let e=[];for(let[t,n]of this.workspacePullStates)this.documentPullStates.has(t)&&(n=this.documentPullStates.get(t)),n.resultId!==void 0&&e.push({uri:t,value:n.resultId});return e}},ta=class{constructor(e,t,n){this.client=e,this.tabs=t,this.options=n,this.isDisposed=!1,this.onDidChangeDiagnosticsEmitter=new ae.EventEmitter,this.provider=this.createProvider(),this.diagnostics=ae.languages.createDiagnosticCollection(n.identifier),this.openRequests=new Map,this.documentStates=new ea,this.workspaceErrorCounter=0}knows(e,t){return this.documentStates.tracks(e,t)}pull(e,t){if(this.isDisposed)return;let n=e instanceof ae.Uri?e:e.uri;this.pullAsync(e).then(()=>{t&&t()},r=>{this.client.error(`Document pull failed for text document ${n.toString()}`,r,!1)})}async pullAsync(e,t){if(this.isDisposed)return;let n=e instanceof ae.Uri,r=n?e:e.uri,o=r.toString();t=n?t:e.version;let a=this.openRequests.get(o),c=n?this.documentStates.track(_t.document,e,t):this.documentStates.track(_t.document,e);if(a===void 0){let d=new ae.CancellationTokenSource;this.openRequests.set(o,{state:at.active,document:e,version:t,tokenSource:d});let h,m;try{h=await this.provider.provideDiagnostics(e,c.resultId,d.token)??{kind:Yt.DocumentDiagnosticReportKind.full,items:[]}}catch(R){if(R instanceof Xs.LSPCancellationError&&Le.DiagnosticServerCancellationData.is(R.data)&&R.data.retriggerRequest===!1&&(m={state:at.outDated,document:e}),m===void 0&&R instanceof ae.CancellationError)m={state:at.reschedule,document:e};else throw R}if(m=m??this.openRequests.get(o),m===void 0){this.client.error(`Lost request state in diagnostic pull model. Clearing diagnostics for ${o}`),this.diagnostics.delete(r);return}if(this.openRequests.delete(o),!this.tabs.isVisible(e)){this.documentStates.unTrack(_t.document,e);return}if(m.state===at.outDated)return;h!==void 0&&(h.kind===Yt.DocumentDiagnosticReportKind.full&&this.diagnostics.set(r,h.items),c.pulledVersion=t,c.resultId=h.resultId),m.state===at.reschedule&&this.pull(e)}else a.state===at.active?(a.tokenSource.cancel(),this.openRequests.set(o,{state:at.reschedule,document:a.document})):a.state===at.outDated&&this.openRequests.set(o,{state:at.reschedule,document:a.document})}cleanupPull(e){let t=e instanceof ae.Uri?e:e.uri,n=t.toString(),r=this.openRequests.get(n);this.options.workspaceDiagnostics||this.options.interFileDependencies?r!==void 0?this.openRequests.set(n,{state:at.reschedule,document:e}):this.pull(e):(r!==void 0&&(r.state===at.active&&r.tokenSource.cancel(),this.openRequests.set(n,{state:at.outDated,document:e})),this.diagnostics.delete(t))}pullWorkspace(){this.isDisposed||this.pullWorkspaceAsync().then(()=>{this.workspaceTimeout=(0,Le.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3)},e=>{!(e instanceof Xs.LSPCancellationError)&&!Le.DiagnosticServerCancellationData.is(e.data)&&(this.client.error("Workspace diagnostic pull failed.",e,!1),this.workspaceErrorCounter++),this.workspaceErrorCounter<=5&&(this.workspaceTimeout=(0,Le.RAL)().timer.setTimeout(()=>{this.pullWorkspace()},2e3))})}async pullWorkspaceAsync(){if(!this.provider.provideWorkspaceDiagnostics||this.isDisposed)return;this.workspaceCancellation!==void 0&&(this.workspaceCancellation.cancel(),this.workspaceCancellation=void 0),this.workspaceCancellation=new ae.CancellationTokenSource;let e=this.documentStates.getAllResultIds().map(t=>({uri:this.client.protocol2CodeConverter.asUri(t.uri),value:t.value}));await this.provider.provideWorkspaceDiagnostics(e,this.workspaceCancellation.token,t=>{if(!(!t||this.isDisposed))for(let n of t.items)n.kind===Yt.DocumentDiagnosticReportKind.full&&(this.documentStates.tracks(_t.document,n.uri)||this.diagnostics.set(n.uri,n.items)),this.documentStates.update(_t.workspace,n.uri,n.version??void 0,n.resultId)})}createProvider(){let e={onDidChangeDiagnostics:this.onDidChangeDiagnosticsEmitter.event,provideDiagnostics:(t,n,r)=>{let o=(c,d,h)=>{let m={identifier:this.options.identifier,textDocument:{uri:this.client.code2ProtocolConverter.asUri(c instanceof ae.Uri?c:c.uri)},previousResultId:d};return this.isDisposed===!0||!this.client.isRunning()?{kind:Yt.DocumentDiagnosticReportKind.full,items:[]}:this.client.sendRequest(Le.DocumentDiagnosticRequest.type,m,h).then(async R=>R==null||this.isDisposed||h.isCancellationRequested?{kind:Yt.DocumentDiagnosticReportKind.full,items:[]}:R.kind===Le.DocumentDiagnosticReportKind.Full?{kind:Yt.DocumentDiagnosticReportKind.full,resultId:R.resultId,items:await this.client.protocol2CodeConverter.asDiagnostics(R.items,h)}:{kind:Yt.DocumentDiagnosticReportKind.unChanged,resultId:R.resultId},R=>this.client.handleFailedRequest(Le.DocumentDiagnosticRequest.type,h,R,{kind:Yt.DocumentDiagnosticReportKind.full,items:[]}))},a=this.client.middleware;return a.provideDiagnostics?a.provideDiagnostics(t,n,r,o):o(t,n,r)}};return this.options.workspaceDiagnostics&&(e.provideWorkspaceDiagnostics=(t,n,r)=>{let o=async h=>h.kind===Le.DocumentDiagnosticReportKind.Full?{kind:Yt.DocumentDiagnosticReportKind.full,uri:this.client.protocol2CodeConverter.asUri(h.uri),resultId:h.resultId,version:h.version,items:await this.client.protocol2CodeConverter.asDiagnostics(h.items,n)}:{kind:Yt.DocumentDiagnosticReportKind.unChanged,uri:this.client.protocol2CodeConverter.asUri(h.uri),resultId:h.resultId,version:h.version},a=h=>{let m=[];for(let R of h)m.push({uri:this.client.code2ProtocolConverter.asUri(R.uri),value:R.value});return m},c=(h,m)=>{let R=(0,Im.generateUuid)(),_=this.client.onProgress(Le.WorkspaceDiagnosticRequest.partialResult,R,async y=>{if(y==null){r(null);return}let P={items:[]};for(let O of y.items)try{P.items.push(await o(O))}catch(L){this.client.error("Converting workspace diagnostics failed.",L)}r(P)}),T={identifier:this.options.identifier,previousResultIds:a(h),partialResultToken:R};return this.isDisposed===!0||!this.client.isRunning()?{items:[]}:this.client.sendRequest(Le.WorkspaceDiagnosticRequest.type,T,m).then(async y=>{if(m.isCancellationRequested)return{items:[]};let P={items:[]};for(let O of y.items)P.items.push(await o(O));return _.dispose(),r(P),{items:[]}},y=>(_.dispose(),this.client.handleFailedRequest(Le.DocumentDiagnosticRequest.type,m,y,{items:[]})))},d=this.client.middleware;return d.provideWorkspaceDiagnostics?d.provideWorkspaceDiagnostics(t,n,r,c):c(t,n,r)}),e}dispose(){this.isDisposed=!0,this.workspaceCancellation?.cancel(),this.workspaceTimeout?.dispose();for(let[e,t]of this.openRequests)t.state===at.active&&t.tokenSource.cancel(),this.openRequests.set(e,{state:at.outDated,document:t.document})}},na=class{constructor(e){this.diagnosticRequestor=e,this.documents=new Le.LinkedMap,this.isDisposed=!1}add(e){if(this.isDisposed===!0)return;let t=e instanceof ae.Uri?e.toString():e.uri.toString();this.documents.has(t)||(this.documents.set(t,e,Le.Touch.Last),this.trigger())}remove(e){let t=e instanceof ae.Uri?e.toString():e.uri.toString();this.documents.has(t)&&(this.documents.delete(t),this.diagnosticRequestor.pull(e)),this.documents.size===0?this.stop():e===this.endDocument&&(this.endDocument=this.documents.last)}trigger(){if(this.isDisposed!==!0){if(this.intervalHandle!==void 0){this.endDocument=this.documents.last;return}this.endDocument=this.documents.last,this.intervalHandle=(0,Le.RAL)().timer.setInterval(()=>{let e=this.documents.first;if(e!==void 0){let t=e instanceof ae.Uri?e.toString():e.uri.toString();this.diagnosticRequestor.pull(e),this.documents.set(t,e,Le.Touch.Last),e===this.endDocument&&this.stop()}},200)}}dispose(){this.isDisposed=!0,this.stop(),this.documents.clear()}stop(){this.intervalHandle?.dispose(),this.intervalHandle=void 0,this.endDocument=void 0}},ia=class{constructor(e,t,n){let r=e.clientOptions.diagnosticPullOptions??{onChange:!0,onSave:!1},o=e.protocol2CodeConverter.asDocumentSelector(n.documentSelector),a=[],c=y=>{let P=n.documentSelector;if(r.match!==void 0)return r.match(P,y);for(let O of P)if(!!Le.TextDocumentFilter.is(O)){if(typeof O=="string"||O.language!==void 0&&O.language!=="*"||O.scheme!==void 0&&O.scheme!=="*"&&O.scheme!==y.scheme)return!1;if(O.pattern!==void 0){let L=new Om.Minimatch(O.pattern,{noext:!0});if(!L.makeRe()||!L.match(y.fsPath))return!1}}return!0},d=y=>y instanceof ae.Uri?c(y):ae.languages.match(o,y)>0&&t.isVisible(y),h=y=>y instanceof ae.Uri?this.activeTextDocument?.uri.toString()===y.toString():this.activeTextDocument===y;this.diagnosticRequestor=new ta(e,t,n),this.backgroundScheduler=new na(this.diagnosticRequestor);let m=y=>{!d(y)||!n.interFileDependencies||h(y)||this.backgroundScheduler.add(y)};this.activeTextDocument=ae.window.activeTextEditor?.document,ae.window.onDidChangeActiveTextEditor(y=>{let P=this.activeTextDocument;this.activeTextDocument=y?.document,P!==void 0&&m(P),this.activeTextDocument!==void 0&&this.backgroundScheduler.remove(this.activeTextDocument)});let R=e.getFeature(Le.DidOpenTextDocumentNotification.method);a.push(R.onNotificationSent(y=>{let P=y.original;d(P)&&this.diagnosticRequestor.pull(P,()=>{m(P)})}));let _=new Set;for(let y of ae.workspace.textDocuments)d(y)&&(this.diagnosticRequestor.pull(y,()=>{m(y)}),_.add(y.uri.toString()));if(r.onTabs===!0)for(let y of t.getTabResources())!_.has(y.toString())&&d(y)&&this.diagnosticRequestor.pull(y,()=>{m(y)});if(r.onChange===!0){let y=e.getFeature(Le.DidChangeTextDocumentNotification.method);a.push(y.onNotificationSent(async P=>{let O=P.original.document;(r.filter===void 0||!r.filter(O,Ys.onType))&&this.diagnosticRequestor.knows(_t.document,O)&&P.original.contentChanges.length>0&&this.diagnosticRequestor.pull(O,()=>{this.backgroundScheduler.trigger()})}))}if(r.onSave===!0){let y=e.getFeature(Le.DidSaveTextDocumentNotification.method);a.push(y.onNotificationSent(P=>{let O=P.original;(r.filter===void 0||!r.filter(O,Ys.onSave))&&this.diagnosticRequestor.knows(_t.document,O)&&this.diagnosticRequestor.pull(P.original,()=>{this.backgroundScheduler.trigger()})}))}let T=e.getFeature(Le.DidCloseTextDocumentNotification.method);a.push(T.onNotificationSent(y=>{let P=y.original;this.diagnosticRequestor.cleanupPull(P),this.backgroundScheduler.remove(P)})),this.diagnosticRequestor.onDidChangeDiagnosticsEmitter.event(()=>{for(let y of ae.workspace.textDocuments)d(y)&&this.diagnosticRequestor.pull(y)}),n.workspaceDiagnostics===!0&&n.identifier!=="da348dc5-c30a-4515-9d98-31ff3be38d14"&&this.diagnosticRequestor.pullWorkspace(),this.disposable=ae.Disposable.from(...a,this.backgroundScheduler,this.diagnosticRequestor)}get onDidChangeDiagnosticsEmitter(){return this.diagnosticRequestor.onDidChangeDiagnosticsEmitter}get diagnostics(){return this.diagnosticRequestor.provider}},ra=class extends Xs.TextDocumentLanguageFeature{constructor(e){super(e,Le.DocumentDiagnosticRequest.type)}fillClientCapabilities(e){let t=qr(qr(e,"textDocument"),"diagnostic");t.dynamicRegistration=!0,t.relatedDocumentSupport=!1,qr(qr(e,"workspace"),"diagnostics").refreshSupport=!0}initialize(e,t){this._client.onRequest(Le.DiagnosticRefreshRequest.type,async()=>{for(let a of this.getAllProviders())a.onDidChangeDiagnosticsEmitter.fire()});let[r,o]=this.getRegistration(t,e.diagnosticProvider);!r||!o||this.register({id:r,registerOptions:o})}dispose(){this.tabs!==void 0&&(this.tabs.dispose(),this.tabs=void 0),super.dispose()}registerLanguageProvider(e){this.tabs===void 0&&(this.tabs=new Zs);let t=new ia(this._client,this.tabs,e);return[t.disposable,t]}};sn.DiagnosticFeature=ra});var Qi=I(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.forEach=Mt.mapAsync=Mt.map=Mt.Semaphore=Mt.Delayer=void 0;var Bi=X(),sa=class{constructor(e){this.defaultDelay=e,this.timeout=void 0,this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0}trigger(e,t=this.defaultDelay){return this.task=e,t>=0&&this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(n=>{this.onSuccess=n}).then(()=>{this.completionPromise=void 0,this.onSuccess=void 0;var n=this.task();return this.task=void 0,n})),(t>=0||this.timeout===void 0)&&(this.timeout=(0,Bi.RAL)().timer.setTimeout(()=>{this.timeout=void 0,this.onSuccess(void 0)},t>=0?t:this.defaultDelay)),this.completionPromise}forceDelivery(){if(!this.completionPromise)return;this.cancelTimeout();let e=this.task();return this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0,e}isTriggered(){return this.timeout!==void 0}cancel(){this.cancelTimeout(),this.completionPromise=void 0}cancelTimeout(){this.timeout!==void 0&&(this.timeout.dispose(),this.timeout=void 0)}};Mt.Delayer=sa;var aa=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,Bi.RAL)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let t=e.thunk();t instanceof Promise?t.then(n=>{this._active--,e.resolve(n),this.runNext()},n=>{this._active--,e.reject(n),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};Mt.Semaphore=aa;var dl=15,Vi=class{constructor(e=dl){this.yieldAfter=Math.max(e,dl),this.startTime=Date.now(),this.counter=0,this.total=0,this.counterInterval=1}start(){this.startTime=Date.now()}shouldYield(){if(++this.counter>=this.counterInterval){let e=Date.now()-this.startTime,t=Math.max(0,this.yieldAfter-e);if(this.total+=this.counter,this.counter=0,e>=this.yieldAfter||t<=1)return this.counterInterval=1,this.total=0,!0;switch(e){case 0:case 1:this.counterInterval=this.total*2;break}}return!1}};async function Nm(i,e,t,n){if(i.length===0)return[];let r=new Array(i.length),o=new Vi(n?.yieldAfter);function a(d){o.start();for(let h=d;h<i.length;h++)if(r[h]=e(i[h]),o.shouldYield())return n?.yieldCallback&&n.yieldCallback(),h+1;return-1}let c=a(0);for(;c!==-1&&!(t!==void 0&&t.isCancellationRequested);)c=await new Promise(d=>{(0,Bi.RAL)().timer.setImmediate(()=>{d(a(c))})});return r}Mt.map=Nm;async function Lm(i,e,t,n){if(i.length===0)return[];let r=new Array(i.length),o=new Vi(n?.yieldAfter);async function a(d){o.start();for(let h=d;h<i.length;h++)if(r[h]=await e(i[h],t),o.shouldYield())return n?.yieldCallback&&n.yieldCallback(),h+1;return-1}let c=await a(0);for(;c!==-1&&!(t!==void 0&&t.isCancellationRequested);)c=await new Promise(d=>{(0,Bi.RAL)().timer.setImmediate(()=>{d(a(c))})});return r}Mt.mapAsync=Lm;async function Mm(i,e,t,n){if(i.length===0)return;let r=new Vi(n?.yieldAfter);function o(c){r.start();for(let d=c;d<i.length;d++)if(e(i[d]),r.shouldYield())return n?.yieldCallback&&n.yieldCallback(),d+1;return-1}let a=o(0);for(;a!==-1&&!(t!==void 0&&t.isCancellationRequested);)a=await new Promise(c=>{(0,Bi.RAL)().timer.setImmediate(()=>{c(o(a))})})}Mt.forEach=Mm});var da=I(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});var jm=require("vscode"),ca=class extends jm.CompletionItem{constructor(e){super(e)}};ua.default=ca});var ha=I(fa=>{"use strict";Object.defineProperty(fa,"__esModule",{value:!0});var Am=require("vscode"),la=class extends Am.CodeLens{constructor(e){super(e)}};fa.default=la});var ma=I(pa=>{"use strict";Object.defineProperty(pa,"__esModule",{value:!0});var Hm=require("vscode"),ga=class extends Hm.DocumentLink{constructor(e,t){super(e,t)}};pa.default=ga});var Ca=I(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var Wm=require("vscode"),ya=class extends Wm.CodeAction{constructor(e,t){super(e),this.data=t}};va.default=ya});var Ra=I(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.ProtocolDiagnostic=Qn.DiagnosticCode=void 0;var Km=require("vscode"),_a=Xt(),Um;(function(i){function e(t){let n=t;return n!=null&&(_a.number(n.value)||_a.string(n.value))&&_a.string(n.target)}i.is=e})(Um=Qn.DiagnosticCode||(Qn.DiagnosticCode={}));var ba=class extends Km.Diagnostic{constructor(e,t,n,r){super(e,t,n),this.data=r,this.hasDiagnosticCode=!1}};Qn.ProtocolDiagnostic=ba});var Sa=I(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});var zm=require("vscode"),Da=class extends zm.CallHierarchyItem{constructor(e,t,n,r,o,a,c){super(e,t,n,r,o,a),c!==void 0&&(this.data=c)}};wa.default=Da});var Pa=I(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});var $m=require("vscode"),Ta=class extends $m.TypeHierarchyItem{constructor(e,t,n,r,o,a,c){super(e,t,n,r,o,a),c!==void 0&&(this.data=c)}};qa.default=Ta});var Fa=I(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});var Pr=require("vscode"),ka=class extends Pr.SymbolInformation{constructor(e,t,n,r,o){let a=!(r instanceof Pr.Uri);super(e,t,n,a?r:new Pr.Location(r,new Pr.Range(0,0,0,0))),this.hasRange=a,o!==void 0&&(this.data=o)}};xa.default=ka});var Ia=I(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});var Vm=require("vscode"),Ea=class extends Vm.InlayHint{constructor(e,t,n){super(e,t,n)}};Oa.default=Ea});var hl=I(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.createConverter=void 0;var Ue=require("vscode"),ee=X(),hi=Xt(),ll=Qi(),Bm=da(),Qm=ha(),Jm=ma(),Gm=Ca(),fl=Ra(),Xm=Sa(),Ym=Pa(),Zm=Fa(),ey=Ia(),Na;(function(i){function e(t){let n=t;return n&&!!n.inserting&&!!n.replacing}i.is=e})(Na||(Na={}));function ty(i){let t=i||(l=>l.toString());function n(l){return t(l)}function r(l){return{uri:t(l.uri)}}function o(l){return{uri:t(l.uri),languageId:l.languageId,version:l.version,text:l.getText()}}function a(l){return{uri:t(l.uri),version:l.version}}function c(l){return{textDocument:o(l)}}function d(l){let q=l;return!!q.document&&!!q.contentChanges}function h(l){let q=l;return!!q.uri&&!!q.version}function m(l){if(h(l))return{textDocument:{uri:t(l.uri),version:l.version},contentChanges:[{text:l.getText()}]};if(d(l)){let q=l.document;return{textDocument:{uri:t(q.uri),version:q.version},contentChanges:l.contentChanges.map(ne=>{let D=ne.range;return{range:{start:{line:D.start.line,character:D.start.character},end:{line:D.end.line,character:D.end.character}},rangeLength:ne.rangeLength,text:ne.text}})}}else throw Error("Unsupported text document change parameter")}function R(l){return{textDocument:r(l)}}function _(l,q=!1){let A={textDocument:r(l)};return q&&(A.text=l.getText()),A}function T(l){switch(l){case Ue.TextDocumentSaveReason.Manual:return ee.TextDocumentSaveReason.Manual;case Ue.TextDocumentSaveReason.AfterDelay:return ee.TextDocumentSaveReason.AfterDelay;case Ue.TextDocumentSaveReason.FocusOut:return ee.TextDocumentSaveReason.FocusOut}return ee.TextDocumentSaveReason.Manual}function y(l){return{textDocument:r(l.document),reason:T(l.reason)}}function P(l){return{files:l.files.map(q=>({uri:t(q)}))}}function O(l){return{files:l.files.map(q=>({oldUri:t(q.oldUri),newUri:t(q.newUri)}))}}function L(l){return{files:l.files.map(q=>({uri:t(q)}))}}function $(l){return{files:l.files.map(q=>({uri:t(q)}))}}function H(l){return{files:l.files.map(q=>({oldUri:t(q.oldUri),newUri:t(q.newUri)}))}}function G(l){return{files:l.files.map(q=>({uri:t(q)}))}}function z(l,q){return{textDocument:r(l),position:Ge(q)}}function Re(l){switch(l){case Ue.CompletionTriggerKind.TriggerCharacter:return ee.CompletionTriggerKind.TriggerCharacter;case Ue.CompletionTriggerKind.TriggerForIncompleteCompletions:return ee.CompletionTriggerKind.TriggerForIncompleteCompletions;default:return ee.CompletionTriggerKind.Invoked}}function te(l,q,A){return{textDocument:r(l),position:Ge(q),context:{triggerKind:Re(A.triggerKind),triggerCharacter:A.triggerCharacter}}}function Ie(l){switch(l){case Ue.SignatureHelpTriggerKind.Invoke:return ee.SignatureHelpTriggerKind.Invoked;case Ue.SignatureHelpTriggerKind.TriggerCharacter:return ee.SignatureHelpTriggerKind.TriggerCharacter;case Ue.SignatureHelpTriggerKind.ContentChange:return ee.SignatureHelpTriggerKind.ContentChange}}function Me(l){return{label:l.label}}function Be(l){return l.map(Me)}function ut(l){return{label:l.label,parameters:Be(l.parameters)}}function it(l){return l.map(ut)}function dt(l){return l===void 0?l:{signatures:it(l.signatures),activeSignature:l.activeSignature,activeParameter:l.activeParameter}}function lt(l,q,A){return{textDocument:r(l),position:Ge(q),context:{isRetrigger:A.isRetrigger,triggerCharacter:A.triggerCharacter,triggerKind:Ie(A.triggerKind),activeSignatureHelp:dt(A.activeSignatureHelp)}}}function Ge(l){return{line:l.line,character:l.character}}function rt(l){return l==null?l:{line:l.line>ee.uinteger.MAX_VALUE?ee.uinteger.MAX_VALUE:l.line,character:l.character>ee.uinteger.MAX_VALUE?ee.uinteger.MAX_VALUE:l.character}}function un(l,q){return ll.map(l,rt,q)}function ke(l){return l==null?l:{start:rt(l.start),end:rt(l.end)}}function ze(l){return l==null?l:ee.Location.create(n(l.uri),ke(l.range))}function Xe(l){switch(l){case Ue.DiagnosticSeverity.Error:return ee.DiagnosticSeverity.Error;case Ue.DiagnosticSeverity.Warning:return ee.DiagnosticSeverity.Warning;case Ue.DiagnosticSeverity.Information:return ee.DiagnosticSeverity.Information;case Ue.DiagnosticSeverity.Hint:return ee.DiagnosticSeverity.Hint}}function Dt(l){if(!l)return;let q=[];for(let A of l){let ne=je(A);ne!==void 0&&q.push(ne)}return q.length>0?q:void 0}function je(l){switch(l){case Ue.DiagnosticTag.Unnecessary:return ee.DiagnosticTag.Unnecessary;case Ue.DiagnosticTag.Deprecated:return ee.DiagnosticTag.Deprecated;default:return}}function jn(l){return{message:l.message,location:ze(l.location)}}function Sn(l){return l.map(jn)}function Tn(l){if(l!=null)return hi.number(l)||hi.string(l)?l:{value:l.value,target:n(l.target)}}function dn(l){let q=ee.Diagnostic.create(ke(l.range),l.message),A=l instanceof fl.ProtocolDiagnostic?l:void 0;A!==void 0&&A.data!==void 0&&(q.data=A.data);let ne=Tn(l.code);return fl.DiagnosticCode.is(ne)?A!==void 0&&A.hasDiagnosticCode?q.code=ne:(q.code=ne.value,q.codeDescription={href:ne.target}):q.code=ne,hi.number(l.severity)&&(q.severity=Xe(l.severity)),Array.isArray(l.tags)&&(q.tags=Dt(l.tags)),l.relatedInformation&&(q.relatedInformation=Sn(l.relatedInformation)),l.source&&(q.source=l.source),q}function ln(l,q){return l==null?l:ll.map(l,dn,q)}function An(l,q){switch(l){case"$string":return q;case ee.MarkupKind.PlainText:return{kind:l,value:q};case ee.MarkupKind.Markdown:return{kind:l,value:q.value};default:return`Unsupported Markup content received. Kind is: ${l}`}}function qn(l){switch(l){case Ue.CompletionItemTag.Deprecated:return ee.CompletionItemTag.Deprecated}}function Pn(l){if(l===void 0)return l;let q=[];for(let A of l){let ne=qn(A);ne!==void 0&&q.push(ne)}return q}function ot(l,q){return q!==void 0?q:l+1}function Ot(l,q=!1){let A,ne;hi.string(l.label)?A=l.label:(A=l.label.label,q&&(l.label.detail!==void 0||l.label.description!==void 0)&&(ne={detail:l.label.detail,description:l.label.description}));let D={label:A};ne!==void 0&&(D.labelDetails=ne);let f=l instanceof Bm.default?l:void 0;l.detail&&(D.detail=l.detail),l.documentation&&(!f||f.documentationFormat==="$string"?D.documentation=l.documentation:D.documentation=An(f.documentationFormat,l.documentation)),l.filterText&&(D.filterText=l.filterText),kn(D,l),hi.number(l.kind)&&(D.kind=ot(l.kind,f&&f.originalItemKind)),l.sortText&&(D.sortText=l.sortText),l.additionalTextEdits&&(D.additionalTextEdits=en(l.additionalTextEdits)),l.commitCharacters&&(D.commitCharacters=l.commitCharacters.slice()),l.command&&(D.command=qt(l.command)),(l.preselect===!0||l.preselect===!1)&&(D.preselect=l.preselect);let C=Pn(l.tags);if(f){if(f.data!==void 0&&(D.data=f.data),f.deprecated===!0||f.deprecated===!1){if(f.deprecated===!0&&C!==void 0&&C.length>0){let b=C.indexOf(Ue.CompletionItemTag.Deprecated);b!==-1&&C.splice(b,1)}D.deprecated=f.deprecated}f.insertTextMode!==void 0&&(D.insertTextMode=f.insertTextMode)}return C!==void 0&&C.length>0&&(D.tags=C),D.insertTextMode===void 0&&l.keepWhitespace===!0&&(D.insertTextMode=ee.InsertTextMode.adjustIndentation),D}function kn(l,q){let A=ee.InsertTextFormat.PlainText,ne,D;q.textEdit?(ne=q.textEdit.newText,D=q.textEdit.range):q.insertText instanceof Ue.SnippetString?(A=ee.InsertTextFormat.Snippet,ne=q.insertText.value):ne=q.insertText,q.range&&(D=q.range),l.insertTextFormat=A,q.fromEdit&&ne!==void 0&&D!==void 0?l.textEdit=wt(ne,D):l.insertText=ne}function wt(l,q){return Na.is(q)?ee.InsertReplaceEdit.create(l,ke(q.inserting),ke(q.replacing)):{newText:l,range:ke(q)}}function fn(l){return{range:ke(l.range),newText:l.newText}}function en(l){return l==null?l:l.map(fn)}function St(l){return l<=Ue.SymbolKind.TypeParameter?l+1:ee.SymbolKind.Property}function yt(l){return l}function Ae(l){return l.map(yt)}function Hn(l,q,A){return{textDocument:r(l),position:Ge(q),context:{includeDeclaration:A.includeDeclaration}}}async function ft(l,q){let A=ee.CodeAction.create(l.title);if(l instanceof Gm.default&&l.data!==void 0&&(A.data=l.data),l.kind!==void 0&&(A.kind=hn(l.kind)),l.diagnostics!==void 0&&(A.diagnostics=await ln(l.diagnostics,q)),l.edit!==void 0)throw new Error("VS Code code actions can only be converted to a protocol code action without an edit.");return l.command!==void 0&&(A.command=qt(l.command)),l.isPreferred!==void 0&&(A.isPreferred=l.isPreferred),l.disabled!==void 0&&(A.disabled={reason:l.disabled.reason}),A}async function Tt(l,q){if(l==null)return l;let A;return l.only&&hi.string(l.only.value)&&(A=[l.only.value]),ee.CodeActionContext.create(await ln(l.diagnostics,q),A,tn(l.triggerKind))}function tn(l){switch(l){case Ue.CodeActionTriggerKind.Invoke:return ee.CodeActionTriggerKind.Invoked;case Ue.CodeActionTriggerKind.Automatic:return ee.CodeActionTriggerKind.Automatic;default:return}}function hn(l){if(l!=null)return l.value}function gn(l){return l==null?l:ee.InlineValueContext.create(l.frameId,ke(l.stoppedLocation))}function qt(l){let q=ee.Command.create(l.title,l.command);return l.arguments&&(q.arguments=l.arguments),q}function It(l){let q=ee.CodeLens.create(ke(l.range));return l.command&&(q.command=qt(l.command)),l instanceof Qm.default&&l.data&&(q.data=l.data),q}function v(l,q){let A={tabSize:l.tabSize,insertSpaces:l.insertSpaces};return q.trimTrailingWhitespace&&(A.trimTrailingWhitespace=!0),q.trimFinalNewlines&&(A.trimFinalNewlines=!0),q.insertFinalNewline&&(A.insertFinalNewline=!0),A}function k(l){return{textDocument:r(l)}}function N(l){return{textDocument:r(l)}}function W(l){let q=ee.DocumentLink.create(ke(l.range));l.target&&(q.target=n(l.target)),l.tooltip!==void 0&&(q.tooltip=l.tooltip);let A=l instanceof Jm.default?l:void 0;return A&&A.data&&(q.data=A.data),q}function le(l){return{textDocument:r(l)}}function fe(l){let q={name:l.name,kind:St(l.kind),uri:n(l.uri),range:ke(l.range),selectionRange:ke(l.selectionRange)};return l.detail!==void 0&&l.detail.length>0&&(q.detail=l.detail),l.tags!==void 0&&(q.tags=Ae(l.tags)),l instanceof Xm.default&&l.data!==void 0&&(q.data=l.data),q}function _e(l){let q={name:l.name,kind:St(l.kind),uri:n(l.uri),range:ke(l.range),selectionRange:ke(l.selectionRange)};return l.detail!==void 0&&l.detail.length>0&&(q.detail=l.detail),l.tags!==void 0&&(q.tags=Ae(l.tags)),l instanceof Ym.default&&l.data!==void 0&&(q.data=l.data),q}function Se(l){let q=l instanceof Zm.default?{name:l.name,kind:St(l.kind),location:l.hasRange?ze(l.location):{uri:t(l.location.uri)},data:l.data}:{name:l.name,kind:St(l.kind),location:ze(l.location)};return l.tags!==void 0&&(q.tags=Ae(l.tags)),l.containerName!==""&&(q.containerName=l.containerName),q}function re(l){let q=typeof l.label=="string"?l.label:l.label.map(ge),A=ee.InlayHint.create(rt(l.position),q);return l.kind!==void 0&&(A.kind=l.kind),l.textEdits!==void 0&&(A.textEdits=en(l.textEdits)),l.tooltip!==void 0&&(A.tooltip=oe(l.tooltip)),l.paddingLeft!==void 0&&(A.paddingLeft=l.paddingLeft),l.paddingRight!==void 0&&(A.paddingRight=l.paddingRight),l instanceof ey.default&&l.data!==void 0&&(A.data=l.data),A}function ge(l){let q=ee.InlayHintLabelPart.create(l.value);return l.location!==void 0&&(q.location=ze(l.location)),l.command!==void 0&&(q.command=qt(l.command)),l.tooltip!==void 0&&(q.tooltip=oe(l.tooltip)),q}function oe(l){return typeof l=="string"?l:{kind:ee.MarkupKind.Markdown,value:l.value}}return{asUri:n,asTextDocumentIdentifier:r,asTextDocumentItem:o,asVersionedTextDocumentIdentifier:a,asOpenTextDocumentParams:c,asChangeTextDocumentParams:m,asCloseTextDocumentParams:R,asSaveTextDocumentParams:_,asWillSaveTextDocumentParams:y,asDidCreateFilesParams:P,asDidRenameFilesParams:O,asDidDeleteFilesParams:L,asWillCreateFilesParams:$,asWillRenameFilesParams:H,asWillDeleteFilesParams:G,asTextDocumentPositionParams:z,asCompletionParams:te,asSignatureHelpParams:lt,asWorkerPosition:Ge,asRange:ke,asPosition:rt,asPositions:un,asLocation:ze,asDiagnosticSeverity:Xe,asDiagnosticTag:je,asDiagnostic:dn,asDiagnostics:ln,asCompletionItem:Ot,asTextEdit:fn,asSymbolKind:St,asSymbolTag:yt,asSymbolTags:Ae,asReferenceParams:Hn,asCodeAction:ft,asCodeActionContext:Tt,asInlineValueContext:gn,asCommand:qt,asCodeLens:It,asFormattingOptions:v,asDocumentSymbolParams:k,asCodeLensParams:N,asDocumentLink:W,asDocumentLinkParams:le,asCallHierarchyItem:fe,asTypeHierarchyItem:_e,asInlayHint:re,asWorkspaceSymbol:Se}}kr.createConverter=ty});var ml=I(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.createConverter=void 0;var j=require("vscode"),B=X(),jt=Xt(),pe=Qi(),ny=da(),iy=ha(),ry=ma(),oy=Ca(),gl=Ra(),sy=Sa(),ay=Pa(),cy=Fa(),uy=Ia(),pl=X(),xr;(function(i){function e(t){let n=t;return n&&jt.string(n.language)&&jt.string(n.value)}i.is=e})(xr||(xr={}));function dy(i,e,t){let r=i||(s=>j.Uri.parse(s));function o(s){return r(s)}function a(s){let w=[];for(let E of s)if(typeof E=="string")w.push(E);else if(pl.NotebookCellTextDocumentFilter.is(E))if(typeof E.notebook=="string")w.push({notebookType:E.notebook,language:E.language});else{let U=E.notebook.notebookType??"*";w.push({notebookType:U,scheme:E.notebook.scheme,pattern:E.notebook.pattern,language:E.language})}else pl.TextDocumentFilter.is(E)&&w.push({language:E.language,scheme:E.scheme,pattern:E.pattern});return w}async function c(s,w){return pe.map(s,h,w)}function d(s){let w=new Array(s.length);for(let E=0;E<s.length;E++)w[E]=h(s[E]);return w}function h(s){let w=new gl.ProtocolDiagnostic(y(s.range),s.message,O(s.severity),s.data);if(s.code!==void 0){if(typeof s.code=="string"||typeof s.code=="number")B.CodeDescription.is(s.codeDescription)?w.code={value:s.code,target:o(s.codeDescription.href)}:w.code=s.code;else if(gl.DiagnosticCode.is(s.code)){w.hasDiagnosticCode=!0;let E=s.code;w.code={value:E.value,target:o(E.target)}}}return s.source&&(w.source=s.source),s.relatedInformation&&(w.relatedInformation=m(s.relatedInformation)),Array.isArray(s.tags)&&(w.tags=R(s.tags)),w}function m(s){let w=new Array(s.length);for(let E=0;E<s.length;E++){let U=s[E];w[E]=new j.DiagnosticRelatedInformation(je(U.location),U.message)}return w}function R(s){if(!s)return;let w=[];for(let E of s){let U=_(E);U!==void 0&&w.push(U)}return w.length>0?w:void 0}function _(s){switch(s){case B.DiagnosticTag.Unnecessary:return j.DiagnosticTag.Unnecessary;case B.DiagnosticTag.Deprecated:return j.DiagnosticTag.Deprecated;default:return}}function T(s){return s?new j.Position(s.line,s.character):void 0}function y(s){return s?new j.Range(s.start.line,s.start.character,s.end.line,s.end.character):void 0}async function P(s,w){return pe.map(s,E=>new j.Range(E.start.line,E.start.character,E.end.line,E.end.character),w)}function O(s){if(s==null)return j.DiagnosticSeverity.Error;switch(s){case B.DiagnosticSeverity.Error:return j.DiagnosticSeverity.Error;case B.DiagnosticSeverity.Warning:return j.DiagnosticSeverity.Warning;case B.DiagnosticSeverity.Information:return j.DiagnosticSeverity.Information;case B.DiagnosticSeverity.Hint:return j.DiagnosticSeverity.Hint}return j.DiagnosticSeverity.Error}function L(s){if(jt.string(s))return H(s);if(xr.is(s))return H().appendCodeblock(s.value,s.language);if(Array.isArray(s)){let w=[];for(let E of s){let U=H();xr.is(E)?U.appendCodeblock(E.value,E.language):U.appendMarkdown(E),w.push(U)}return w}else return H(s)}function $(s){if(jt.string(s))return s;switch(s.kind){case B.MarkupKind.Markdown:return H(s.value);case B.MarkupKind.PlainText:return s.value;default:return`Unsupported Markup content received. Kind is: ${s.kind}`}}function H(s){let w;if(s===void 0||typeof s=="string")w=new j.MarkdownString(s);else switch(s.kind){case B.MarkupKind.Markdown:w=new j.MarkdownString(s.value);break;case B.MarkupKind.PlainText:w=new j.MarkdownString,w.appendText(s.value);break;default:w=new j.MarkdownString,w.appendText(`Unsupported Markup content received. Kind is: ${s.kind}`);break}return w.isTrusted=e,w.supportHtml=t,w}function G(s){if(!!s)return new j.Hover(L(s.contents),y(s.range))}async function z(s,w,E){if(!s)return;if(Array.isArray(s))return pe.map(s,nn=>Be(nn,w),E);let U=s,{defaultRange:Ct,commitCharacters:Ye}=Re(U,w),ye=await pe.map(U.items,nn=>Be(nn,Ye,Ct,U.itemDefaults?.insertTextMode,U.itemDefaults?.insertTextFormat,U.itemDefaults?.data),E);return new j.CompletionList(ye,U.isIncomplete)}function Re(s,w){let E=s.itemDefaults?.editRange,U=s.itemDefaults?.commitCharacters??w;return B.Range.is(E)?{defaultRange:y(E),commitCharacters:U}:E!==void 0?{defaultRange:{inserting:y(E.insert),replacing:y(E.replace)},commitCharacters:U}:{defaultRange:void 0,commitCharacters:U}}function te(s){return B.CompletionItemKind.Text<=s&&s<=B.CompletionItemKind.TypeParameter?[s-1,void 0]:[j.CompletionItemKind.Text,s]}function Ie(s){switch(s){case B.CompletionItemTag.Deprecated:return j.CompletionItemTag.Deprecated}}function Me(s){if(s==null)return[];let w=[];for(let E of s){let U=Ie(E);U!==void 0&&w.push(U)}return w}function Be(s,w,E,U,Ct,Ye){let ye=Me(s.tags),nn=ut(s),De=new ny.default(nn);s.detail&&(De.detail=s.detail),s.documentation&&(De.documentation=$(s.documentation),De.documentationFormat=jt.string(s.documentation)?"$string":s.documentation.kind),s.filterText&&(De.filterText=s.filterText);let dr=it(s,E,Ct);if(dr&&(De.insertText=dr.text,De.range=dr.range,De.fromEdit=dr.fromEdit),jt.number(s.kind)){let[xf,Ru]=te(s.kind);De.kind=xf,Ru&&(De.originalItemKind=Ru)}s.sortText&&(De.sortText=s.sortText),s.additionalTextEdits&&(De.additionalTextEdits=rt(s.additionalTextEdits));let _u=s.commitCharacters!==void 0?jt.stringArray(s.commitCharacters)?s.commitCharacters:void 0:w;_u&&(De.commitCharacters=_u.slice()),s.command&&(De.command=Ae(s.command)),(s.deprecated===!0||s.deprecated===!1)&&(De.deprecated=s.deprecated,s.deprecated===!0&&ye.push(j.CompletionItemTag.Deprecated)),(s.preselect===!0||s.preselect===!1)&&(De.preselect=s.preselect);let bu=s.data??Ye;bu!==void 0&&(De.data=bu),ye.length>0&&(De.tags=ye);let Co=s.insertTextMode??U;return Co!==void 0&&(De.insertTextMode=Co,Co===B.InsertTextMode.asIs&&(De.keepWhitespace=!0)),De}function ut(s){return B.CompletionItemLabelDetails.is(s.labelDetails)?{label:s.label,detail:s.labelDetails.detail,description:s.labelDetails.description}:s.label}function it(s,w,E){let U=s.insertTextFormat??E;if(s.textEdit!==void 0||w!==void 0){let[Ct,Ye]=s.textEdit!==void 0?dt(s.textEdit):[w,s.textEditText??s.label];return U===B.InsertTextFormat.Snippet?{text:new j.SnippetString(Ye),range:Ct,fromEdit:!0}:{text:Ye,range:Ct,fromEdit:!0}}else return s.insertText?U===B.InsertTextFormat.Snippet?{text:new j.SnippetString(s.insertText),fromEdit:!1}:{text:s.insertText,fromEdit:!1}:void 0}function dt(s){return B.InsertReplaceEdit.is(s)?[{inserting:y(s.insert),replacing:y(s.replace)},s.newText]:[y(s.range),s.newText]}function lt(s){if(!!s)return new j.TextEdit(y(s.range),s.newText)}async function Ge(s,w){if(!!s)return pe.map(s,lt,w)}function rt(s){if(!s)return;let w=new Array(s.length);for(let E=0;E<s.length;E++)w[E]=lt(s[E]);return w}async function un(s,w){if(!s)return;let E=new j.SignatureHelp;return jt.number(s.activeSignature)?E.activeSignature=s.activeSignature:E.activeSignature=0,jt.number(s.activeParameter)?E.activeParameter=s.activeParameter:E.activeParameter=0,s.signatures&&(E.signatures=await ke(s.signatures,w)),E}async function ke(s,w){return pe.mapAsync(s,ze,w)}async function ze(s,w){let E=new j.SignatureInformation(s.label);return s.documentation!==void 0&&(E.documentation=$(s.documentation)),s.parameters!==void 0&&(E.parameters=await Xe(s.parameters,w)),s.activeParameter!==void 0&&(E.activeParameter=s.activeParameter),E}function Xe(s,w){return pe.map(s,Dt,w)}function Dt(s){let w=new j.ParameterInformation(s.label);return s.documentation&&(w.documentation=$(s.documentation)),w}function je(s){return s?new j.Location(r(s.uri),y(s.range)):void 0}async function jn(s,w){if(!!s)return dn(s,w)}async function Sn(s,w){if(!!s)return dn(s,w)}function Tn(s){if(!s)return;let w={targetUri:r(s.targetUri),targetRange:y(s.targetRange),originSelectionRange:y(s.originSelectionRange),targetSelectionRange:y(s.targetSelectionRange)};if(!w.targetSelectionRange)throw new Error("targetSelectionRange must not be undefined or null");return w}async function dn(s,w){if(!!s)if(jt.array(s)){if(s.length===0)return[];if(B.LocationLink.is(s[0])){let E=s;return pe.map(E,Tn,w)}else{let E=s;return pe.map(E,je,w)}}else return B.LocationLink.is(s)?[Tn(s)]:je(s)}async function ln(s,w){if(!!s)return pe.map(s,je,w)}async function An(s,w){if(!!s)return pe.map(s,qn,w)}function qn(s){let w=new j.DocumentHighlight(y(s.range));return jt.number(s.kind)&&(w.kind=Pn(s.kind)),w}function Pn(s){switch(s){case B.DocumentHighlightKind.Text:return j.DocumentHighlightKind.Text;case B.DocumentHighlightKind.Read:return j.DocumentHighlightKind.Read;case B.DocumentHighlightKind.Write:return j.DocumentHighlightKind.Write}return j.DocumentHighlightKind.Text}async function ot(s,w){if(!!s)return pe.map(s,fn,w)}function Ot(s){return s<=B.SymbolKind.TypeParameter?s-1:j.SymbolKind.Property}function kn(s){switch(s){case B.SymbolTag.Deprecated:return j.SymbolTag.Deprecated;default:return}}function wt(s){if(s==null)return;let w=[];for(let E of s){let U=kn(E);U!==void 0&&w.push(U)}return w.length===0?void 0:w}function fn(s){let w=s.data,E=s.location,U=E.range===void 0||w!==void 0?new cy.default(s.name,Ot(s.kind),s.containerName??"",E.range===void 0?r(E.uri):new j.Location(r(s.location.uri),y(E.range)),w):new j.SymbolInformation(s.name,Ot(s.kind),s.containerName??"",new j.Location(r(s.location.uri),y(E.range)));return yt(U,s),U}async function en(s,w){if(s!=null)return pe.map(s,St,w)}function St(s){let w=new j.DocumentSymbol(s.name,s.detail||"",Ot(s.kind),y(s.range),y(s.selectionRange));if(yt(w,s),s.children!==void 0&&s.children.length>0){let E=[];for(let U of s.children)E.push(St(U));w.children=E}return w}function yt(s,w){s.tags=wt(w.tags),w.deprecated&&(s.tags?s.tags.includes(j.SymbolTag.Deprecated)||(s.tags=s.tags.concat(j.SymbolTag.Deprecated)):s.tags=[j.SymbolTag.Deprecated])}function Ae(s){let w={title:s.title,command:s.command};return s.arguments&&(w.arguments=s.arguments),w}async function Hn(s,w){if(!!s)return pe.map(s,Ae,w)}let ft=new Map;ft.set(B.CodeActionKind.Empty,j.CodeActionKind.Empty),ft.set(B.CodeActionKind.QuickFix,j.CodeActionKind.QuickFix),ft.set(B.CodeActionKind.Refactor,j.CodeActionKind.Refactor),ft.set(B.CodeActionKind.RefactorExtract,j.CodeActionKind.RefactorExtract),ft.set(B.CodeActionKind.RefactorInline,j.CodeActionKind.RefactorInline),ft.set(B.CodeActionKind.RefactorRewrite,j.CodeActionKind.RefactorRewrite),ft.set(B.CodeActionKind.Source,j.CodeActionKind.Source),ft.set(B.CodeActionKind.SourceOrganizeImports,j.CodeActionKind.SourceOrganizeImports);function Tt(s){if(s==null)return;let w=ft.get(s);if(w)return w;let E=s.split(".");w=j.CodeActionKind.Empty;for(let U of E)w=w.append(U);return w}function tn(s){if(s!=null)return s.map(w=>Tt(w))}async function hn(s,w){if(s==null)return;let E=new oy.default(s.title,s.data);return s.kind!==void 0&&(E.kind=Tt(s.kind)),s.diagnostics!==void 0&&(E.diagnostics=d(s.diagnostics)),s.edit!==void 0&&(E.edit=await v(s.edit,w)),s.command!==void 0&&(E.command=Ae(s.command)),s.isPreferred!==void 0&&(E.isPreferred=s.isPreferred),s.disabled!==void 0&&(E.disabled={reason:s.disabled.reason}),E}function gn(s,w){return pe.mapAsync(s,async E=>B.Command.is(E)?Ae(E):hn(E,w),w)}function qt(s){if(!s)return;let w=new iy.default(y(s.range));return s.command&&(w.command=Ae(s.command)),s.data!==void 0&&s.data!==null&&(w.data=s.data),w}async function It(s,w){if(!!s)return pe.map(s,qt,w)}async function v(s,w){if(!s)return;let E=new Map;if(s.changeAnnotations!==void 0){let Ye=s.changeAnnotations;await pe.forEach(Object.keys(Ye),ye=>{let nn=k(Ye[ye]);E.set(ye,nn)},w)}let U=Ye=>{if(Ye!==void 0)return E.get(Ye)},Ct=new j.WorkspaceEdit;if(s.documentChanges){let Ye=s.documentChanges;await pe.forEach(Ye,ye=>{if(B.CreateFile.is(ye))Ct.createFile(r(ye.uri),ye.options,U(ye.annotationId));else if(B.RenameFile.is(ye))Ct.renameFile(r(ye.oldUri),r(ye.newUri),ye.options,U(ye.annotationId));else if(B.DeleteFile.is(ye))Ct.deleteFile(r(ye.uri),ye.options,U(ye.annotationId));else if(B.TextDocumentEdit.is(ye)){let nn=r(ye.textDocument.uri);for(let De of ye.edits)B.AnnotatedTextEdit.is(De)?Ct.replace(nn,y(De.range),De.newText,U(De.annotationId)):Ct.replace(nn,y(De.range),De.newText)}else throw new Error(`Unknown workspace edit change received:
37
37
  ${JSON.stringify(ye,void 0,4)}`)},w)}else if(s.changes){let Ye=s.changes;await pe.forEach(Object.keys(Ye),ye=>{Ct.set(r(ye),rt(Ye[ye]))},w)}return Ct}function k(s){if(s!==void 0)return{label:s.label,needsConfirmation:!!s.needsConfirmation,description:s.description}}function N(s){let w=y(s.range),E=s.target?o(s.target):void 0,U=new ry.default(w,E);return s.tooltip!==void 0&&(U.tooltip=s.tooltip),s.data!==void 0&&s.data!==null&&(U.data=s.data),U}async function W(s,w){if(!!s)return pe.map(s,N,w)}function le(s){return new j.Color(s.red,s.green,s.blue,s.alpha)}function fe(s){return new j.ColorInformation(y(s.range),le(s.color))}async function _e(s,w){if(!!s)return pe.map(s,fe,w)}function Se(s){let w=new j.ColorPresentation(s.label);return w.additionalTextEdits=rt(s.additionalTextEdits),s.textEdit&&(w.textEdit=lt(s.textEdit)),w}async function re(s,w){if(!!s)return pe.map(s,Se,w)}function ge(s){if(s)switch(s){case B.FoldingRangeKind.Comment:return j.FoldingRangeKind.Comment;case B.FoldingRangeKind.Imports:return j.FoldingRangeKind.Imports;case B.FoldingRangeKind.Region:return j.FoldingRangeKind.Region}}function oe(s){return new j.FoldingRange(s.startLine,s.endLine,ge(s.kind))}async function l(s,w){if(!!s)return pe.map(s,oe,w)}function q(s){return new j.SelectionRange(y(s.range),s.parent?q(s.parent):void 0)}async function A(s,w){return Array.isArray(s)?pe.map(s,q,w):[]}function ne(s){return B.InlineValueText.is(s)?new j.InlineValueText(y(s.range),s.text):B.InlineValueVariableLookup.is(s)?new j.InlineValueVariableLookup(y(s.range),s.variableName,s.caseSensitiveLookup):new j.InlineValueEvaluatableExpression(y(s.range),s.expression)}async function D(s,w){return Array.isArray(s)?pe.map(s,ne,w):[]}async function f(s,w){let E=typeof s.label=="string"?s.label:await pe.map(s.label,C,w),U=new uy.default(T(s.position),E);return s.kind!==void 0&&(U.kind=s.kind),s.textEdits!==void 0&&(U.textEdits=await Ge(s.textEdits,w)),s.tooltip!==void 0&&(U.tooltip=b(s.tooltip)),s.paddingLeft!==void 0&&(U.paddingLeft=s.paddingLeft),s.paddingRight!==void 0&&(U.paddingRight=s.paddingRight),s.data!==void 0&&(U.data=s.data),U}function C(s){let w=new j.InlayHintLabelPart(s.value);return s.location!==void 0&&(w.location=je(s.location)),s.tooltip!==void 0&&(w.tooltip=b(s.tooltip)),s.command!==void 0&&(w.command=Ae(s.command)),w}function b(s){return typeof s=="string"?s:H(s)}async function p(s,w){if(!!Array.isArray(s))return pe.mapAsync(s,f,w)}function u(s){if(s===null)return;let w=new sy.default(Ot(s.kind),s.name,s.detail||"",o(s.uri),y(s.range),y(s.selectionRange),s.data);return s.tags!==void 0&&(w.tags=wt(s.tags)),w}async function S(s,w){if(s!==null)return pe.map(s,u,w)}async function x(s,w){return new j.CallHierarchyIncomingCall(u(s.from),await P(s.fromRanges,w))}async function J(s,w){if(s!==null)return pe.mapAsync(s,x,w)}async function Te(s,w){return new j.CallHierarchyOutgoingCall(u(s.to),await P(s.fromRanges,w))}async function be(s,w){if(s!==null)return pe.mapAsync(s,Te,w)}async function Pt(s,w){if(s!=null)return new j.SemanticTokens(new Uint32Array(s.data),s.resultId)}function vt(s){return new j.SemanticTokensEdit(s.start,s.deleteCount,s.data!==void 0?new Uint32Array(s.data):void 0)}async function Kt(s,w){if(s!=null)return new j.SemanticTokensEdits(s.edits.map(vt),s.resultId)}function se(s){return s}async function xn(s,w){if(s!=null)return new j.LinkedEditingRanges(await P(s.ranges,w),ni(s.wordPattern))}function ni(s){if(s!=null)return new RegExp(s)}function wi(s){if(s===null)return;let w=new ay.default(Ot(s.kind),s.name,s.detail||"",o(s.uri),y(s.range),y(s.selectionRange),s.data);return s.tags!==void 0&&(w.tags=wt(s.tags)),w}async function Pf(s,w){if(s!==null)return pe.map(s,wi,w)}function kf(s){if(jt.string(s))return s;if(B.RelativePattern.is(s)){if(B.URI.is(s.baseUri))return new j.RelativePattern(o(s.baseUri),s.pattern);if(B.WorkspaceFolder.is(s.baseUri)){let w=j.workspace.getWorkspaceFolder(o(s.baseUri.uri));return w!==void 0?new j.RelativePattern(w,s.pattern):void 0}}}return{asUri:o,asDocumentSelector:a,asDiagnostics:c,asDiagnostic:h,asRange:y,asRanges:P,asPosition:T,asDiagnosticSeverity:O,asDiagnosticTag:_,asHover:G,asCompletionResult:z,asCompletionItem:Be,asTextEdit:lt,asTextEdits:Ge,asSignatureHelp:un,asSignatureInformations:ke,asSignatureInformation:ze,asParameterInformations:Xe,asParameterInformation:Dt,asDeclarationResult:jn,asDefinitionResult:Sn,asLocation:je,asReferences:ln,asDocumentHighlights:An,asDocumentHighlight:qn,asDocumentHighlightKind:Pn,asSymbolKind:Ot,asSymbolTag:kn,asSymbolTags:wt,asSymbolInformations:ot,asSymbolInformation:fn,asDocumentSymbols:en,asDocumentSymbol:St,asCommand:Ae,asCommands:Hn,asCodeAction:hn,asCodeActionKind:Tt,asCodeActionKinds:tn,asCodeActionResult:gn,asCodeLens:qt,asCodeLenses:It,asWorkspaceEdit:v,asDocumentLink:N,asDocumentLinks:W,asFoldingRangeKind:ge,asFoldingRange:oe,asFoldingRanges:l,asColor:le,asColorInformation:fe,asColorInformations:_e,asColorPresentation:Se,asColorPresentations:re,asSelectionRange:q,asSelectionRanges:A,asInlineValue:ne,asInlineValues:D,asInlayHint:f,asInlayHints:p,asSemanticTokensLegend:se,asSemanticTokens:Pt,asSemanticTokensEdit:vt,asSemanticTokensEdits:Kt,asCallHierarchyItem:u,asCallHierarchyItems:S,asCallHierarchyIncomingCall:x,asCallHierarchyIncomingCalls:J,asCallHierarchyOutgoingCall:Te,asCallHierarchyOutgoingCalls:be,asLinkedEditingRanges:xn,asTypeHierarchyItem:wi,asTypeHierarchyItems:Pf,asGlobPattern:kf}}Fr.createConverter=dy});var Ma=I(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.ProgressPart=void 0;var yl=require("vscode"),vl=X(),Cl=Xt(),La=class{constructor(e,t,n){this._client=e,this._token=t,this._reported=0,this._infinite=!1,this._lspProgressDisposable=this._client.onProgress(vl.WorkDoneProgress.type,this._token,r=>{switch(r.kind){case"begin":this.begin(r);break;case"report":this.report(r);break;case"end":this.done(),n&&n(this);break}})}begin(e){this._infinite=e.percentage===void 0,this._lspProgressDisposable!==void 0&&yl.window.withProgress({location:yl.ProgressLocation.Window,cancellable:e.cancellable,title:e.title},async(t,n)=>{if(this._lspProgressDisposable!==void 0)return this._progress=t,this._cancellationToken=n,this._tokenDisposable=this._cancellationToken.onCancellationRequested(()=>{this._client.sendNotification(vl.WorkDoneProgressCancelNotification.type,{token:this._token})}),this.report(e),new Promise((r,o)=>{this._resolve=r,this._reject=o})})}report(e){if(this._infinite&&Cl.string(e.message))this._progress!==void 0&&this._progress.report({message:e.message});else if(Cl.number(e.percentage)){let t=Math.max(0,Math.min(e.percentage,100)),n=Math.max(0,t-this._reported);this._reported+=n,this._progress!==void 0&&this._progress.report({message:e.message,increment:n})}}cancel(){this.cleanup(),this._reject!==void 0&&(this._reject(),this._resolve=void 0,this._reject=void 0)}done(){this.cleanup(),this._resolve!==void 0&&(this._resolve(),this._resolve=void 0,this._reject=void 0)}cleanup(){this._lspProgressDisposable!==void 0&&(this._lspProgressDisposable.dispose(),this._lspProgressDisposable=void 0),this._tokenDisposable!==void 0&&(this._tokenDisposable.dispose(),this._tokenDisposable=void 0),this._progress=void 0,this._cancellationToken=void 0}};Er.ProgressPart=La});var Rl=I(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.NotebookDocumentSyncFeature=void 0;var ct=require("vscode"),ly=Tr(),Cn=X(),fy=Ee(),_l=Xt();function bl(i,e){return i[e]===void 0&&(i[e]={}),i[e]}var gi;(function(i){let e;(function(t){function n(_,T){return{version:_.version,uri:T.asUri(_.uri)}}t.asVersionedNotebookDocumentIdentifier=n;function r(_,T,y){let P=Cn.NotebookDocument.create(y.asUri(_.uri),_.notebookType,_.version,o(T,y));return Object.keys(_.metadata).length>0&&(P.metadata=a(_.metadata)),P}t.asNotebookDocument=r;function o(_,T){return _.map(y=>c(y,T))}t.asNotebookCells=o;function a(_){return h(new Set,_)}t.asMetadata=a;function c(_,T){let y=Cn.NotebookCell.create(d(_.kind),T.asUri(_.document.uri));return Object.keys(_.metadata).length>0&&(y.metadata=a(_.metadata)),_.executionSummary!==void 0&&_l.number(_.executionSummary.executionOrder)&&_l.boolean(_.executionSummary.success)&&(y.executionSummary={executionOrder:_.executionSummary.executionOrder,success:_.executionSummary.success}),y}t.asNotebookCell=c;function d(_){switch(_){case ct.NotebookCellKind.Markup:return Cn.NotebookCellKind.Markup;case ct.NotebookCellKind.Code:return Cn.NotebookCellKind.Code}}function h(_,T){if(_.has(T))throw new Error("Can't deep copy cyclic structures.");if(Array.isArray(T)){let y=[];for(let P of T)if(P!==null&&typeof P=="object"||Array.isArray(P))y.push(h(_,P));else{if(P instanceof RegExp)throw new Error("Can't transfer regular expressions to the server");y.push(P)}return y}else{let y=Object.keys(T),P=Object.create(null);for(let O of y){let L=T[O];if(L!==null&&typeof L=="object"||Array.isArray(L))P[O]=h(_,L);else{if(L instanceof RegExp)throw new Error("Can't transfer regular expressions to the server");P[O]=L}}return P}}function m(_,T){let y=T.asChangeTextDocumentParams(_);return{document:y.textDocument,changes:y.contentChanges}}t.asTextContentChange=m;function R(_,T){let y=Object.create(null);if(_.metadata&&(y.metadata=i.c2p.asMetadata(_.metadata)),_.cells!==void 0){let P=Object.create(null),O=_.cells;O.structure&&(P.structure={array:{start:O.structure.array.start,deleteCount:O.structure.array.deleteCount,cells:O.structure.array.cells!==void 0?O.structure.array.cells.map(L=>i.c2p.asNotebookCell(L,T)):void 0},didOpen:O.structure.didOpen!==void 0?O.structure.didOpen.map(L=>T.asOpenTextDocumentParams(L.document).textDocument):void 0,didClose:O.structure.didClose!==void 0?O.structure.didClose.map(L=>T.asCloseTextDocumentParams(L.document).textDocument):void 0}),O.data!==void 0&&(P.data=O.data.map(L=>i.c2p.asNotebookCell(L,T))),O.textContent!==void 0&&(P.textContent=O.textContent.map(L=>i.c2p.asTextContentChange(L,T))),Object.keys(P).length>0&&(y.cells=P)}return y}t.asNotebookDocumentChangeEvent=R})(e=i.c2p||(i.c2p={}))})(gi||(gi={}));var ja;(function(i){function e(c,d,h){let m=c.length,R=d.length,_=0;for(;_<R&&_<m&&t(c[_],d[_],h);)_++;if(_<R&&_<m){let T=m-1,y=R-1;for(;T>=0&&y>=0&&t(c[T],d[y],h);)T--,y--;let P=T+1-_,O=_===y+1?void 0:d.slice(_,y+1);return O!==void 0?{start:_,deleteCount:P,cells:O}:{start:_,deleteCount:P}}else return _<R?{start:_,deleteCount:0,cells:d.slice(_)}:_<m?{start:_,deleteCount:m-_}:void 0}i.computeDiff=e;function t(c,d,h=!0){return c.kind!==d.kind||c.document.uri.toString()!==d.document.uri.toString()||c.document.languageId!==d.document.languageId||!n(c.executionSummary,d.executionSummary)?!1:!h||h&&o(c.metadata,d.metadata)}function n(c,d){return c===d?!0:c===void 0||d===void 0?!1:c.executionOrder===d.executionOrder&&c.success===d.success&&r(c.timing,d.timing)}function r(c,d){return c===d?!0:c===void 0||d===void 0?!1:c.startTime===d.startTime&&c.endTime===d.endTime}function o(c,d){if(c===d)return!0;if(c==null||d===null||d===void 0||typeof c!=typeof d||typeof c!="object")return!1;let h=Array.isArray(c),m=Array.isArray(d);if(h!==m)return!1;if(h&&m){if(c.length!==d.length)return!1;for(let R=0;R<c.length;R++)if(!o(c[R],d[R]))return!1}if(a(c)&&a(d)){let R=Object.keys(c),_=Object.keys(d);if(R.length!==_.length||(R.sort(),_.sort(),!o(R,_)))return!1;for(let T=0;T<R.length;T++){let y=R[T];if(!o(c[y],d[y]))return!1}return!0}return!1}function a(c){return c!==null&&typeof c=="object"}i.isObjectLiteral=a})(ja||(ja={}));var Aa;(function(i){function e(t,n){if(typeof t=="string")return t==="*"||n.notebookType===t;if(t.notebookType!==void 0&&t.notebookType!=="*"&&n.notebookType!==t.notebookType)return!1;let r=n.uri;if(t.scheme!==void 0&&t.scheme!=="*"&&r.scheme!==t.scheme)return!1;if(t.pattern!==void 0){let o=new ly.Minimatch(t.pattern,{noext:!0});if(!o.makeRe()||!o.match(r.fsPath))return!1}return!0}i.matchNotebook=e})(Aa||(Aa={}));var Or;(function(i){function e(n){let r=n.notebookSelector,o=[];for(let a of r){let c=(typeof a.notebook=="string"?a.notebook:a.notebook?.notebookType)??"*",d=typeof a.notebook=="string"?void 0:a.notebook?.scheme,h=typeof a.notebook=="string"?void 0:a.notebook?.pattern;if(a.cells!==void 0)for(let m of a.cells)o.push(t(c,d,h,m.language));else o.push(t(c,d,h,void 0))}return o}i.asDocumentSelector=e;function t(n,r,o,a){return r===void 0&&o===void 0?{notebook:n,language:a}:{notebook:{notebookType:n,scheme:r,pattern:o},language:a}}})(Or||(Or={}));var Ir;(function(i){function e(t){return{cells:t,uris:new Set(t.map(n=>n.document.uri.toString()))}}i.create=e})(Ir||(Ir={}));var pi=class{constructor(e,t){this.client=e,this.options=t,this.notebookSyncInfo=new Map,this.notebookDidOpen=new Set,this.disposables=[],this.selector=e.protocol2CodeConverter.asDocumentSelector(Or.asDocumentSelector(t)),ct.workspace.onDidOpenNotebookDocument(n=>{this.notebookDidOpen.add(n.uri.toString()),this.didOpen(n)},void 0,this.disposables);for(let n of ct.workspace.notebookDocuments)this.notebookDidOpen.add(n.uri.toString()),this.didOpen(n);ct.workspace.onDidChangeNotebookDocument(n=>this.didChangeNotebookDocument(n),void 0,this.disposables),this.options.save===!0&&ct.workspace.onDidSaveNotebookDocument(n=>this.didSave(n),void 0,this.disposables),ct.workspace.onDidCloseNotebookDocument(n=>{this.didClose(n),this.notebookDidOpen.delete(n.uri.toString())},void 0,this.disposables)}getState(){for(let e of ct.workspace.notebookDocuments)if(this.getMatchingCells(e)!==void 0)return{kind:"document",id:"$internal",registrations:!0,matches:!0};return{kind:"document",id:"$internal",registrations:!0,matches:!1}}get mode(){return"notebook"}handles(e){return ct.languages.match(this.selector,e)>0}didOpenNotebookCellTextDocument(e,t){if(ct.languages.match(this.selector,t.document)===0||!this.notebookDidOpen.has(e.uri.toString()))return;let n=this.notebookSyncInfo.get(e.uri.toString()),r=this.cellMatches(e,t);if(n!==void 0){let o=n.uris.has(t.document.uri.toString());if(r&&o||!r&&!o)return;if(r){let a=this.getMatchingCells(e);if(a!==void 0){let c=this.asNotebookDocumentChangeEvent(e,void 0,n,a);c!==void 0&&this.doSendChange(c,a).catch(()=>{})}}}else r&&this.doSendOpen(e,[t]).catch(()=>{})}didChangeNotebookCellTextDocument(e,t){ct.languages.match(this.selector,t.document)!==0&&this.doSendChange({notebook:e,cells:{textContent:[t]}},void 0).catch(()=>{})}didCloseNotebookCellTextDocument(e,t){let n=this.notebookSyncInfo.get(e.uri.toString());if(n===void 0)return;let r=t.document.uri,o=n.cells.findIndex(a=>a.document.uri.toString()===r.toString());if(o!==-1)if(o===0&&n.cells.length===1)this.doSendClose(e,n.cells).catch(()=>{});else{let a=n.cells.slice(),c=a.splice(o,1);this.doSendChange({notebook:e,cells:{structure:{array:{start:o,deleteCount:1},didClose:c}}},a).catch(()=>{})}}dispose(){for(let e of this.disposables)e.dispose()}didOpen(e,t=this.getMatchingCells(e),n=this.notebookSyncInfo.get(e.uri.toString())){if(n!==void 0)if(t!==void 0){let r=this.asNotebookDocumentChangeEvent(e,void 0,n,t);r!==void 0&&this.doSendChange(r,t).catch(()=>{})}else this.doSendClose(e,[]).catch(()=>{});else{if(t===void 0)return;this.doSendOpen(e,t).catch(()=>{})}}didChangeNotebookDocument(e){let t=e.notebook,n=this.notebookSyncInfo.get(t.uri.toString());if(n===void 0){if(e.contentChanges.length===0)return;let r=this.getMatchingCells(t);if(r===void 0)return;this.didOpen(t,r,n)}else{let r=this.getMatchingCells(t);if(r===void 0){this.didClose(t,n);return}let o=this.asNotebookDocumentChangeEvent(e.notebook,e,n,r);o!==void 0&&this.doSendChange(o,r).catch(()=>{})}}didSave(e){this.notebookSyncInfo.get(e.uri.toString())!==void 0&&this.doSendSave(e).catch(()=>{})}didClose(e,t=this.notebookSyncInfo.get(e.uri.toString())){if(t===void 0)return;let n=e.getCells().filter(r=>t.uris.has(r.document.uri.toString()));this.doSendClose(e,n).catch(()=>{})}async sendDidOpenNotebookDocument(e){let t=this.getMatchingCells(e);if(t!==void 0)return this.doSendOpen(e,t)}async doSendOpen(e,t){let n=async(o,a)=>{let c=gi.c2p.asNotebookDocument(o,a,this.client.code2ProtocolConverter),d=a.map(h=>this.client.code2ProtocolConverter.asTextDocumentItem(h.document));try{await this.client.sendNotification(Cn.DidOpenNotebookDocumentNotification.type,{notebookDocument:c,cellTextDocuments:d})}catch(h){throw this.client.error("Sending DidOpenNotebookDocumentNotification failed",h),h}},r=this.client.middleware?.notebooks;return this.notebookSyncInfo.set(e.uri.toString(),Ir.create(t)),r?.didOpen!==void 0?r.didOpen(e,t,n):n(e,t)}async sendDidChangeNotebookDocument(e){return this.doSendChange(e,void 0)}async doSendChange(e,t=this.getMatchingCells(e.notebook)){let n=async o=>{try{await this.client.sendNotification(Cn.DidChangeNotebookDocumentNotification.type,{notebookDocument:gi.c2p.asVersionedNotebookDocumentIdentifier(o.notebook,this.client.code2ProtocolConverter),change:gi.c2p.asNotebookDocumentChangeEvent(o,this.client.code2ProtocolConverter)})}catch(a){throw this.client.error("Sending DidChangeNotebookDocumentNotification failed",a),a}},r=this.client.middleware?.notebooks;return e.cells?.structure!==void 0&&this.notebookSyncInfo.set(e.notebook.uri.toString(),Ir.create(t??[])),r?.didChange!==void 0?r?.didChange(e,n):n(e)}async sendDidSaveNotebookDocument(e){return this.doSendSave(e)}async doSendSave(e){let t=async r=>{try{await this.client.sendNotification(Cn.DidSaveNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(r.uri)}})}catch(o){throw this.client.error("Sending DidSaveNotebookDocumentNotification failed",o),o}},n=this.client.middleware?.notebooks;return n?.didSave!==void 0?n.didSave(e,t):t(e)}async sendDidCloseNotebookDocument(e){return this.doSendClose(e,this.getMatchingCells(e)??[])}async doSendClose(e,t){let n=async(o,a)=>{try{await this.client.sendNotification(Cn.DidCloseNotebookDocumentNotification.type,{notebookDocument:{uri:this.client.code2ProtocolConverter.asUri(o.uri)},cellTextDocuments:a.map(c=>this.client.code2ProtocolConverter.asTextDocumentIdentifier(c.document))})}catch(c){throw this.client.error("Sending DidCloseNotebookDocumentNotification failed",c),c}},r=this.client.middleware?.notebooks;return this.notebookSyncInfo.delete(e.uri.toString()),r?.didClose!==void 0?r.didClose(e,t,n):n(e,t)}asNotebookDocumentChangeEvent(e,t,n,r){if(t!==void 0&&t.notebook!==e)throw new Error("Notebook must be identical");let o={notebook:e};t?.metadata!==void 0&&(o.metadata=gi.c2p.asMetadata(t.metadata));let a;if(t?.cellChanges!==void 0&&t.cellChanges.length>0){let c=[];a=new Set(r.map(d=>d.document.uri.toString()));for(let d of t.cellChanges)a.has(d.cell.document.uri.toString())&&(d.executionSummary!==void 0||d.metadata!==void 0)&&c.push(d.cell);c.length>0&&(o.cells=o.cells??{},o.cells.data=c)}if((t?.contentChanges!==void 0&&t.contentChanges.length>0||t===void 0)&&n!==void 0&&r!==void 0){let c=n.cells,d=r,h=ja.computeDiff(c,d,!1),m,R;if(h!==void 0){m=h.cells===void 0?new Map:new Map(h.cells.map(y=>[y.document.uri.toString(),y])),R=h.deleteCount===0?new Map:new Map(c.slice(h.start,h.start+h.deleteCount).map(y=>[y.document.uri.toString(),y]));for(let y of Array.from(R.keys()))m.has(y)&&(R.delete(y),m.delete(y));o.cells=o.cells??{};let _=[],T=[];if(m.size>0||R.size>0){for(let y of m.values())_.push(y);for(let y of R.values())T.push(y)}o.cells.structure={array:h,didOpen:_,didClose:T}}}return Object.keys(o).length>1?o:void 0}getMatchingCells(e,t=e.getCells()){if(this.options.notebookSelector!==void 0){for(let n of this.options.notebookSelector)if(n.notebook===void 0){if(n.cells===void 0)return;let r=this.filterCells(e,t,n.cells);return r.length===0?void 0:r}else if(Aa.matchNotebook(n.notebook,e))return n.cells===void 0?t:this.filterCells(e,t,n.cells)}}cellMatches(e,t){let n=this.getMatchingCells(e,[t]);return n!==void 0&&n[0]===t}filterCells(e,t,n){let r=t.filter(o=>{let a=o.document.languageId;return n.some(c=>c.language==="*"||a===c.language)});return typeof this.client.clientOptions.notebookDocumentOptions?.filterCells=="function"?this.client.clientOptions.notebookDocumentOptions.filterCells(e,t):r}},_n=class{constructor(e){this.client=e,this.registrations=new Map,this.registrationType=Cn.NotebookDocumentSyncRegistrationType.type,ct.workspace.onDidOpenTextDocument(t=>{if(t.uri.scheme!==_n.CellScheme)return;let[n,r]=this.findNotebookDocumentAndCell(t);if(!(n===void 0||r===void 0))for(let o of this.registrations.values())o instanceof pi&&o.didOpenNotebookCellTextDocument(n,r)}),ct.workspace.onDidChangeTextDocument(t=>{if(t.contentChanges.length===0)return;let n=t.document;if(n.uri.scheme!==_n.CellScheme)return;let[r]=this.findNotebookDocumentAndCell(n);if(r!==void 0)for(let o of this.registrations.values())o instanceof pi&&o.didChangeNotebookCellTextDocument(r,t)}),ct.workspace.onDidCloseTextDocument(t=>{if(t.uri.scheme!==_n.CellScheme)return;let[n,r]=this.findNotebookDocumentAndCell(t);if(!(n===void 0||r===void 0))for(let o of this.registrations.values())o instanceof pi&&o.didCloseNotebookCellTextDocument(n,r)})}getState(){if(this.registrations.size===0)return{kind:"document",id:this.registrationType.method,registrations:!1,matches:!1};for(let e of this.registrations.values()){let t=e.getState();if(t.kind==="document"&&t.registrations===!0&&t.matches===!0)return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!0}}return{kind:"document",id:this.registrationType.method,registrations:!0,matches:!1}}fillClientCapabilities(e){let t=bl(bl(e,"notebookDocument"),"synchronization");t.dynamicRegistration=!0,t.executionSummarySupport=!0}preInitialize(e){let t=e.notebookDocumentSync;t!==void 0&&(this.dedicatedChannel=this.client.protocol2CodeConverter.asDocumentSelector(Or.asDocumentSelector(t)))}initialize(e){let t=e.notebookDocumentSync;if(t===void 0)return;let n=t.id??fy.generateUuid();this.register({id:n,registerOptions:t})}register(e){let t=new pi(this.client,e.registerOptions);this.registrations.set(e.id,t)}unregister(e){let t=this.registrations.get(e);t&&t.dispose()}dispose(){for(let e of this.registrations.values())e.dispose();this.registrations.clear()}handles(e){if(e.uri.scheme!==_n.CellScheme)return!1;if(this.dedicatedChannel!==void 0&&ct.languages.match(this.dedicatedChannel,e)>0)return!0;for(let t of this.registrations.values())if(t.handles(e))return!0;return!1}getProvider(e){for(let t of this.registrations.values())if(t.handles(e.document))return t}findNotebookDocumentAndCell(e){let t=e.uri.toString();for(let n of ct.workspace.notebookDocuments)for(let r of n.getCells())if(r.document.uri.toString()===t)return[n,r];return[void 0,void 0]}};Nr.NotebookDocumentSyncFeature=_n;_n.CellScheme="vscode-notebook-cell"});var Ka=I(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.SyncConfigurationFeature=Ln.toJSONObject=Ln.ConfigurationFeature=void 0;var mi=require("vscode"),Ji=X(),hy=Xt(),gy=Ee(),Dl=ue(),Ha=class{constructor(e){this._client=e}getState(){return{kind:"static"}}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.configuration=!0}initialize(){let e=this._client;e.onRequest(Ji.ConfigurationRequest.type,(t,n)=>{let r=a=>{let c=[];for(let d of a.items){let h=d.scopeUri!==void 0&&d.scopeUri!==null?this._client.protocol2CodeConverter.asUri(d.scopeUri):void 0;c.push(this.getConfiguration(h,d.section!==null?d.section:void 0))}return c},o=e.middleware.workspace;return o&&o.configuration?o.configuration(t,n,r):r(t,n)})}getConfiguration(e,t){let n=null;if(t){let r=t.lastIndexOf(".");if(r===-1)n=Jn(mi.workspace.getConfiguration(void 0,e).get(t));else{let o=mi.workspace.getConfiguration(t.substr(0,r),e);o&&(n=Jn(o.get(t.substr(r+1))))}}else{let r=mi.workspace.getConfiguration(void 0,e);n={};for(let o of Object.keys(r))r.has(o)&&(n[o]=Jn(r.get(o)))}return n===void 0&&(n=null),n}dispose(){}};Ln.ConfigurationFeature=Ha;function Jn(i){if(i){if(Array.isArray(i))return i.map(Jn);if(typeof i=="object"){let e=Object.create(null);for(let t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=Jn(i[t]));return e}}return i}Ln.toJSONObject=Jn;var Wa=class{constructor(e){this._client=e,this._listeners=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._listeners.size>0}}get registrationType(){return Ji.DidChangeConfigurationNotification.type}fillClientCapabilities(e){(0,Dl.ensure)((0,Dl.ensure)(e,"workspace"),"didChangeConfiguration").dynamicRegistration=!0}initialize(){let e=this._client.clientOptions.synchronize?.configurationSection;e!==void 0&&this.register({id:gy.generateUuid(),registerOptions:{section:e}})}register(e){let t=mi.workspace.onDidChangeConfiguration(n=>{this.onDidChangeConfiguration(e.registerOptions.section,n)});this._listeners.set(e.id,t),e.registerOptions.section!==void 0&&this.onDidChangeConfiguration(e.registerOptions.section,void 0)}unregister(e){let t=this._listeners.get(e);t&&(this._listeners.delete(e),t.dispose())}dispose(){for(let e of this._listeners.values())e.dispose();this._listeners.clear()}onDidChangeConfiguration(e,t){let n;if(hy.string(e)?n=[e]:n=e,n!==void 0&&t!==void 0&&!n.some(c=>t.affectsConfiguration(c)))return;let r=async a=>a===void 0?this._client.sendNotification(Ji.DidChangeConfigurationNotification.type,{settings:null}):this._client.sendNotification(Ji.DidChangeConfigurationNotification.type,{settings:this.extractSettingsInformation(a)}),o=this._client.middleware.workspace?.didChangeConfiguration;(o?o(n,r):r(n)).catch(a=>{this._client.error(`Sending notification ${Ji.DidChangeConfigurationNotification.type.method} failed`,a)})}extractSettingsInformation(e){function t(o,a){let c=o;for(let d=0;d<a.length-1;d++){let h=c[a[d]];h||(h=Object.create(null),c[a[d]]=h),c=h}return c}let n=this._client.clientOptions.workspaceFolder?this._client.clientOptions.workspaceFolder.uri:void 0,r=Object.create(null);for(let o=0;o<e.length;o++){let a=e[o],c=a.indexOf("."),d=null;if(c>=0?d=mi.workspace.getConfiguration(a.substr(0,c),n).get(a.substr(c+1)):d=mi.workspace.getConfiguration(void 0,n).get(a),d){let h=e[o].split(".");t(r,h)[h[h.length-1]]=Jn(d)}}return r}};Ln.SyncConfigurationFeature=Wa});var wl=I(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.DidSaveTextDocumentFeature=bt.WillSaveWaitUntilFeature=bt.WillSaveFeature=bt.DidChangeTextDocumentFeature=bt.DidCloseTextDocumentFeature=bt.DidOpenTextDocumentFeature=void 0;var At=require("vscode"),Ve=X(),Oe=ue(),py=Qi(),yi=Ee(),Ua=class extends Oe.TextDocumentEventFeature{constructor(e,t){super(e,At.workspace.onDidOpenTextDocument,Ve.DidOpenTextDocumentNotification.type,()=>e.middleware.didOpen,n=>e.code2ProtocolConverter.asOpenTextDocumentParams(n),n=>n,Oe.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t}get openDocuments(){return this._syncedDocuments.values()}fillClientCapabilities(e){(0,Oe.ensure)((0,Oe.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.openClose&&this.register({id:yi.generateUuid(),registerOptions:{documentSelector:t}})}get registrationType(){return Ve.DidOpenTextDocumentNotification.type}register(e){if(super.register(e),!e.registerOptions.documentSelector)return;let t=this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector);At.workspace.textDocuments.forEach(n=>{let r=n.uri.toString();if(!this._syncedDocuments.has(r)&&At.languages.match(t,n)>0&&!this._client.hasDedicatedTextSynchronizationFeature(n)){let o=this._client.middleware,a=c=>this._client.sendNotification(this._type,this._createParams(c));(o.didOpen?o.didOpen(n,a):a(n)).catch(c=>{this._client.error(`Sending document notification ${this._type.method} failed`,c)}),this._syncedDocuments.set(r,n)}})}notificationSent(e,t,n){super.notificationSent(e,t,n),this._syncedDocuments.set(e.uri.toString(),e)}};bt.DidOpenTextDocumentFeature=Ua;var za=class extends Oe.TextDocumentEventFeature{constructor(e,t){super(e,At.workspace.onDidCloseTextDocument,Ve.DidCloseTextDocumentNotification.type,()=>e.middleware.didClose,n=>e.code2ProtocolConverter.asCloseTextDocumentParams(n),n=>n,Oe.TextDocumentEventFeature.textDocumentFilter),this._syncedDocuments=t}get registrationType(){return Ve.DidCloseTextDocumentNotification.type}fillClientCapabilities(e){(0,Oe.ensure)((0,Oe.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.openClose&&this.register({id:yi.generateUuid(),registerOptions:{documentSelector:t}})}notificationSent(e,t,n){super.notificationSent(e,t,n),this._syncedDocuments.delete(e.uri.toString())}unregister(e){let t=this._selectors.get(e);super.unregister(e);let n=this._selectors.values();this._syncedDocuments.forEach(r=>{if(At.languages.match(t,r)>0&&!this._selectorFilter(n,r)&&!this._client.hasDedicatedTextSynchronizationFeature(r)){let o=this._client.middleware,a=c=>this._client.sendNotification(this._type,this._createParams(c));this._syncedDocuments.delete(r.uri.toString()),(o.didClose?o.didClose(r,a):a(r)).catch(c=>{this._client.error(`Sending document notification ${this._type.method} failed`,c)})}})}};bt.DidCloseTextDocumentFeature=za;var $a=class extends Oe.DynamicDocumentFeature{constructor(e){super(e),this._forcingDelivery=!1,this._changeData=new Map,this._onNotificationSent=new At.EventEmitter}get registrationType(){return Ve.DidChangeTextDocumentNotification.type}fillClientCapabilities(e){(0,Oe.ensure)((0,Oe.ensure)(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.change!==void 0&&n.change!==Ve.TextDocumentSyncKind.None&&this.register({id:yi.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},{syncKind:n.change})})}register(e){!e.registerOptions.documentSelector||(this._listener||(this._listener=At.workspace.onDidChangeTextDocument(this.callback,this)),this._changeData.set(e.id,{syncKind:e.registerOptions.syncKind,documentSelector:this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)}))}*getDocumentSelectors(){for(let e of this._changeData.values())yield e.documentSelector}async callback(e){if(e.contentChanges.length===0)return;let t=[];for(let n of this._changeData.values())if(At.languages.match(n.documentSelector,e.document)>0&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){let r=this._client.middleware;if(n.syncKind===Ve.TextDocumentSyncKind.Incremental){let o=async a=>{let c=this._client.code2ProtocolConverter.asChangeTextDocumentParams(a);await this._client.sendNotification(Ve.DidChangeTextDocumentNotification.type,c),this.notificationSent(a,Ve.DidChangeTextDocumentNotification.type,c)};t.push(r.didChange?r.didChange(e,a=>o(a)):o(e))}else if(n.syncKind===Ve.TextDocumentSyncKind.Full){let o=async a=>{let c=async d=>{let h=this._client.code2ProtocolConverter.asChangeTextDocumentParams(d.document);await this._client.sendNotification(Ve.DidChangeTextDocumentNotification.type,h),this.notificationSent(d,Ve.DidChangeTextDocumentNotification.type,h)};return this._changeDelayer?(this._changeDelayer.uri!==a.document.uri.toString()&&(this.forceDelivery(),this._changeDelayer.uri=a.document.uri.toString()),this._changeDelayer.delayer.trigger(()=>c(a))):(this._changeDelayer={uri:a.document.uri.toString(),delayer:new py.Delayer(200)},this._changeDelayer.delayer.trigger(()=>c(a),-1))};t.push(r.didChange?r.didChange(e,a=>o(a)):o(e))}}return Promise.all(t).then(void 0,n=>{throw this._client.error(`Sending document notification ${Ve.DidChangeTextDocumentNotification.type.method} failed`,n),n})}get onNotificationSent(){return this._onNotificationSent.event}notificationSent(e,t,n){this._onNotificationSent.fire({original:e,type:t,params:n})}unregister(e){this._changeData.delete(e),this._changeData.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}dispose(){this._changeDelayer!==void 0&&this._changeDelayer.delayer.cancel(),this._changeDelayer=void 0,this._forcingDelivery=!1,this._changeData.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}forceDelivery(){if(!(this._forcingDelivery||!this._changeDelayer))try{this._forcingDelivery=!0,this._changeDelayer.delayer.forceDelivery()}finally{this._forcingDelivery=!1}}getProvider(e){for(let t of this._changeData.values())if(At.languages.match(t.documentSelector,e)>0)return{send:n=>this.callback(n)}}};bt.DidChangeTextDocumentFeature=$a;var Va=class extends Oe.TextDocumentEventFeature{constructor(e){super(e,At.workspace.onWillSaveTextDocument,Ve.WillSaveTextDocumentNotification.type,()=>e.middleware.willSave,t=>e.code2ProtocolConverter.asWillSaveTextDocumentParams(t),t=>t.document,(t,n)=>Oe.TextDocumentEventFeature.textDocumentFilter(t,n.document))}get registrationType(){return Ve.WillSaveTextDocumentNotification.type}fillClientCapabilities(e){let t=(0,Oe.ensure)((0,Oe.ensure)(e,"textDocument"),"synchronization");t.willSave=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.willSave&&this.register({id:yi.generateUuid(),registerOptions:{documentSelector:t}})}};bt.WillSaveFeature=Va;var Ba=class extends Oe.DynamicDocumentFeature{constructor(e){super(e),this._selectors=new Map}getDocumentSelectors(){return this._selectors.values()}get registrationType(){return Ve.WillSaveTextDocumentWaitUntilRequest.type}fillClientCapabilities(e){let t=(0,Oe.ensure)((0,Oe.ensure)(e,"textDocument"),"synchronization");t.willSaveWaitUntil=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;t&&n&&n.willSaveWaitUntil&&this.register({id:yi.generateUuid(),registerOptions:{documentSelector:t}})}register(e){!e.registerOptions.documentSelector||(this._listener||(this._listener=At.workspace.onWillSaveTextDocument(this.callback,this)),this._selectors.set(e.id,this._client.protocol2CodeConverter.asDocumentSelector(e.registerOptions.documentSelector)))}callback(e){if(Oe.TextDocumentEventFeature.textDocumentFilter(this._selectors.values(),e.document)&&!this._client.hasDedicatedTextSynchronizationFeature(e.document)){let t=this._client.middleware,n=r=>this._client.sendRequest(Ve.WillSaveTextDocumentWaitUntilRequest.type,this._client.code2ProtocolConverter.asWillSaveTextDocumentParams(r)).then(async o=>{let a=await this._client.protocol2CodeConverter.asTextEdits(o);return a===void 0?[]:a});e.waitUntil(t.willSaveWaitUntil?t.willSaveWaitUntil(e,n):n(e))}}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}dispose(){this._selectors.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}};bt.WillSaveWaitUntilFeature=Ba;var Qa=class extends Oe.TextDocumentEventFeature{constructor(e){super(e,At.workspace.onDidSaveTextDocument,Ve.DidSaveTextDocumentNotification.type,()=>e.middleware.didSave,t=>e.code2ProtocolConverter.asSaveTextDocumentParams(t,this._includeText),t=>t,Oe.TextDocumentEventFeature.textDocumentFilter),this._includeText=!1}get registrationType(){return Ve.DidSaveTextDocumentNotification.type}fillClientCapabilities(e){(0,Oe.ensure)((0,Oe.ensure)(e,"textDocument"),"synchronization").didSave=!0}initialize(e,t){let n=e.resolvedTextDocumentSync;if(t&&n&&n.save){let r=typeof n.save=="boolean"?{includeText:!1}:{includeText:!!n.save.includeText};this.register({id:yi.generateUuid(),registerOptions:Object.assign({},{documentSelector:t},r)})}}register(e){this._includeText=!!e.registerOptions.includeText,super.register(e)}};bt.DidSaveTextDocumentFeature=Qa});var Sl=I(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.CompletionItemFeature=void 0;var my=require("vscode"),ce=X(),Ja=ue(),yy=Ee(),vy=[ce.CompletionItemKind.Text,ce.CompletionItemKind.Method,ce.CompletionItemKind.Function,ce.CompletionItemKind.Constructor,ce.CompletionItemKind.Field,ce.CompletionItemKind.Variable,ce.CompletionItemKind.Class,ce.CompletionItemKind.Interface,ce.CompletionItemKind.Module,ce.CompletionItemKind.Property,ce.CompletionItemKind.Unit,ce.CompletionItemKind.Value,ce.CompletionItemKind.Enum,ce.CompletionItemKind.Keyword,ce.CompletionItemKind.Snippet,ce.CompletionItemKind.Color,ce.CompletionItemKind.File,ce.CompletionItemKind.Reference,ce.CompletionItemKind.Folder,ce.CompletionItemKind.EnumMember,ce.CompletionItemKind.Constant,ce.CompletionItemKind.Struct,ce.CompletionItemKind.Event,ce.CompletionItemKind.Operator,ce.CompletionItemKind.TypeParameter],Ga=class extends Ja.TextDocumentLanguageFeature{constructor(e){super(e,ce.CompletionRequest.type),this.labelDetailsSupport=new Map}fillClientCapabilities(e){let t=(0,Ja.ensure)((0,Ja.ensure)(e,"textDocument"),"completion");t.dynamicRegistration=!0,t.contextSupport=!0,t.completionItem={snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:[ce.MarkupKind.Markdown,ce.MarkupKind.PlainText],deprecatedSupport:!0,preselectSupport:!0,tagSupport:{valueSet:[ce.CompletionItemTag.Deprecated]},insertReplaceSupport:!0,resolveSupport:{properties:["documentation","detail","additionalTextEdits"]},insertTextModeSupport:{valueSet:[ce.InsertTextMode.asIs,ce.InsertTextMode.adjustIndentation]},labelDetailsSupport:!0},t.insertTextMode=ce.InsertTextMode.adjustIndentation,t.completionItemKind={valueSet:vy},t.completionList={itemDefaults:["commitCharacters","editRange","insertTextFormat","insertTextMode"]}}initialize(e,t){let n=this.getRegistrationOptions(t,e.completionProvider);!n||this.register({id:yy.generateUuid(),registerOptions:n})}registerLanguageProvider(e,t){this.labelDetailsSupport.set(t,!!e.completionItem?.labelDetailsSupport);let n=e.triggerCharacters??[],r=e.allCommitCharacters,o=e.documentSelector,a={provideCompletionItems:(c,d,h,m)=>{let R=this._client,_=this._client.middleware,T=(y,P,O,L)=>R.sendRequest(ce.CompletionRequest.type,R.code2ProtocolConverter.asCompletionParams(y,P,O),L).then($=>L.isCancellationRequested?null:R.protocol2CodeConverter.asCompletionResult($,r,L),$=>R.handleFailedRequest(ce.CompletionRequest.type,L,$,null));return _.provideCompletionItem?_.provideCompletionItem(c,d,m,h,T):T(c,d,m,h)},resolveCompletionItem:e.resolveProvider?(c,d)=>{let h=this._client,m=this._client.middleware,R=(_,T)=>h.sendRequest(ce.CompletionResolveRequest.type,h.code2ProtocolConverter.asCompletionItem(_,!!this.labelDetailsSupport.get(t)),T).then(y=>T.isCancellationRequested?null:h.protocol2CodeConverter.asCompletionItem(y),y=>h.handleFailedRequest(ce.CompletionResolveRequest.type,T,y,_));return m.resolveCompletionItem?m.resolveCompletionItem(c,d,R):R(c,d)}:void 0};return[my.languages.registerCompletionItemProvider(this._client.protocol2CodeConverter.asDocumentSelector(o),a,...n),a]}};Lr.CompletionItemFeature=Ga});var Tl=I(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.HoverFeature=void 0;var Cy=require("vscode"),Gi=X(),Xa=ue(),_y=Ee(),Ya=class extends Xa.TextDocumentLanguageFeature{constructor(e){super(e,Gi.HoverRequest.type)}fillClientCapabilities(e){let t=(0,Xa.ensure)((0,Xa.ensure)(e,"textDocument"),"hover");t.dynamicRegistration=!0,t.contentFormat=[Gi.MarkupKind.Markdown,Gi.MarkupKind.PlainText]}initialize(e,t){let n=this.getRegistrationOptions(t,e.hoverProvider);!n||this.register({id:_y.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideHover:(r,o,a)=>{let c=this._client,d=(m,R,_)=>c.sendRequest(Gi.HoverRequest.type,c.code2ProtocolConverter.asTextDocumentPositionParams(m,R),_).then(T=>_.isCancellationRequested?null:c.protocol2CodeConverter.asHover(T),T=>c.handleFailedRequest(Gi.HoverRequest.type,_,T,null)),h=c.middleware;return h.provideHover?h.provideHover(r,o,a,d):d(r,o,a)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return Cy.languages.registerHoverProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};Mr.HoverFeature=Ya});var ql=I(jr=>{"use strict";Object.defineProperty(jr,"__esModule",{value:!0});jr.DefinitionFeature=void 0;var by=require("vscode"),Za=X(),ec=ue(),Ry=Ee(),tc=class extends ec.TextDocumentLanguageFeature{constructor(e){super(e,Za.DefinitionRequest.type)}fillClientCapabilities(e){let t=(0,ec.ensure)((0,ec.ensure)(e,"textDocument"),"definition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.definitionProvider);!n||this.register({id:Ry.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDefinition:(r,o,a)=>{let c=this._client,d=(m,R,_)=>c.sendRequest(Za.DefinitionRequest.type,c.code2ProtocolConverter.asTextDocumentPositionParams(m,R),_).then(T=>_.isCancellationRequested?null:c.protocol2CodeConverter.asDefinitionResult(T,_),T=>c.handleFailedRequest(Za.DefinitionRequest.type,_,T,null)),h=c.middleware;return h.provideDefinition?h.provideDefinition(r,o,a,d):d(r,o,a)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return by.languages.registerDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};jr.DefinitionFeature=tc});var kl=I(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.SignatureHelpFeature=void 0;var Pl=require("vscode"),Xi=X(),nc=ue(),Dy=Ee(),ic=class extends nc.TextDocumentLanguageFeature{constructor(e){super(e,Xi.SignatureHelpRequest.type)}fillClientCapabilities(e){let t=(0,nc.ensure)((0,nc.ensure)(e,"textDocument"),"signatureHelp");t.dynamicRegistration=!0,t.signatureInformation={documentationFormat:[Xi.MarkupKind.Markdown,Xi.MarkupKind.PlainText]},t.signatureInformation.parameterInformation={labelOffsetSupport:!0},t.signatureInformation.activeParameterSupport=!0,t.contextSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.signatureHelpProvider);!n||this.register({id:Dy.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t={provideSignatureHelp:(n,r,o,a)=>{let c=this._client,d=(m,R,_,T)=>c.sendRequest(Xi.SignatureHelpRequest.type,c.code2ProtocolConverter.asSignatureHelpParams(m,R,_),T).then(y=>T.isCancellationRequested?null:c.protocol2CodeConverter.asSignatureHelp(y,T),y=>c.handleFailedRequest(Xi.SignatureHelpRequest.type,T,y,null)),h=c.middleware;return h.provideSignatureHelp?h.provideSignatureHelp(n,r,a,o,d):d(n,r,a,o)}};return[this.registerProvider(e,t),t]}registerProvider(e,t){let n=this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector);if(e.retriggerCharacters===void 0){let r=e.triggerCharacters||[];return Pl.languages.registerSignatureHelpProvider(n,t,...r)}else{let r={triggerCharacters:e.triggerCharacters||[],retriggerCharacters:e.retriggerCharacters||[]};return Pl.languages.registerSignatureHelpProvider(n,t,r)}}};Ar.SignatureHelpFeature=ic});var xl=I(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.DocumentHighlightFeature=void 0;var wy=require("vscode"),rc=X(),oc=ue(),Sy=Ee(),sc=class extends oc.TextDocumentLanguageFeature{constructor(e){super(e,rc.DocumentHighlightRequest.type)}fillClientCapabilities(e){(0,oc.ensure)((0,oc.ensure)(e,"textDocument"),"documentHighlight").dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentHighlightProvider);!n||this.register({id:Sy.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDocumentHighlights:(r,o,a)=>{let c=this._client,d=(m,R,_)=>c.sendRequest(rc.DocumentHighlightRequest.type,c.code2ProtocolConverter.asTextDocumentPositionParams(m,R),_).then(T=>_.isCancellationRequested?null:c.protocol2CodeConverter.asDocumentHighlights(T,_),T=>c.handleFailedRequest(rc.DocumentHighlightRequest.type,_,T,null)),h=c.middleware;return h.provideDocumentHighlights?h.provideDocumentHighlights(r,o,a,d):d(r,o,a)}};return[wy.languages.registerDocumentHighlightProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};Hr.DocumentHighlightFeature=sc});var uc=I(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.DocumentSymbolFeature=an.SupportedSymbolTags=an.SupportedSymbolKinds=void 0;var Ty=require("vscode"),me=X(),ac=ue(),qy=Ee();an.SupportedSymbolKinds=[me.SymbolKind.File,me.SymbolKind.Module,me.SymbolKind.Namespace,me.SymbolKind.Package,me.SymbolKind.Class,me.SymbolKind.Method,me.SymbolKind.Property,me.SymbolKind.Field,me.SymbolKind.Constructor,me.SymbolKind.Enum,me.SymbolKind.Interface,me.SymbolKind.Function,me.SymbolKind.Variable,me.SymbolKind.Constant,me.SymbolKind.String,me.SymbolKind.Number,me.SymbolKind.Boolean,me.SymbolKind.Array,me.SymbolKind.Object,me.SymbolKind.Key,me.SymbolKind.Null,me.SymbolKind.EnumMember,me.SymbolKind.Struct,me.SymbolKind.Event,me.SymbolKind.Operator,me.SymbolKind.TypeParameter];an.SupportedSymbolTags=[me.SymbolTag.Deprecated];var cc=class extends ac.TextDocumentLanguageFeature{constructor(e){super(e,me.DocumentSymbolRequest.type)}fillClientCapabilities(e){let t=(0,ac.ensure)((0,ac.ensure)(e,"textDocument"),"documentSymbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:an.SupportedSymbolKinds},t.hierarchicalDocumentSymbolSupport=!0,t.tagSupport={valueSet:an.SupportedSymbolTags},t.labelSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentSymbolProvider);!n||this.register({id:qy.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDocumentSymbols:(o,a)=>{let c=this._client,d=(m,R)=>c.sendRequest(me.DocumentSymbolRequest.type,c.code2ProtocolConverter.asDocumentSymbolParams(m),R).then(async _=>{if(R.isCancellationRequested||_===void 0||_===null)return null;if(_.length===0)return[];{let T=_[0];return me.DocumentSymbol.is(T)?await c.protocol2CodeConverter.asDocumentSymbols(_,R):await c.protocol2CodeConverter.asSymbolInformations(_,R)}},_=>c.handleFailedRequest(me.DocumentSymbolRequest.type,R,_,null)),h=c.middleware;return h.provideDocumentSymbols?h.provideDocumentSymbols(o,a,d):d(o,a)}},r=e.label!==void 0?{label:e.label}:void 0;return[Ty.languages.registerDocumentSymbolProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n,r),n]}};an.DocumentSymbolFeature=cc});var El=I(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.WorkspaceSymbolFeature=void 0;var Py=require("vscode"),Yi=X(),dc=ue(),Fl=uc(),ky=Ee(),lc=class extends dc.WorkspaceFeature{constructor(e){super(e,Yi.WorkspaceSymbolRequest.type)}fillClientCapabilities(e){let t=(0,dc.ensure)((0,dc.ensure)(e,"workspace"),"symbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:Fl.SupportedSymbolKinds},t.tagSupport={valueSet:Fl.SupportedSymbolTags},t.resolveSupport={properties:["location.range"]}}initialize(e){!e.workspaceSymbolProvider||this.register({id:ky.generateUuid(),registerOptions:e.workspaceSymbolProvider===!0?{workDoneProgress:!1}:e.workspaceSymbolProvider})}registerLanguageProvider(e){let t={provideWorkspaceSymbols:(n,r)=>{let o=this._client,a=(d,h)=>o.sendRequest(Yi.WorkspaceSymbolRequest.type,{query:d},h).then(m=>h.isCancellationRequested?null:o.protocol2CodeConverter.asSymbolInformations(m,h),m=>o.handleFailedRequest(Yi.WorkspaceSymbolRequest.type,h,m,null)),c=o.middleware;return c.provideWorkspaceSymbols?c.provideWorkspaceSymbols(n,r,a):a(n,r)},resolveWorkspaceSymbol:e.resolveProvider===!0?(n,r)=>{let o=this._client,a=(d,h)=>o.sendRequest(Yi.WorkspaceSymbolResolveRequest.type,o.code2ProtocolConverter.asWorkspaceSymbol(d),h).then(m=>h.isCancellationRequested?null:o.protocol2CodeConverter.asSymbolInformation(m),m=>o.handleFailedRequest(Yi.WorkspaceSymbolResolveRequest.type,h,m,null)),c=o.middleware;return c.resolveWorkspaceSymbol?c.resolveWorkspaceSymbol(n,r,a):a(n,r)}:void 0};return[Py.languages.registerWorkspaceSymbolProvider(t),t]}};Wr.WorkspaceSymbolFeature=lc});var Ol=I(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.ReferencesFeature=void 0;var xy=require("vscode"),fc=X(),hc=ue(),Fy=Ee(),gc=class extends hc.TextDocumentLanguageFeature{constructor(e){super(e,fc.ReferencesRequest.type)}fillClientCapabilities(e){(0,hc.ensure)((0,hc.ensure)(e,"textDocument"),"references").dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.referencesProvider);!n||this.register({id:Fy.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideReferences:(r,o,a,c)=>{let d=this._client,h=(R,_,T,y)=>d.sendRequest(fc.ReferencesRequest.type,d.code2ProtocolConverter.asReferenceParams(R,_,T),y).then(P=>y.isCancellationRequested?null:d.protocol2CodeConverter.asReferences(P,y),P=>d.handleFailedRequest(fc.ReferencesRequest.type,y,P,null)),m=d.middleware;return m.provideReferences?m.provideReferences(r,o,a,c,h):h(r,o,a,c)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return xy.languages.registerReferenceProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};Kr.ReferencesFeature=gc});var Il=I(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.CodeActionFeature=void 0;var Ey=require("vscode"),Ft=X(),Oy=Ee(),pc=ue(),mc=class extends pc.TextDocumentLanguageFeature{constructor(e){super(e,Ft.CodeActionRequest.type)}fillClientCapabilities(e){let t=(0,pc.ensure)((0,pc.ensure)(e,"textDocument"),"codeAction");t.dynamicRegistration=!0,t.isPreferredSupport=!0,t.disabledSupport=!0,t.dataSupport=!0,t.resolveSupport={properties:["edit"]},t.codeActionLiteralSupport={codeActionKind:{valueSet:[Ft.CodeActionKind.Empty,Ft.CodeActionKind.QuickFix,Ft.CodeActionKind.Refactor,Ft.CodeActionKind.RefactorExtract,Ft.CodeActionKind.RefactorInline,Ft.CodeActionKind.RefactorRewrite,Ft.CodeActionKind.Source,Ft.CodeActionKind.SourceOrganizeImports]}},t.honorsChangeAnnotations=!1}initialize(e,t){let n=this.getRegistrationOptions(t,e.codeActionProvider);!n||this.register({id:Oy.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideCodeActions:(r,o,a,c)=>{let d=this._client,h=async(R,_,T,y)=>{let P={textDocument:d.code2ProtocolConverter.asTextDocumentIdentifier(R),range:d.code2ProtocolConverter.asRange(_),context:await d.code2ProtocolConverter.asCodeActionContext(T,y)};return d.sendRequest(Ft.CodeActionRequest.type,P,y).then(O=>y.isCancellationRequested||O===null||O===void 0?null:d.protocol2CodeConverter.asCodeActionResult(O,y),O=>d.handleFailedRequest(Ft.CodeActionRequest.type,y,O,null))},m=d.middleware;return m.provideCodeActions?m.provideCodeActions(r,o,a,c,h):h(r,o,a,c)},resolveCodeAction:e.resolveProvider?(r,o)=>{let a=this._client,c=this._client.middleware,d=async(h,m)=>a.sendRequest(Ft.CodeActionResolveRequest.type,await a.code2ProtocolConverter.asCodeAction(h,m),m).then(R=>m.isCancellationRequested?h:a.protocol2CodeConverter.asCodeAction(R,m),R=>a.handleFailedRequest(Ft.CodeActionResolveRequest.type,m,R,h));return c.resolveCodeAction?c.resolveCodeAction(r,o,d):d(r,o)}:void 0};return[Ey.languages.registerCodeActionsProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n,e.codeActionKinds?{providedCodeActionKinds:this._client.protocol2CodeConverter.asCodeActionKinds(e.codeActionKinds)}:void 0),n]}};Ur.CodeActionFeature=mc});var Ll=I(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.CodeLensFeature=void 0;var Nl=require("vscode"),vi=X(),Iy=Ee(),Zi=ue(),yc=class extends Zi.TextDocumentLanguageFeature{constructor(e){super(e,vi.CodeLensRequest.type)}fillClientCapabilities(e){(0,Zi.ensure)((0,Zi.ensure)(e,"textDocument"),"codeLens").dynamicRegistration=!0,(0,Zi.ensure)((0,Zi.ensure)(e,"workspace"),"codeLens").refreshSupport=!0}initialize(e,t){this._client.onRequest(vi.CodeLensRefreshRequest.type,async()=>{for(let o of this.getAllProviders())o.onDidChangeCodeLensEmitter.fire()});let r=this.getRegistrationOptions(t,e.codeLensProvider);!r||this.register({id:Iy.generateUuid(),registerOptions:r})}registerLanguageProvider(e){let t=e.documentSelector,n=new Nl.EventEmitter,r={onDidChangeCodeLenses:n.event,provideCodeLenses:(o,a)=>{let c=this._client,d=(m,R)=>c.sendRequest(vi.CodeLensRequest.type,c.code2ProtocolConverter.asCodeLensParams(m),R).then(_=>R.isCancellationRequested?null:c.protocol2CodeConverter.asCodeLenses(_,R),_=>c.handleFailedRequest(vi.CodeLensRequest.type,R,_,null)),h=c.middleware;return h.provideCodeLenses?h.provideCodeLenses(o,a,d):d(o,a)},resolveCodeLens:e.resolveProvider?(o,a)=>{let c=this._client,d=(m,R)=>c.sendRequest(vi.CodeLensResolveRequest.type,c.code2ProtocolConverter.asCodeLens(m),R).then(_=>R.isCancellationRequested?m:c.protocol2CodeConverter.asCodeLens(_),_=>c.handleFailedRequest(vi.CodeLensResolveRequest.type,R,_,m)),h=c.middleware;return h.resolveCodeLens?h.resolveCodeLens(o,a,d):d(o,a)}:void 0};return[Nl.languages.registerCodeLensProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),r),{provider:r,onDidChangeCodeLensEmitter:n}]}};zr.CodeLensFeature=yc});var Ml=I(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.DocumentOnTypeFormattingFeature=Mn.DocumentRangeFormattingFeature=Mn.DocumentFormattingFeature=void 0;var $r=require("vscode"),bn=X(),bc=Ee(),Rn=ue(),er;(function(i){function e(t){let n=$r.workspace.getConfiguration("files",t);return{trimTrailingWhitespace:n.get("trimTrailingWhitespace"),trimFinalNewlines:n.get("trimFinalNewlines"),insertFinalNewline:n.get("insertFinalNewline")}}i.fromConfiguration=e})(er||(er={}));var vc=class extends Rn.TextDocumentLanguageFeature{constructor(e){super(e,bn.DocumentFormattingRequest.type)}fillClientCapabilities(e){(0,Rn.ensure)((0,Rn.ensure)(e,"textDocument"),"formatting").dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentFormattingProvider);!n||this.register({id:bc.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDocumentFormattingEdits:(r,o,a)=>{let c=this._client,d=(m,R,_)=>{let T={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(m),options:c.code2ProtocolConverter.asFormattingOptions(R,er.fromConfiguration(m))};return c.sendRequest(bn.DocumentFormattingRequest.type,T,_).then(y=>_.isCancellationRequested?null:c.protocol2CodeConverter.asTextEdits(y,_),y=>c.handleFailedRequest(bn.DocumentFormattingRequest.type,_,y,null))},h=c.middleware;return h.provideDocumentFormattingEdits?h.provideDocumentFormattingEdits(r,o,a,d):d(r,o,a)}};return[$r.languages.registerDocumentFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};Mn.DocumentFormattingFeature=vc;var Cc=class extends Rn.TextDocumentLanguageFeature{constructor(e){super(e,bn.DocumentRangeFormattingRequest.type)}fillClientCapabilities(e){(0,Rn.ensure)((0,Rn.ensure)(e,"textDocument"),"rangeFormatting").dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentRangeFormattingProvider);!n||this.register({id:bc.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDocumentRangeFormattingEdits:(r,o,a,c)=>{let d=this._client,h=(R,_,T,y)=>{let P={textDocument:d.code2ProtocolConverter.asTextDocumentIdentifier(R),range:d.code2ProtocolConverter.asRange(_),options:d.code2ProtocolConverter.asFormattingOptions(T,er.fromConfiguration(R))};return d.sendRequest(bn.DocumentRangeFormattingRequest.type,P,y).then(O=>y.isCancellationRequested?null:d.protocol2CodeConverter.asTextEdits(O,y),O=>d.handleFailedRequest(bn.DocumentRangeFormattingRequest.type,y,O,null))},m=d.middleware;return m.provideDocumentRangeFormattingEdits?m.provideDocumentRangeFormattingEdits(r,o,a,c,h):h(r,o,a,c)}};return[$r.languages.registerDocumentRangeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};Mn.DocumentRangeFormattingFeature=Cc;var _c=class extends Rn.TextDocumentLanguageFeature{constructor(e){super(e,bn.DocumentOnTypeFormattingRequest.type)}fillClientCapabilities(e){(0,Rn.ensure)((0,Rn.ensure)(e,"textDocument"),"onTypeFormatting").dynamicRegistration=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentOnTypeFormattingProvider);!n||this.register({id:bc.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideOnTypeFormattingEdits:(o,a,c,d,h)=>{let m=this._client,R=(T,y,P,O,L)=>{let $={textDocument:m.code2ProtocolConverter.asTextDocumentIdentifier(T),position:m.code2ProtocolConverter.asPosition(y),ch:P,options:m.code2ProtocolConverter.asFormattingOptions(O,er.fromConfiguration(T))};return m.sendRequest(bn.DocumentOnTypeFormattingRequest.type,$,L).then(H=>L.isCancellationRequested?null:m.protocol2CodeConverter.asTextEdits(H,L),H=>m.handleFailedRequest(bn.DocumentOnTypeFormattingRequest.type,L,H,null))},_=m.middleware;return _.provideOnTypeFormattingEdits?_.provideOnTypeFormattingEdits(o,a,c,d,h,R):R(o,a,c,d,h)}},r=e.moreTriggerCharacter||[];return[$r.languages.registerOnTypeFormattingEditProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n,e.firstTriggerCharacter,...r),n]}};Mn.DocumentOnTypeFormattingFeature=_c});var Al=I(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.RenameFeature=void 0;var Ny=require("vscode"),Gn=X(),Ly=Ee(),jl=Xt(),Rc=ue(),Dc=class extends Rc.TextDocumentLanguageFeature{constructor(e){super(e,Gn.RenameRequest.type)}fillClientCapabilities(e){let t=(0,Rc.ensure)((0,Rc.ensure)(e,"textDocument"),"rename");t.dynamicRegistration=!0,t.prepareSupport=!0,t.prepareSupportDefaultBehavior=Gn.PrepareSupportDefaultBehavior.Identifier,t.honorsChangeAnnotations=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.renameProvider);!n||(jl.boolean(e.renameProvider)&&(n.prepareProvider=!1),this.register({id:Ly.generateUuid(),registerOptions:n}))}registerLanguageProvider(e){let t=e.documentSelector,n={provideRenameEdits:(r,o,a,c)=>{let d=this._client,h=(R,_,T,y)=>{let P={textDocument:d.code2ProtocolConverter.asTextDocumentIdentifier(R),position:d.code2ProtocolConverter.asPosition(_),newName:T};return d.sendRequest(Gn.RenameRequest.type,P,y).then(O=>y.isCancellationRequested?null:d.protocol2CodeConverter.asWorkspaceEdit(O,y),O=>d.handleFailedRequest(Gn.RenameRequest.type,y,O,null,!1))},m=d.middleware;return m.provideRenameEdits?m.provideRenameEdits(r,o,a,c,h):h(r,o,a,c)},prepareRename:e.prepareProvider?(r,o,a)=>{let c=this._client,d=(m,R,_)=>{let T={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(m),position:c.code2ProtocolConverter.asPosition(R)};return c.sendRequest(Gn.PrepareRenameRequest.type,T,_).then(y=>_.isCancellationRequested?null:Gn.Range.is(y)?c.protocol2CodeConverter.asRange(y):this.isDefaultBehavior(y)?y.defaultBehavior===!0?null:Promise.reject(new Error("The element can't be renamed.")):y&&Gn.Range.is(y.range)?{range:c.protocol2CodeConverter.asRange(y.range),placeholder:y.placeholder}:Promise.reject(new Error("The element can't be renamed.")),y=>{throw typeof y.message=="string"?new Error(y.message):new Error("The element can't be renamed.")})},h=c.middleware;return h.prepareRename?h.prepareRename(r,o,a,d):d(r,o,a)}:void 0};return[this.registerProvider(t,n),n]}registerProvider(e,t){return Ny.languages.registerRenameProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}isDefaultBehavior(e){let t=e;return t&&jl.boolean(t.defaultBehavior)}};Vr.RenameFeature=Dc});var Hl=I(Br=>{"use strict";Object.defineProperty(Br,"__esModule",{value:!0});Br.DocumentLinkFeature=void 0;var My=require("vscode"),tr=X(),wc=ue(),jy=Ee(),Sc=class extends wc.TextDocumentLanguageFeature{constructor(e){super(e,tr.DocumentLinkRequest.type)}fillClientCapabilities(e){let t=(0,wc.ensure)((0,wc.ensure)(e,"textDocument"),"documentLink");t.dynamicRegistration=!0,t.tooltipSupport=!0}initialize(e,t){let n=this.getRegistrationOptions(t,e.documentLinkProvider);!n||this.register({id:jy.generateUuid(),registerOptions:n})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDocumentLinks:(r,o)=>{let a=this._client,c=(h,m)=>a.sendRequest(tr.DocumentLinkRequest.type,a.code2ProtocolConverter.asDocumentLinkParams(h),m).then(R=>m.isCancellationRequested?null:a.protocol2CodeConverter.asDocumentLinks(R,m),R=>a.handleFailedRequest(tr.DocumentLinkRequest.type,m,R,null)),d=a.middleware;return d.provideDocumentLinks?d.provideDocumentLinks(r,o,c):c(r,o)},resolveDocumentLink:e.resolveProvider?(r,o)=>{let a=this._client,c=(h,m)=>a.sendRequest(tr.DocumentLinkResolveRequest.type,a.code2ProtocolConverter.asDocumentLink(h),m).then(R=>m.isCancellationRequested?h:a.protocol2CodeConverter.asDocumentLink(R),R=>a.handleFailedRequest(tr.DocumentLinkResolveRequest.type,m,R,h)),d=a.middleware;return d.resolveDocumentLink?d.resolveDocumentLink(r,o,c):c(r,o)}:void 0};return[My.languages.registerDocumentLinkProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};Br.DocumentLinkFeature=Sc});var Kl=I(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.ExecuteCommandFeature=void 0;var Ay=require("vscode"),Tc=X(),Hy=Ee(),Wl=ue(),qc=class{constructor(e){this._client=e,this._commands=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._commands.size>0}}get registrationType(){return Tc.ExecuteCommandRequest.type}fillClientCapabilities(e){(0,Wl.ensure)((0,Wl.ensure)(e,"workspace"),"executeCommand").dynamicRegistration=!0}initialize(e){!e.executeCommandProvider||this.register({id:Hy.generateUuid(),registerOptions:Object.assign({},e.executeCommandProvider)})}register(e){let t=this._client,n=t.middleware,r=(o,a)=>{let c={command:o,arguments:a};return t.sendRequest(Tc.ExecuteCommandRequest.type,c).then(void 0,d=>t.handleFailedRequest(Tc.ExecuteCommandRequest.type,void 0,d,void 0))};if(e.registerOptions.commands){let o=[];for(let a of e.registerOptions.commands)o.push(Ay.commands.registerCommand(a,(...c)=>n.executeCommand?n.executeCommand(a,c,r):r(a,c)));this._commands.set(e.id,o)}}unregister(e){let t=this._commands.get(e);t&&t.forEach(n=>n.dispose())}dispose(){this._commands.forEach(e=>{e.forEach(t=>t.dispose())}),this._commands.clear()}};Qr.ExecuteCommandFeature=qc});var Ul=I(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.FileSystemWatcherFeature=void 0;var Wy=require("vscode"),Xn=X(),Jr=ue(),Pc=class{constructor(e,t){this._client=e,this._notifyFileEvent=t,this._watchers=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._watchers.size>0}}get registrationType(){return Xn.DidChangeWatchedFilesNotification.type}fillClientCapabilities(e){(0,Jr.ensure)((0,Jr.ensure)(e,"workspace"),"didChangeWatchedFiles").dynamicRegistration=!0,(0,Jr.ensure)((0,Jr.ensure)(e,"workspace"),"didChangeWatchedFiles").relativePatternSupport=!0}initialize(e,t){}register(e){if(!Array.isArray(e.registerOptions.watchers))return;let t=[];for(let n of e.registerOptions.watchers){let r=this._client.protocol2CodeConverter.asGlobPattern(n.globPattern);if(r===void 0)continue;let o=!0,a=!0,c=!0;n.kind!==void 0&&n.kind!==null&&(o=(n.kind&Xn.WatchKind.Create)!==0,a=(n.kind&Xn.WatchKind.Change)!==0,c=(n.kind&Xn.WatchKind.Delete)!==0);let d=Wy.workspace.createFileSystemWatcher(r,!o,!a,!c);this.hookListeners(d,o,a,c,t),t.push(d)}this._watchers.set(e.id,t)}registerRaw(e,t){let n=[];for(let r of t)this.hookListeners(r,!0,!0,!0,n);this._watchers.set(e,n)}hookListeners(e,t,n,r,o){t&&e.onDidCreate(a=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(a),type:Xn.FileChangeType.Created}),null,o),n&&e.onDidChange(a=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(a),type:Xn.FileChangeType.Changed}),null,o),r&&e.onDidDelete(a=>this._notifyFileEvent({uri:this._client.code2ProtocolConverter.asUri(a),type:Xn.FileChangeType.Deleted}),null,o)}unregister(e){let t=this._watchers.get(e);if(t)for(let n of t)n.dispose()}dispose(){this._watchers.forEach(e=>{for(let t of e)t.dispose()}),this._watchers.clear()}};Gr.FileSystemWatcherFeature=Pc});var zl=I(Xr=>{"use strict";Object.defineProperty(Xr,"__esModule",{value:!0});Xr.ColorProviderFeature=void 0;var Ky=require("vscode"),nr=X(),kc=ue(),xc=class extends kc.TextDocumentLanguageFeature{constructor(e){super(e,nr.DocumentColorRequest.type)}fillClientCapabilities(e){(0,kc.ensure)((0,kc.ensure)(e,"textDocument"),"colorProvider").dynamicRegistration=!0}initialize(e,t){let[n,r]=this.getRegistration(t,e.colorProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let t=e.documentSelector,n={provideColorPresentations:(r,o,a)=>{let c=this._client,d=(m,R,_)=>{let T={color:m,textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(R.document),range:c.code2ProtocolConverter.asRange(R.range)};return c.sendRequest(nr.ColorPresentationRequest.type,T,_).then(y=>_.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorPresentations(y,_),y=>c.handleFailedRequest(nr.ColorPresentationRequest.type,_,y,null))},h=c.middleware;return h.provideColorPresentations?h.provideColorPresentations(r,o,a,d):d(r,o,a)},provideDocumentColors:(r,o)=>{let a=this._client,c=(h,m)=>{let R={textDocument:a.code2ProtocolConverter.asTextDocumentIdentifier(h)};return a.sendRequest(nr.DocumentColorRequest.type,R,m).then(_=>m.isCancellationRequested?null:this._client.protocol2CodeConverter.asColorInformations(_,m),_=>a.handleFailedRequest(nr.DocumentColorRequest.type,m,_,null))},d=a.middleware;return d.provideDocumentColors?d.provideDocumentColors(r,o,c):c(r,o)}};return[Ky.languages.registerColorProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};Xr.ColorProviderFeature=xc});var $l=I(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.ImplementationFeature=void 0;var Uy=require("vscode"),Fc=X(),Ec=ue(),Oc=class extends Ec.TextDocumentLanguageFeature{constructor(e){super(e,Fc.ImplementationRequest.type)}fillClientCapabilities(e){let t=(0,Ec.ensure)((0,Ec.ensure)(e,"textDocument"),"implementation");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[n,r]=this.getRegistration(t,e.implementationProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let t=e.documentSelector,n={provideImplementation:(r,o,a)=>{let c=this._client,d=(m,R,_)=>c.sendRequest(Fc.ImplementationRequest.type,c.code2ProtocolConverter.asTextDocumentPositionParams(m,R),_).then(T=>_.isCancellationRequested?null:c.protocol2CodeConverter.asDefinitionResult(T,_),T=>c.handleFailedRequest(Fc.ImplementationRequest.type,_,T,null)),h=c.middleware;return h.provideImplementation?h.provideImplementation(r,o,a,d):d(r,o,a)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return Uy.languages.registerImplementationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};Yr.ImplementationFeature=Oc});var Vl=I(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.TypeDefinitionFeature=void 0;var zy=require("vscode"),Ic=X(),ir=ue(),Nc=class extends ir.TextDocumentLanguageFeature{constructor(e){super(e,Ic.TypeDefinitionRequest.type)}fillClientCapabilities(e){(0,ir.ensure)((0,ir.ensure)(e,"textDocument"),"typeDefinition").dynamicRegistration=!0;let t=(0,ir.ensure)((0,ir.ensure)(e,"textDocument"),"typeDefinition");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[n,r]=this.getRegistration(t,e.typeDefinitionProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let t=e.documentSelector,n={provideTypeDefinition:(r,o,a)=>{let c=this._client,d=(m,R,_)=>c.sendRequest(Ic.TypeDefinitionRequest.type,c.code2ProtocolConverter.asTextDocumentPositionParams(m,R),_).then(T=>_.isCancellationRequested?null:c.protocol2CodeConverter.asDefinitionResult(T,_),T=>c.handleFailedRequest(Ic.TypeDefinitionRequest.type,_,T,null)),h=c.middleware;return h.provideTypeDefinition?h.provideTypeDefinition(r,o,a,d):d(r,o,a)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return zy.languages.registerTypeDefinitionProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};Zr.TypeDefinitionFeature=Nc});var Bl=I(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.WorkspaceFoldersFeature=Ci.arrayDiff=void 0;var $y=Ee(),eo=require("vscode"),rr=X();function Lc(i,e){if(i!==void 0)return i[e]}function Mc(i,e){return i.filter(t=>e.indexOf(t)<0)}Ci.arrayDiff=Mc;var jc=class{constructor(e){this._client=e,this._listeners=new Map}getState(){return{kind:"workspace",id:this.registrationType.method,registrations:this._listeners.size>0}}get registrationType(){return rr.DidChangeWorkspaceFoldersNotification.type}fillInitializeParams(e){let t=eo.workspace.workspaceFolders;this.initializeWithFolders(t),t===void 0?e.workspaceFolders=null:e.workspaceFolders=t.map(n=>this.asProtocol(n))}initializeWithFolders(e){this._initialFolders=e}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.workspaceFolders=!0}initialize(e){let t=this._client;t.onRequest(rr.WorkspaceFoldersRequest.type,o=>{let a=()=>{let d=eo.workspace.workspaceFolders;return d===void 0?null:d.map(m=>this.asProtocol(m))},c=t.middleware.workspace;return c&&c.workspaceFolders?c.workspaceFolders(o,a):a(o)});let n=Lc(Lc(Lc(e,"workspace"),"workspaceFolders"),"changeNotifications"),r;typeof n=="string"?r=n:n===!0&&(r=$y.generateUuid()),r&&this.register({id:r,registerOptions:void 0})}sendInitialEvent(e){let t;if(this._initialFolders&&e){let n=Mc(this._initialFolders,e),r=Mc(e,this._initialFolders);(r.length>0||n.length>0)&&(t=this.doSendEvent(r,n))}else this._initialFolders?t=this.doSendEvent([],this._initialFolders):e&&(t=this.doSendEvent(e,[]));t!==void 0&&t.catch(n=>{this._client.error(`Sending notification ${rr.DidChangeWorkspaceFoldersNotification.type.method} failed`,n)})}doSendEvent(e,t){let n={event:{added:e.map(r=>this.asProtocol(r)),removed:t.map(r=>this.asProtocol(r))}};return this._client.sendNotification(rr.DidChangeWorkspaceFoldersNotification.type,n)}register(e){let t=e.id,n=this._client,r=eo.workspace.onDidChangeWorkspaceFolders(o=>{let a=h=>this.doSendEvent(h.added,h.removed),c=n.middleware.workspace;(c&&c.didChangeWorkspaceFolders?c.didChangeWorkspaceFolders(o,a):a(o)).catch(h=>{this._client.error(`Sending notification ${rr.DidChangeWorkspaceFoldersNotification.type.method} failed`,h)})});this._listeners.set(t,r),this.sendInitialEvent(eo.workspace.workspaceFolders)}unregister(e){let t=this._listeners.get(e);t!==void 0&&(this._listeners.delete(e),t.dispose())}dispose(){for(let e of this._listeners.values())e.dispose();this._listeners.clear()}asProtocol(e){return e===void 0?null:{uri:this._client.code2ProtocolConverter.asUri(e.uri),name:e.name}}};Ci.WorkspaceFoldersFeature=jc});var Ql=I(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.FoldingRangeFeature=void 0;var Vy=require("vscode"),_i=X(),Ac=ue(),Hc=class extends Ac.TextDocumentLanguageFeature{constructor(e){super(e,_i.FoldingRangeRequest.type)}fillClientCapabilities(e){let t=(0,Ac.ensure)((0,Ac.ensure)(e,"textDocument"),"foldingRange");t.dynamicRegistration=!0,t.rangeLimit=5e3,t.lineFoldingOnly=!0,t.foldingRangeKind={valueSet:[_i.FoldingRangeKind.Comment,_i.FoldingRangeKind.Imports,_i.FoldingRangeKind.Region]},t.foldingRange={collapsedText:!1}}initialize(e,t){let[n,r]=this.getRegistration(t,e.foldingRangeProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let t=e.documentSelector,n={provideFoldingRanges:(r,o,a)=>{let c=this._client,d=(m,R,_)=>{let T={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(m)};return c.sendRequest(_i.FoldingRangeRequest.type,T,_).then(y=>_.isCancellationRequested?null:c.protocol2CodeConverter.asFoldingRanges(y,_),y=>c.handleFailedRequest(_i.FoldingRangeRequest.type,_,y,null))},h=c.middleware;return h.provideFoldingRanges?h.provideFoldingRanges(r,o,a,d):d(r,o,a)}};return[Vy.languages.registerFoldingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(t),n),n]}};to.FoldingRangeFeature=Hc});var Jl=I(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.DeclarationFeature=void 0;var By=require("vscode"),Wc=X(),Kc=ue(),Uc=class extends Kc.TextDocumentLanguageFeature{constructor(e){super(e,Wc.DeclarationRequest.type)}fillClientCapabilities(e){let t=(0,Kc.ensure)((0,Kc.ensure)(e,"textDocument"),"declaration");t.dynamicRegistration=!0,t.linkSupport=!0}initialize(e,t){let[n,r]=this.getRegistration(t,e.declarationProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let t=e.documentSelector,n={provideDeclaration:(r,o,a)=>{let c=this._client,d=(m,R,_)=>c.sendRequest(Wc.DeclarationRequest.type,c.code2ProtocolConverter.asTextDocumentPositionParams(m,R),_).then(T=>_.isCancellationRequested?null:c.protocol2CodeConverter.asDeclarationResult(T,_),T=>c.handleFailedRequest(Wc.DeclarationRequest.type,_,T,null)),h=c.middleware;return h.provideDeclaration?h.provideDeclaration(r,o,a,d):d(r,o,a)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return By.languages.registerDeclarationProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};no.DeclarationFeature=Uc});var Gl=I(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.SelectionRangeFeature=void 0;var Qy=require("vscode"),zc=X(),$c=ue(),Vc=class extends $c.TextDocumentLanguageFeature{constructor(e){super(e,zc.SelectionRangeRequest.type)}fillClientCapabilities(e){let t=(0,$c.ensure)((0,$c.ensure)(e,"textDocument"),"selectionRange");t.dynamicRegistration=!0}initialize(e,t){let[n,r]=this.getRegistration(t,e.selectionRangeProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let t=e.documentSelector,n={provideSelectionRanges:(r,o,a)=>{let c=this._client,d=async(m,R,_)=>{let T={textDocument:c.code2ProtocolConverter.asTextDocumentIdentifier(m),positions:await c.code2ProtocolConverter.asPositions(R,_)};return c.sendRequest(zc.SelectionRangeRequest.type,T,_).then(y=>_.isCancellationRequested?null:c.protocol2CodeConverter.asSelectionRanges(y,_),y=>c.handleFailedRequest(zc.SelectionRangeRequest.type,_,y,null))},h=c.middleware;return h.provideSelectionRanges?h.provideSelectionRanges(r,o,a,d):d(r,o,a)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return Qy.languages.registerSelectionRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};io.SelectionRangeFeature=Vc});var Yl=I(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.ProgressFeature=void 0;var Xl=X(),Jy=Ma();function Gy(i,e){return i[e]===void 0&&(i[e]=Object.create(null)),i[e]}var Bc=class{constructor(e){this._client=e,this.activeParts=new Set}getState(){return{kind:"window",id:Xl.WorkDoneProgressCreateRequest.method,registrations:this.activeParts.size>0}}fillClientCapabilities(e){Gy(e,"window").workDoneProgress=!0}initialize(){let e=this._client,t=r=>{this.activeParts.delete(r)},n=r=>{this.activeParts.add(new Jy.ProgressPart(this._client,r.token,t))};e.onRequest(Xl.WorkDoneProgressCreateRequest.type,n)}dispose(){for(let e of this.activeParts)e.done();this.activeParts.clear()}};ro.ProgressFeature=Bc});var Zl=I(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.CallHierarchyFeature=void 0;var Xy=require("vscode"),Yn=X(),Qc=ue(),Jc=class{constructor(e){this.client=e,this.middleware=e.middleware}prepareCallHierarchy(e,t,n){let r=this.client,o=this.middleware,a=(c,d,h)=>{let m=r.code2ProtocolConverter.asTextDocumentPositionParams(c,d);return r.sendRequest(Yn.CallHierarchyPrepareRequest.type,m,h).then(R=>h.isCancellationRequested?null:r.protocol2CodeConverter.asCallHierarchyItems(R,h),R=>r.handleFailedRequest(Yn.CallHierarchyPrepareRequest.type,h,R,null))};return o.prepareCallHierarchy?o.prepareCallHierarchy(e,t,n,a):a(e,t,n)}provideCallHierarchyIncomingCalls(e,t){let n=this.client,r=this.middleware,o=(a,c)=>{let d={item:n.code2ProtocolConverter.asCallHierarchyItem(a)};return n.sendRequest(Yn.CallHierarchyIncomingCallsRequest.type,d,c).then(h=>c.isCancellationRequested?null:n.protocol2CodeConverter.asCallHierarchyIncomingCalls(h,c),h=>n.handleFailedRequest(Yn.CallHierarchyIncomingCallsRequest.type,c,h,null))};return r.provideCallHierarchyIncomingCalls?r.provideCallHierarchyIncomingCalls(e,t,o):o(e,t)}provideCallHierarchyOutgoingCalls(e,t){let n=this.client,r=this.middleware,o=(a,c)=>{let d={item:n.code2ProtocolConverter.asCallHierarchyItem(a)};return n.sendRequest(Yn.CallHierarchyOutgoingCallsRequest.type,d,c).then(h=>c.isCancellationRequested?null:n.protocol2CodeConverter.asCallHierarchyOutgoingCalls(h,c),h=>n.handleFailedRequest(Yn.CallHierarchyOutgoingCallsRequest.type,c,h,null))};return r.provideCallHierarchyOutgoingCalls?r.provideCallHierarchyOutgoingCalls(e,t,o):o(e,t)}},Gc=class extends Qc.TextDocumentLanguageFeature{constructor(e){super(e,Yn.CallHierarchyPrepareRequest.type)}fillClientCapabilities(e){let t=e,n=(0,Qc.ensure)((0,Qc.ensure)(t,"textDocument"),"callHierarchy");n.dynamicRegistration=!0}initialize(e,t){let[n,r]=this.getRegistration(t,e.callHierarchyProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let t=this._client,n=new Jc(t);return[Xy.languages.registerCallHierarchyProvider(this._client.protocol2CodeConverter.asDocumentSelector(e.documentSelector),n),n]}};oo.CallHierarchyFeature=Gc});var ef=I(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.SemanticTokensFeature=void 0;var so=require("vscode"),Z=X(),or=ue(),Yy=Xt(),Xc=class extends or.TextDocumentLanguageFeature{constructor(e){super(e,Z.SemanticTokensRegistrationType.type)}fillClientCapabilities(e){let t=(0,or.ensure)((0,or.ensure)(e,"textDocument"),"semanticTokens");t.dynamicRegistration=!0,t.tokenTypes=[Z.SemanticTokenTypes.namespace,Z.SemanticTokenTypes.type,Z.SemanticTokenTypes.class,Z.SemanticTokenTypes.enum,Z.SemanticTokenTypes.interface,Z.SemanticTokenTypes.struct,Z.SemanticTokenTypes.typeParameter,Z.SemanticTokenTypes.parameter,Z.SemanticTokenTypes.variable,Z.SemanticTokenTypes.property,Z.SemanticTokenTypes.enumMember,Z.SemanticTokenTypes.event,Z.SemanticTokenTypes.function,Z.SemanticTokenTypes.method,Z.SemanticTokenTypes.macro,Z.SemanticTokenTypes.keyword,Z.SemanticTokenTypes.modifier,Z.SemanticTokenTypes.comment,Z.SemanticTokenTypes.string,Z.SemanticTokenTypes.number,Z.SemanticTokenTypes.regexp,Z.SemanticTokenTypes.operator,Z.SemanticTokenTypes.decorator],t.tokenModifiers=[Z.SemanticTokenModifiers.declaration,Z.SemanticTokenModifiers.definition,Z.SemanticTokenModifiers.readonly,Z.SemanticTokenModifiers.static,Z.SemanticTokenModifiers.deprecated,Z.SemanticTokenModifiers.abstract,Z.SemanticTokenModifiers.async,Z.SemanticTokenModifiers.modification,Z.SemanticTokenModifiers.documentation,Z.SemanticTokenModifiers.defaultLibrary],t.formats=[Z.TokenFormat.Relative],t.requests={range:!0,full:{delta:!0}},t.multilineTokenSupport=!1,t.overlappingTokenSupport=!1,t.serverCancelSupport=!0,t.augmentsSyntaxTokens=!0,(0,or.ensure)((0,or.ensure)(e,"workspace"),"semanticTokens").refreshSupport=!0}initialize(e,t){this._client.onRequest(Z.SemanticTokensRefreshRequest.type,async()=>{for(let a of this.getAllProviders())a.onDidChangeSemanticTokensEmitter.fire()});let[r,o]=this.getRegistration(t,e.semanticTokensProvider);!r||!o||this.register({id:r,registerOptions:o})}registerLanguageProvider(e){let t=e.documentSelector,n=Yy.boolean(e.full)?e.full:e.full!==void 0,r=e.full!==void 0&&typeof e.full!="boolean"&&e.full.delta===!0,o=new so.EventEmitter,a=n?{onDidChangeSemanticTokens:o.event,provideDocumentSemanticTokens:(T,y)=>{let P=this._client,O=P.middleware,L=($,H)=>{let G={textDocument:P.code2ProtocolConverter.asTextDocumentIdentifier($)};return P.sendRequest(Z.SemanticTokensRequest.type,G,H).then(z=>H.isCancellationRequested?null:P.protocol2CodeConverter.asSemanticTokens(z,H),z=>P.handleFailedRequest(Z.SemanticTokensRequest.type,H,z,null))};return O.provideDocumentSemanticTokens?O.provideDocumentSemanticTokens(T,y,L):L(T,y)},provideDocumentSemanticTokensEdits:r?(T,y,P)=>{let O=this._client,L=O.middleware,$=(H,G,z)=>{let Re={textDocument:O.code2ProtocolConverter.asTextDocumentIdentifier(H),previousResultId:G};return O.sendRequest(Z.SemanticTokensDeltaRequest.type,Re,z).then(async te=>z.isCancellationRequested?null:Z.SemanticTokens.is(te)?await O.protocol2CodeConverter.asSemanticTokens(te,z):await O.protocol2CodeConverter.asSemanticTokensEdits(te,z),te=>O.handleFailedRequest(Z.SemanticTokensDeltaRequest.type,z,te,null))};return L.provideDocumentSemanticTokensEdits?L.provideDocumentSemanticTokensEdits(T,y,P,$):$(T,y,P)}:void 0}:void 0,d=e.range===!0?{provideDocumentRangeSemanticTokens:(T,y,P)=>{let O=this._client,L=O.middleware,$=(H,G,z)=>{let Re={textDocument:O.code2ProtocolConverter.asTextDocumentIdentifier(H),range:O.code2ProtocolConverter.asRange(G)};return O.sendRequest(Z.SemanticTokensRangeRequest.type,Re,z).then(te=>z.isCancellationRequested?null:O.protocol2CodeConverter.asSemanticTokens(te,z),te=>O.handleFailedRequest(Z.SemanticTokensRangeRequest.type,z,te,null))};return L.provideDocumentRangeSemanticTokens?L.provideDocumentRangeSemanticTokens(T,y,P,$):$(T,y,P)}}:void 0,h=[],m=this._client,R=m.protocol2CodeConverter.asSemanticTokensLegend(e.legend),_=m.protocol2CodeConverter.asDocumentSelector(t);return a!==void 0&&h.push(so.languages.registerDocumentSemanticTokensProvider(_,a,R)),d!==void 0&&h.push(so.languages.registerDocumentRangeSemanticTokensProvider(_,d,R)),[new so.Disposable(()=>h.forEach(T=>T.dispose())),{range:d,full:a,onDidChangeSemanticTokensEmitter:o}]}};ao.SemanticTokensFeature=Xc});var rf=I(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.WillDeleteFilesFeature=Rt.WillRenameFilesFeature=Rt.WillCreateFilesFeature=Rt.DidDeleteFilesFeature=Rt.DidRenameFilesFeature=Rt.DidCreateFilesFeature=void 0;var Ht=require("vscode"),Zy=Tr(),Dn=X(),ev=Ee();function tf(i,e){return i[e]===void 0&&(i[e]={}),i[e]}function tv(i,e){return i[e]}function nf(i,e,t){i[e]=t}var wn=class{constructor(e,t,n,r,o){this._client=e,this._event=t,this._registrationType=n,this._clientCapability=r,this._serverCapability=o,this._filters=new Map}getState(){return{kind:"workspace",id:this._registrationType.method,registrations:this._filters.size>0}}filterSize(){return this._filters.size}get registrationType(){return this._registrationType}fillClientCapabilities(e){let t=tf(tf(e,"workspace"),"fileOperations");nf(t,"dynamicRegistration",!0),nf(t,this._clientCapability,!0)}initialize(e){let t=e.workspace?.fileOperations,n=t!==void 0?tv(t,this._serverCapability):void 0;if(n?.filters!==void 0)try{this.register({id:ev.generateUuid(),registerOptions:{filters:n.filters}})}catch(r){this._client.warn(`Ignoring invalid glob pattern for ${this._serverCapability} registration: ${r}`)}}register(e){this._listener||(this._listener=this._event(this.send,this));let t=e.registerOptions.filters.map(n=>{let r=new Zy.Minimatch(n.pattern.glob,wn.asMinimatchOptions(n.pattern.options));if(!r.makeRe())throw new Error(`Invalid pattern ${n.pattern.glob}!`);return{scheme:n.scheme,matcher:r,kind:n.pattern.matches}});this._filters.set(e.id,t)}unregister(e){this._filters.delete(e),this._filters.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}dispose(){this._filters.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}getFileType(e){return wn.getFileType(e)}async filter(e,t){let n=await Promise.all(e.files.map(async o=>{let a=t(o),c=a.fsPath.replace(/\\/g,"/");for(let d of this._filters.values())for(let h of d)if(!(h.scheme!==void 0&&h.scheme!==a.scheme)){if(h.matcher.match(c)){if(h.kind===void 0)return!0;let m=await this.getFileType(a);if(m===void 0)return this._client.error(`Failed to determine file type for ${a.toString()}.`),!0;if(m===Ht.FileType.File&&h.kind===Dn.FileOperationPatternKind.file||m===Ht.FileType.Directory&&h.kind===Dn.FileOperationPatternKind.folder)return!0}else if(h.kind===Dn.FileOperationPatternKind.folder&&await wn.getFileType(a)===Ht.FileType.Directory&&h.matcher.match(`${c}/`))return!0}return!1})),r=e.files.filter((o,a)=>n[a]);return{...e,files:r}}static async getFileType(e){try{return(await Ht.workspace.fs.stat(e)).type}catch{return}}static asMinimatchOptions(e){if(e!==void 0&&e.ignoreCase===!0)return{nocase:!0}}},co=class extends wn{constructor(e,t,n,r,o,a,c){super(e,t,n,r,o),this._notificationType=n,this._accessUri=a,this._createParams=c}async send(e){let t=await this.filter(e,this._accessUri);if(t.files.length){let n=async r=>this._client.sendNotification(this._notificationType,this._createParams(r));return this.doSend(t,n)}}},uo=class extends co{constructor(){super(...arguments),this._fsPathFileTypes=new Map}async getFileType(e){let t=e.fsPath;if(this._fsPathFileTypes.has(t))return this._fsPathFileTypes.get(t);let n=await wn.getFileType(e);return n&&this._fsPathFileTypes.set(t,n),n}async cacheFileTypes(e,t){await this.filter(e,t)}clearFileTypeCache(){this._fsPathFileTypes.clear()}unregister(e){super.unregister(e),this.filterSize()===0&&this._willListener&&(this._willListener.dispose(),this._willListener=void 0)}dispose(){super.dispose(),this._willListener&&(this._willListener.dispose(),this._willListener=void 0)}},Yc=class extends co{constructor(e){super(e,Ht.workspace.onDidCreateFiles,Dn.DidCreateFilesNotification.type,"didCreate","didCreate",t=>t,e.code2ProtocolConverter.asDidCreateFilesParams)}doSend(e,t){let n=this._client.middleware.workspace;return n?.didCreateFiles?n.didCreateFiles(e,t):t(e)}};Rt.DidCreateFilesFeature=Yc;var Zc=class extends uo{constructor(e){super(e,Ht.workspace.onDidRenameFiles,Dn.DidRenameFilesNotification.type,"didRename","didRename",t=>t.oldUri,e.code2ProtocolConverter.asDidRenameFilesParams)}register(e){this._willListener||(this._willListener=Ht.workspace.onWillRenameFiles(this.willRename,this)),super.register(e)}willRename(e){e.waitUntil(this.cacheFileTypes(e,t=>t.oldUri))}doSend(e,t){this.clearFileTypeCache();let n=this._client.middleware.workspace;return n?.didRenameFiles?n.didRenameFiles(e,t):t(e)}};Rt.DidRenameFilesFeature=Zc;var eu=class extends uo{constructor(e){super(e,Ht.workspace.onDidDeleteFiles,Dn.DidDeleteFilesNotification.type,"didDelete","didDelete",t=>t,e.code2ProtocolConverter.asDidDeleteFilesParams)}register(e){this._willListener||(this._willListener=Ht.workspace.onWillDeleteFiles(this.willDelete,this)),super.register(e)}willDelete(e){e.waitUntil(this.cacheFileTypes(e,t=>t))}doSend(e,t){this.clearFileTypeCache();let n=this._client.middleware.workspace;return n?.didDeleteFiles?n.didDeleteFiles(e,t):t(e)}};Rt.DidDeleteFilesFeature=eu;var sr=class extends wn{constructor(e,t,n,r,o,a,c){super(e,t,n,r,o),this._requestType=n,this._accessUri=a,this._createParams=c}async send(e){let t=this.waitUntil(e);e.waitUntil(t)}async waitUntil(e){let t=await this.filter(e,this._accessUri);if(t.files.length){let n=r=>this._client.sendRequest(this._requestType,this._createParams(r),r.token).then(this._client.protocol2CodeConverter.asWorkspaceEdit);return this.doSend(t,n)}else return}},tu=class extends sr{constructor(e){super(e,Ht.workspace.onWillCreateFiles,Dn.WillCreateFilesRequest.type,"willCreate","willCreate",t=>t,e.code2ProtocolConverter.asWillCreateFilesParams)}doSend(e,t){let n=this._client.middleware.workspace;return n?.willCreateFiles?n.willCreateFiles(e,t):t(e)}};Rt.WillCreateFilesFeature=tu;var nu=class extends sr{constructor(e){super(e,Ht.workspace.onWillRenameFiles,Dn.WillRenameFilesRequest.type,"willRename","willRename",t=>t.oldUri,e.code2ProtocolConverter.asWillRenameFilesParams)}doSend(e,t){let n=this._client.middleware.workspace;return n?.willRenameFiles?n.willRenameFiles(e,t):t(e)}};Rt.WillRenameFilesFeature=nu;var iu=class extends sr{constructor(e){super(e,Ht.workspace.onWillDeleteFiles,Dn.WillDeleteFilesRequest.type,"willDelete","willDelete",t=>t,e.code2ProtocolConverter.asWillDeleteFilesParams)}doSend(e,t){let n=this._client.middleware.workspace;return n?.willDeleteFiles?n.willDeleteFiles(e,t):t(e)}};Rt.WillDeleteFilesFeature=iu});var of=I(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.LinkedEditingFeature=void 0;var nv=require("vscode"),ru=X(),ou=ue(),su=class extends ou.TextDocumentLanguageFeature{constructor(e){super(e,ru.LinkedEditingRangeRequest.type)}fillClientCapabilities(e){let t=(0,ou.ensure)((0,ou.ensure)(e,"textDocument"),"linkedEditingRange");t.dynamicRegistration=!0}initialize(e,t){let[n,r]=this.getRegistration(t,e.linkedEditingRangeProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let t=e.documentSelector,n={provideLinkedEditingRanges:(r,o,a)=>{let c=this._client,d=(m,R,_)=>c.sendRequest(ru.LinkedEditingRangeRequest.type,c.code2ProtocolConverter.asTextDocumentPositionParams(m,R),_).then(T=>_.isCancellationRequested?null:c.protocol2CodeConverter.asLinkedEditingRanges(T,_),T=>c.handleFailedRequest(ru.LinkedEditingRangeRequest.type,_,T,null)),h=c.middleware;return h.provideLinkedEditingRange?h.provideLinkedEditingRange(r,o,a,d):d(r,o,a)}};return[this.registerProvider(t,n),n]}registerProvider(e,t){return nv.languages.registerLinkedEditingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};lo.LinkedEditingFeature=su});var sf=I(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.TypeHierarchyFeature=void 0;var iv=require("vscode"),Zn=X(),au=ue(),cu=class{constructor(e){this.client=e,this.middleware=e.middleware}prepareTypeHierarchy(e,t,n){let r=this.client,o=this.middleware,a=(c,d,h)=>{let m=r.code2ProtocolConverter.asTextDocumentPositionParams(c,d);return r.sendRequest(Zn.TypeHierarchyPrepareRequest.type,m,h).then(R=>h.isCancellationRequested?null:r.protocol2CodeConverter.asTypeHierarchyItems(R,h),R=>r.handleFailedRequest(Zn.TypeHierarchyPrepareRequest.type,h,R,null))};return o.prepareTypeHierarchy?o.prepareTypeHierarchy(e,t,n,a):a(e,t,n)}provideTypeHierarchySupertypes(e,t){let n=this.client,r=this.middleware,o=(a,c)=>{let d={item:n.code2ProtocolConverter.asTypeHierarchyItem(a)};return n.sendRequest(Zn.TypeHierarchySupertypesRequest.type,d,c).then(h=>c.isCancellationRequested?null:n.protocol2CodeConverter.asTypeHierarchyItems(h,c),h=>n.handleFailedRequest(Zn.TypeHierarchySupertypesRequest.type,c,h,null))};return r.provideTypeHierarchySupertypes?r.provideTypeHierarchySupertypes(e,t,o):o(e,t)}provideTypeHierarchySubtypes(e,t){let n=this.client,r=this.middleware,o=(a,c)=>{let d={item:n.code2ProtocolConverter.asTypeHierarchyItem(a)};return n.sendRequest(Zn.TypeHierarchySubtypesRequest.type,d,c).then(h=>c.isCancellationRequested?null:n.protocol2CodeConverter.asTypeHierarchyItems(h,c),h=>n.handleFailedRequest(Zn.TypeHierarchySubtypesRequest.type,c,h,null))};return r.provideTypeHierarchySubtypes?r.provideTypeHierarchySubtypes(e,t,o):o(e,t)}},uu=class extends au.TextDocumentLanguageFeature{constructor(e){super(e,Zn.TypeHierarchyPrepareRequest.type)}fillClientCapabilities(e){let t=(0,au.ensure)((0,au.ensure)(e,"textDocument"),"typeHierarchy");t.dynamicRegistration=!0}initialize(e,t){let[n,r]=this.getRegistration(t,e.typeHierarchyProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let t=this._client,n=new cu(t);return[iv.languages.registerTypeHierarchyProvider(t.protocol2CodeConverter.asDocumentSelector(e.documentSelector),n),n]}};fo.TypeHierarchyFeature=uu});var cf=I(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.InlineValueFeature=void 0;var af=require("vscode"),ho=X(),ar=ue(),du=class extends ar.TextDocumentLanguageFeature{constructor(e){super(e,ho.InlineValueRequest.type)}fillClientCapabilities(e){(0,ar.ensure)((0,ar.ensure)(e,"textDocument"),"inlineValue").dynamicRegistration=!0,(0,ar.ensure)((0,ar.ensure)(e,"workspace"),"inlineValue").refreshSupport=!0}initialize(e,t){this._client.onRequest(ho.InlineValueRefreshRequest.type,async()=>{for(let o of this.getAllProviders())o.onDidChangeInlineValues.fire()});let[n,r]=this.getRegistration(t,e.inlineValueProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let t=e.documentSelector,n=new af.EventEmitter,r={onDidChangeInlineValues:n.event,provideInlineValues:(o,a,c,d)=>{let h=this._client,m=(_,T,y,P)=>{let O={textDocument:h.code2ProtocolConverter.asTextDocumentIdentifier(_),range:h.code2ProtocolConverter.asRange(T),context:h.code2ProtocolConverter.asInlineValueContext(y)};return h.sendRequest(ho.InlineValueRequest.type,O,P).then(L=>P.isCancellationRequested?null:h.protocol2CodeConverter.asInlineValues(L,P),L=>h.handleFailedRequest(ho.InlineValueRequest.type,P,L,null))},R=h.middleware;return R.provideInlineValues?R.provideInlineValues(o,a,c,d,m):m(o,a,c,d)}};return[this.registerProvider(t,r),{provider:r,onDidChangeInlineValues:n}]}registerProvider(e,t){return af.languages.registerInlineValuesProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};go.InlineValueFeature=du});var df=I(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.InlayHintsFeature=void 0;var uf=require("vscode"),bi=X(),cr=ue(),lu=class extends cr.TextDocumentLanguageFeature{constructor(e){super(e,bi.InlayHintRequest.type)}fillClientCapabilities(e){let t=(0,cr.ensure)((0,cr.ensure)(e,"textDocument"),"inlayHint");t.dynamicRegistration=!0,t.resolveSupport={properties:["tooltip","textEdits","label.tooltip","label.location","label.command"]},(0,cr.ensure)((0,cr.ensure)(e,"workspace"),"inlayHint").refreshSupport=!0}initialize(e,t){this._client.onRequest(bi.InlayHintRefreshRequest.type,async()=>{for(let o of this.getAllProviders())o.onDidChangeInlayHints.fire()});let[n,r]=this.getRegistration(t,e.inlayHintProvider);!n||!r||this.register({id:n,registerOptions:r})}registerLanguageProvider(e){let t=e.documentSelector,n=new uf.EventEmitter,r={onDidChangeInlayHints:n.event,provideInlayHints:(o,a,c)=>{let d=this._client,h=async(R,_,T)=>{let y={textDocument:d.code2ProtocolConverter.asTextDocumentIdentifier(R),range:d.code2ProtocolConverter.asRange(_)};try{let P=await d.sendRequest(bi.InlayHintRequest.type,y,T);return T.isCancellationRequested?null:d.protocol2CodeConverter.asInlayHints(P,T)}catch(P){return d.handleFailedRequest(bi.InlayHintRequest.type,T,P,null)}},m=d.middleware;return m.provideInlayHints?m.provideInlayHints(o,a,c,h):h(o,a,c)}};return r.resolveInlayHint=e.resolveProvider===!0?(o,a)=>{let c=this._client,d=async(m,R)=>{try{let _=await c.sendRequest(bi.InlayHintResolveRequest.type,c.code2ProtocolConverter.asInlayHint(m),R);if(R.isCancellationRequested)return null;let T=c.protocol2CodeConverter.asInlayHint(_,R);return R.isCancellationRequested?null:T}catch(_){return c.handleFailedRequest(bi.InlayHintResolveRequest.type,R,_,null)}},h=c.middleware;return h.resolveInlayHint?h.resolveInlayHint(o,a,d):d(o,a)}:void 0,[this.registerProvider(t,r),{provider:r,onDidChangeInlayHints:n}]}registerProvider(e,t){return uf.languages.registerInlayHintsProvider(this._client.protocol2CodeConverter.asDocumentSelector(e),t)}};po.InlayHintsFeature=lu});var mf=I(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.ProposedFeatures=Pe.BaseLanguageClient=Pe.MessageTransports=Pe.SuspendMode=Pe.State=Pe.CloseAction=Pe.ErrorAction=Pe.RevealOutputChannelOn=void 0;var Ce=require("vscode"),M=X(),rv=hl(),ov=ml(),Wt=Xt(),lf=Qi(),ff=Ee(),sv=Ma(),Zt=ue(),av=oa(),hf=Rl(),gf=Ka(),Ri=wl(),cv=Sl(),uv=Tl(),dv=ql(),lv=kl(),fv=xl(),hv=uc(),gv=El(),pv=Ol(),mv=Il(),yv=Ll(),fu=Ml(),vv=Al(),Cv=Hl(),_v=Kl(),bv=Ul(),Rv=zl(),Dv=Ka(),wv=$l(),Sv=Vl(),Tv=Bl(),qv=Ql(),Pv=Jl(),kv=Gl(),xv=Yl(),Fv=Zl(),Ev=ef(),Di=rf(),Ov=of(),Iv=sf(),Nv=cf(),Lv=df(),ur;(function(i){i[i.Info=1]="Info",i[i.Warn=2]="Warn",i[i.Error=3]="Error",i[i.Never=4]="Never"})(ur=Pe.RevealOutputChannelOn||(Pe.RevealOutputChannelOn={}));var yo;(function(i){i[i.Continue=1]="Continue",i[i.Shutdown=2]="Shutdown"})(yo=Pe.ErrorAction||(Pe.ErrorAction={}));var ei;(function(i){i[i.DoNotRestart=1]="DoNotRestart",i[i.Restart=2]="Restart"})(ei=Pe.CloseAction||(Pe.CloseAction={}));var mo;(function(i){i[i.Stopped=1]="Stopped",i[i.Starting=3]="Starting",i[i.Running=2]="Running"})(mo=Pe.State||(Pe.State={}));var Mv;(function(i){i.off="off",i.on="on"})(Mv=Pe.SuspendMode||(Pe.SuspendMode={}));var hu=class{constructor(e,t){this.client=e,this.maxRestartCount=t,this.restarts=[]}error(e,t,n){return n&&n<=3?{action:yo.Continue}:{action:yo.Shutdown}}closed(){return this.restarts.push(Date.now()),this.restarts.length<=this.maxRestartCount?{action:ei.Restart}:this.restarts[this.restarts.length-1]-this.restarts[0]<=3*60*1e3?{action:ei.DoNotRestart,message:`The ${this.client.name} server crashed ${this.maxRestartCount+1} times in the last 3 minutes. The server will not be restarted. See the output for more information.`}:(this.restarts.shift(),{action:ei.Restart})}},de;(function(i){i.Initial="initial",i.Starting="starting",i.StartFailed="startFailed",i.Running="running",i.Stopping="stopping",i.Stopped="stopped"})(de||(de={}));var jv;(function(i){function e(t){return t&&M.MessageReader.is(t.reader)&&M.MessageWriter.is(t.writer)}i.is=e})(jv=Pe.MessageTransports||(Pe.MessageTransports={}));var ti=class{constructor(e,t,n){this._traceFormat=M.TraceFormat.Text,this._diagnosticQueue=new Map,this._diagnosticQueueState={state:"idle"},this._features=[],this._dynamicFeatures=new Map,this.workspaceEditLock=new lf.Semaphore(1),this._id=e,this._name=t,n=n||{};let r={isTrusted:!1,supportHtml:!1};n.markdown!==void 0&&(r.isTrusted=n.markdown.isTrusted===!0,r.supportHtml=n.markdown.supportHtml===!0),this._clientOptions={documentSelector:n.documentSelector??[],synchronize:n.synchronize??{},diagnosticCollectionName:n.diagnosticCollectionName,outputChannelName:n.outputChannelName??this._name,revealOutputChannelOn:n.revealOutputChannelOn??ur.Error,stdioEncoding:n.stdioEncoding??"utf8",initializationOptions:n.initializationOptions,initializationFailedHandler:n.initializationFailedHandler,progressOnInitialization:!!n.progressOnInitialization,errorHandler:n.errorHandler??this.createDefaultErrorHandler(n.connectionOptions?.maxRestartCount),middleware:n.middleware??{},uriConverters:n.uriConverters,workspaceFolder:n.workspaceFolder,connectionOptions:n.connectionOptions,markdown:r,diagnosticPullOptions:n.diagnosticPullOptions??{onChange:!0,onSave:!1},notebookDocumentOptions:n.notebookDocumentOptions??{}},this._clientOptions.synchronize=this._clientOptions.synchronize||{},this._state=de.Initial,this._ignoredRegistrations=new Set,this._notificationHandlers=new Map,this._pendingNotificationHandlers=new Map,this._notificationDisposables=new Map,this._requestHandlers=new Map,this._pendingRequestHandlers=new Map,this._requestDisposables=new Map,this._progressHandlers=new Map,this._pendingProgressHandlers=new Map,this._progressDisposables=new Map,this._connection=void 0,this._initializeResult=void 0,n.outputChannel?(this._outputChannel=n.outputChannel,this._disposeOutputChannel=!1):(this._outputChannel=void 0,this._disposeOutputChannel=!0),this._traceOutputChannel=n.traceOutputChannel,this._diagnostics=void 0,this._fileEvents=[],this._fileEventDelayer=new lf.Delayer(250),this._onStop=void 0,this._telemetryEmitter=new M.Emitter,this._stateChangeEmitter=new M.Emitter,this._trace=M.Trace.Off,this._tracer={log:(o,a)=>{Wt.string(o)?this.logTrace(o,a):this.logObjectTrace(o)}},this._c2p=rv.createConverter(n.uriConverters?n.uriConverters.code2Protocol:void 0),this._p2c=ov.createConverter(n.uriConverters?n.uriConverters.protocol2Code:void 0,this._clientOptions.markdown.isTrusted,this._clientOptions.markdown.supportHtml),this._syncedDocuments=new Map,this.registerBuiltinFeatures()}get name(){return this._name}get middleware(){return this._clientOptions.middleware??Object.create(null)}get clientOptions(){return this._clientOptions}get protocol2CodeConverter(){return this._p2c}get code2ProtocolConverter(){return this._c2p}get onTelemetry(){return this._telemetryEmitter.event}get onDidChangeState(){return this._stateChangeEmitter.event}get outputChannel(){return this._outputChannel||(this._outputChannel=Ce.window.createOutputChannel(this._clientOptions.outputChannelName?this._clientOptions.outputChannelName:this._name)),this._outputChannel}get traceOutputChannel(){return this._traceOutputChannel?this._traceOutputChannel:this.outputChannel}get diagnostics(){return this._diagnostics}get state(){return this.getPublicState()}get $state(){return this._state}set $state(e){let t=this.getPublicState();this._state=e;let n=this.getPublicState();n!==t&&this._stateChangeEmitter.fire({oldState:t,newState:n})}getPublicState(){switch(this.$state){case de.Starting:return mo.Starting;case de.Running:return mo.Running;default:return mo.Stopped}}get initializeResult(){return this._initializeResult}async sendRequest(e,...t){if(this.$state===de.StartFailed||this.$state===de.Stopping||this.$state===de.Stopped)return Promise.reject(new M.ResponseError(M.ErrorCodes.ConnectionInactive,"Client is not running"));try{let n=await this.$start();return this.forceDocumentSync(),n.sendRequest(e,...t)}catch(n){throw this.error(`Sending request ${Wt.string(e)?e:e.method} failed.`,n),n}}onRequest(e,t){let n=typeof e=="string"?e:e.method;this._requestHandlers.set(n,t);let r=this.activeConnection(),o;return r!==void 0?(this._requestDisposables.set(n,r.onRequest(e,t)),o={dispose:()=>{let a=this._requestDisposables.get(n);a!==void 0&&(a.dispose(),this._requestDisposables.delete(n))}}):(this._pendingRequestHandlers.set(n,t),o={dispose:()=>{this._pendingRequestHandlers.delete(n);let a=this._requestDisposables.get(n);a!==void 0&&(a.dispose(),this._requestDisposables.delete(n))}}),{dispose:()=>{this._requestHandlers.delete(n),o.dispose()}}}async sendNotification(e,t){if(this.$state===de.StartFailed||this.$state===de.Stopping||this.$state===de.Stopped)return Promise.reject(new M.ResponseError(M.ErrorCodes.ConnectionInactive,"Client is not running"));try{let n=await this.$start();return this.forceDocumentSync(),n.sendNotification(e,t)}catch(n){throw this.error(`Sending notification ${Wt.string(e)?e:e.method} failed.`,n),n}}onNotification(e,t){let n=typeof e=="string"?e:e.method;this._notificationHandlers.set(n,t);let r=this.activeConnection(),o;return r!==void 0?(this._notificationDisposables.set(n,r.onNotification(e,t)),o={dispose:()=>{let a=this._notificationDisposables.get(n);a!==void 0&&(a.dispose(),this._notificationDisposables.delete(n))}}):(this._pendingNotificationHandlers.set(n,t),o={dispose:()=>{this._pendingNotificationHandlers.delete(n);let a=this._notificationDisposables.get(n);a!==void 0&&(a.dispose(),this._notificationDisposables.delete(n))}}),{dispose:()=>{this._notificationHandlers.delete(n),o.dispose()}}}async sendProgress(e,t,n){try{return(await this.$start()).sendProgress(e,t,n)}catch(r){throw this.error(`Sending progress for token ${t} failed.`,r),r}}onProgress(e,t,n){this._progressHandlers.set(t,{type:e,handler:n});let r=this.activeConnection(),o,a=this._clientOptions.middleware?.handleWorkDoneProgress,c=M.WorkDoneProgress.is(e)&&a!==void 0?d=>{a(t,d,()=>n(d))}:n;return r!==void 0?(this._progressDisposables.set(t,r.onProgress(e,t,c)),o={dispose:()=>{let d=this._progressDisposables.get(t);d!==void 0&&(d.dispose(),this._progressDisposables.delete(t))}}):(this._pendingProgressHandlers.set(t,{type:e,handler:n}),o={dispose:()=>{this._pendingProgressHandlers.delete(t);let d=this._progressDisposables.get(t);d!==void 0&&(d.dispose(),this._progressDisposables.delete(t))}}),{dispose:()=>{this._progressHandlers.delete(t),o.dispose()}}}createDefaultErrorHandler(e){if(e!==void 0&&e<0)throw new Error(`Invalid maxRestartCount: ${e}`);return new hu(this,e??4)}async setTrace(e){this._trace=e;let t=this.activeConnection();t!==void 0&&await t.trace(this._trace,this._tracer,{sendNotification:!1,traceFormat:this._traceFormat})}data2String(e){if(e instanceof M.ResponseError){let t=e;return` Message: ${t.message}
38
38
  Code: ${t.code} ${t.data?`
39
- `+t.data.toString():""}`}return e instanceof Error?Wt.string(e.stack)?e.stack:e.message:Wt.string(e)?e:e.toString()}info(e,t,n=!0){this.outputChannel.appendLine(`[Info - ${new Date().toLocaleTimeString()}] ${e}`),t!=null&&this.outputChannel.appendLine(this.data2String(t)),n&&this._clientOptions.revealOutputChannelOn<=ur.Info&&this.showNotificationMessage(M.MessageType.Info,e)}warn(e,t,n=!0){this.outputChannel.appendLine(`[Warn - ${new Date().toLocaleTimeString()}] ${e}`),t!=null&&this.outputChannel.appendLine(this.data2String(t)),n&&this._clientOptions.revealOutputChannelOn<=ur.Warn&&this.showNotificationMessage(M.MessageType.Warning,e)}error(e,t,n=!0){this.outputChannel.appendLine(`[Error - ${new Date().toLocaleTimeString()}] ${e}`),t!=null&&this.outputChannel.appendLine(this.data2String(t)),(n==="force"||n&&this._clientOptions.revealOutputChannelOn<=ur.Error)&&this.showNotificationMessage(M.MessageType.Error,e)}showNotificationMessage(e,t){t=t??"A request has failed. See the output for more information.",(e===M.MessageType.Error?Ce.window.showErrorMessage:e===M.MessageType.Warning?Ce.window.showWarningMessage:Ce.window.showInformationMessage)(t,"Go to output").then(r=>{r!==void 0&&this.outputChannel.show(!0)})}logTrace(e,t){this.traceOutputChannel.appendLine(`[Trace - ${new Date().toLocaleTimeString()}] ${e}`),t&&this.traceOutputChannel.appendLine(this.data2String(t))}logObjectTrace(e){e.isLSPMessage&&e.type?this.traceOutputChannel.append(`[LSP - ${new Date().toLocaleTimeString()}] `):this.traceOutputChannel.append(`[Trace - ${new Date().toLocaleTimeString()}] `),e&&this.traceOutputChannel.appendLine(`${JSON.stringify(e)}`)}needsStart(){return this.$state===de.Initial||this.$state===de.Stopping||this.$state===de.Stopped}needsStop(){return this.$state===de.Starting||this.$state===de.Running}activeConnection(){return this.$state===de.Running&&this._connection!==void 0?this._connection:void 0}isRunning(){return this.$state===de.Running}async start(){if(this._onStart!==void 0)return this._onStart;let[e,t,n]=this.createOnStartPromise();this._onStart=e,this._onStop!==void 0&&(await this._onStop,this._onStop=void 0),this._diagnostics===void 0&&(this._diagnostics=this._clientOptions.diagnosticCollectionName?Ce.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName):Ce.languages.createDiagnosticCollection());for(let[r,o]of this._notificationHandlers)this._pendingNotificationHandlers.has(r)||this._pendingNotificationHandlers.set(r,o);for(let[r,o]of this._requestHandlers)this._pendingRequestHandlers.has(r)||this._pendingRequestHandlers.set(r,o);for(let[r,o]of this._progressHandlers)this._pendingProgressHandlers.has(r)||this._pendingProgressHandlers.set(r,o);this.$state=de.Starting;try{let r=await this.createConnection();r.onNotification(M.LogMessageNotification.type,o=>{switch(o.type){case M.MessageType.Error:this.error(o.message,void 0,!1);break;case M.MessageType.Warning:this.warn(o.message,void 0,!1);break;case M.MessageType.Info:this.info(o.message,void 0,!1);break;default:this.outputChannel.appendLine(o.message)}}),r.onNotification(M.ShowMessageNotification.type,o=>{switch(o.type){case M.MessageType.Error:Ce.window.showErrorMessage(o.message);break;case M.MessageType.Warning:Ce.window.showWarningMessage(o.message);break;case M.MessageType.Info:Ce.window.showInformationMessage(o.message);break;default:Ce.window.showInformationMessage(o.message)}}),r.onRequest(M.ShowMessageRequest.type,o=>{let a;switch(o.type){case M.MessageType.Error:a=Ce.window.showErrorMessage;break;case M.MessageType.Warning:a=Ce.window.showWarningMessage;break;case M.MessageType.Info:a=Ce.window.showInformationMessage;break;default:a=Ce.window.showInformationMessage}let c=o.actions||[];return a(o.message,...c)}),r.onNotification(M.TelemetryEventNotification.type,o=>{this._telemetryEmitter.fire(o)}),r.onRequest(M.ShowDocumentRequest.type,async o=>{let a=async d=>{let h=this.protocol2CodeConverter.asUri(d.uri);try{if(d.external===!0)return{success:await Ce.env.openExternal(h)};{let m={};return d.selection!==void 0&&(m.selection=this.protocol2CodeConverter.asRange(d.selection)),d.takeFocus===void 0||d.takeFocus===!1?m.preserveFocus=!0:d.takeFocus===!0&&(m.preserveFocus=!1),await Ce.window.showTextDocument(h,m),{success:!0}}}catch{return{success:!0}}},c=this._clientOptions.middleware.window?.showDocument;return c!==void 0?c(o,a):a(o)}),r.listen(),await this.initialize(r),t()}catch(r){this.$state=de.StartFailed,this.error(`${this._name} client: couldn't create connection to server.`,r,"force"),n(r)}return this._onStart}createOnStartPromise(){let e,t;return[new Promise((r,o)=>{e=r,t=o}),e,t]}async initialize(e){this.refreshTrace(e,!1);let t=this._clientOptions.initializationOptions,[n,r]=this._clientOptions.workspaceFolder!==void 0?[this._clientOptions.workspaceFolder.uri.fsPath,[{uri:this._c2p.asUri(this._clientOptions.workspaceFolder.uri),name:this._clientOptions.workspaceFolder.name}]]:[this._clientGetRootPath(),null],o={processId:null,clientInfo:{name:Ce.env.appName,version:Ce.version},locale:this.getLocale(),rootPath:n||null,rootUri:n?this._c2p.asUri(Ce.Uri.file(n)):null,capabilities:this.computeClientCapabilities(),initializationOptions:Wt.func(t)?t():t,trace:M.Trace.toString(this._trace),workspaceFolders:r};if(this.fillInitializeParams(o),this._clientOptions.progressOnInitialization){let a=ff.generateUuid(),c=new sv.ProgressPart(e,a);o.workDoneToken=a;try{let d=await this.doInitialize(e,o);return c.done(),d}catch(d){throw c.cancel(),d}}else return this.doInitialize(e,o)}async doInitialize(e,t){try{let n=await e.initialize(t);if(n.capabilities.positionEncoding!==void 0&&n.capabilities.positionEncoding!==M.PositionEncodingKind.UTF16)throw new Error(`Unsupported position encoding (${n.capabilities.positionEncoding}) received from server ${this.name}`);this._initializeResult=n,this.$state=de.Running;let r;Wt.number(n.capabilities.textDocumentSync)?n.capabilities.textDocumentSync===M.TextDocumentSyncKind.None?r={openClose:!1,change:M.TextDocumentSyncKind.None,save:void 0}:r={openClose:!0,change:n.capabilities.textDocumentSync,save:{includeText:!1}}:n.capabilities.textDocumentSync!==void 0&&n.capabilities.textDocumentSync!==null&&(r=n.capabilities.textDocumentSync),this._capabilities=Object.assign({},n.capabilities,{resolvedTextDocumentSync:r}),e.onNotification(M.PublishDiagnosticsNotification.type,o=>this.handleDiagnostics(o)),e.onRequest(M.RegistrationRequest.type,o=>this.handleRegistrationRequest(o)),e.onRequest("client/registerFeature",o=>this.handleRegistrationRequest(o)),e.onRequest(M.UnregistrationRequest.type,o=>this.handleUnregistrationRequest(o)),e.onRequest("client/unregisterFeature",o=>this.handleUnregistrationRequest(o)),e.onRequest(M.ApplyWorkspaceEditRequest.type,o=>this.handleApplyWorkspaceEdit(o));for(let[o,a]of this._pendingNotificationHandlers)this._notificationDisposables.set(o,e.onNotification(o,a));this._pendingNotificationHandlers.clear();for(let[o,a]of this._pendingRequestHandlers)this._requestDisposables.set(o,e.onRequest(o,a));this._pendingRequestHandlers.clear();for(let[o,a]of this._pendingProgressHandlers)this._progressDisposables.set(o,e.onProgress(a.type,o,a.handler));return this._pendingProgressHandlers.clear(),await e.sendNotification(M.InitializedNotification.type,{}),this.hookFileEvents(e),this.hookConfigurationChanged(e),this.initializeFeatures(e),n}catch(n){throw this._clientOptions.initializationFailedHandler?this._clientOptions.initializationFailedHandler(n)?this.initialize(e):this.stop():n instanceof M.ResponseError&&n.data&&n.data.retry?Ce.window.showErrorMessage(n.message,{title:"Retry",id:"retry"}).then(r=>{r&&r.id==="retry"?this.initialize(e):this.stop()}):(n&&n.message&&Ce.window.showErrorMessage(n.message),this.error("Server initialization failed.",n),this.stop()),n}}_clientGetRootPath(){let e=Ce.workspace.workspaceFolders;if(!e||e.length===0)return;let t=e[0];if(t.uri.scheme==="file")return t.uri.fsPath}stop(e=2e3){return this.shutdown("stop",e)}suspend(){return this.shutdown("suspend",5e3)}async shutdown(e,t){if(this.$state===de.Stopped||this.$state===de.Initial)return;if(this.$state===de.Stopping&&this._onStop)return this._onStop;let n=await this.$start();this._initializeResult=void 0,this.$state=de.Stopping,this.cleanUp(e);let r=new Promise(a=>{(0,M.RAL)().timer.setTimeout(a,t)}),o=(async a=>(await a.shutdown(),await a.exit(),a))(n);return this._onStop=Promise.race([r,o]).then(a=>{if(a!==void 0)a.end(),a.dispose();else throw this.error("Stopping server timed out",void 0,!1),new Error("Stopping the server timed out")},a=>{throw this.error("Stopping server failed",a,!1),a}).finally(()=>{this.$state=de.Stopped,e==="stop"&&this.cleanUpChannel(),this._onStart=void 0,this._onStop=void 0,this._connection=void 0,this._ignoredRegistrations.clear()})}cleanUp(e){this._fileEvents=[],this._fileEventDelayer.cancel(),this._syncedDocuments&&this._syncedDocuments.clear();for(let t of Array.from(this._features.entries()).map(n=>n[1]).reverse())t.dispose();e==="stop"&&this._diagnostics!==void 0&&(this._diagnostics.dispose(),this._diagnostics=void 0),this._idleInterval!==void 0&&(this._idleInterval.dispose(),this._idleInterval=void 0)}cleanUpChannel(){this._outputChannel!==void 0&&this._disposeOutputChannel&&(this._outputChannel.dispose(),this._outputChannel=void 0)}notifyFileEvent(e){let t=this;async function n(o){return t._fileEvents.push(o),t._fileEventDelayer.trigger(async()=>{let a=await t.$start();t.forceDocumentSync();let c=a.sendNotification(M.DidChangeWatchedFilesNotification.type,{changes:t._fileEvents});return t._fileEvents=[],c})}let r=this.clientOptions.middleware?.workspace;(r?.didChangeWatchedFile?r.didChangeWatchedFile(e,n):n(e)).catch(o=>{t.error("Notify file events failed.",o)})}forceDocumentSync(){this._didChangeTextDocumentFeature===void 0&&(this._didChangeTextDocumentFeature=this._dynamicFeatures.get(M.DidChangeTextDocumentNotification.type.method)),this._didChangeTextDocumentFeature.forceDelivery()}handleDiagnostics(e){if(!this._diagnostics)return;let t=e.uri;this._diagnosticQueueState.state==="busy"&&this._diagnosticQueueState.document===t&&this._diagnosticQueueState.tokenSource.cancel(),this._diagnosticQueue.set(e.uri,e.diagnostics),this.triggerDiagnosticQueue()}triggerDiagnosticQueue(){(0,M.RAL)().timer.setImmediate(()=>{this.workDiagnosticQueue()})}workDiagnosticQueue(){if(this._diagnosticQueueState.state==="busy")return;let e=this._diagnosticQueue.entries().next();if(e.done===!0)return;let[t,n]=e.value;this._diagnosticQueue.delete(t);let r=new Ce.CancellationTokenSource;this._diagnosticQueueState={state:"busy",document:t,tokenSource:r},this._p2c.asDiagnostics(n,r.token).then(o=>{if(!r.token.isCancellationRequested){let a=this._p2c.asUri(t),c=this.clientOptions.middleware;c.handleDiagnostics?c.handleDiagnostics(a,o,(d,h)=>this.setDiagnostics(d,h)):this.setDiagnostics(a,o)}}).finally(()=>{this._diagnosticQueueState={state:"idle"},this.triggerDiagnosticQueue()})}setDiagnostics(e,t){!this._diagnostics||this._diagnostics.set(e,t)}async $start(){if(this.$state===de.StartFailed)throw new Error("Previous start failed. Can't restart server.");await this.start();let e=this.activeConnection();if(e===void 0)throw new Error("Starting server failed");return e}async createConnection(){let e=(r,o,a)=>{this.handleConnectionError(r,o,a)},t=()=>{this.handleConnectionClosed()},n=await this.createMessageTransports(this._clientOptions.stdioEncoding||"utf8");return this._connection=Av(n.reader,n.writer,e,t,this._clientOptions.connectionOptions),this._connection}handleConnectionClosed(){if(this.$state===de.Stopped)return;try{this._connection!==void 0&&this._connection.dispose()}catch{}let e={action:ei.DoNotRestart};if(this.$state!==de.Stopping)try{e=this._clientOptions.errorHandler.closed()}catch{}this._connection=void 0,e.action===ei.DoNotRestart?(this.error(e.message??"Connection to server got closed. Server will not be restarted.",void 0,"force"),this.cleanUp("stop"),this.$state===de.Starting?this.$state=de.StartFailed:this.$state=de.Stopped,this._onStop=Promise.resolve(),this._onStart=void 0):e.action===ei.Restart&&(this.info(e.message??"Connection to server got closed. Server will restart."),this.cleanUp("restart"),this.$state=de.Initial,this._onStop=Promise.resolve(),this._onStart=void 0,this.start().catch(t=>this.error("Restarting server failed",t,"force")))}handleConnectionError(e,t,n){let r=this._clientOptions.errorHandler.error(e,t,n);r.action===yo.Shutdown&&(this.error(r.message??`Client ${this._name}: connection to server is erroring. Shutting down server.`,void 0,"force"),this.stop().catch(o=>{this.error("Stopping server failed",o,!1)}))}hookConfigurationChanged(e){Ce.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)})}refreshTrace(e,t=!1){let n=Ce.workspace.getConfiguration(this._id),r=M.Trace.Off,o=M.TraceFormat.Text;if(n){let a=n.get("trace.server","off");typeof a=="string"?r=M.Trace.fromString(a):(r=M.Trace.fromString(n.get("trace.server.verbosity","off")),o=M.TraceFormat.fromString(n.get("trace.server.format","text")))}this._trace=r,this._traceFormat=o,e.trace(this._trace,this._tracer,{sendNotification:t,traceFormat:this._traceFormat}).catch(a=>{this.error("Updating trace failed with error",a,!1)})}hookFileEvents(e){let t=this._clientOptions.synchronize.fileEvents;if(!t)return;let n;Wt.array(t)?n=t:n=[t],n&&this._dynamicFeatures.get(M.DidChangeWatchedFilesNotification.type.method).registerRaw(ff.generateUuid(),n)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),Zt.DynamicFeature.is(e)){let t=e.registrationType;this._dynamicFeatures.set(t.method,e)}}getFeature(e){return this._dynamicFeatures.get(e)}hasDedicatedTextSynchronizationFeature(e){let t=this.getFeature(M.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof hf.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){this.registerFeature(new gf.ConfigurationFeature(this)),this.registerFeature(new Ri.DidOpenTextDocumentFeature(this,this._syncedDocuments)),this.registerFeature(new Ri.DidChangeTextDocumentFeature(this)),this.registerFeature(new Ri.WillSaveFeature(this)),this.registerFeature(new Ri.WillSaveWaitUntilFeature(this)),this.registerFeature(new Ri.DidSaveTextDocumentFeature(this)),this.registerFeature(new Ri.DidCloseTextDocumentFeature(this,this._syncedDocuments)),this.registerFeature(new bv.FileSystemWatcherFeature(this,e=>this.notifyFileEvent(e))),this.registerFeature(new cv.CompletionItemFeature(this)),this.registerFeature(new uv.HoverFeature(this)),this.registerFeature(new lv.SignatureHelpFeature(this)),this.registerFeature(new dv.DefinitionFeature(this)),this.registerFeature(new pv.ReferencesFeature(this)),this.registerFeature(new fv.DocumentHighlightFeature(this)),this.registerFeature(new hv.DocumentSymbolFeature(this)),this.registerFeature(new gv.WorkspaceSymbolFeature(this)),this.registerFeature(new mv.CodeActionFeature(this)),this.registerFeature(new yv.CodeLensFeature(this)),this.registerFeature(new fu.DocumentFormattingFeature(this)),this.registerFeature(new fu.DocumentRangeFormattingFeature(this)),this.registerFeature(new fu.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new vv.RenameFeature(this)),this.registerFeature(new Cv.DocumentLinkFeature(this)),this.registerFeature(new _v.ExecuteCommandFeature(this)),this.registerFeature(new gf.SyncConfigurationFeature(this)),this.registerFeature(new Dv.ConfigurationFeature(this)),this.registerFeature(new Sv.TypeDefinitionFeature(this)),this.registerFeature(new wv.ImplementationFeature(this)),this.registerFeature(new Rv.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new Tv.WorkspaceFoldersFeature(this)),this.registerFeature(new qv.FoldingRangeFeature(this)),this.registerFeature(new Pv.DeclarationFeature(this)),this.registerFeature(new kv.SelectionRangeFeature(this)),this.registerFeature(new xv.ProgressFeature(this)),this.registerFeature(new Fv.CallHierarchyFeature(this)),this.registerFeature(new Ev.SemanticTokensFeature(this)),this.registerFeature(new Ov.LinkedEditingFeature(this)),this.registerFeature(new Di.DidCreateFilesFeature(this)),this.registerFeature(new Di.DidRenameFilesFeature(this)),this.registerFeature(new Di.DidDeleteFilesFeature(this)),this.registerFeature(new Di.WillCreateFilesFeature(this)),this.registerFeature(new Di.WillRenameFilesFeature(this)),this.registerFeature(new Di.WillDeleteFilesFeature(this)),this.registerFeature(new Iv.TypeHierarchyFeature(this)),this.registerFeature(new Nv.InlineValueFeature(this)),this.registerFeature(new Lv.InlayHintsFeature(this)),this.registerFeature(new av.DiagnosticFeature(this)),this.registerFeature(new hf.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(pf.createAll(this))}fillInitializeParams(e){for(let t of this._features)Wt.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){let e={};(0,Zt.ensure)(e,"workspace").applyEdit=!0;let t=(0,Zt.ensure)((0,Zt.ensure)(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[M.ResourceOperationKind.Create,M.ResourceOperationKind.Rename,M.ResourceOperationKind.Delete],t.failureHandling=M.FailureHandlingKind.TextOnlyTransactional,t.normalizesLineEndings=!0,t.changeAnnotationSupport={groupsOnLabel:!0};let n=(0,Zt.ensure)((0,Zt.ensure)(e,"textDocument"),"publishDiagnostics");n.relatedInformation=!0,n.versionSupport=!1,n.tagSupport={valueSet:[M.DiagnosticTag.Unnecessary,M.DiagnosticTag.Deprecated]},n.codeDescriptionSupport=!0,n.dataSupport=!0;let r=(0,Zt.ensure)(e,"window"),o=(0,Zt.ensure)(r,"showMessage");o.messageActionItem={additionalPropertiesSupport:!0};let a=(0,Zt.ensure)(r,"showDocument");a.support=!0;let c=(0,Zt.ensure)(e,"general");c.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(ti.RequestsToCancelOnContentModified)},c.regularExpressions={engine:"ECMAScript",version:"ES2020"},c.markdown={parser:"marked",version:"1.1.0"},c.positionEncodings=["utf-16"],this._clientOptions.markdown.supportHtml&&(c.markdown.allowedTags=["ul","li","p","code","blockquote","ol","h1","h2","h3","h4","h5","h6","hr","em","pre","table","thead","tbody","tr","th","td","div","del","a","strong","br","img","span"]);for(let d of this._features)d.fillClientCapabilities(e);return e}initializeFeatures(e){let t=this._clientOptions.documentSelector;for(let n of this._features)Wt.func(n.preInitialize)&&n.preInitialize(this._capabilities,t);for(let n of this._features)n.initialize(this._capabilities,t)}async handleRegistrationRequest(e){if(!this.isRunning()){for(let t of e.registrations)this._ignoredRegistrations.add(t.id);return}for(let t of e.registrations){let n=this._dynamicFeatures.get(t.method);if(n===void 0)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Registration failed.`));let r=t.registerOptions??{};r.documentSelector=r.documentSelector??this._clientOptions.documentSelector;let o={id:t.id,registerOptions:r};try{n.register(o)}catch(a){return Promise.reject(a)}}}async handleUnregistrationRequest(e){for(let t of e.unregisterations){if(this._ignoredRegistrations.has(t.id))continue;let n=this._dynamicFeatures.get(t.method);if(!n)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Unregistration failed.`));n.unregister(t.id)}}async handleApplyWorkspaceEdit(e){let t=e.edit,n=await this.workspaceEditLock.lock(()=>this._p2c.asWorkspaceEdit(t)),r=new Map;Ce.workspace.textDocuments.forEach(a=>r.set(a.uri.toString(),a));let o=!1;if(t.documentChanges){for(let a of t.documentChanges)if(M.TextDocumentEdit.is(a)&&a.textDocument.version&&a.textDocument.version>=0){let c=r.get(a.textDocument.uri);if(c&&c.version!==a.textDocument.version){o=!0;break}}}return o?Promise.resolve({applied:!1}):Wt.asPromise(Ce.workspace.applyEdit(n).then(a=>({applied:a})))}handleFailedRequest(e,t,n,r,o=!0){if(n instanceof M.ResponseError){if(n.code===M.ErrorCodes.PendingResponseRejected||n.code===M.ErrorCodes.ConnectionInactive)return r;if(n.code===M.LSPErrorCodes.RequestCancelled||n.code===M.LSPErrorCodes.ServerCancelled){if(t!==void 0&&t.isCancellationRequested)return r;throw n.data!==void 0?new Zt.LSPCancellationError(n.data):new Ce.CancellationError}else if(n.code===M.LSPErrorCodes.ContentModified){if(ti.RequestsToCancelOnContentModified.has(e.method))throw new Ce.CancellationError;return r}}throw this.error(`Request ${e.method} failed.`,n,o),n}};Pe.BaseLanguageClient=ti;ti.RequestsToCancelOnContentModified=new Set([M.SemanticTokensRequest.method,M.SemanticTokensRangeRequest.method,M.SemanticTokensDeltaRequest.method]);var gu=class{error(e){(0,M.RAL)().console.error(e)}warn(e){(0,M.RAL)().console.warn(e)}info(e){(0,M.RAL)().console.info(e)}log(e){(0,M.RAL)().console.log(e)}};function Av(i,e,t,n,r){let o=-1,a=new gu,c=(0,M.createProtocolConnection)(i,e,a,r);return c.onError(h=>{t(h[0],h[1],h[2])}),c.onClose(n),{get lastUsed(){return o},resetLastUsed:()=>{o=-1},listen:()=>c.listen(),sendRequest:(h,...m)=>(o=Date.now(),c.sendRequest(h,...m)),onRequest:(h,m)=>c.onRequest(h,m),hasPendingResponse:()=>c.hasPendingResponse(),sendNotification:(h,m)=>(o=Date.now(),c.sendNotification(h,m)),onNotification:(h,m)=>c.onNotification(h,m),onProgress:c.onProgress,sendProgress:c.sendProgress,trace:(h,m,R)=>{let _={sendNotification:!1,traceFormat:M.TraceFormat.Text};return R===void 0?c.trace(h,m,_):(Wt.boolean(R),c.trace(h,m,R))},initialize:h=>(o=Date.now(),c.sendRequest(M.InitializeRequest.type,h)),shutdown:()=>(o=Date.now(),c.sendRequest(M.ShutdownRequest.type,void 0)),exit:()=>(o=Date.now(),c.sendNotification(M.ExitNotification.type)),end:()=>c.end(),dispose:()=>c.dispose()}}var pf;(function(i){function e(t){return[]}i.createAll=e})(pf=Pe.ProposedFeatures||(Pe.ProposedFeatures={}))});var mu=I(Et=>{"use strict";var Hv=Et&&Et.__createBinding||(Object.create?function(i,e,t,n){n===void 0&&(n=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,r)}:function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]}),pu=Et&&Et.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Hv(e,i,t)};Object.defineProperty(Et,"__esModule",{value:!0});Et.DiagnosticPullMode=Et.vsdiag=void 0;pu(X(),Et);pu(ue(),Et);var yf=oa();Object.defineProperty(Et,"vsdiag",{enumerable:!0,get:function(){return yf.vsdiag}});Object.defineProperty(Et,"DiagnosticPullMode",{enumerable:!0,get:function(){return yf.DiagnosticPullMode}});pu(mf(),Et)});var yu=I((H_,vf)=>{"use strict";vf.exports=X()});var bf=I(cn=>{"use strict";var Wv=cn&&cn.__createBinding||(Object.create?function(i,e,t,n){n===void 0&&(n=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,r)}:function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]}),_f=cn&&cn.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Wv(e,i,t)};Object.defineProperty(cn,"__esModule",{value:!0});cn.LanguageClient=void 0;var Kv=mu(),Cf=yu();_f(yu(),cn);_f(mu(),cn);var vu=class extends Kv.BaseLanguageClient{constructor(e,t,n,r){super(e,t,n),this.worker=r}createMessageTransports(e){let t=new Cf.BrowserMessageReader(this.worker),n=new Cf.BrowserMessageWriter(this.worker);return Promise.resolve({reader:t,writer:n})}getLocale(){return"en"}};cn.LanguageClient=vu});var Df=I((K_,Rf)=>{"use strict";Rf.exports=bf()});var Qv={};Du(Qv,{activate:()=>Vv});module.exports=Mf(Qv);var qf=require("vscode"),vo=Lf(Df());var Cu={};Du(Cu,{onDidChangeConfiguration:()=>zv,selectVersionCommand:()=>Uv});function Uv(){}async function zv(){}var nt=require("vscode");function wf(i,e,t){let n=[];nt.workspace.onDidChangeTextDocument(d=>c(d.document,d.contentChanges),null,n);let r=!1;a(),nt.window.onDidChangeActiveTextEditor(a,null,n);let o;function a(){r=!1;let d=nt.window.activeTextEditor;if(!d)return;let h=d.document;!e[h.languageId]||!nt.workspace.getConfiguration(void 0,h.uri).get(t)||(r=!0)}function c(d,h){if(!r)return;let m=nt.window.activeTextEditor&&nt.window.activeTextEditor.document;if(d!==m||h.length===0)return;typeof o<"u"&&clearTimeout(o);let R=h[h.length-1],_=R.text[R.text.length-1];if("range"in R&&(R.rangeLength??0)>0||_!==">"&&_!=="/")return;let T="range"in R?R.range.start:new nt.Position(0,d.getText().length),y=d.version;o=setTimeout(()=>{let P=new nt.Position(T.line,T.character+R.text.length);i(d,P).then(O=>{if(O&&r){let L=nt.window.activeTextEditor;if(L){let $=L.document;if(d===$&&$.version===y){let H=L.selections;H.length&&H.some(G=>G.active.isEqual(P))?L.insertSnippet(new nt.SnippetString(O),H.map(G=>G.active)):L.insertSnippet(new nt.SnippetString(O),P)}}}}),o=void 0},100)}return nt.Disposable.from(...n)}var Je=require("vscode");function Sf(i,e){return{documentSelector:[{scheme:"file",language:"astro"}],synchronize:{fileEvents:Je.workspace.createFileSystemWatcher("{**/*.js,**/*.ts}",!1,!1,!1)},initializationOptions:{typescript:e,environment:i,dontFilterIncompleteCompletions:!0,isTrusted:Je.workspace.isTrusted}}}function Tf(i,e,t){Je.workspace.onDidChangeConfiguration(a=>t.onDidChangeConfiguration(a,i,e)),Je.workspace.onDidSaveTextDocument(async a=>{let c=a.fileName.split(/\/|\\/).pop()??a.fileName;[/^tsconfig\.json$/,/^jsconfig\.json$/].some(d=>d.test(c))&&await r(!1)}),Je.workspace.onDidChangeTextDocument(a=>{if(["vue","svelte","javascript","typescript","javascriptreact","typescriptreact","json","jsonc"].includes(a.document.languageId)){let c=a.document.fileName.split(/\/|\\/).pop()??a.document.fileName;if(["json","jsonc"].includes(a.document.languageId)&&(c.startsWith("tsconfig")||c.startsWith("jsconfig")))return;o().sendNotification("$/onDidChangeNonAstroFile",{uri:a.document.uri.toString(!0),changes:["vue","svelte"].includes(a.document.languageId)?void 0:a.contentChanges.map(d=>({range:{start:{line:d.range.start.line,character:d.range.start.character},end:{line:d.range.end.line,character:d.range.end.character}},text:d.text}))})}}),i.subscriptions.push(Je.commands.registerCommand("astro.restartLanguageServer",async(a=!0)=>{await r(a)}),Je.commands.registerCommand("astro.showTSXOutput",async()=>{let a=await o().sendRequest("$/getTSXOutput",Je.window.activeTextEditor?.document.uri.toString());if(a){let c=await Je.workspace.openTextDocument({content:a,language:"typescriptreact"});await Je.window.showTextDocument(c,{preview:!0,viewColumn:Je.ViewColumn.Beside})}else Je.window.showErrorMessage("Could not open the current document's TSX output")}),Je.commands.registerCommand("astro.selectTypescriptVersion",()=>t.selectVersionCommand(i,e)));let n=!1;async function r(a){n||(n=!0,await e.stop(),await e.start(),a&&Je.window.showInformationMessage("Astro language server restarted."),n=!1)}function o(){return e}}var $v=new vo.RequestType("html/tag");async function Vv(i){let e=qf.Uri.joinPath(i.extensionUri,"dist/browser/server.js"),t=new Worker(e.toString()),n=Sf("browser",{serverPath:void 0}),r=Bv(n,t);return r.start().then(()=>{let a=wf((c,d)=>{let h=r.code2ProtocolConverter.asTextDocumentPositionParams(c,d);return r.sendRequest($v,h)},{astro:!0},"html.autoClosingTags");i.subscriptions.push(a)}).catch(o=>{console.error("Astro, unable to load language server.",o)}),Tf(i,r,Cu),{getLanguageServer:()=>r}}function Bv(i,e){return new vo.LanguageClient("astro","Astro",i,e)}
39
+ `+t.data.toString():""}`}return e instanceof Error?Wt.string(e.stack)?e.stack:e.message:Wt.string(e)?e:e.toString()}info(e,t,n=!0){this.outputChannel.appendLine(`[Info - ${new Date().toLocaleTimeString()}] ${e}`),t!=null&&this.outputChannel.appendLine(this.data2String(t)),n&&this._clientOptions.revealOutputChannelOn<=ur.Info&&this.showNotificationMessage(M.MessageType.Info,e)}warn(e,t,n=!0){this.outputChannel.appendLine(`[Warn - ${new Date().toLocaleTimeString()}] ${e}`),t!=null&&this.outputChannel.appendLine(this.data2String(t)),n&&this._clientOptions.revealOutputChannelOn<=ur.Warn&&this.showNotificationMessage(M.MessageType.Warning,e)}error(e,t,n=!0){this.outputChannel.appendLine(`[Error - ${new Date().toLocaleTimeString()}] ${e}`),t!=null&&this.outputChannel.appendLine(this.data2String(t)),(n==="force"||n&&this._clientOptions.revealOutputChannelOn<=ur.Error)&&this.showNotificationMessage(M.MessageType.Error,e)}showNotificationMessage(e,t){t=t??"A request has failed. See the output for more information.",(e===M.MessageType.Error?Ce.window.showErrorMessage:e===M.MessageType.Warning?Ce.window.showWarningMessage:Ce.window.showInformationMessage)(t,"Go to output").then(r=>{r!==void 0&&this.outputChannel.show(!0)})}logTrace(e,t){this.traceOutputChannel.appendLine(`[Trace - ${new Date().toLocaleTimeString()}] ${e}`),t&&this.traceOutputChannel.appendLine(this.data2String(t))}logObjectTrace(e){e.isLSPMessage&&e.type?this.traceOutputChannel.append(`[LSP - ${new Date().toLocaleTimeString()}] `):this.traceOutputChannel.append(`[Trace - ${new Date().toLocaleTimeString()}] `),e&&this.traceOutputChannel.appendLine(`${JSON.stringify(e)}`)}needsStart(){return this.$state===de.Initial||this.$state===de.Stopping||this.$state===de.Stopped}needsStop(){return this.$state===de.Starting||this.$state===de.Running}activeConnection(){return this.$state===de.Running&&this._connection!==void 0?this._connection:void 0}isRunning(){return this.$state===de.Running}async start(){if(this._onStart!==void 0)return this._onStart;let[e,t,n]=this.createOnStartPromise();this._onStart=e,this._onStop!==void 0&&(await this._onStop,this._onStop=void 0),this._diagnostics===void 0&&(this._diagnostics=this._clientOptions.diagnosticCollectionName?Ce.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName):Ce.languages.createDiagnosticCollection());for(let[r,o]of this._notificationHandlers)this._pendingNotificationHandlers.has(r)||this._pendingNotificationHandlers.set(r,o);for(let[r,o]of this._requestHandlers)this._pendingRequestHandlers.has(r)||this._pendingRequestHandlers.set(r,o);for(let[r,o]of this._progressHandlers)this._pendingProgressHandlers.has(r)||this._pendingProgressHandlers.set(r,o);this.$state=de.Starting;try{let r=await this.createConnection();r.onNotification(M.LogMessageNotification.type,o=>{switch(o.type){case M.MessageType.Error:this.error(o.message,void 0,!1);break;case M.MessageType.Warning:this.warn(o.message,void 0,!1);break;case M.MessageType.Info:this.info(o.message,void 0,!1);break;default:this.outputChannel.appendLine(o.message)}}),r.onNotification(M.ShowMessageNotification.type,o=>{switch(o.type){case M.MessageType.Error:Ce.window.showErrorMessage(o.message);break;case M.MessageType.Warning:Ce.window.showWarningMessage(o.message);break;case M.MessageType.Info:Ce.window.showInformationMessage(o.message);break;default:Ce.window.showInformationMessage(o.message)}}),r.onRequest(M.ShowMessageRequest.type,o=>{let a;switch(o.type){case M.MessageType.Error:a=Ce.window.showErrorMessage;break;case M.MessageType.Warning:a=Ce.window.showWarningMessage;break;case M.MessageType.Info:a=Ce.window.showInformationMessage;break;default:a=Ce.window.showInformationMessage}let c=o.actions||[];return a(o.message,...c)}),r.onNotification(M.TelemetryEventNotification.type,o=>{this._telemetryEmitter.fire(o)}),r.onRequest(M.ShowDocumentRequest.type,async o=>{let a=async d=>{let h=this.protocol2CodeConverter.asUri(d.uri);try{if(d.external===!0)return{success:await Ce.env.openExternal(h)};{let m={};return d.selection!==void 0&&(m.selection=this.protocol2CodeConverter.asRange(d.selection)),d.takeFocus===void 0||d.takeFocus===!1?m.preserveFocus=!0:d.takeFocus===!0&&(m.preserveFocus=!1),await Ce.window.showTextDocument(h,m),{success:!0}}}catch{return{success:!0}}},c=this._clientOptions.middleware.window?.showDocument;return c!==void 0?c(o,a):a(o)}),r.listen(),await this.initialize(r),t()}catch(r){this.$state=de.StartFailed,this.error(`${this._name} client: couldn't create connection to server.`,r,"force"),n(r)}return this._onStart}createOnStartPromise(){let e,t;return[new Promise((r,o)=>{e=r,t=o}),e,t]}async initialize(e){this.refreshTrace(e,!1);let t=this._clientOptions.initializationOptions,[n,r]=this._clientOptions.workspaceFolder!==void 0?[this._clientOptions.workspaceFolder.uri.fsPath,[{uri:this._c2p.asUri(this._clientOptions.workspaceFolder.uri),name:this._clientOptions.workspaceFolder.name}]]:[this._clientGetRootPath(),null],o={processId:null,clientInfo:{name:Ce.env.appName,version:Ce.version},locale:this.getLocale(),rootPath:n||null,rootUri:n?this._c2p.asUri(Ce.Uri.file(n)):null,capabilities:this.computeClientCapabilities(),initializationOptions:Wt.func(t)?t():t,trace:M.Trace.toString(this._trace),workspaceFolders:r};if(this.fillInitializeParams(o),this._clientOptions.progressOnInitialization){let a=ff.generateUuid(),c=new sv.ProgressPart(e,a);o.workDoneToken=a;try{let d=await this.doInitialize(e,o);return c.done(),d}catch(d){throw c.cancel(),d}}else return this.doInitialize(e,o)}async doInitialize(e,t){try{let n=await e.initialize(t);if(n.capabilities.positionEncoding!==void 0&&n.capabilities.positionEncoding!==M.PositionEncodingKind.UTF16)throw new Error(`Unsupported position encoding (${n.capabilities.positionEncoding}) received from server ${this.name}`);this._initializeResult=n,this.$state=de.Running;let r;Wt.number(n.capabilities.textDocumentSync)?n.capabilities.textDocumentSync===M.TextDocumentSyncKind.None?r={openClose:!1,change:M.TextDocumentSyncKind.None,save:void 0}:r={openClose:!0,change:n.capabilities.textDocumentSync,save:{includeText:!1}}:n.capabilities.textDocumentSync!==void 0&&n.capabilities.textDocumentSync!==null&&(r=n.capabilities.textDocumentSync),this._capabilities=Object.assign({},n.capabilities,{resolvedTextDocumentSync:r}),e.onNotification(M.PublishDiagnosticsNotification.type,o=>this.handleDiagnostics(o)),e.onRequest(M.RegistrationRequest.type,o=>this.handleRegistrationRequest(o)),e.onRequest("client/registerFeature",o=>this.handleRegistrationRequest(o)),e.onRequest(M.UnregistrationRequest.type,o=>this.handleUnregistrationRequest(o)),e.onRequest("client/unregisterFeature",o=>this.handleUnregistrationRequest(o)),e.onRequest(M.ApplyWorkspaceEditRequest.type,o=>this.handleApplyWorkspaceEdit(o));for(let[o,a]of this._pendingNotificationHandlers)this._notificationDisposables.set(o,e.onNotification(o,a));this._pendingNotificationHandlers.clear();for(let[o,a]of this._pendingRequestHandlers)this._requestDisposables.set(o,e.onRequest(o,a));this._pendingRequestHandlers.clear();for(let[o,a]of this._pendingProgressHandlers)this._progressDisposables.set(o,e.onProgress(a.type,o,a.handler));return this._pendingProgressHandlers.clear(),await e.sendNotification(M.InitializedNotification.type,{}),this.hookFileEvents(e),this.hookConfigurationChanged(e),this.initializeFeatures(e),n}catch(n){throw this._clientOptions.initializationFailedHandler?this._clientOptions.initializationFailedHandler(n)?this.initialize(e):this.stop():n instanceof M.ResponseError&&n.data&&n.data.retry?Ce.window.showErrorMessage(n.message,{title:"Retry",id:"retry"}).then(r=>{r&&r.id==="retry"?this.initialize(e):this.stop()}):(n&&n.message&&Ce.window.showErrorMessage(n.message),this.error("Server initialization failed.",n),this.stop()),n}}_clientGetRootPath(){let e=Ce.workspace.workspaceFolders;if(!e||e.length===0)return;let t=e[0];if(t.uri.scheme==="file")return t.uri.fsPath}stop(e=2e3){return this.shutdown("stop",e)}suspend(){return this.shutdown("suspend",5e3)}async shutdown(e,t){if(this.$state===de.Stopped||this.$state===de.Initial)return;if(this.$state===de.Stopping&&this._onStop)return this._onStop;let n=await this.$start();this._initializeResult=void 0,this.$state=de.Stopping,this.cleanUp(e);let r=new Promise(a=>{(0,M.RAL)().timer.setTimeout(a,t)}),o=(async a=>(await a.shutdown(),await a.exit(),a))(n);return this._onStop=Promise.race([r,o]).then(a=>{if(a!==void 0)a.end(),a.dispose();else throw this.error("Stopping server timed out",void 0,!1),new Error("Stopping the server timed out")},a=>{throw this.error("Stopping server failed",a,!1),a}).finally(()=>{this.$state=de.Stopped,e==="stop"&&this.cleanUpChannel(),this._onStart=void 0,this._onStop=void 0,this._connection=void 0,this._ignoredRegistrations.clear()})}cleanUp(e){this._fileEvents=[],this._fileEventDelayer.cancel(),this._syncedDocuments&&this._syncedDocuments.clear();for(let t of Array.from(this._features.entries()).map(n=>n[1]).reverse())t.dispose();e==="stop"&&this._diagnostics!==void 0&&(this._diagnostics.dispose(),this._diagnostics=void 0),this._idleInterval!==void 0&&(this._idleInterval.dispose(),this._idleInterval=void 0)}cleanUpChannel(){this._outputChannel!==void 0&&this._disposeOutputChannel&&(this._outputChannel.dispose(),this._outputChannel=void 0)}notifyFileEvent(e){let t=this;async function n(o){return t._fileEvents.push(o),t._fileEventDelayer.trigger(async()=>{let a=await t.$start();t.forceDocumentSync();let c=a.sendNotification(M.DidChangeWatchedFilesNotification.type,{changes:t._fileEvents});return t._fileEvents=[],c})}let r=this.clientOptions.middleware?.workspace;(r?.didChangeWatchedFile?r.didChangeWatchedFile(e,n):n(e)).catch(o=>{t.error("Notify file events failed.",o)})}forceDocumentSync(){this._didChangeTextDocumentFeature===void 0&&(this._didChangeTextDocumentFeature=this._dynamicFeatures.get(M.DidChangeTextDocumentNotification.type.method)),this._didChangeTextDocumentFeature.forceDelivery()}handleDiagnostics(e){if(!this._diagnostics)return;let t=e.uri;this._diagnosticQueueState.state==="busy"&&this._diagnosticQueueState.document===t&&this._diagnosticQueueState.tokenSource.cancel(),this._diagnosticQueue.set(e.uri,e.diagnostics),this.triggerDiagnosticQueue()}triggerDiagnosticQueue(){(0,M.RAL)().timer.setImmediate(()=>{this.workDiagnosticQueue()})}workDiagnosticQueue(){if(this._diagnosticQueueState.state==="busy")return;let e=this._diagnosticQueue.entries().next();if(e.done===!0)return;let[t,n]=e.value;this._diagnosticQueue.delete(t);let r=new Ce.CancellationTokenSource;this._diagnosticQueueState={state:"busy",document:t,tokenSource:r},this._p2c.asDiagnostics(n,r.token).then(o=>{if(!r.token.isCancellationRequested){let a=this._p2c.asUri(t),c=this.clientOptions.middleware;c.handleDiagnostics?c.handleDiagnostics(a,o,(d,h)=>this.setDiagnostics(d,h)):this.setDiagnostics(a,o)}}).finally(()=>{this._diagnosticQueueState={state:"idle"},this.triggerDiagnosticQueue()})}setDiagnostics(e,t){!this._diagnostics||this._diagnostics.set(e,t)}async $start(){if(this.$state===de.StartFailed)throw new Error("Previous start failed. Can't restart server.");await this.start();let e=this.activeConnection();if(e===void 0)throw new Error("Starting server failed");return e}async createConnection(){let e=(r,o,a)=>{this.handleConnectionError(r,o,a)},t=()=>{this.handleConnectionClosed()},n=await this.createMessageTransports(this._clientOptions.stdioEncoding||"utf8");return this._connection=Av(n.reader,n.writer,e,t,this._clientOptions.connectionOptions),this._connection}handleConnectionClosed(){if(this.$state===de.Stopped)return;try{this._connection!==void 0&&this._connection.dispose()}catch{}let e={action:ei.DoNotRestart};if(this.$state!==de.Stopping)try{e=this._clientOptions.errorHandler.closed()}catch{}this._connection=void 0,e.action===ei.DoNotRestart?(this.error(e.message??"Connection to server got closed. Server will not be restarted.",void 0,"force"),this.cleanUp("stop"),this.$state===de.Starting?this.$state=de.StartFailed:this.$state=de.Stopped,this._onStop=Promise.resolve(),this._onStart=void 0):e.action===ei.Restart&&(this.info(e.message??"Connection to server got closed. Server will restart."),this.cleanUp("restart"),this.$state=de.Initial,this._onStop=Promise.resolve(),this._onStart=void 0,this.start().catch(t=>this.error("Restarting server failed",t,"force")))}handleConnectionError(e,t,n){let r=this._clientOptions.errorHandler.error(e,t,n);r.action===yo.Shutdown&&(this.error(r.message??`Client ${this._name}: connection to server is erroring. Shutting down server.`,void 0,"force"),this.stop().catch(o=>{this.error("Stopping server failed",o,!1)}))}hookConfigurationChanged(e){Ce.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)})}refreshTrace(e,t=!1){let n=Ce.workspace.getConfiguration(this._id),r=M.Trace.Off,o=M.TraceFormat.Text;if(n){let a=n.get("trace.server","off");typeof a=="string"?r=M.Trace.fromString(a):(r=M.Trace.fromString(n.get("trace.server.verbosity","off")),o=M.TraceFormat.fromString(n.get("trace.server.format","text")))}this._trace=r,this._traceFormat=o,e.trace(this._trace,this._tracer,{sendNotification:t,traceFormat:this._traceFormat}).catch(a=>{this.error("Updating trace failed with error",a,!1)})}hookFileEvents(e){let t=this._clientOptions.synchronize.fileEvents;if(!t)return;let n;Wt.array(t)?n=t:n=[t],n&&this._dynamicFeatures.get(M.DidChangeWatchedFilesNotification.type.method).registerRaw(ff.generateUuid(),n)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),Zt.DynamicFeature.is(e)){let t=e.registrationType;this._dynamicFeatures.set(t.method,e)}}getFeature(e){return this._dynamicFeatures.get(e)}hasDedicatedTextSynchronizationFeature(e){let t=this.getFeature(M.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof hf.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){this.registerFeature(new gf.ConfigurationFeature(this)),this.registerFeature(new Ri.DidOpenTextDocumentFeature(this,this._syncedDocuments)),this.registerFeature(new Ri.DidChangeTextDocumentFeature(this)),this.registerFeature(new Ri.WillSaveFeature(this)),this.registerFeature(new Ri.WillSaveWaitUntilFeature(this)),this.registerFeature(new Ri.DidSaveTextDocumentFeature(this)),this.registerFeature(new Ri.DidCloseTextDocumentFeature(this,this._syncedDocuments)),this.registerFeature(new bv.FileSystemWatcherFeature(this,e=>this.notifyFileEvent(e))),this.registerFeature(new cv.CompletionItemFeature(this)),this.registerFeature(new uv.HoverFeature(this)),this.registerFeature(new lv.SignatureHelpFeature(this)),this.registerFeature(new dv.DefinitionFeature(this)),this.registerFeature(new pv.ReferencesFeature(this)),this.registerFeature(new fv.DocumentHighlightFeature(this)),this.registerFeature(new hv.DocumentSymbolFeature(this)),this.registerFeature(new gv.WorkspaceSymbolFeature(this)),this.registerFeature(new mv.CodeActionFeature(this)),this.registerFeature(new yv.CodeLensFeature(this)),this.registerFeature(new fu.DocumentFormattingFeature(this)),this.registerFeature(new fu.DocumentRangeFormattingFeature(this)),this.registerFeature(new fu.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new vv.RenameFeature(this)),this.registerFeature(new Cv.DocumentLinkFeature(this)),this.registerFeature(new _v.ExecuteCommandFeature(this)),this.registerFeature(new gf.SyncConfigurationFeature(this)),this.registerFeature(new Dv.ConfigurationFeature(this)),this.registerFeature(new Sv.TypeDefinitionFeature(this)),this.registerFeature(new wv.ImplementationFeature(this)),this.registerFeature(new Rv.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new Tv.WorkspaceFoldersFeature(this)),this.registerFeature(new qv.FoldingRangeFeature(this)),this.registerFeature(new Pv.DeclarationFeature(this)),this.registerFeature(new kv.SelectionRangeFeature(this)),this.registerFeature(new xv.ProgressFeature(this)),this.registerFeature(new Fv.CallHierarchyFeature(this)),this.registerFeature(new Ev.SemanticTokensFeature(this)),this.registerFeature(new Ov.LinkedEditingFeature(this)),this.registerFeature(new Di.DidCreateFilesFeature(this)),this.registerFeature(new Di.DidRenameFilesFeature(this)),this.registerFeature(new Di.DidDeleteFilesFeature(this)),this.registerFeature(new Di.WillCreateFilesFeature(this)),this.registerFeature(new Di.WillRenameFilesFeature(this)),this.registerFeature(new Di.WillDeleteFilesFeature(this)),this.registerFeature(new Iv.TypeHierarchyFeature(this)),this.registerFeature(new Nv.InlineValueFeature(this)),this.registerFeature(new Lv.InlayHintsFeature(this)),this.registerFeature(new av.DiagnosticFeature(this)),this.registerFeature(new hf.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(pf.createAll(this))}fillInitializeParams(e){for(let t of this._features)Wt.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){let e={};(0,Zt.ensure)(e,"workspace").applyEdit=!0;let t=(0,Zt.ensure)((0,Zt.ensure)(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[M.ResourceOperationKind.Create,M.ResourceOperationKind.Rename,M.ResourceOperationKind.Delete],t.failureHandling=M.FailureHandlingKind.TextOnlyTransactional,t.normalizesLineEndings=!0,t.changeAnnotationSupport={groupsOnLabel:!0};let n=(0,Zt.ensure)((0,Zt.ensure)(e,"textDocument"),"publishDiagnostics");n.relatedInformation=!0,n.versionSupport=!1,n.tagSupport={valueSet:[M.DiagnosticTag.Unnecessary,M.DiagnosticTag.Deprecated]},n.codeDescriptionSupport=!0,n.dataSupport=!0;let r=(0,Zt.ensure)(e,"window"),o=(0,Zt.ensure)(r,"showMessage");o.messageActionItem={additionalPropertiesSupport:!0};let a=(0,Zt.ensure)(r,"showDocument");a.support=!0;let c=(0,Zt.ensure)(e,"general");c.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(ti.RequestsToCancelOnContentModified)},c.regularExpressions={engine:"ECMAScript",version:"ES2020"},c.markdown={parser:"marked",version:"1.1.0"},c.positionEncodings=["utf-16"],this._clientOptions.markdown.supportHtml&&(c.markdown.allowedTags=["ul","li","p","code","blockquote","ol","h1","h2","h3","h4","h5","h6","hr","em","pre","table","thead","tbody","tr","th","td","div","del","a","strong","br","img","span"]);for(let d of this._features)d.fillClientCapabilities(e);return e}initializeFeatures(e){let t=this._clientOptions.documentSelector;for(let n of this._features)Wt.func(n.preInitialize)&&n.preInitialize(this._capabilities,t);for(let n of this._features)n.initialize(this._capabilities,t)}async handleRegistrationRequest(e){if(!this.isRunning()){for(let t of e.registrations)this._ignoredRegistrations.add(t.id);return}for(let t of e.registrations){let n=this._dynamicFeatures.get(t.method);if(n===void 0)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Registration failed.`));let r=t.registerOptions??{};r.documentSelector=r.documentSelector??this._clientOptions.documentSelector;let o={id:t.id,registerOptions:r};try{n.register(o)}catch(a){return Promise.reject(a)}}}async handleUnregistrationRequest(e){for(let t of e.unregisterations){if(this._ignoredRegistrations.has(t.id))continue;let n=this._dynamicFeatures.get(t.method);if(!n)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Unregistration failed.`));n.unregister(t.id)}}async handleApplyWorkspaceEdit(e){let t=e.edit,n=await this.workspaceEditLock.lock(()=>this._p2c.asWorkspaceEdit(t)),r=new Map;Ce.workspace.textDocuments.forEach(a=>r.set(a.uri.toString(),a));let o=!1;if(t.documentChanges){for(let a of t.documentChanges)if(M.TextDocumentEdit.is(a)&&a.textDocument.version&&a.textDocument.version>=0){let c=r.get(a.textDocument.uri);if(c&&c.version!==a.textDocument.version){o=!0;break}}}return o?Promise.resolve({applied:!1}):Wt.asPromise(Ce.workspace.applyEdit(n).then(a=>({applied:a})))}handleFailedRequest(e,t,n,r,o=!0){if(n instanceof M.ResponseError){if(n.code===M.ErrorCodes.PendingResponseRejected||n.code===M.ErrorCodes.ConnectionInactive)return r;if(n.code===M.LSPErrorCodes.RequestCancelled||n.code===M.LSPErrorCodes.ServerCancelled){if(t!==void 0&&t.isCancellationRequested)return r;throw n.data!==void 0?new Zt.LSPCancellationError(n.data):new Ce.CancellationError}else if(n.code===M.LSPErrorCodes.ContentModified){if(ti.RequestsToCancelOnContentModified.has(e.method))throw new Ce.CancellationError;return r}}throw this.error(`Request ${e.method} failed.`,n,o),n}};Pe.BaseLanguageClient=ti;ti.RequestsToCancelOnContentModified=new Set([M.SemanticTokensRequest.method,M.SemanticTokensRangeRequest.method,M.SemanticTokensDeltaRequest.method]);var gu=class{error(e){(0,M.RAL)().console.error(e)}warn(e){(0,M.RAL)().console.warn(e)}info(e){(0,M.RAL)().console.info(e)}log(e){(0,M.RAL)().console.log(e)}};function Av(i,e,t,n,r){let o=-1,a=new gu,c=(0,M.createProtocolConnection)(i,e,a,r);return c.onError(h=>{t(h[0],h[1],h[2])}),c.onClose(n),{get lastUsed(){return o},resetLastUsed:()=>{o=-1},listen:()=>c.listen(),sendRequest:(h,...m)=>(o=Date.now(),c.sendRequest(h,...m)),onRequest:(h,m)=>c.onRequest(h,m),hasPendingResponse:()=>c.hasPendingResponse(),sendNotification:(h,m)=>(o=Date.now(),c.sendNotification(h,m)),onNotification:(h,m)=>c.onNotification(h,m),onProgress:c.onProgress,sendProgress:c.sendProgress,trace:(h,m,R)=>{let _={sendNotification:!1,traceFormat:M.TraceFormat.Text};return R===void 0?c.trace(h,m,_):(Wt.boolean(R),c.trace(h,m,R))},initialize:h=>(o=Date.now(),c.sendRequest(M.InitializeRequest.type,h)),shutdown:()=>(o=Date.now(),c.sendRequest(M.ShutdownRequest.type,void 0)),exit:()=>(o=Date.now(),c.sendNotification(M.ExitNotification.type)),end:()=>c.end(),dispose:()=>c.dispose()}}var pf;(function(i){function e(t){return[]}i.createAll=e})(pf=Pe.ProposedFeatures||(Pe.ProposedFeatures={}))});var mu=I(Et=>{"use strict";var Hv=Et&&Et.__createBinding||(Object.create?function(i,e,t,n){n===void 0&&(n=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,r)}:function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]}),pu=Et&&Et.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Hv(e,i,t)};Object.defineProperty(Et,"__esModule",{value:!0});Et.DiagnosticPullMode=Et.vsdiag=void 0;pu(X(),Et);pu(ue(),Et);var yf=oa();Object.defineProperty(Et,"vsdiag",{enumerable:!0,get:function(){return yf.vsdiag}});Object.defineProperty(Et,"DiagnosticPullMode",{enumerable:!0,get:function(){return yf.DiagnosticPullMode}});pu(mf(),Et)});var yu=I((H_,vf)=>{"use strict";vf.exports=X()});var bf=I(cn=>{"use strict";var Wv=cn&&cn.__createBinding||(Object.create?function(i,e,t,n){n===void 0&&(n=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,r)}:function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]}),_f=cn&&cn.__exportStar||function(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Wv(e,i,t)};Object.defineProperty(cn,"__esModule",{value:!0});cn.LanguageClient=void 0;var Kv=mu(),Cf=yu();_f(yu(),cn);_f(mu(),cn);var vu=class extends Kv.BaseLanguageClient{constructor(e,t,n,r){super(e,t,n),this.worker=r}createMessageTransports(e){let t=new Cf.BrowserMessageReader(this.worker),n=new Cf.BrowserMessageWriter(this.worker);return Promise.resolve({reader:t,writer:n})}getLocale(){return"en"}};cn.LanguageClient=vu});var Df=I((K_,Rf)=>{"use strict";Rf.exports=bf()});var Qv={};Du(Qv,{activate:()=>Vv});module.exports=Mf(Qv);var qf=require("vscode"),vo=Lf(Df());var Cu={};Du(Cu,{onDidChangeConfiguration:()=>zv,selectVersionCommand:()=>Uv});function Uv(){}async function zv(){}var nt=require("vscode");function wf(i,e,t){let n=[];nt.workspace.onDidChangeTextDocument(d=>c(d.document,d.contentChanges),null,n);let r=!1;a(),nt.window.onDidChangeActiveTextEditor(a,null,n);let o;function a(){r=!1;let d=nt.window.activeTextEditor;if(!d)return;let h=d.document;!e[h.languageId]||!nt.workspace.getConfiguration(void 0,h.uri).get(t)||(r=!0)}function c(d,h){if(!r)return;let m=nt.window.activeTextEditor&&nt.window.activeTextEditor.document;if(d!==m||h.length===0)return;typeof o<"u"&&clearTimeout(o);let R=h[h.length-1],_=R.text[R.text.length-1];if("range"in R&&(R.rangeLength??0)>0||_!==">"&&_!=="/")return;let T="range"in R?R.range.start:new nt.Position(0,d.getText().length),y=d.version;o=setTimeout(()=>{let P=new nt.Position(T.line,T.character+R.text.length);i(d,P).then(O=>{if(O&&r){let L=nt.window.activeTextEditor;if(L){let $=L.document;if(d===$&&$.version===y){let H=L.selections;H.length&&H.some(G=>G.active.isEqual(P))?L.insertSnippet(new nt.SnippetString(O),H.map(G=>G.active)):L.insertSnippet(new nt.SnippetString(O),P)}}}}),o=void 0},100)}return nt.Disposable.from(...n)}var Je=require("vscode");function Sf(i,e){return{documentSelector:[{scheme:"file",language:"astro"}],synchronize:{fileEvents:Je.workspace.createFileSystemWatcher("{**/*.js,**/*.ts}",!1,!1,!1)},initializationOptions:{typescript:e,environment:i,dontFilterIncompleteCompletions:!0,isTrusted:Je.workspace.isTrusted}}}function Tf(i,e,t){Je.workspace.onDidChangeConfiguration(a=>t.onDidChangeConfiguration(a,i,e)),Je.workspace.onDidSaveTextDocument(async a=>{let c=a.fileName.split(/\/|\\/).pop()??a.fileName;[/^tsconfig\.json$/,/^jsconfig\.json$/].some(d=>d.test(c))&&await r(!1)}),Je.workspace.onDidChangeTextDocument(a=>{if(["vue","svelte","javascript","typescript","javascriptreact","typescriptreact","json","jsonc"].includes(a.document.languageId)){let c=a.document.fileName.split(/\/|\\/).pop()??a.document.fileName;if(["json","jsonc"].includes(a.document.languageId)&&(c.startsWith("tsconfig")||c.startsWith("jsconfig")))return;o().sendNotification("$/onDidChangeNonAstroFile",{uri:a.document.uri.toString(!0),changes:["vue","svelte"].includes(a.document.languageId)?void 0:a.contentChanges.map(d=>({range:{start:{line:d.range.start.line,character:d.range.start.character},end:{line:d.range.end.line,character:d.range.end.character}},text:d.text}))})}}),i.subscriptions.push(Je.commands.registerCommand("astro.restartLanguageServer",async(a=!0)=>{await r(a)}),Je.commands.registerCommand("astro.showTSXOutput",async()=>{let a=await o().sendRequest("$/getTSXOutput",Je.window.activeTextEditor?.document.uri.toString());if(a){let c=await Je.workspace.openTextDocument({content:a,language:"typescriptreact"});await Je.window.showTextDocument(c,{preview:!0,viewColumn:Je.ViewColumn.Beside})}else Je.window.showErrorMessage("Could not open the current document's TSX output")}),Je.commands.registerCommand("astro.selectTypescriptVersion",()=>t.selectVersionCommand(i,e)));let n=!1;async function r(a){n||(n=!0,await e.stop(),await e.start(),a&&Je.window.showInformationMessage("Astro language server restarted."),n=!1)}function o(){return e}}var $v=new vo.RequestType("html/tag");async function Vv(i){let e=qf.Uri.joinPath(i.extensionUri,"dist/browser/server.js").with({query:"target=web"}),t=new Worker(e.toString(!0)),n=Sf("browser",{serverPath:void 0}),r=Bv(n,t);return r.start().then(()=>{let a=wf((c,d)=>{let h=r.code2ProtocolConverter.asTextDocumentPositionParams(c,d);return r.sendRequest($v,h)},{astro:!0},"html.autoClosingTags");i.subscriptions.push(a)}).catch(o=>{console.error("Astro, unable to load language server.",o)}),Tf(i,r,Cu),{getLanguageServer:()=>r}}function Bv(i,e){return new vo.LanguageClient("astro","Astro",i,e)}
package/package.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "color": "#FFBE2D",
24
24
  "theme": "dark"
25
25
  },
26
- "version": "0.24.1",
26
+ "version": "0.24.4",
27
27
  "author": "withastro",
28
28
  "license": "MIT",
29
29
  "publisher": "astro-build",
@@ -260,12 +260,14 @@
260
260
  "description": "Enable document symbols for CSS"
261
261
  },
262
262
  "astro.format.indentFrontmatter": {
263
+ "deprecationMessage": "The `astro.format` settings are deprecated. Formatting is now powered by Prettier and can be configured through a Prettier configuration file.",
263
264
  "type": "boolean",
264
265
  "default": false,
265
266
  "title": "Formatting: Indent frontmatter",
266
267
  "description": "Indent the formatter by one level of indentation"
267
268
  },
268
269
  "astro.format.newLineAfterFrontmatter": {
270
+ "deprecationMessage": "The `astro.format` settings are deprecated. Formatting is now powered by Prettier and can be configured through a Prettier configuration file.",
269
271
  "type": "boolean",
270
272
  "default": true,
271
273
  "title": "Formatting: Add line return after the frontmatter",