astro-vscode 2.15.1 → 2.15.3

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.
Files changed (65) hide show
  1. package/.turbo/turbo-build.log +12 -0
  2. package/.vscodeignore +10 -0
  3. package/CHANGELOG.md +1411 -0
  4. package/dist/node/client.js +1 -1
  5. package/dist/node/server.js +272 -272
  6. package/package.json +3 -9
  7. package/scripts/build-grammar.mjs +45 -0
  8. package/scripts/build.mjs +79 -0
  9. package/scripts/shared.mjs +29 -0
  10. package/src/client.ts +151 -0
  11. package/test/grammar/README.md +5 -0
  12. package/test/grammar/dummy/css.tmLanguage-dummy.json +4 -0
  13. package/test/grammar/dummy/html.tmLanguage-dummy.json +4 -0
  14. package/test/grammar/dummy/js.tmLanguage-dummy.json +4 -0
  15. package/test/grammar/dummy/json.tmLanguage-dummy.json +4 -0
  16. package/test/grammar/dummy/less.tsLanguage-dummy.json +4 -0
  17. package/test/grammar/dummy/postcss.tmLanguage-dummy.json +4 -0
  18. package/test/grammar/dummy/sass.tmLanguage-dummy.json +4 -0
  19. package/test/grammar/dummy/scss.tsLanguage-dummy.json +4 -0
  20. package/test/grammar/dummy/stylus.tmLanguage-dummy.json +4 -0
  21. package/test/grammar/dummy/ts.tmLanguage-dummy.json +4 -0
  22. package/test/grammar/dummy/tsx.tmLanguage-dummy.json +4 -0
  23. package/test/grammar/dummy/unknown.tmLanguage-dummy.json +4 -0
  24. package/test/grammar/fixtures/attributes.astro +14 -0
  25. package/test/grammar/fixtures/attributes.astro.snap +102 -0
  26. package/test/grammar/fixtures/components/component.astro +3 -0
  27. package/test/grammar/fixtures/components/component.astro.snap +17 -0
  28. package/test/grammar/fixtures/constant-entities.astro +7 -0
  29. package/test/grammar/fixtures/constant-entities.astro.snap +80 -0
  30. package/test/grammar/fixtures/raw/israw.astro +15 -0
  31. package/test/grammar/fixtures/raw/israw.astro.snap +68 -0
  32. package/test/grammar/fixtures/script/events.astro +3 -0
  33. package/test/grammar/fixtures/script/events.astro.snap +30 -0
  34. package/test/grammar/fixtures/script/israw.astro +3 -0
  35. package/test/grammar/fixtures/script/israw.astro.snap +13 -0
  36. package/test/grammar/fixtures/script/json.astro +14 -0
  37. package/test/grammar/fixtures/script/json.astro.snap +39 -0
  38. package/test/grammar/fixtures/script/jstypes.astro +15 -0
  39. package/test/grammar/fixtures/script/jstypes.astro.snap +68 -0
  40. package/test/grammar/fixtures/script/module.astro +3 -0
  41. package/test/grammar/fixtures/script/module.astro.snap +17 -0
  42. package/test/grammar/fixtures/script/script.astro +3 -0
  43. package/test/grammar/fixtures/script/script.astro.snap +11 -0
  44. package/test/grammar/fixtures/script/unknowntype.astro +3 -0
  45. package/test/grammar/fixtures/script/unknowntype.astro.snap +17 -0
  46. package/test/grammar/fixtures/style/israw.astro +5 -0
  47. package/test/grammar/fixtures/style/israw.astro.snap +17 -0
  48. package/test/grammar/fixtures/style/less.astro +9 -0
  49. package/test/grammar/fixtures/style/less.astro.snap +28 -0
  50. package/test/grammar/fixtures/style/sass.astro +8 -0
  51. package/test/grammar/fixtures/style/sass.astro.snap +26 -0
  52. package/test/grammar/fixtures/style/scss.astro +9 -0
  53. package/test/grammar/fixtures/style/scss.astro.snap +28 -0
  54. package/test/grammar/fixtures/style/style.astro +3 -0
  55. package/test/grammar/fixtures/style/style.astro.snap +11 -0
  56. package/test/grammar/fixtures/style/stylus.astro +9 -0
  57. package/test/grammar/fixtures/style/stylus.astro.snap +38 -0
  58. package/test/grammar/fixtures/text.astro +15 -0
  59. package/test/grammar/fixtures/text.astro.snap +58 -0
  60. package/test/grammar/test.mjs +59 -0
  61. package/test/runTest.js +27 -0
  62. package/test/suite/extension.test.js +15 -0
  63. package/test/suite/index.js +40 -0
  64. package/test/tsconfig.json +14 -0
  65. package/tsconfig.json +9 -0
@@ -43,4 +43,4 @@ globstar while`,e,m,t,g,D),this.matchOne(e.slice(m),t.slice(g),r))return this.de
43
43
  `+t.data.toString():""}`}return e instanceof Error?Sn.string(e.stack)?e.stack:e.message:Sn.string(e)?e:e.toString()}debug(e,t,r=!0){this.logOutputMessage(j.MessageType.Debug,zr.Debug,"Debug",e,t,r)}info(e,t,r=!0){this.logOutputMessage(j.MessageType.Info,zr.Info,"Info",e,t,r)}warn(e,t,r=!0){this.logOutputMessage(j.MessageType.Warning,zr.Warn,"Warn",e,t,r)}error(e,t,r=!0){this.logOutputMessage(j.MessageType.Error,zr.Error,"Error",e,t,r)}logOutputMessage(e,t,r,i,s,o){this.outputChannel.appendLine(`[${r.padEnd(5)} - ${new Date().toLocaleTimeString()}] ${i}`),s!=null&&this.outputChannel.appendLine(this.data2String(s)),(o==="force"||o&&this._clientOptions.revealOutputChannelOn<=t)&&this.showNotificationMessage(e,i)}showNotificationMessage(e,t){t=t??"A request has failed. See the output for more information.",(e===j.MessageType.Error?Se.window.showErrorMessage:e===j.MessageType.Warning?Se.window.showWarningMessage:Se.window.showInformationMessage)(t,"Go to output").then(i=>{i!==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===ce.Initial||this.$state===ce.Stopping||this.$state===ce.Stopped}needsStop(){return this.$state===ce.Starting||this.$state===ce.Running}activeConnection(){return this.$state===ce.Running&&this._connection!==void 0?this._connection:void 0}isRunning(){return this.$state===ce.Running}async start(){if(this._disposed==="disposing"||this._disposed==="disposed")throw new Error("Client got disposed and can't be restarted.");if(this.$state===ce.Stopping)throw new Error("Client is currently stopping. Can only restart a full stopped client");if(this._onStart!==void 0)return this._onStart;let[e,t,r]=this.createOnStartPromise();this._onStart=e,this._diagnostics===void 0&&(this._diagnostics=this._clientOptions.diagnosticCollectionName?Se.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName):Se.languages.createDiagnosticCollection());for(let[i,s]of this._notificationHandlers)this._pendingNotificationHandlers.has(i)||this._pendingNotificationHandlers.set(i,s);for(let[i,s]of this._requestHandlers)this._pendingRequestHandlers.has(i)||this._pendingRequestHandlers.set(i,s);for(let[i,s]of this._progressHandlers)this._pendingProgressHandlers.has(i)||this._pendingProgressHandlers.set(i,s);this.$state=ce.Starting;try{let i=await this.createConnection();i.onNotification(j.LogMessageNotification.type,s=>{switch(s.type){case j.MessageType.Error:this.error(s.message,void 0,!1);break;case j.MessageType.Warning:this.warn(s.message,void 0,!1);break;case j.MessageType.Info:this.info(s.message,void 0,!1);break;case j.MessageType.Debug:this.debug(s.message,void 0,!1);break;default:this.outputChannel.appendLine(s.message)}}),i.onNotification(j.ShowMessageNotification.type,s=>{switch(s.type){case j.MessageType.Error:Se.window.showErrorMessage(s.message);break;case j.MessageType.Warning:Se.window.showWarningMessage(s.message);break;case j.MessageType.Info:Se.window.showInformationMessage(s.message);break;default:Se.window.showInformationMessage(s.message)}}),i.onRequest(j.ShowMessageRequest.type,s=>{let o;switch(s.type){case j.MessageType.Error:o=Se.window.showErrorMessage;break;case j.MessageType.Warning:o=Se.window.showWarningMessage;break;case j.MessageType.Info:o=Se.window.showInformationMessage;break;default:o=Se.window.showInformationMessage}let a=s.actions||[];return o(s.message,...a)}),i.onNotification(j.TelemetryEventNotification.type,s=>{this._telemetryEmitter.fire(s)}),i.onRequest(j.ShowDocumentRequest.type,async s=>{let o=async u=>{let l=this.protocol2CodeConverter.asUri(u.uri);try{if(u.external===!0)return{success:await Se.env.openExternal(l)};{let p={};return u.selection!==void 0&&(p.selection=this.protocol2CodeConverter.asRange(u.selection)),u.takeFocus===void 0||u.takeFocus===!1?p.preserveFocus=!0:u.takeFocus===!0&&(p.preserveFocus=!1),await Se.window.showTextDocument(l,p),{success:!0}}}catch{return{success:!1}}},a=this._clientOptions.middleware.window?.showDocument;return a!==void 0?a(s,o):o(s)}),i.listen(),await this.initialize(i),t()}catch(i){this.$state=ce.StartFailed,this.error(`${this._name} client: couldn't create connection to server.`,i,"force"),r(i)}return this._onStart}createOnStartPromise(){let e,t;return[new Promise((i,s)=>{e=i,t=s}),e,t]}async initialize(e){this.refreshTrace(e,!1);let t=this._clientOptions.initializationOptions,[r,i]=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],s={processId:null,clientInfo:{name:Se.env.appName,version:Se.version},locale:this.getLocale(),rootPath:r||null,rootUri:r?this._c2p.asUri(Se.Uri.file(r)):null,capabilities:this.computeClientCapabilities(),initializationOptions:Sn.func(t)?t():t,trace:j.Trace.toString(this._trace),workspaceFolders:i};if(this.fillInitializeParams(s),this._clientOptions.progressOnInitialization){let o=ny.generateUuid(),a=new lD.ProgressPart(e,o);s.workDoneToken=o;try{let u=await this.doInitialize(e,s);return a.done(),u}catch(u){throw a.cancel(),u}}else return this.doInitialize(e,s)}async doInitialize(e,t){try{let r=await e.initialize(t);if(r.capabilities.positionEncoding!==void 0&&r.capabilities.positionEncoding!==j.PositionEncodingKind.UTF16)throw new Error(`Unsupported position encoding (${r.capabilities.positionEncoding}) received from server ${this.name}`);this._initializeResult=r,this.$state=ce.Running;let i;Sn.number(r.capabilities.textDocumentSync)?r.capabilities.textDocumentSync===j.TextDocumentSyncKind.None?i={openClose:!1,change:j.TextDocumentSyncKind.None,save:void 0}:i={openClose:!0,change:r.capabilities.textDocumentSync,save:{includeText:!1}}:r.capabilities.textDocumentSync!==void 0&&r.capabilities.textDocumentSync!==null&&(i=r.capabilities.textDocumentSync),this._capabilities=Object.assign({},r.capabilities,{resolvedTextDocumentSync:i}),e.onNotification(j.PublishDiagnosticsNotification.type,s=>this.handleDiagnostics(s)),e.onRequest(j.RegistrationRequest.type,s=>this.handleRegistrationRequest(s)),e.onRequest("client/registerFeature",s=>this.handleRegistrationRequest(s)),e.onRequest(j.UnregistrationRequest.type,s=>this.handleUnregistrationRequest(s)),e.onRequest("client/unregisterFeature",s=>this.handleUnregistrationRequest(s)),e.onRequest(j.ApplyWorkspaceEditRequest.type,s=>this.handleApplyWorkspaceEdit(s));for(let[s,o]of this._pendingNotificationHandlers)this._notificationDisposables.set(s,e.onNotification(s,o));this._pendingNotificationHandlers.clear();for(let[s,o]of this._pendingRequestHandlers)this._requestDisposables.set(s,e.onRequest(s,o));this._pendingRequestHandlers.clear();for(let[s,o]of this._pendingProgressHandlers)this._progressDisposables.set(s,e.onProgress(o.type,s,o.handler));return this._pendingProgressHandlers.clear(),await e.sendNotification(j.InitializedNotification.type,{}),this.hookFileEvents(e),this.hookConfigurationChanged(e),this.initializeFeatures(e),r}catch(r){throw this._clientOptions.initializationFailedHandler?this._clientOptions.initializationFailedHandler(r)?this.initialize(e):this.stop():r instanceof j.ResponseError&&r.data&&r.data.retry?Se.window.showErrorMessage(r.message,{title:"Retry",id:"retry"}).then(i=>{i&&i.id==="retry"?this.initialize(e):this.stop()}):(r&&r.message&&Se.window.showErrorMessage(r.message),this.error("Server initialization failed.",r),this.stop()),r}}_clientGetRootPath(){let e=Se.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)}dispose(e=2e3){try{return this._disposed="disposing",this.stop(e)}finally{this._disposed="disposed"}}async shutdown(e,t){if(this.$state===ce.Stopped||this.$state===ce.Initial)return;if(this.$state===ce.Stopping){if(this._onStop!==void 0)return this._onStop;throw new Error("Client is stopping but no stop promise available.")}let r=this.activeConnection();if(r===void 0||this.$state!==ce.Running)throw new Error(`Client is not running and can't be stopped. It's current state is: ${this.$state}`);this._initializeResult=void 0,this.$state=ce.Stopping,this.cleanUp(e);let i=new Promise(o=>{(0,j.RAL)().timer.setTimeout(o,t)}),s=(async o=>(await o.shutdown(),await o.exit(),o))(r);return this._onStop=Promise.race([i,s]).then(o=>{if(o!==void 0)o.end(),o.dispose();else throw this.error("Stopping server timed out",void 0,!1),new Error("Stopping the server timed out")},o=>{throw this.error("Stopping server failed",o,!1),o}).finally(()=>{this.$state=ce.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();let t=this._listeners.splice(0,this._listeners.length);for(let r of t)r.dispose();this._syncedDocuments&&this._syncedDocuments.clear();for(let r of Array.from(this._features.entries()).map(i=>i[1]).reverse())r.clear();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 r(s){return t._fileEvents.push(s),t._fileEventDelayer.trigger(async()=>{await t.sendNotification(j.DidChangeWatchedFilesNotification.type,{changes:t._fileEvents}),t._fileEvents=[]})}let i=this.clientOptions.middleware?.workspace;(i?.didChangeWatchedFile?i.didChangeWatchedFile(e,r):r(e)).catch(s=>{t.error("Notify file events failed.",s)})}async sendPendingFullTextDocumentChanges(e){return this._pendingChangeSemaphore.lock(async()=>{try{let t=this._didChangeTextDocumentFeature.getPendingDocumentChanges(this._pendingOpenNotifications);if(t.length===0)return;for(let r of t){let i=this.code2ProtocolConverter.asChangeTextDocumentParams(r);await e.sendNotification(j.DidChangeTextDocumentNotification.type,i),this._didChangeTextDocumentFeature.notificationSent(r,j.DidChangeTextDocumentNotification.type,i)}}catch(t){throw this.error("Sending pending changes failed",t,!1),t}})}triggerPendingChangeDelivery(){this._pendingChangeDelayer.trigger(async()=>{let e=this.activeConnection();if(e===void 0){this.triggerPendingChangeDelivery();return}await this.sendPendingFullTextDocumentChanges(e)}).catch(e=>this.error("Delivering pending changes failed",e,!1))}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,j.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,r]=e.value;this._diagnosticQueue.delete(t);let i=new Se.CancellationTokenSource;this._diagnosticQueueState={state:"busy",document:t,tokenSource:i},this._p2c.asDiagnostics(r,i.token).then(s=>{if(!i.token.isCancellationRequested){let o=this._p2c.asUri(t),a=this.clientOptions.middleware;a.handleDiagnostics?a.handleDiagnostics(o,s,(u,l)=>this.setDiagnostics(u,l)):this.setDiagnostics(o,s)}}).finally(()=>{this._diagnosticQueueState={state:"idle"},this.triggerDiagnosticQueue()})}setDiagnostics(e,t){this._diagnostics&&this._diagnostics.set(e,t)}getLocale(){return Se.env.language}async $start(){if(this.$state===ce.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=(i,s,o)=>{this.handleConnectionError(i,s,o).catch(a=>this.error("Handling connection error failed",a))},t=()=>{this.handleConnectionClosed().catch(i=>this.error("Handling connection close failed",i))},r=await this.createMessageTransports(this._clientOptions.stdioEncoding||"utf8");return this._connection=HD(r.reader,r.writer,e,t,this._clientOptions.connectionOptions),this._connection}async handleConnectionClosed(){if(this.$state===ce.Stopped)return;try{this._connection!==void 0&&this._connection.dispose()}catch{}let e={action:Tr.DoNotRestart};if(this.$state!==ce.Stopping)try{e=await this._clientOptions.errorHandler.closed()}catch{}this._connection=void 0,e.action===Tr.DoNotRestart?(this.error(e.message??"Connection to server got closed. Server will not be restarted.",void 0,e.handled===!0?!1:"force"),this.cleanUp("stop"),this.$state===ce.Starting?this.$state=ce.StartFailed:this.$state=ce.Stopped,this._onStop=Promise.resolve(),this._onStart=void 0):e.action===Tr.Restart&&(this.info(e.message??"Connection to server got closed. Server will restart.",!e.handled),this.cleanUp("restart"),this.$state=ce.Initial,this._onStop=Promise.resolve(),this._onStart=void 0,this.start().catch(t=>this.error("Restarting server failed",t,"force")))}async handleConnectionError(e,t,r){let i=await this._clientOptions.errorHandler.error(e,t,r);i.action===fs.Shutdown?(this.error(i.message??`Client ${this._name}: connection to server is erroring.
44
44
  ${e.message}
45
45
  Shutting down server.`,void 0,i.handled===!0?!1:"force"),this.stop().catch(s=>{this.error("Stopping server failed",s,!1)})):this.error(i.message??`Client ${this._name}: connection to server is erroring.
46
- ${e.message}`,void 0,i.handled===!0?!1:"force")}hookConfigurationChanged(e){this._listeners.push(Se.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)}))}refreshTrace(e,t=!1){let r=Se.workspace.getConfiguration(this._id),i=j.Trace.Off,s=j.TraceFormat.Text;if(r){let o=r.get("trace.server","off");typeof o=="string"?i=j.Trace.fromString(o):(i=j.Trace.fromString(r.get("trace.server.verbosity","off")),s=j.TraceFormat.fromString(r.get("trace.server.format","text")))}this._trace=i,this._traceFormat=s,e.trace(this._trace,this._tracer,{sendNotification:t,traceFormat:this._traceFormat}).catch(o=>{this.error("Updating trace failed with error",o,!1)})}hookFileEvents(e){let t=this._clientOptions.synchronize.fileEvents;if(!t)return;let r;Sn.array(t)?r=t:r=[t],r&&this._dynamicFeatures.get(j.DidChangeWatchedFilesNotification.type.method).registerRaw(ny.generateUuid(),r)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),Rn.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(j.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof ry.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){let e=new Map;this.registerFeature(new iy.ConfigurationFeature(this)),this.registerFeature(new Ti.DidOpenTextDocumentFeature(this,this._syncedDocuments)),this._didChangeTextDocumentFeature=new Ti.DidChangeTextDocumentFeature(this,e),this._didChangeTextDocumentFeature.onPendingChangeAdded(()=>{this.triggerPendingChangeDelivery()}),this.registerFeature(this._didChangeTextDocumentFeature),this.registerFeature(new Ti.WillSaveFeature(this)),this.registerFeature(new Ti.WillSaveWaitUntilFeature(this)),this.registerFeature(new Ti.DidSaveTextDocumentFeature(this)),this.registerFeature(new Ti.DidCloseTextDocumentFeature(this,this._syncedDocuments,e)),this.registerFeature(new SD.FileSystemWatcherFeature(this,t=>this.notifyFileEvent(t))),this.registerFeature(new fD.CompletionItemFeature(this)),this.registerFeature(new hD.HoverFeature(this)),this.registerFeature(new gD.SignatureHelpFeature(this)),this.registerFeature(new pD.DefinitionFeature(this)),this.registerFeature(new CD.ReferencesFeature(this)),this.registerFeature(new mD.DocumentHighlightFeature(this)),this.registerFeature(new vD.DocumentSymbolFeature(this)),this.registerFeature(new yD.WorkspaceSymbolFeature(this)),this.registerFeature(new bD.CodeActionFeature(this)),this.registerFeature(new _D.CodeLensFeature(this)),this.registerFeature(new Nd.DocumentFormattingFeature(this)),this.registerFeature(new Nd.DocumentRangeFormattingFeature(this)),this.registerFeature(new Nd.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new wD.RenameFeature(this)),this.registerFeature(new DD.DocumentLinkFeature(this)),this.registerFeature(new RD.ExecuteCommandFeature(this)),this.registerFeature(new iy.SyncConfigurationFeature(this)),this.registerFeature(new qD.TypeDefinitionFeature(this)),this.registerFeature(new PD.ImplementationFeature(this)),this.registerFeature(new TD.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new ED.WorkspaceFoldersFeature(this)),this.registerFeature(new kD.FoldingRangeFeature(this)),this.registerFeature(new xD.DeclarationFeature(this)),this.registerFeature(new ID.SelectionRangeFeature(this)),this.registerFeature(new OD.ProgressFeature(this)),this.registerFeature(new FD.CallHierarchyFeature(this)),this.registerFeature(new ND.SemanticTokensFeature(this)),this.registerFeature(new MD.LinkedEditingFeature(this)),this.registerFeature(new Pi.DidCreateFilesFeature(this)),this.registerFeature(new Pi.DidRenameFilesFeature(this)),this.registerFeature(new Pi.DidDeleteFilesFeature(this)),this.registerFeature(new Pi.WillCreateFilesFeature(this)),this.registerFeature(new Pi.WillRenameFilesFeature(this)),this.registerFeature(new Pi.WillDeleteFilesFeature(this)),this.registerFeature(new LD.TypeHierarchyFeature(this)),this.registerFeature(new AD.InlineValueFeature(this)),this.registerFeature(new jD.InlayHintsFeature(this)),this.registerFeature(new dD.DiagnosticFeature(this)),this.registerFeature(new ry.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(jd.createAll(this))}fillInitializeParams(e){for(let t of this._features)Sn.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){let e={};(0,Rn.ensure)(e,"workspace").applyEdit=!0;let t=(0,Rn.ensure)((0,Rn.ensure)(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[j.ResourceOperationKind.Create,j.ResourceOperationKind.Rename,j.ResourceOperationKind.Delete],t.failureHandling=j.FailureHandlingKind.TextOnlyTransactional,t.normalizesLineEndings=!0,t.changeAnnotationSupport={groupsOnLabel:!0};let r=(0,Rn.ensure)((0,Rn.ensure)(e,"textDocument"),"publishDiagnostics");r.relatedInformation=!0,r.versionSupport=!1,r.tagSupport={valueSet:[j.DiagnosticTag.Unnecessary,j.DiagnosticTag.Deprecated]},r.codeDescriptionSupport=!0,r.dataSupport=!0;let i=(0,Rn.ensure)(e,"window"),s=(0,Rn.ensure)(i,"showMessage");s.messageActionItem={additionalPropertiesSupport:!0};let o=(0,Rn.ensure)(i,"showDocument");o.support=!0;let a=(0,Rn.ensure)(e,"general");a.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(er.RequestsToCancelOnContentModified)},a.regularExpressions={engine:"ECMAScript",version:"ES2020"},a.markdown={parser:"marked",version:"1.1.0"},a.positionEncodings=["utf-16"],this._clientOptions.markdown.supportHtml&&(a.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 u of this._features)u.fillClientCapabilities(e);return e}initializeFeatures(e){let t=this._clientOptions.documentSelector;for(let r of this._features)Sn.func(r.preInitialize)&&r.preInitialize(this._capabilities,t);for(let r of this._features)r.initialize(this._capabilities,t)}async handleRegistrationRequest(e){let t=this.clientOptions.middleware?.handleRegisterCapability;return t?t(e,r=>this.doRegisterCapability(r)):this.doRegisterCapability(e)}async doRegisterCapability(e){if(!this.isRunning()){for(let t of e.registrations)this._ignoredRegistrations.add(t.id);return}for(let t of e.registrations){let r=this._dynamicFeatures.get(t.method);if(r===void 0)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Registration failed.`));let i=t.registerOptions??{};i.documentSelector=i.documentSelector??this._clientOptions.documentSelector;let s={id:t.id,registerOptions:i};try{r.register(s)}catch(o){return Promise.reject(o)}}}async handleUnregistrationRequest(e){let t=this.clientOptions.middleware?.handleUnregisterCapability;return t?t(e,r=>this.doUnregisterCapability(r)):this.doUnregisterCapability(e)}async doUnregisterCapability(e){for(let t of e.unregisterations){if(this._ignoredRegistrations.has(t.id))continue;let r=this._dynamicFeatures.get(t.method);if(!r)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Unregistration failed.`));r.unregister(t.id)}}async handleApplyWorkspaceEdit(e){let t=e.edit,r=await this.workspaceEditLock.lock(()=>this._p2c.asWorkspaceEdit(t)),i=new Map;Se.workspace.textDocuments.forEach(o=>i.set(o.uri.toString(),o));let s=!1;if(t.documentChanges){for(let o of t.documentChanges)if(j.TextDocumentEdit.is(o)&&o.textDocument.version&&o.textDocument.version>=0){let a=this._p2c.asUri(o.textDocument.uri).toString(),u=i.get(a);if(u&&u.version!==o.textDocument.version){s=!0;break}}}return s?Promise.resolve({applied:!1}):Sn.asPromise(Se.workspace.applyEdit(r).then(o=>({applied:o})))}handleFailedRequest(e,t,r,i,s=!0){if(r instanceof j.ResponseError){if(r.code===j.ErrorCodes.PendingResponseRejected||r.code===j.ErrorCodes.ConnectionInactive)return i;if(r.code===j.LSPErrorCodes.RequestCancelled||r.code===j.LSPErrorCodes.ServerCancelled){if(t!==void 0&&t.isCancellationRequested)return i;throw r.data!==void 0?new Rn.LSPCancellationError(r.data):new Se.CancellationError}else if(r.code===j.LSPErrorCodes.ContentModified){if(er.RequestsToCancelOnContentModified.has(e.method)||er.CancellableResolveCalls.has(e.method))throw new Se.CancellationError;return i}}throw this.error(`Request ${e.method} failed.`,r,s),r}};dt.BaseLanguageClient=er;er.RequestsToCancelOnContentModified=new Set([j.SemanticTokensRequest.method,j.SemanticTokensRangeRequest.method,j.SemanticTokensDeltaRequest.method]);er.CancellableResolveCalls=new Set([j.CompletionResolveRequest.method,j.CodeLensResolveRequest.method,j.CodeActionResolveRequest.method,j.InlayHintResolveRequest.method,j.DocumentLinkResolveRequest.method,j.WorkspaceSymbolResolveRequest.method]);var Ad=class{error(e){(0,j.RAL)().console.error(e)}warn(e){(0,j.RAL)().console.warn(e)}info(e){(0,j.RAL)().console.info(e)}log(e){(0,j.RAL)().console.log(e)}};function HD(n,e,t,r,i){let s=new Ad,o=(0,j.createProtocolConnection)(n,e,s,i);return o.onError(u=>{t(u[0],u[1],u[2])}),o.onClose(r),{listen:()=>o.listen(),sendRequest:o.sendRequest,onRequest:o.onRequest,hasPendingResponse:o.hasPendingResponse,sendNotification:o.sendNotification,onNotification:o.onNotification,onProgress:o.onProgress,sendProgress:o.sendProgress,trace:(u,l,p)=>{let m={sendNotification:!1,traceFormat:j.TraceFormat.Text};return p===void 0?o.trace(u,l,m):(Sn.boolean(p),o.trace(u,l,p))},initialize:u=>o.sendRequest(j.InitializeRequest.type,u),shutdown:()=>o.sendRequest(j.ShutdownRequest.type,void 0),exit:()=>o.sendNotification(j.ExitNotification.type),end:()=>o.end(),dispose:()=>o.dispose()}}var jd;(function(n){function e(t){return[new $D.InlineCompletionItemFeature(t)]}n.createAll=e})(jd||(dt.ProposedFeatures=jd={}))});var cy=E(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.terminate=void 0;var ay=require("child_process"),WD=require("path"),UD=process.platform==="win32",KD=process.platform==="darwin",zD=process.platform==="linux";function VD(n,e){if(UD)try{let i={stdio:["pipe","pipe","ignore"]};return e&&(i.cwd=e),ay.execFileSync("taskkill",["/T","/F","/PID",n.pid.toString()],i),!0}catch{return!1}else if(zD||KD)try{var t=(0,WD.join)(__dirname,"terminateProcess.sh"),r=ay.spawnSync(t,[n.pid.toString()]);return!r.error}catch{return!1}else return n.kill("SIGKILL"),!0}ra.terminate=VD});var Hd=E((xP,uy)=>{"use strict";uy.exports=Y()});var hs=E((IP,ly)=>{var BD=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{};ly.exports=BD});var ia=E((OP,dy)=>{var GD="2.0.0",XD=Number.MAX_SAFE_INTEGER||9007199254740991,JD=16,QD=256-6,YD=["major","premajor","minor","preminor","patch","prepatch","prerelease"];dy.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:JD,MAX_SAFE_BUILD_LENGTH:QD,MAX_SAFE_INTEGER:XD,RELEASE_TYPES:YD,SEMVER_SPEC_VERSION:GD,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var sa=E((tr,fy)=>{var{MAX_SAFE_COMPONENT_LENGTH:Wd,MAX_SAFE_BUILD_LENGTH:ZD,MAX_LENGTH:eR}=ia(),tR=hs();tr=fy.exports={};var nR=tr.re=[],rR=tr.safeRe=[],z=tr.src=[],V=tr.t={},iR=0,Ud="[a-zA-Z0-9-]",sR=[["\\s",1],["\\d",eR],[Ud,ZD]],oR=n=>{for(let[e,t]of sR)n=n.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return n},re=(n,e,t)=>{let r=oR(e),i=iR++;tR(n,i,e),V[n]=i,z[i]=e,nR[i]=new RegExp(e,t?"g":void 0),rR[i]=new RegExp(r,t?"g":void 0)};re("NUMERICIDENTIFIER","0|[1-9]\\d*");re("NUMERICIDENTIFIERLOOSE","\\d+");re("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ud}*`);re("MAINVERSION",`(${z[V.NUMERICIDENTIFIER]})\\.(${z[V.NUMERICIDENTIFIER]})\\.(${z[V.NUMERICIDENTIFIER]})`);re("MAINVERSIONLOOSE",`(${z[V.NUMERICIDENTIFIERLOOSE]})\\.(${z[V.NUMERICIDENTIFIERLOOSE]})\\.(${z[V.NUMERICIDENTIFIERLOOSE]})`);re("PRERELEASEIDENTIFIER",`(?:${z[V.NUMERICIDENTIFIER]}|${z[V.NONNUMERICIDENTIFIER]})`);re("PRERELEASEIDENTIFIERLOOSE",`(?:${z[V.NUMERICIDENTIFIERLOOSE]}|${z[V.NONNUMERICIDENTIFIER]})`);re("PRERELEASE",`(?:-(${z[V.PRERELEASEIDENTIFIER]}(?:\\.${z[V.PRERELEASEIDENTIFIER]})*))`);re("PRERELEASELOOSE",`(?:-?(${z[V.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[V.PRERELEASEIDENTIFIERLOOSE]})*))`);re("BUILDIDENTIFIER",`${Ud}+`);re("BUILD",`(?:\\+(${z[V.BUILDIDENTIFIER]}(?:\\.${z[V.BUILDIDENTIFIER]})*))`);re("FULLPLAIN",`v?${z[V.MAINVERSION]}${z[V.PRERELEASE]}?${z[V.BUILD]}?`);re("FULL",`^${z[V.FULLPLAIN]}$`);re("LOOSEPLAIN",`[v=\\s]*${z[V.MAINVERSIONLOOSE]}${z[V.PRERELEASELOOSE]}?${z[V.BUILD]}?`);re("LOOSE",`^${z[V.LOOSEPLAIN]}$`);re("GTLT","((?:<|>)?=?)");re("XRANGEIDENTIFIERLOOSE",`${z[V.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);re("XRANGEIDENTIFIER",`${z[V.NUMERICIDENTIFIER]}|x|X|\\*`);re("XRANGEPLAIN",`[v=\\s]*(${z[V.XRANGEIDENTIFIER]})(?:\\.(${z[V.XRANGEIDENTIFIER]})(?:\\.(${z[V.XRANGEIDENTIFIER]})(?:${z[V.PRERELEASE]})?${z[V.BUILD]}?)?)?`);re("XRANGEPLAINLOOSE",`[v=\\s]*(${z[V.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[V.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[V.XRANGEIDENTIFIERLOOSE]})(?:${z[V.PRERELEASELOOSE]})?${z[V.BUILD]}?)?)?`);re("XRANGE",`^${z[V.GTLT]}\\s*${z[V.XRANGEPLAIN]}$`);re("XRANGELOOSE",`^${z[V.GTLT]}\\s*${z[V.XRANGEPLAINLOOSE]}$`);re("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Wd}})(?:\\.(\\d{1,${Wd}}))?(?:\\.(\\d{1,${Wd}}))?`);re("COERCE",`${z[V.COERCEPLAIN]}(?:$|[^\\d])`);re("COERCEFULL",z[V.COERCEPLAIN]+`(?:${z[V.PRERELEASE]})?(?:${z[V.BUILD]})?(?:$|[^\\d])`);re("COERCERTL",z[V.COERCE],!0);re("COERCERTLFULL",z[V.COERCEFULL],!0);re("LONETILDE","(?:~>?)");re("TILDETRIM",`(\\s*)${z[V.LONETILDE]}\\s+`,!0);tr.tildeTrimReplace="$1~";re("TILDE",`^${z[V.LONETILDE]}${z[V.XRANGEPLAIN]}$`);re("TILDELOOSE",`^${z[V.LONETILDE]}${z[V.XRANGEPLAINLOOSE]}$`);re("LONECARET","(?:\\^)");re("CARETTRIM",`(\\s*)${z[V.LONECARET]}\\s+`,!0);tr.caretTrimReplace="$1^";re("CARET",`^${z[V.LONECARET]}${z[V.XRANGEPLAIN]}$`);re("CARETLOOSE",`^${z[V.LONECARET]}${z[V.XRANGEPLAINLOOSE]}$`);re("COMPARATORLOOSE",`^${z[V.GTLT]}\\s*(${z[V.LOOSEPLAIN]})$|^$`);re("COMPARATOR",`^${z[V.GTLT]}\\s*(${z[V.FULLPLAIN]})$|^$`);re("COMPARATORTRIM",`(\\s*)${z[V.GTLT]}\\s*(${z[V.LOOSEPLAIN]}|${z[V.XRANGEPLAIN]})`,!0);tr.comparatorTrimReplace="$1$2$3";re("HYPHENRANGE",`^\\s*(${z[V.XRANGEPLAIN]})\\s+-\\s+(${z[V.XRANGEPLAIN]})\\s*$`);re("HYPHENRANGELOOSE",`^\\s*(${z[V.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[V.XRANGEPLAINLOOSE]})\\s*$`);re("STAR","(<|>)?=?\\s*\\*");re("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");re("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var oa=E((FP,hy)=>{var aR=Object.freeze({loose:!0}),cR=Object.freeze({}),uR=n=>n?typeof n!="object"?aR:n:cR;hy.exports=uR});var vy=E((NP,my)=>{var py=/^[0-9]+$/,gy=(n,e)=>{let t=py.test(n),r=py.test(e);return t&&r&&(n=+n,e=+e),n===e?0:t&&!r?-1:r&&!t?1:n<e?-1:1},lR=(n,e)=>gy(e,n);my.exports={compareIdentifiers:gy,rcompareIdentifiers:lR}});var ps=E((MP,_y)=>{var aa=hs(),{MAX_LENGTH:yy,MAX_SAFE_INTEGER:ca}=ia(),{safeRe:Cy,t:by}=sa(),dR=oa(),{compareIdentifiers:qi}=vy(),en=class{constructor(e,t){if(t=dR(t),e instanceof en){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>yy)throw new TypeError(`version is longer than ${yy} characters`);aa("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Cy[by.LOOSE]:Cy[by.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>ca||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ca||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ca||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<ca)return s}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(aa("SemVer.compare",this.version,this.options,e),!(e instanceof en)){if(typeof e=="string"&&e===this.version)return 0;e=new en(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof en||(e=new en(e,this.options)),qi(this.major,e.major)||qi(this.minor,e.minor)||qi(this.patch,e.patch)}comparePre(e){if(e instanceof en||(e=new en(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(aa("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return qi(r,i)}while(++t)}compareBuild(e){e instanceof en||(e=new en(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(aa("build compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return qi(r,i)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(r)?1:0;if(!t&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(t===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let s=[t,i];r===!1&&(s=[t]),qi(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};_y.exports=en});var Ry=E((LP,Dy)=>{var wy=ps(),fR=(n,e,t=!1)=>{if(n instanceof wy)return n;try{return new wy(n,e)}catch(r){if(!t)return null;throw r}};Dy.exports=fR});var Ty=E((AP,Sy)=>{var Kd=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}};Sy.exports=Kd});var Vr=E((jP,qy)=>{var Py=ps(),hR=(n,e,t)=>new Py(n,t).compare(new Py(e,t));qy.exports=hR});var ky=E(($P,Ey)=>{var pR=Vr(),gR=(n,e,t)=>pR(n,e,t)===0;Ey.exports=gR});var Iy=E((HP,xy)=>{var mR=Vr(),vR=(n,e,t)=>mR(n,e,t)!==0;xy.exports=vR});var Fy=E((WP,Oy)=>{var yR=Vr(),CR=(n,e,t)=>yR(n,e,t)>0;Oy.exports=CR});var My=E((UP,Ny)=>{var bR=Vr(),_R=(n,e,t)=>bR(n,e,t)>=0;Ny.exports=_R});var Ay=E((KP,Ly)=>{var wR=Vr(),DR=(n,e,t)=>wR(n,e,t)<0;Ly.exports=DR});var $y=E((zP,jy)=>{var RR=Vr(),SR=(n,e,t)=>RR(n,e,t)<=0;jy.exports=SR});var Wy=E((VP,Hy)=>{var TR=ky(),PR=Iy(),qR=Fy(),ER=My(),kR=Ay(),xR=$y(),IR=(n,e,t,r)=>{switch(e){case"===":return typeof n=="object"&&(n=n.version),typeof t=="object"&&(t=t.version),n===t;case"!==":return typeof n=="object"&&(n=n.version),typeof t=="object"&&(t=t.version),n!==t;case"":case"=":case"==":return TR(n,t,r);case"!=":return PR(n,t,r);case">":return qR(n,t,r);case">=":return ER(n,t,r);case"<":return kR(n,t,r);case"<=":return xR(n,t,r);default:throw new TypeError(`Invalid operator: ${e}`)}};Hy.exports=IR});var Xy=E((BP,Gy)=>{var gs=Symbol("SemVer ANY"),Ei=class{static get ANY(){return gs}constructor(e,t){if(t=Uy(t),e instanceof Ei){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Vd("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===gs?this.value="":this.value=this.operator+this.semver.version,Vd("comp",this)}parse(e){let t=this.options.loose?Ky[zy.COMPARATORLOOSE]:Ky[zy.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new Vy(r[2],this.options.loose):this.semver=gs}toString(){return this.value}test(e){if(Vd("Comparator.test",e,this.options.loose),this.semver===gs||e===gs)return!0;if(typeof e=="string")try{e=new Vy(e,this.options)}catch{return!1}return zd(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Ei))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new By(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new By(this.value,t).test(e.semver):(t=Uy(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||zd(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||zd(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Gy.exports=Ei;var Uy=oa(),{safeRe:Ky,t:zy}=sa(),zd=Wy(),Vd=hs(),Vy=ps(),By=Bd()});var Bd=E((GP,Zy)=>{var OR=/\s+/g,Br=class{constructor(e,t){if(t=NR(t),e instanceof Br)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new Br(e.raw,t);if(e instanceof Gd)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(OR," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(i=>!Qy(i[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&WR(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let r=0;r<t.length;r++)r>0&&(this.formatted+=" "),this.formatted+=t[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&$R)|(this.options.loose&&HR))+":"+e,i=Jy.get(r);if(i)return i;let s=this.options.loose,o=s?Ht[qt.HYPHENRANGELOOSE]:Ht[qt.HYPHENRANGE];e=e.replace(o,YR(this.options.includePrerelease)),Le("hyphen replace",e),e=e.replace(Ht[qt.COMPARATORTRIM],LR),Le("comparator trim",e),e=e.replace(Ht[qt.TILDETRIM],AR),Le("tilde trim",e),e=e.replace(Ht[qt.CARETTRIM],jR),Le("caret trim",e);let a=e.split(" ").map(m=>UR(m,this.options)).join(" ").split(/\s+/).map(m=>QR(m,this.options));s&&(a=a.filter(m=>(Le("loose invalid filter",m,this.options),!!m.match(Ht[qt.COMPARATORLOOSE])))),Le("range list",a);let u=new Map,l=a.map(m=>new Gd(m,this.options));for(let m of l){if(Qy(m))return[m];u.set(m.value,m)}u.size>1&&u.has("")&&u.delete("");let p=[...u.values()];return Jy.set(r,p),p}intersects(e,t){if(!(e instanceof Br))throw new TypeError("a Range is required");return this.set.some(r=>Yy(r,t)&&e.set.some(i=>Yy(i,t)&&r.every(s=>i.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new MR(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(ZR(this.set[t],e,this.options))return!0;return!1}};Zy.exports=Br;var FR=Ty(),Jy=new FR,NR=oa(),Gd=Xy(),Le=hs(),MR=ps(),{safeRe:Ht,t:qt,comparatorTrimReplace:LR,tildeTrimReplace:AR,caretTrimReplace:jR}=sa(),{FLAG_INCLUDE_PRERELEASE:$R,FLAG_LOOSE:HR}=ia(),Qy=n=>n.value==="<0.0.0-0",WR=n=>n.value==="",Yy=(n,e)=>{let t=!0,r=n.slice(),i=r.pop();for(;t&&r.length;)t=r.every(s=>i.intersects(s,e)),i=r.pop();return t},UR=(n,e)=>(Le("comp",n,e),n=VR(n,e),Le("caret",n),n=KR(n,e),Le("tildes",n),n=GR(n,e),Le("xrange",n),n=JR(n,e),Le("stars",n),n),Et=n=>!n||n.toLowerCase()==="x"||n==="*",KR=(n,e)=>n.trim().split(/\s+/).map(t=>zR(t,e)).join(" "),zR=(n,e)=>{let t=e.loose?Ht[qt.TILDELOOSE]:Ht[qt.TILDE];return n.replace(t,(r,i,s,o,a)=>{Le("tilde",n,r,i,s,o,a);let u;return Et(i)?u="":Et(s)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:Et(o)?u=`>=${i}.${s}.0 <${i}.${+s+1}.0-0`:a?(Le("replaceTilde pr",a),u=`>=${i}.${s}.${o}-${a} <${i}.${+s+1}.0-0`):u=`>=${i}.${s}.${o} <${i}.${+s+1}.0-0`,Le("tilde return",u),u})},VR=(n,e)=>n.trim().split(/\s+/).map(t=>BR(t,e)).join(" "),BR=(n,e)=>{Le("caret",n,e);let t=e.loose?Ht[qt.CARETLOOSE]:Ht[qt.CARET],r=e.includePrerelease?"-0":"";return n.replace(t,(i,s,o,a,u)=>{Le("caret",n,i,s,o,a,u);let l;return Et(s)?l="":Et(o)?l=`>=${s}.0.0${r} <${+s+1}.0.0-0`:Et(a)?s==="0"?l=`>=${s}.${o}.0${r} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.0${r} <${+s+1}.0.0-0`:u?(Le("replaceCaret pr",u),s==="0"?o==="0"?l=`>=${s}.${o}.${a}-${u} <${s}.${o}.${+a+1}-0`:l=`>=${s}.${o}.${a}-${u} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.${a}-${u} <${+s+1}.0.0-0`):(Le("no pr"),s==="0"?o==="0"?l=`>=${s}.${o}.${a}${r} <${s}.${o}.${+a+1}-0`:l=`>=${s}.${o}.${a}${r} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),Le("caret return",l),l})},GR=(n,e)=>(Le("replaceXRanges",n,e),n.split(/\s+/).map(t=>XR(t,e)).join(" ")),XR=(n,e)=>{n=n.trim();let t=e.loose?Ht[qt.XRANGELOOSE]:Ht[qt.XRANGE];return n.replace(t,(r,i,s,o,a,u)=>{Le("xRange",n,r,i,s,o,a,u);let l=Et(s),p=l||Et(o),m=p||Et(a),g=m;return i==="="&&g&&(i=""),u=e.includePrerelease?"-0":"",l?i===">"||i==="<"?r="<0.0.0-0":r="*":i&&g?(p&&(o=0),a=0,i===">"?(i=">=",p?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",p?s=+s+1:o=+o+1),i==="<"&&(u="-0"),r=`${i+s}.${o}.${a}${u}`):p?r=`>=${s}.0.0${u} <${+s+1}.0.0-0`:m&&(r=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`),Le("xRange return",r),r})},JR=(n,e)=>(Le("replaceStars",n,e),n.trim().replace(Ht[qt.STAR],"")),QR=(n,e)=>(Le("replaceGTE0",n,e),n.trim().replace(Ht[e.includePrerelease?qt.GTE0PRE:qt.GTE0],"")),YR=n=>(e,t,r,i,s,o,a,u,l,p,m,g)=>(Et(r)?t="":Et(i)?t=`>=${r}.0.0${n?"-0":""}`:Et(s)?t=`>=${r}.${i}.0${n?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${n?"-0":""}`,Et(l)?u="":Et(p)?u=`<${+l+1}.0.0-0`:Et(m)?u=`<${l}.${+p+1}.0-0`:g?u=`<=${l}.${p}.${m}-${g}`:n?u=`<${l}.${p}.${+m+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),ZR=(n,e,t)=>{for(let r=0;r<n.length;r++)if(!n[r].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let r=0;r<n.length;r++)if(Le(n[r].semver),n[r].semver!==Gd.ANY&&n[r].semver.prerelease.length>0){let i=n[r].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var tC=E((XP,eC)=>{var eS=Bd(),tS=(n,e,t)=>{try{e=new eS(e,t)}catch{return!1}return e.test(n)};eC.exports=tS});var rC=E(tn=>{"use strict";var nS=tn&&tn.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),Xd=tn&&tn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&nS(e,n,t)};Object.defineProperty(tn,"__esModule",{value:!0});tn.DiagnosticPullMode=tn.vsdiag=void 0;Xd(Y(),tn);Xd(ve(),tn);var nC=sl();Object.defineProperty(tn,"vsdiag",{enumerable:!0,get:function(){return nC.vsdiag}});Object.defineProperty(tn,"DiagnosticPullMode",{enumerable:!0,get:function(){return nC.DiagnosticPullMode}});Xd($d(),tn)});var sf=E(Wt=>{"use strict";var rS=Wt&&Wt.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),oC=Wt&&Wt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&rS(e,n,t)};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.SettingMonitor=Wt.LanguageClient=Wt.TransportKind=void 0;var nr=require("child_process"),Jd=require("fs"),Qd=require("path"),qr=require("vscode"),We=cn(),iC=$d(),iS=cy(),ze=Hd(),sS=Ry(),oS=tC();oC(Hd(),Wt);oC(rC(),Wt);var sC="^1.82.0",Ve;(function(n){n[n.stdio=0]="stdio",n[n.ipc=1]="ipc",n[n.pipe=2]="pipe",n[n.socket=3]="socket"})(Ve||(Wt.TransportKind=Ve={}));var Pr;(function(n){function e(t){let r=t;return r&&r.kind===Ve.socket&&We.number(r.port)}n.isSocket=e})(Pr||(Pr={}));var Yd;(function(n){function e(t){return We.string(t.command)}n.is=e})(Yd||(Yd={}));var Zd;(function(n){function e(t){return We.string(t.module)}n.is=e})(Zd||(Zd={}));var ef;(function(n){function e(t){let r=t;return r&&r.writer!==void 0&&r.reader!==void 0}n.is=e})(ef||(ef={}));var tf;(function(n){function e(t){let r=t;return r&&r.process!==void 0&&typeof r.detached=="boolean"}n.is=e})(tf||(tf={}));var nf=class extends iC.BaseLanguageClient{constructor(e,t,r,i,s){let o,a,u,l,p;We.string(t)?(o=e,a=t,u=r,l=i,p=!!s):(o=e.toLowerCase(),a=e,u=t,l=r,p=i),p===void 0&&(p=!1),super(o,a,l),this._serverOptions=u,this._forceDebug=p,this._isInDebugMode=p;try{this.checkVersion()}catch(m){throw We.string(m.message)&&this.outputChannel.appendLine(m.message),m}}checkVersion(){let e=sS(qr.version);if(!e)throw new Error(`No valid VS Code version detected. Version string is: ${qr.version}`);if(e.prerelease&&e.prerelease.length>0&&(e.prerelease=[]),!oS(e,sC))throw new Error(`The language client requires VS Code version ${sC} but received version ${qr.version}`)}get isInDebugMode(){return this._isInDebugMode}async restart(){await this.stop(),this.isInDebugMode?(await new Promise(e=>setTimeout(e,1e3)),await this.start()):await this.start()}stop(e=2e3){return super.stop(e).finally(()=>{if(this._serverProcess){let t=this._serverProcess;this._serverProcess=void 0,(this._isDetached===void 0||!this._isDetached)&&this.checkProcessDied(t),this._isDetached=void 0}})}checkProcessDied(e){!e||e.pid===void 0||setTimeout(()=>{try{e.pid!==void 0&&(process.kill(e.pid,0),(0,iS.terminate)(e))}catch{}},2e3)}handleConnectionClosed(){return this._serverProcess=void 0,super.handleConnectionClosed()}fillInitializeParams(e){super.fillInitializeParams(e),e.processId===null&&(e.processId=process.pid)}createMessageTransports(e){function t(p,m){if(!p&&!m)return;let g=Object.create(null);return Object.keys(process.env).forEach(D=>g[D]=process.env[D]),m&&(g.ELECTRON_RUN_AS_NODE="1",g.ELECTRON_NO_ASAR="1"),p&&Object.keys(p).forEach(D=>g[D]=p[D]),g}let r=["--debug=","--debug-brk=","--inspect=","--inspect-brk="],i=["--debug","--debug-brk","--inspect","--inspect-brk"];function s(){let p=process.execArgv;return p?p.some(m=>r.some(g=>m.startsWith(g))||i.some(g=>m===g)):!1}function o(p){if(p.stdin===null||p.stdout===null||p.stderr===null)throw new Error("Process created without stdio streams")}let a=this._serverOptions;if(We.func(a))return a().then(p=>{if(iC.MessageTransports.is(p))return this._isDetached=!!p.detached,p;if(ef.is(p))return this._isDetached=!!p.detached,{reader:new ze.StreamMessageReader(p.reader),writer:new ze.StreamMessageWriter(p.writer)};{let m;return tf.is(p)?(m=p.process,this._isDetached=p.detached):(m=p,this._isDetached=!1),m.stderr.on("data",g=>this.outputChannel.append(We.string(g)?g:g.toString(e))),{reader:new ze.StreamMessageReader(m.stdout),writer:new ze.StreamMessageWriter(m.stdin)}}});let u,l=a;return l.run||l.debug?this._forceDebug||s()?(u=l.debug,this._isInDebugMode=!0):(u=l.run,this._isInDebugMode=!1):u=a,this._getServerWorkingDir(u.options).then(p=>{if(Zd.is(u)&&u.module){let m=u,g=m.transport||Ve.stdio;if(m.runtime){let D=[],y=m.options??Object.create(null);y.execArgv&&y.execArgv.forEach(L=>D.push(L)),D.push(m.module),m.args&&m.args.forEach(L=>D.push(L));let P=Object.create(null);P.cwd=p,P.env=t(y.env,!1);let q=this._getRuntimePath(m.runtime,p),O;if(g===Ve.ipc?(P.stdio=[null,null,null,"ipc"],D.push("--node-ipc")):g===Ve.stdio?D.push("--stdio"):g===Ve.pipe?(O=(0,ze.generateRandomPipeName)(),D.push(`--pipe=${O}`)):Pr.isSocket(g)&&D.push(`--socket=${g.port}`),D.push(`--clientProcessId=${process.pid.toString()}`),g===Ve.ipc||g===Ve.stdio){let L=nr.spawn(q,D,P);return!L||!L.pid?ki(L,`Launching server using runtime ${q} failed.`):(this._serverProcess=L,L.stderr.on("data",M=>this.outputChannel.append(We.string(M)?M:M.toString(e))),g===Ve.ipc?(L.stdout.on("data",M=>this.outputChannel.append(We.string(M)?M:M.toString(e))),Promise.resolve({reader:new ze.IPCMessageReader(L),writer:new ze.IPCMessageWriter(L)})):Promise.resolve({reader:new ze.StreamMessageReader(L.stdout),writer:new ze.StreamMessageWriter(L.stdin)}))}else{if(g===Ve.pipe)return(0,ze.createClientPipeTransport)(O).then(L=>{let M=nr.spawn(q,D,P);return!M||!M.pid?ki(M,`Launching server using runtime ${q} failed.`):(this._serverProcess=M,M.stderr.on("data",A=>this.outputChannel.append(We.string(A)?A:A.toString(e))),M.stdout.on("data",A=>this.outputChannel.append(We.string(A)?A:A.toString(e))),L.onConnected().then(A=>({reader:A[0],writer:A[1]})))});if(Pr.isSocket(g))return(0,ze.createClientSocketTransport)(g.port).then(L=>{let M=nr.spawn(q,D,P);return!M||!M.pid?ki(M,`Launching server using runtime ${q} failed.`):(this._serverProcess=M,M.stderr.on("data",A=>this.outputChannel.append(We.string(A)?A:A.toString(e))),M.stdout.on("data",A=>this.outputChannel.append(We.string(A)?A:A.toString(e))),L.onConnected().then(A=>({reader:A[0],writer:A[1]})))})}}else{let D;return new Promise((y,P)=>{let q=(m.args&&m.args.slice())??[];g===Ve.ipc?q.push("--node-ipc"):g===Ve.stdio?q.push("--stdio"):g===Ve.pipe?(D=(0,ze.generateRandomPipeName)(),q.push(`--pipe=${D}`)):Pr.isSocket(g)&&q.push(`--socket=${g.port}`),q.push(`--clientProcessId=${process.pid.toString()}`);let O=m.options??Object.create(null);if(O.env=t(O.env,!0),O.execArgv=O.execArgv||[],O.cwd=p,O.silent=!0,g===Ve.ipc||g===Ve.stdio){let L=nr.fork(m.module,q||[],O);o(L),this._serverProcess=L,L.stderr.on("data",M=>this.outputChannel.append(We.string(M)?M:M.toString(e))),g===Ve.ipc?(L.stdout.on("data",M=>this.outputChannel.append(We.string(M)?M:M.toString(e))),y({reader:new ze.IPCMessageReader(this._serverProcess),writer:new ze.IPCMessageWriter(this._serverProcess)})):y({reader:new ze.StreamMessageReader(L.stdout),writer:new ze.StreamMessageWriter(L.stdin)})}else g===Ve.pipe?(0,ze.createClientPipeTransport)(D).then(L=>{let M=nr.fork(m.module,q||[],O);o(M),this._serverProcess=M,M.stderr.on("data",A=>this.outputChannel.append(We.string(A)?A:A.toString(e))),M.stdout.on("data",A=>this.outputChannel.append(We.string(A)?A:A.toString(e))),L.onConnected().then(A=>{y({reader:A[0],writer:A[1]})},P)},P):Pr.isSocket(g)&&(0,ze.createClientSocketTransport)(g.port).then(L=>{let M=nr.fork(m.module,q||[],O);o(M),this._serverProcess=M,M.stderr.on("data",A=>this.outputChannel.append(We.string(A)?A:A.toString(e))),M.stdout.on("data",A=>this.outputChannel.append(We.string(A)?A:A.toString(e))),L.onConnected().then(A=>{y({reader:A[0],writer:A[1]})},P)},P)})}}else if(Yd.is(u)&&u.command){let m=u,g=u.args!==void 0?u.args.slice(0):[],D,y=u.transport;if(y===Ve.stdio)g.push("--stdio");else if(y===Ve.pipe)D=(0,ze.generateRandomPipeName)(),g.push(`--pipe=${D}`);else if(Pr.isSocket(y))g.push(`--socket=${y.port}`);else if(y===Ve.ipc)throw new Error("Transport kind ipc is not support for command executable");let P=Object.assign({},m.options);if(P.cwd=P.cwd||p,y===void 0||y===Ve.stdio){let q=nr.spawn(m.command,g,P);return!q||!q.pid?ki(q,`Launching server using command ${m.command} failed.`):(q.stderr.on("data",O=>this.outputChannel.append(We.string(O)?O:O.toString(e))),this._serverProcess=q,this._isDetached=!!P.detached,Promise.resolve({reader:new ze.StreamMessageReader(q.stdout),writer:new ze.StreamMessageWriter(q.stdin)}))}else{if(y===Ve.pipe)return(0,ze.createClientPipeTransport)(D).then(q=>{let O=nr.spawn(m.command,g,P);return!O||!O.pid?ki(O,`Launching server using command ${m.command} failed.`):(this._serverProcess=O,this._isDetached=!!P.detached,O.stderr.on("data",L=>this.outputChannel.append(We.string(L)?L:L.toString(e))),O.stdout.on("data",L=>this.outputChannel.append(We.string(L)?L:L.toString(e))),q.onConnected().then(L=>({reader:L[0],writer:L[1]})))});if(Pr.isSocket(y))return(0,ze.createClientSocketTransport)(y.port).then(q=>{let O=nr.spawn(m.command,g,P);return!O||!O.pid?ki(O,`Launching server using command ${m.command} failed.`):(this._serverProcess=O,this._isDetached=!!P.detached,O.stderr.on("data",L=>this.outputChannel.append(We.string(L)?L:L.toString(e))),O.stdout.on("data",L=>this.outputChannel.append(We.string(L)?L:L.toString(e))),q.onConnected().then(L=>({reader:L[0],writer:L[1]})))})}}return Promise.reject(new Error("Unsupported server configuration "+JSON.stringify(a,null,4)))}).finally(()=>{this._serverProcess!==void 0&&this._serverProcess.on("exit",(p,m)=>{p!==null&&this.error(`Server process exited with code ${p}.`,void 0,!1),m!==null&&this.error(`Server process exited with signal ${m}.`,void 0,!1)})})}_getRuntimePath(e,t){if(Qd.isAbsolute(e))return e;let r=this._mainGetRootPath();if(r!==void 0){let i=Qd.join(r,e);if(Jd.existsSync(i))return i}if(t!==void 0){let i=Qd.join(t,e);if(Jd.existsSync(i))return i}return e}_mainGetRootPath(){let e=qr.workspace.workspaceFolders;if(!e||e.length===0)return;let t=e[0];if(t.uri.scheme==="file")return t.uri.fsPath}_getServerWorkingDir(e){let t=e&&e.cwd;return t||(t=this.clientOptions.workspaceFolder?this.clientOptions.workspaceFolder.uri.fsPath:this._mainGetRootPath()),t?new Promise(r=>{Jd.lstat(t,(i,s)=>{r(!i&&s.isDirectory()?t:void 0)})}):Promise.resolve(void 0)}};Wt.LanguageClient=nf;var rf=class{constructor(e,t){this._client=e,this._setting=t,this._listeners=[]}start(){return qr.workspace.onDidChangeConfiguration(this.onDidChangeConfiguration,this,this._listeners),this.onDidChangeConfiguration(),new qr.Disposable(()=>{this._client.needsStop()&&this._client.stop()})}onDidChangeConfiguration(){let e=this._setting.indexOf("."),t=e>=0?this._setting.substr(0,e):this._setting,r=e>=0?this._setting.substr(e+1):void 0,i=r?qr.workspace.getConfiguration(t).get(r,!1):qr.workspace.getConfiguration(t);i&&this._client.needsStart()?this._client.start().catch(s=>this._client.error("Start failed after configuration change",s,"force")):!i&&this._client.needsStop()&&this._client.stop().catch(s=>this._client.error("Stop failed after configuration change",s,"force"))}};Wt.SettingMonitor=rf;function ki(n,e){return n===null?Promise.reject(e):new Promise((t,r)=>{n.on("error",i=>{r(`${e} ${i}`)}),setImmediate(()=>r(e))})}});var cC=E(Te=>{"use strict";var aS=Te&&Te.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),cS=Te&&Te.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&aS(e,n,t)};Object.defineProperty(Te,"__esModule",{value:!0});Te.currentLabsVersion=Te.middleware=Te.getTsdk=Te.activateTsVersionStatusItem=Te.activateTsConfigStatusItem=Te.activateReloadProjects=Te.activateFindFileReferences=Te.activateWriteVirtualFiles=Te.activateDocumentDropEdit=Te.activateAutoInsertion=void 0;Te.parseServerCommand=xi;Te.createLabsInfo=gS;var rr=require("vscode"),uS=Zg();Object.defineProperty(Te,"activateAutoInsertion",{enumerable:!0,get:function(){return uS.activate}});var lS=em();Object.defineProperty(Te,"activateDocumentDropEdit",{enumerable:!0,get:function(){return lS.activate}});var dS=tm();Object.defineProperty(Te,"activateWriteVirtualFiles",{enumerable:!0,get:function(){return dS.activate}});var fS=lm();Object.defineProperty(Te,"activateFindFileReferences",{enumerable:!0,get:function(){return fS.activate}});var hS=dm();Object.defineProperty(Te,"activateReloadProjects",{enumerable:!0,get:function(){return hS.activate}});var pS=pm();Object.defineProperty(Te,"activateTsConfigStatusItem",{enumerable:!0,get:function(){return pS.activate}});var aC=_m();Object.defineProperty(Te,"activateTsVersionStatusItem",{enumerable:!0,get:function(){return aC.activate}});Object.defineProperty(Te,"getTsdk",{enumerable:!0,get:function(){return aC.getTsdk}});cS(sf(),Te);Te.middleware={async provideCodeActions(n,e,t,r,i){let s=await i(n,e,t,r);return s=s?.map(o=>o instanceof rr.CodeAction?(o.command&&(o.command=xi(o.command)),o):xi(o)),s},async resolveCodeAction(n,e,t){let r=await t(n,e);return r?.command&&(r.command=xi(r.command)),r},async provideCodeLenses(n,e,t){let r=await t(n,e);return r=r?.map(i=>(i.command&&(i.command=xi(i.command)),i)),r},async resolveCodeLens(n,e,t){let r=await t(n,e);return r?.command&&(r.command=xi(r.command)),r}};function xi(n){return n.command==="editor.action.rename"&&n.arguments?{...n,arguments:[[rr.Uri.parse(n.arguments[0]),new rr.Position(n.arguments[1].line,n.arguments[1].character)]]}:n.command==="editor.action.showReferences"&&n.arguments?{...n,arguments:[rr.Uri.parse(n.arguments[0]),new rr.Position(n.arguments[1].line,n.arguments[1].character),n.arguments[2].map(e=>new rr.Location(rr.Uri.parse(e.uri),new rr.Range(e.range.start.line,e.range.start.character,e.range.end.line,e.range.end.character)))]}:n}Te.currentLabsVersion="2.3.1";function gS(n){let e=new rr.EventEmitter,t={volarLabs:{version:Te.currentLabsVersion,languageClients:[],languageServerProtocol:n,onDidAddLanguageClient:e.event}};return{extensionExports:t,addLanguageClient(r){t.volarLabs.languageClients.push(r),e.fire(r)}}}});var lC=E((ZP,uC)=>{"use strict";uC.exports=sf()});var bS={};vC(bS,{activate:()=>vS,deactivate:()=>yS});module.exports=yC(bS);var ua=Ii(require("node:path")),mS=Ii(_r()),Ut=Ii(cC()),ir=Ii(require("vscode")),ms=Ii(lC()),Er;async function vS(n){let e=ir.workspace.getConfiguration("astro.language-server"),{workspaceFolders:t}=ir.workspace,r=t?.[0].uri.fsPath,i=await CS(n.workspaceState);typeof i=="string"&&i.trim()!==""&&typeof r=="string"?(i=ua.isAbsolute(i)?i:ua.join(r,i),console.info(`Using language server at ${i}`)):i=void 0;let s=i?require.resolve(i):ir.Uri.joinPath(n.extensionUri,"dist/node/server.js").fsPath,o={execArgv:[]},a={execArgv:["--nolazy","--inspect=6009"]},u={run:{module:s,transport:ms.TransportKind.ipc,options:o},debug:{module:s,transport:ms.TransportKind.ipc,options:a}},l=e.get("runtime");l&&(u.run.runtime=l,u.debug.runtime=l,console.info(`Using ${l} as runtime`));let p=ir.workspace.getConfiguration("astro").get("content-intellisense"),m={typescript:{tsdk:(await(0,Ut.getTsdk)(n)).tsdk},contentIntellisense:p},g={documentSelector:[{language:"astro"},...p?[{language:"markdown"},{language:"mdx"},{language:"markdoc"}]:[]],initializationOptions:m};Er=new ms.LanguageClient("astro","Astro Language Server",u,g),await Er.start(),(0,Ut.activateAutoInsertion)("astro",Er),(0,Ut.activateFindFileReferences)("astro.findFileReferences",Er),(0,Ut.activateReloadProjects)("astro.reloadProjects",Er),(0,Ut.activateTsConfigStatusItem)("astro","astro.openTsConfig",Er),(0,Ut.activateTsVersionStatusItem)("astro","astro.selectTypescriptVersion",n,y=>y);let D=(0,Ut.createLabsInfo)(mS);return D.addLanguageClient(Er),D.extensionExports}function yS(){return Er?.stop()}async function CS(n){let e="astro.language-server",t=ir.workspace.getConfiguration(e).inspect("ls-path"),r=t?.globalLanguageValue||t?.defaultLanguageValue||t?.globalValue||t?.defaultValue,i=t?.workspaceFolderLanguageValue||t?.workspaceLanguageValue||t?.workspaceFolderValue||t?.workspaceValue,s=`${e}.useLocalLS`,o=n.get(s);if(o===void 0&&i!==void 0){let a="This workspace contains an Astro Language Server version. Would you like to use the workplace version?",u="Allow",l="Dismiss",p="Never in This Workspace",m=await ir.window.showInformationMessage(a,u,l,p);m===u?(await n.update(s,!0),o=!0):m===p&&await n.update(s,!1)}return o===!0&&i||r}0&&(module.exports={activate,deactivate});
46
+ ${e.message}`,void 0,i.handled===!0?!1:"force")}hookConfigurationChanged(e){this._listeners.push(Se.workspace.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)}))}refreshTrace(e,t=!1){let r=Se.workspace.getConfiguration(this._id),i=j.Trace.Off,s=j.TraceFormat.Text;if(r){let o=r.get("trace.server","off");typeof o=="string"?i=j.Trace.fromString(o):(i=j.Trace.fromString(r.get("trace.server.verbosity","off")),s=j.TraceFormat.fromString(r.get("trace.server.format","text")))}this._trace=i,this._traceFormat=s,e.trace(this._trace,this._tracer,{sendNotification:t,traceFormat:this._traceFormat}).catch(o=>{this.error("Updating trace failed with error",o,!1)})}hookFileEvents(e){let t=this._clientOptions.synchronize.fileEvents;if(!t)return;let r;Sn.array(t)?r=t:r=[t],r&&this._dynamicFeatures.get(j.DidChangeWatchedFilesNotification.type.method).registerRaw(ny.generateUuid(),r)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),Rn.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(j.NotebookDocumentSyncRegistrationType.method);return t===void 0||!(t instanceof ry.NotebookDocumentSyncFeature)?!1:t.handles(e)}registerBuiltinFeatures(){let e=new Map;this.registerFeature(new iy.ConfigurationFeature(this)),this.registerFeature(new Ti.DidOpenTextDocumentFeature(this,this._syncedDocuments)),this._didChangeTextDocumentFeature=new Ti.DidChangeTextDocumentFeature(this,e),this._didChangeTextDocumentFeature.onPendingChangeAdded(()=>{this.triggerPendingChangeDelivery()}),this.registerFeature(this._didChangeTextDocumentFeature),this.registerFeature(new Ti.WillSaveFeature(this)),this.registerFeature(new Ti.WillSaveWaitUntilFeature(this)),this.registerFeature(new Ti.DidSaveTextDocumentFeature(this)),this.registerFeature(new Ti.DidCloseTextDocumentFeature(this,this._syncedDocuments,e)),this.registerFeature(new SD.FileSystemWatcherFeature(this,t=>this.notifyFileEvent(t))),this.registerFeature(new fD.CompletionItemFeature(this)),this.registerFeature(new hD.HoverFeature(this)),this.registerFeature(new gD.SignatureHelpFeature(this)),this.registerFeature(new pD.DefinitionFeature(this)),this.registerFeature(new CD.ReferencesFeature(this)),this.registerFeature(new mD.DocumentHighlightFeature(this)),this.registerFeature(new vD.DocumentSymbolFeature(this)),this.registerFeature(new yD.WorkspaceSymbolFeature(this)),this.registerFeature(new bD.CodeActionFeature(this)),this.registerFeature(new _D.CodeLensFeature(this)),this.registerFeature(new Nd.DocumentFormattingFeature(this)),this.registerFeature(new Nd.DocumentRangeFormattingFeature(this)),this.registerFeature(new Nd.DocumentOnTypeFormattingFeature(this)),this.registerFeature(new wD.RenameFeature(this)),this.registerFeature(new DD.DocumentLinkFeature(this)),this.registerFeature(new RD.ExecuteCommandFeature(this)),this.registerFeature(new iy.SyncConfigurationFeature(this)),this.registerFeature(new qD.TypeDefinitionFeature(this)),this.registerFeature(new PD.ImplementationFeature(this)),this.registerFeature(new TD.ColorProviderFeature(this)),this.clientOptions.workspaceFolder===void 0&&this.registerFeature(new ED.WorkspaceFoldersFeature(this)),this.registerFeature(new kD.FoldingRangeFeature(this)),this.registerFeature(new xD.DeclarationFeature(this)),this.registerFeature(new ID.SelectionRangeFeature(this)),this.registerFeature(new OD.ProgressFeature(this)),this.registerFeature(new FD.CallHierarchyFeature(this)),this.registerFeature(new ND.SemanticTokensFeature(this)),this.registerFeature(new MD.LinkedEditingFeature(this)),this.registerFeature(new Pi.DidCreateFilesFeature(this)),this.registerFeature(new Pi.DidRenameFilesFeature(this)),this.registerFeature(new Pi.DidDeleteFilesFeature(this)),this.registerFeature(new Pi.WillCreateFilesFeature(this)),this.registerFeature(new Pi.WillRenameFilesFeature(this)),this.registerFeature(new Pi.WillDeleteFilesFeature(this)),this.registerFeature(new LD.TypeHierarchyFeature(this)),this.registerFeature(new AD.InlineValueFeature(this)),this.registerFeature(new jD.InlayHintsFeature(this)),this.registerFeature(new dD.DiagnosticFeature(this)),this.registerFeature(new ry.NotebookDocumentSyncFeature(this))}registerProposedFeatures(){this.registerFeatures(jd.createAll(this))}fillInitializeParams(e){for(let t of this._features)Sn.func(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){let e={};(0,Rn.ensure)(e,"workspace").applyEdit=!0;let t=(0,Rn.ensure)((0,Rn.ensure)(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[j.ResourceOperationKind.Create,j.ResourceOperationKind.Rename,j.ResourceOperationKind.Delete],t.failureHandling=j.FailureHandlingKind.TextOnlyTransactional,t.normalizesLineEndings=!0,t.changeAnnotationSupport={groupsOnLabel:!0};let r=(0,Rn.ensure)((0,Rn.ensure)(e,"textDocument"),"publishDiagnostics");r.relatedInformation=!0,r.versionSupport=!1,r.tagSupport={valueSet:[j.DiagnosticTag.Unnecessary,j.DiagnosticTag.Deprecated]},r.codeDescriptionSupport=!0,r.dataSupport=!0;let i=(0,Rn.ensure)(e,"window"),s=(0,Rn.ensure)(i,"showMessage");s.messageActionItem={additionalPropertiesSupport:!0};let o=(0,Rn.ensure)(i,"showDocument");o.support=!0;let a=(0,Rn.ensure)(e,"general");a.staleRequestSupport={cancel:!0,retryOnContentModified:Array.from(er.RequestsToCancelOnContentModified)},a.regularExpressions={engine:"ECMAScript",version:"ES2020"},a.markdown={parser:"marked",version:"1.1.0"},a.positionEncodings=["utf-16"],this._clientOptions.markdown.supportHtml&&(a.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 u of this._features)u.fillClientCapabilities(e);return e}initializeFeatures(e){let t=this._clientOptions.documentSelector;for(let r of this._features)Sn.func(r.preInitialize)&&r.preInitialize(this._capabilities,t);for(let r of this._features)r.initialize(this._capabilities,t)}async handleRegistrationRequest(e){let t=this.clientOptions.middleware?.handleRegisterCapability;return t?t(e,r=>this.doRegisterCapability(r)):this.doRegisterCapability(e)}async doRegisterCapability(e){if(!this.isRunning()){for(let t of e.registrations)this._ignoredRegistrations.add(t.id);return}for(let t of e.registrations){let r=this._dynamicFeatures.get(t.method);if(r===void 0)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Registration failed.`));let i=t.registerOptions??{};i.documentSelector=i.documentSelector??this._clientOptions.documentSelector;let s={id:t.id,registerOptions:i};try{r.register(s)}catch(o){return Promise.reject(o)}}}async handleUnregistrationRequest(e){let t=this.clientOptions.middleware?.handleUnregisterCapability;return t?t(e,r=>this.doUnregisterCapability(r)):this.doUnregisterCapability(e)}async doUnregisterCapability(e){for(let t of e.unregisterations){if(this._ignoredRegistrations.has(t.id))continue;let r=this._dynamicFeatures.get(t.method);if(!r)return Promise.reject(new Error(`No feature implementation for ${t.method} found. Unregistration failed.`));r.unregister(t.id)}}async handleApplyWorkspaceEdit(e){let t=e.edit,r=await this.workspaceEditLock.lock(()=>this._p2c.asWorkspaceEdit(t)),i=new Map;Se.workspace.textDocuments.forEach(o=>i.set(o.uri.toString(),o));let s=!1;if(t.documentChanges){for(let o of t.documentChanges)if(j.TextDocumentEdit.is(o)&&o.textDocument.version&&o.textDocument.version>=0){let a=this._p2c.asUri(o.textDocument.uri).toString(),u=i.get(a);if(u&&u.version!==o.textDocument.version){s=!0;break}}}return s?Promise.resolve({applied:!1}):Sn.asPromise(Se.workspace.applyEdit(r).then(o=>({applied:o})))}handleFailedRequest(e,t,r,i,s=!0){if(r instanceof j.ResponseError){if(r.code===j.ErrorCodes.PendingResponseRejected||r.code===j.ErrorCodes.ConnectionInactive)return i;if(r.code===j.LSPErrorCodes.RequestCancelled||r.code===j.LSPErrorCodes.ServerCancelled){if(t!==void 0&&t.isCancellationRequested)return i;throw r.data!==void 0?new Rn.LSPCancellationError(r.data):new Se.CancellationError}else if(r.code===j.LSPErrorCodes.ContentModified){if(er.RequestsToCancelOnContentModified.has(e.method)||er.CancellableResolveCalls.has(e.method))throw new Se.CancellationError;return i}}throw this.error(`Request ${e.method} failed.`,r,s),r}};dt.BaseLanguageClient=er;er.RequestsToCancelOnContentModified=new Set([j.SemanticTokensRequest.method,j.SemanticTokensRangeRequest.method,j.SemanticTokensDeltaRequest.method]);er.CancellableResolveCalls=new Set([j.CompletionResolveRequest.method,j.CodeLensResolveRequest.method,j.CodeActionResolveRequest.method,j.InlayHintResolveRequest.method,j.DocumentLinkResolveRequest.method,j.WorkspaceSymbolResolveRequest.method]);var Ad=class{error(e){(0,j.RAL)().console.error(e)}warn(e){(0,j.RAL)().console.warn(e)}info(e){(0,j.RAL)().console.info(e)}log(e){(0,j.RAL)().console.log(e)}};function HD(n,e,t,r,i){let s=new Ad,o=(0,j.createProtocolConnection)(n,e,s,i);return o.onError(u=>{t(u[0],u[1],u[2])}),o.onClose(r),{listen:()=>o.listen(),sendRequest:o.sendRequest,onRequest:o.onRequest,hasPendingResponse:o.hasPendingResponse,sendNotification:o.sendNotification,onNotification:o.onNotification,onProgress:o.onProgress,sendProgress:o.sendProgress,trace:(u,l,p)=>{let m={sendNotification:!1,traceFormat:j.TraceFormat.Text};return p===void 0?o.trace(u,l,m):(Sn.boolean(p),o.trace(u,l,p))},initialize:u=>o.sendRequest(j.InitializeRequest.type,u),shutdown:()=>o.sendRequest(j.ShutdownRequest.type,void 0),exit:()=>o.sendNotification(j.ExitNotification.type),end:()=>o.end(),dispose:()=>o.dispose()}}var jd;(function(n){function e(t){return[new $D.InlineCompletionItemFeature(t)]}n.createAll=e})(jd||(dt.ProposedFeatures=jd={}))});var cy=E(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.terminate=void 0;var ay=require("child_process"),WD=require("path"),UD=process.platform==="win32",KD=process.platform==="darwin",zD=process.platform==="linux";function VD(n,e){if(UD)try{let i={stdio:["pipe","pipe","ignore"]};return e&&(i.cwd=e),ay.execFileSync("taskkill",["/T","/F","/PID",n.pid.toString()],i),!0}catch{return!1}else if(zD||KD)try{var t=(0,WD.join)(__dirname,"terminateProcess.sh"),r=ay.spawnSync(t,[n.pid.toString()]);return!r.error}catch{return!1}else return n.kill("SIGKILL"),!0}ra.terminate=VD});var Hd=E((xP,uy)=>{"use strict";uy.exports=Y()});var hs=E((IP,ly)=>{var BD=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{};ly.exports=BD});var ia=E((OP,dy)=>{var GD="2.0.0",XD=Number.MAX_SAFE_INTEGER||9007199254740991,JD=16,QD=256-6,YD=["major","premajor","minor","preminor","patch","prepatch","prerelease"];dy.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:JD,MAX_SAFE_BUILD_LENGTH:QD,MAX_SAFE_INTEGER:XD,RELEASE_TYPES:YD,SEMVER_SPEC_VERSION:GD,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var sa=E((tr,fy)=>{var{MAX_SAFE_COMPONENT_LENGTH:Wd,MAX_SAFE_BUILD_LENGTH:ZD,MAX_LENGTH:eR}=ia(),tR=hs();tr=fy.exports={};var nR=tr.re=[],rR=tr.safeRe=[],z=tr.src=[],V=tr.t={},iR=0,Ud="[a-zA-Z0-9-]",sR=[["\\s",1],["\\d",eR],[Ud,ZD]],oR=n=>{for(let[e,t]of sR)n=n.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return n},re=(n,e,t)=>{let r=oR(e),i=iR++;tR(n,i,e),V[n]=i,z[i]=e,nR[i]=new RegExp(e,t?"g":void 0),rR[i]=new RegExp(r,t?"g":void 0)};re("NUMERICIDENTIFIER","0|[1-9]\\d*");re("NUMERICIDENTIFIERLOOSE","\\d+");re("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ud}*`);re("MAINVERSION",`(${z[V.NUMERICIDENTIFIER]})\\.(${z[V.NUMERICIDENTIFIER]})\\.(${z[V.NUMERICIDENTIFIER]})`);re("MAINVERSIONLOOSE",`(${z[V.NUMERICIDENTIFIERLOOSE]})\\.(${z[V.NUMERICIDENTIFIERLOOSE]})\\.(${z[V.NUMERICIDENTIFIERLOOSE]})`);re("PRERELEASEIDENTIFIER",`(?:${z[V.NUMERICIDENTIFIER]}|${z[V.NONNUMERICIDENTIFIER]})`);re("PRERELEASEIDENTIFIERLOOSE",`(?:${z[V.NUMERICIDENTIFIERLOOSE]}|${z[V.NONNUMERICIDENTIFIER]})`);re("PRERELEASE",`(?:-(${z[V.PRERELEASEIDENTIFIER]}(?:\\.${z[V.PRERELEASEIDENTIFIER]})*))`);re("PRERELEASELOOSE",`(?:-?(${z[V.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[V.PRERELEASEIDENTIFIERLOOSE]})*))`);re("BUILDIDENTIFIER",`${Ud}+`);re("BUILD",`(?:\\+(${z[V.BUILDIDENTIFIER]}(?:\\.${z[V.BUILDIDENTIFIER]})*))`);re("FULLPLAIN",`v?${z[V.MAINVERSION]}${z[V.PRERELEASE]}?${z[V.BUILD]}?`);re("FULL",`^${z[V.FULLPLAIN]}$`);re("LOOSEPLAIN",`[v=\\s]*${z[V.MAINVERSIONLOOSE]}${z[V.PRERELEASELOOSE]}?${z[V.BUILD]}?`);re("LOOSE",`^${z[V.LOOSEPLAIN]}$`);re("GTLT","((?:<|>)?=?)");re("XRANGEIDENTIFIERLOOSE",`${z[V.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);re("XRANGEIDENTIFIER",`${z[V.NUMERICIDENTIFIER]}|x|X|\\*`);re("XRANGEPLAIN",`[v=\\s]*(${z[V.XRANGEIDENTIFIER]})(?:\\.(${z[V.XRANGEIDENTIFIER]})(?:\\.(${z[V.XRANGEIDENTIFIER]})(?:${z[V.PRERELEASE]})?${z[V.BUILD]}?)?)?`);re("XRANGEPLAINLOOSE",`[v=\\s]*(${z[V.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[V.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[V.XRANGEIDENTIFIERLOOSE]})(?:${z[V.PRERELEASELOOSE]})?${z[V.BUILD]}?)?)?`);re("XRANGE",`^${z[V.GTLT]}\\s*${z[V.XRANGEPLAIN]}$`);re("XRANGELOOSE",`^${z[V.GTLT]}\\s*${z[V.XRANGEPLAINLOOSE]}$`);re("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Wd}})(?:\\.(\\d{1,${Wd}}))?(?:\\.(\\d{1,${Wd}}))?`);re("COERCE",`${z[V.COERCEPLAIN]}(?:$|[^\\d])`);re("COERCEFULL",z[V.COERCEPLAIN]+`(?:${z[V.PRERELEASE]})?(?:${z[V.BUILD]})?(?:$|[^\\d])`);re("COERCERTL",z[V.COERCE],!0);re("COERCERTLFULL",z[V.COERCEFULL],!0);re("LONETILDE","(?:~>?)");re("TILDETRIM",`(\\s*)${z[V.LONETILDE]}\\s+`,!0);tr.tildeTrimReplace="$1~";re("TILDE",`^${z[V.LONETILDE]}${z[V.XRANGEPLAIN]}$`);re("TILDELOOSE",`^${z[V.LONETILDE]}${z[V.XRANGEPLAINLOOSE]}$`);re("LONECARET","(?:\\^)");re("CARETTRIM",`(\\s*)${z[V.LONECARET]}\\s+`,!0);tr.caretTrimReplace="$1^";re("CARET",`^${z[V.LONECARET]}${z[V.XRANGEPLAIN]}$`);re("CARETLOOSE",`^${z[V.LONECARET]}${z[V.XRANGEPLAINLOOSE]}$`);re("COMPARATORLOOSE",`^${z[V.GTLT]}\\s*(${z[V.LOOSEPLAIN]})$|^$`);re("COMPARATOR",`^${z[V.GTLT]}\\s*(${z[V.FULLPLAIN]})$|^$`);re("COMPARATORTRIM",`(\\s*)${z[V.GTLT]}\\s*(${z[V.LOOSEPLAIN]}|${z[V.XRANGEPLAIN]})`,!0);tr.comparatorTrimReplace="$1$2$3";re("HYPHENRANGE",`^\\s*(${z[V.XRANGEPLAIN]})\\s+-\\s+(${z[V.XRANGEPLAIN]})\\s*$`);re("HYPHENRANGELOOSE",`^\\s*(${z[V.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[V.XRANGEPLAINLOOSE]})\\s*$`);re("STAR","(<|>)?=?\\s*\\*");re("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");re("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var oa=E((FP,hy)=>{var aR=Object.freeze({loose:!0}),cR=Object.freeze({}),uR=n=>n?typeof n!="object"?aR:n:cR;hy.exports=uR});var vy=E((NP,my)=>{var py=/^[0-9]+$/,gy=(n,e)=>{let t=py.test(n),r=py.test(e);return t&&r&&(n=+n,e=+e),n===e?0:t&&!r?-1:r&&!t?1:n<e?-1:1},lR=(n,e)=>gy(e,n);my.exports={compareIdentifiers:gy,rcompareIdentifiers:lR}});var ps=E((MP,_y)=>{var aa=hs(),{MAX_LENGTH:yy,MAX_SAFE_INTEGER:ca}=ia(),{safeRe:Cy,t:by}=sa(),dR=oa(),{compareIdentifiers:qi}=vy(),en=class{constructor(e,t){if(t=dR(t),e instanceof en){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>yy)throw new TypeError(`version is longer than ${yy} characters`);aa("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Cy[by.LOOSE]:Cy[by.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>ca||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ca||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ca||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<ca)return s}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(aa("SemVer.compare",this.version,this.options,e),!(e instanceof en)){if(typeof e=="string"&&e===this.version)return 0;e=new en(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof en||(e=new en(e,this.options)),qi(this.major,e.major)||qi(this.minor,e.minor)||qi(this.patch,e.patch)}comparePre(e){if(e instanceof en||(e=new en(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(aa("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return qi(r,i)}while(++t)}compareBuild(e){e instanceof en||(e=new en(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(aa("build compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return qi(r,i)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(r)?1:0;if(!t&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(t===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let s=[t,i];r===!1&&(s=[t]),qi(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};_y.exports=en});var Ry=E((LP,Dy)=>{var wy=ps(),fR=(n,e,t=!1)=>{if(n instanceof wy)return n;try{return new wy(n,e)}catch(r){if(!t)return null;throw r}};Dy.exports=fR});var Ty=E((AP,Sy)=>{var Kd=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}};Sy.exports=Kd});var Vr=E((jP,qy)=>{var Py=ps(),hR=(n,e,t)=>new Py(n,t).compare(new Py(e,t));qy.exports=hR});var ky=E(($P,Ey)=>{var pR=Vr(),gR=(n,e,t)=>pR(n,e,t)===0;Ey.exports=gR});var Iy=E((HP,xy)=>{var mR=Vr(),vR=(n,e,t)=>mR(n,e,t)!==0;xy.exports=vR});var Fy=E((WP,Oy)=>{var yR=Vr(),CR=(n,e,t)=>yR(n,e,t)>0;Oy.exports=CR});var My=E((UP,Ny)=>{var bR=Vr(),_R=(n,e,t)=>bR(n,e,t)>=0;Ny.exports=_R});var Ay=E((KP,Ly)=>{var wR=Vr(),DR=(n,e,t)=>wR(n,e,t)<0;Ly.exports=DR});var $y=E((zP,jy)=>{var RR=Vr(),SR=(n,e,t)=>RR(n,e,t)<=0;jy.exports=SR});var Wy=E((VP,Hy)=>{var TR=ky(),PR=Iy(),qR=Fy(),ER=My(),kR=Ay(),xR=$y(),IR=(n,e,t,r)=>{switch(e){case"===":return typeof n=="object"&&(n=n.version),typeof t=="object"&&(t=t.version),n===t;case"!==":return typeof n=="object"&&(n=n.version),typeof t=="object"&&(t=t.version),n!==t;case"":case"=":case"==":return TR(n,t,r);case"!=":return PR(n,t,r);case">":return qR(n,t,r);case">=":return ER(n,t,r);case"<":return kR(n,t,r);case"<=":return xR(n,t,r);default:throw new TypeError(`Invalid operator: ${e}`)}};Hy.exports=IR});var Xy=E((BP,Gy)=>{var gs=Symbol("SemVer ANY"),Ei=class{static get ANY(){return gs}constructor(e,t){if(t=Uy(t),e instanceof Ei){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Vd("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===gs?this.value="":this.value=this.operator+this.semver.version,Vd("comp",this)}parse(e){let t=this.options.loose?Ky[zy.COMPARATORLOOSE]:Ky[zy.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new Vy(r[2],this.options.loose):this.semver=gs}toString(){return this.value}test(e){if(Vd("Comparator.test",e,this.options.loose),this.semver===gs||e===gs)return!0;if(typeof e=="string")try{e=new Vy(e,this.options)}catch{return!1}return zd(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Ei))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new By(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new By(this.value,t).test(e.semver):(t=Uy(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||zd(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||zd(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Gy.exports=Ei;var Uy=oa(),{safeRe:Ky,t:zy}=sa(),zd=Wy(),Vd=hs(),Vy=ps(),By=Bd()});var Bd=E((GP,Zy)=>{var OR=/\s+/g,Br=class{constructor(e,t){if(t=NR(t),e instanceof Br)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new Br(e.raw,t);if(e instanceof Gd)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(OR," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(i=>!Qy(i[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&WR(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let r=0;r<t.length;r++)r>0&&(this.formatted+=" "),this.formatted+=t[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&$R)|(this.options.loose&&HR))+":"+e,i=Jy.get(r);if(i)return i;let s=this.options.loose,o=s?Ht[qt.HYPHENRANGELOOSE]:Ht[qt.HYPHENRANGE];e=e.replace(o,YR(this.options.includePrerelease)),Le("hyphen replace",e),e=e.replace(Ht[qt.COMPARATORTRIM],LR),Le("comparator trim",e),e=e.replace(Ht[qt.TILDETRIM],AR),Le("tilde trim",e),e=e.replace(Ht[qt.CARETTRIM],jR),Le("caret trim",e);let a=e.split(" ").map(m=>UR(m,this.options)).join(" ").split(/\s+/).map(m=>QR(m,this.options));s&&(a=a.filter(m=>(Le("loose invalid filter",m,this.options),!!m.match(Ht[qt.COMPARATORLOOSE])))),Le("range list",a);let u=new Map,l=a.map(m=>new Gd(m,this.options));for(let m of l){if(Qy(m))return[m];u.set(m.value,m)}u.size>1&&u.has("")&&u.delete("");let p=[...u.values()];return Jy.set(r,p),p}intersects(e,t){if(!(e instanceof Br))throw new TypeError("a Range is required");return this.set.some(r=>Yy(r,t)&&e.set.some(i=>Yy(i,t)&&r.every(s=>i.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new MR(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(ZR(this.set[t],e,this.options))return!0;return!1}};Zy.exports=Br;var FR=Ty(),Jy=new FR,NR=oa(),Gd=Xy(),Le=hs(),MR=ps(),{safeRe:Ht,t:qt,comparatorTrimReplace:LR,tildeTrimReplace:AR,caretTrimReplace:jR}=sa(),{FLAG_INCLUDE_PRERELEASE:$R,FLAG_LOOSE:HR}=ia(),Qy=n=>n.value==="<0.0.0-0",WR=n=>n.value==="",Yy=(n,e)=>{let t=!0,r=n.slice(),i=r.pop();for(;t&&r.length;)t=r.every(s=>i.intersects(s,e)),i=r.pop();return t},UR=(n,e)=>(Le("comp",n,e),n=VR(n,e),Le("caret",n),n=KR(n,e),Le("tildes",n),n=GR(n,e),Le("xrange",n),n=JR(n,e),Le("stars",n),n),Et=n=>!n||n.toLowerCase()==="x"||n==="*",KR=(n,e)=>n.trim().split(/\s+/).map(t=>zR(t,e)).join(" "),zR=(n,e)=>{let t=e.loose?Ht[qt.TILDELOOSE]:Ht[qt.TILDE];return n.replace(t,(r,i,s,o,a)=>{Le("tilde",n,r,i,s,o,a);let u;return Et(i)?u="":Et(s)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:Et(o)?u=`>=${i}.${s}.0 <${i}.${+s+1}.0-0`:a?(Le("replaceTilde pr",a),u=`>=${i}.${s}.${o}-${a} <${i}.${+s+1}.0-0`):u=`>=${i}.${s}.${o} <${i}.${+s+1}.0-0`,Le("tilde return",u),u})},VR=(n,e)=>n.trim().split(/\s+/).map(t=>BR(t,e)).join(" "),BR=(n,e)=>{Le("caret",n,e);let t=e.loose?Ht[qt.CARETLOOSE]:Ht[qt.CARET],r=e.includePrerelease?"-0":"";return n.replace(t,(i,s,o,a,u)=>{Le("caret",n,i,s,o,a,u);let l;return Et(s)?l="":Et(o)?l=`>=${s}.0.0${r} <${+s+1}.0.0-0`:Et(a)?s==="0"?l=`>=${s}.${o}.0${r} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.0${r} <${+s+1}.0.0-0`:u?(Le("replaceCaret pr",u),s==="0"?o==="0"?l=`>=${s}.${o}.${a}-${u} <${s}.${o}.${+a+1}-0`:l=`>=${s}.${o}.${a}-${u} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.${a}-${u} <${+s+1}.0.0-0`):(Le("no pr"),s==="0"?o==="0"?l=`>=${s}.${o}.${a}${r} <${s}.${o}.${+a+1}-0`:l=`>=${s}.${o}.${a}${r} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),Le("caret return",l),l})},GR=(n,e)=>(Le("replaceXRanges",n,e),n.split(/\s+/).map(t=>XR(t,e)).join(" ")),XR=(n,e)=>{n=n.trim();let t=e.loose?Ht[qt.XRANGELOOSE]:Ht[qt.XRANGE];return n.replace(t,(r,i,s,o,a,u)=>{Le("xRange",n,r,i,s,o,a,u);let l=Et(s),p=l||Et(o),m=p||Et(a),g=m;return i==="="&&g&&(i=""),u=e.includePrerelease?"-0":"",l?i===">"||i==="<"?r="<0.0.0-0":r="*":i&&g?(p&&(o=0),a=0,i===">"?(i=">=",p?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",p?s=+s+1:o=+o+1),i==="<"&&(u="-0"),r=`${i+s}.${o}.${a}${u}`):p?r=`>=${s}.0.0${u} <${+s+1}.0.0-0`:m&&(r=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`),Le("xRange return",r),r})},JR=(n,e)=>(Le("replaceStars",n,e),n.trim().replace(Ht[qt.STAR],"")),QR=(n,e)=>(Le("replaceGTE0",n,e),n.trim().replace(Ht[e.includePrerelease?qt.GTE0PRE:qt.GTE0],"")),YR=n=>(e,t,r,i,s,o,a,u,l,p,m,g)=>(Et(r)?t="":Et(i)?t=`>=${r}.0.0${n?"-0":""}`:Et(s)?t=`>=${r}.${i}.0${n?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${n?"-0":""}`,Et(l)?u="":Et(p)?u=`<${+l+1}.0.0-0`:Et(m)?u=`<${l}.${+p+1}.0-0`:g?u=`<=${l}.${p}.${m}-${g}`:n?u=`<${l}.${p}.${+m+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),ZR=(n,e,t)=>{for(let r=0;r<n.length;r++)if(!n[r].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let r=0;r<n.length;r++)if(Le(n[r].semver),n[r].semver!==Gd.ANY&&n[r].semver.prerelease.length>0){let i=n[r].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var tC=E((XP,eC)=>{var eS=Bd(),tS=(n,e,t)=>{try{e=new eS(e,t)}catch{return!1}return e.test(n)};eC.exports=tS});var rC=E(tn=>{"use strict";var nS=tn&&tn.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),Xd=tn&&tn.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&nS(e,n,t)};Object.defineProperty(tn,"__esModule",{value:!0});tn.DiagnosticPullMode=tn.vsdiag=void 0;Xd(Y(),tn);Xd(ve(),tn);var nC=sl();Object.defineProperty(tn,"vsdiag",{enumerable:!0,get:function(){return nC.vsdiag}});Object.defineProperty(tn,"DiagnosticPullMode",{enumerable:!0,get:function(){return nC.DiagnosticPullMode}});Xd($d(),tn)});var sf=E(Wt=>{"use strict";var rS=Wt&&Wt.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),oC=Wt&&Wt.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&rS(e,n,t)};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.SettingMonitor=Wt.LanguageClient=Wt.TransportKind=void 0;var nr=require("child_process"),Jd=require("fs"),Qd=require("path"),qr=require("vscode"),We=cn(),iC=$d(),iS=cy(),ze=Hd(),sS=Ry(),oS=tC();oC(Hd(),Wt);oC(rC(),Wt);var sC="^1.82.0",Ve;(function(n){n[n.stdio=0]="stdio",n[n.ipc=1]="ipc",n[n.pipe=2]="pipe",n[n.socket=3]="socket"})(Ve||(Wt.TransportKind=Ve={}));var Pr;(function(n){function e(t){let r=t;return r&&r.kind===Ve.socket&&We.number(r.port)}n.isSocket=e})(Pr||(Pr={}));var Yd;(function(n){function e(t){return We.string(t.command)}n.is=e})(Yd||(Yd={}));var Zd;(function(n){function e(t){return We.string(t.module)}n.is=e})(Zd||(Zd={}));var ef;(function(n){function e(t){let r=t;return r&&r.writer!==void 0&&r.reader!==void 0}n.is=e})(ef||(ef={}));var tf;(function(n){function e(t){let r=t;return r&&r.process!==void 0&&typeof r.detached=="boolean"}n.is=e})(tf||(tf={}));var nf=class extends iC.BaseLanguageClient{constructor(e,t,r,i,s){let o,a,u,l,p;We.string(t)?(o=e,a=t,u=r,l=i,p=!!s):(o=e.toLowerCase(),a=e,u=t,l=r,p=i),p===void 0&&(p=!1),super(o,a,l),this._serverOptions=u,this._forceDebug=p,this._isInDebugMode=p;try{this.checkVersion()}catch(m){throw We.string(m.message)&&this.outputChannel.appendLine(m.message),m}}checkVersion(){let e=sS(qr.version);if(!e)throw new Error(`No valid VS Code version detected. Version string is: ${qr.version}`);if(e.prerelease&&e.prerelease.length>0&&(e.prerelease=[]),!oS(e,sC))throw new Error(`The language client requires VS Code version ${sC} but received version ${qr.version}`)}get isInDebugMode(){return this._isInDebugMode}async restart(){await this.stop(),this.isInDebugMode?(await new Promise(e=>setTimeout(e,1e3)),await this.start()):await this.start()}stop(e=2e3){return super.stop(e).finally(()=>{if(this._serverProcess){let t=this._serverProcess;this._serverProcess=void 0,(this._isDetached===void 0||!this._isDetached)&&this.checkProcessDied(t),this._isDetached=void 0}})}checkProcessDied(e){!e||e.pid===void 0||setTimeout(()=>{try{e.pid!==void 0&&(process.kill(e.pid,0),(0,iS.terminate)(e))}catch{}},2e3)}handleConnectionClosed(){return this._serverProcess=void 0,super.handleConnectionClosed()}fillInitializeParams(e){super.fillInitializeParams(e),e.processId===null&&(e.processId=process.pid)}createMessageTransports(e){function t(p,m){if(!p&&!m)return;let g=Object.create(null);return Object.keys(process.env).forEach(D=>g[D]=process.env[D]),m&&(g.ELECTRON_RUN_AS_NODE="1",g.ELECTRON_NO_ASAR="1"),p&&Object.keys(p).forEach(D=>g[D]=p[D]),g}let r=["--debug=","--debug-brk=","--inspect=","--inspect-brk="],i=["--debug","--debug-brk","--inspect","--inspect-brk"];function s(){let p=process.execArgv;return p?p.some(m=>r.some(g=>m.startsWith(g))||i.some(g=>m===g)):!1}function o(p){if(p.stdin===null||p.stdout===null||p.stderr===null)throw new Error("Process created without stdio streams")}let a=this._serverOptions;if(We.func(a))return a().then(p=>{if(iC.MessageTransports.is(p))return this._isDetached=!!p.detached,p;if(ef.is(p))return this._isDetached=!!p.detached,{reader:new ze.StreamMessageReader(p.reader),writer:new ze.StreamMessageWriter(p.writer)};{let m;return tf.is(p)?(m=p.process,this._isDetached=p.detached):(m=p,this._isDetached=!1),m.stderr.on("data",g=>this.outputChannel.append(We.string(g)?g:g.toString(e))),{reader:new ze.StreamMessageReader(m.stdout),writer:new ze.StreamMessageWriter(m.stdin)}}});let u,l=a;return l.run||l.debug?this._forceDebug||s()?(u=l.debug,this._isInDebugMode=!0):(u=l.run,this._isInDebugMode=!1):u=a,this._getServerWorkingDir(u.options).then(p=>{if(Zd.is(u)&&u.module){let m=u,g=m.transport||Ve.stdio;if(m.runtime){let D=[],y=m.options??Object.create(null);y.execArgv&&y.execArgv.forEach(L=>D.push(L)),D.push(m.module),m.args&&m.args.forEach(L=>D.push(L));let P=Object.create(null);P.cwd=p,P.env=t(y.env,!1);let q=this._getRuntimePath(m.runtime,p),O;if(g===Ve.ipc?(P.stdio=[null,null,null,"ipc"],D.push("--node-ipc")):g===Ve.stdio?D.push("--stdio"):g===Ve.pipe?(O=(0,ze.generateRandomPipeName)(),D.push(`--pipe=${O}`)):Pr.isSocket(g)&&D.push(`--socket=${g.port}`),D.push(`--clientProcessId=${process.pid.toString()}`),g===Ve.ipc||g===Ve.stdio){let L=nr.spawn(q,D,P);return!L||!L.pid?ki(L,`Launching server using runtime ${q} failed.`):(this._serverProcess=L,L.stderr.on("data",M=>this.outputChannel.append(We.string(M)?M:M.toString(e))),g===Ve.ipc?(L.stdout.on("data",M=>this.outputChannel.append(We.string(M)?M:M.toString(e))),Promise.resolve({reader:new ze.IPCMessageReader(L),writer:new ze.IPCMessageWriter(L)})):Promise.resolve({reader:new ze.StreamMessageReader(L.stdout),writer:new ze.StreamMessageWriter(L.stdin)}))}else{if(g===Ve.pipe)return(0,ze.createClientPipeTransport)(O).then(L=>{let M=nr.spawn(q,D,P);return!M||!M.pid?ki(M,`Launching server using runtime ${q} failed.`):(this._serverProcess=M,M.stderr.on("data",A=>this.outputChannel.append(We.string(A)?A:A.toString(e))),M.stdout.on("data",A=>this.outputChannel.append(We.string(A)?A:A.toString(e))),L.onConnected().then(A=>({reader:A[0],writer:A[1]})))});if(Pr.isSocket(g))return(0,ze.createClientSocketTransport)(g.port).then(L=>{let M=nr.spawn(q,D,P);return!M||!M.pid?ki(M,`Launching server using runtime ${q} failed.`):(this._serverProcess=M,M.stderr.on("data",A=>this.outputChannel.append(We.string(A)?A:A.toString(e))),M.stdout.on("data",A=>this.outputChannel.append(We.string(A)?A:A.toString(e))),L.onConnected().then(A=>({reader:A[0],writer:A[1]})))})}}else{let D;return new Promise((y,P)=>{let q=(m.args&&m.args.slice())??[];g===Ve.ipc?q.push("--node-ipc"):g===Ve.stdio?q.push("--stdio"):g===Ve.pipe?(D=(0,ze.generateRandomPipeName)(),q.push(`--pipe=${D}`)):Pr.isSocket(g)&&q.push(`--socket=${g.port}`),q.push(`--clientProcessId=${process.pid.toString()}`);let O=m.options??Object.create(null);if(O.env=t(O.env,!0),O.execArgv=O.execArgv||[],O.cwd=p,O.silent=!0,g===Ve.ipc||g===Ve.stdio){let L=nr.fork(m.module,q||[],O);o(L),this._serverProcess=L,L.stderr.on("data",M=>this.outputChannel.append(We.string(M)?M:M.toString(e))),g===Ve.ipc?(L.stdout.on("data",M=>this.outputChannel.append(We.string(M)?M:M.toString(e))),y({reader:new ze.IPCMessageReader(this._serverProcess),writer:new ze.IPCMessageWriter(this._serverProcess)})):y({reader:new ze.StreamMessageReader(L.stdout),writer:new ze.StreamMessageWriter(L.stdin)})}else g===Ve.pipe?(0,ze.createClientPipeTransport)(D).then(L=>{let M=nr.fork(m.module,q||[],O);o(M),this._serverProcess=M,M.stderr.on("data",A=>this.outputChannel.append(We.string(A)?A:A.toString(e))),M.stdout.on("data",A=>this.outputChannel.append(We.string(A)?A:A.toString(e))),L.onConnected().then(A=>{y({reader:A[0],writer:A[1]})},P)},P):Pr.isSocket(g)&&(0,ze.createClientSocketTransport)(g.port).then(L=>{let M=nr.fork(m.module,q||[],O);o(M),this._serverProcess=M,M.stderr.on("data",A=>this.outputChannel.append(We.string(A)?A:A.toString(e))),M.stdout.on("data",A=>this.outputChannel.append(We.string(A)?A:A.toString(e))),L.onConnected().then(A=>{y({reader:A[0],writer:A[1]})},P)},P)})}}else if(Yd.is(u)&&u.command){let m=u,g=u.args!==void 0?u.args.slice(0):[],D,y=u.transport;if(y===Ve.stdio)g.push("--stdio");else if(y===Ve.pipe)D=(0,ze.generateRandomPipeName)(),g.push(`--pipe=${D}`);else if(Pr.isSocket(y))g.push(`--socket=${y.port}`);else if(y===Ve.ipc)throw new Error("Transport kind ipc is not support for command executable");let P=Object.assign({},m.options);if(P.cwd=P.cwd||p,y===void 0||y===Ve.stdio){let q=nr.spawn(m.command,g,P);return!q||!q.pid?ki(q,`Launching server using command ${m.command} failed.`):(q.stderr.on("data",O=>this.outputChannel.append(We.string(O)?O:O.toString(e))),this._serverProcess=q,this._isDetached=!!P.detached,Promise.resolve({reader:new ze.StreamMessageReader(q.stdout),writer:new ze.StreamMessageWriter(q.stdin)}))}else{if(y===Ve.pipe)return(0,ze.createClientPipeTransport)(D).then(q=>{let O=nr.spawn(m.command,g,P);return!O||!O.pid?ki(O,`Launching server using command ${m.command} failed.`):(this._serverProcess=O,this._isDetached=!!P.detached,O.stderr.on("data",L=>this.outputChannel.append(We.string(L)?L:L.toString(e))),O.stdout.on("data",L=>this.outputChannel.append(We.string(L)?L:L.toString(e))),q.onConnected().then(L=>({reader:L[0],writer:L[1]})))});if(Pr.isSocket(y))return(0,ze.createClientSocketTransport)(y.port).then(q=>{let O=nr.spawn(m.command,g,P);return!O||!O.pid?ki(O,`Launching server using command ${m.command} failed.`):(this._serverProcess=O,this._isDetached=!!P.detached,O.stderr.on("data",L=>this.outputChannel.append(We.string(L)?L:L.toString(e))),O.stdout.on("data",L=>this.outputChannel.append(We.string(L)?L:L.toString(e))),q.onConnected().then(L=>({reader:L[0],writer:L[1]})))})}}return Promise.reject(new Error("Unsupported server configuration "+JSON.stringify(a,null,4)))}).finally(()=>{this._serverProcess!==void 0&&this._serverProcess.on("exit",(p,m)=>{p!==null&&this.error(`Server process exited with code ${p}.`,void 0,!1),m!==null&&this.error(`Server process exited with signal ${m}.`,void 0,!1)})})}_getRuntimePath(e,t){if(Qd.isAbsolute(e))return e;let r=this._mainGetRootPath();if(r!==void 0){let i=Qd.join(r,e);if(Jd.existsSync(i))return i}if(t!==void 0){let i=Qd.join(t,e);if(Jd.existsSync(i))return i}return e}_mainGetRootPath(){let e=qr.workspace.workspaceFolders;if(!e||e.length===0)return;let t=e[0];if(t.uri.scheme==="file")return t.uri.fsPath}_getServerWorkingDir(e){let t=e&&e.cwd;return t||(t=this.clientOptions.workspaceFolder?this.clientOptions.workspaceFolder.uri.fsPath:this._mainGetRootPath()),t?new Promise(r=>{Jd.lstat(t,(i,s)=>{r(!i&&s.isDirectory()?t:void 0)})}):Promise.resolve(void 0)}};Wt.LanguageClient=nf;var rf=class{constructor(e,t){this._client=e,this._setting=t,this._listeners=[]}start(){return qr.workspace.onDidChangeConfiguration(this.onDidChangeConfiguration,this,this._listeners),this.onDidChangeConfiguration(),new qr.Disposable(()=>{this._client.needsStop()&&this._client.stop()})}onDidChangeConfiguration(){let e=this._setting.indexOf("."),t=e>=0?this._setting.substr(0,e):this._setting,r=e>=0?this._setting.substr(e+1):void 0,i=r?qr.workspace.getConfiguration(t).get(r,!1):qr.workspace.getConfiguration(t);i&&this._client.needsStart()?this._client.start().catch(s=>this._client.error("Start failed after configuration change",s,"force")):!i&&this._client.needsStop()&&this._client.stop().catch(s=>this._client.error("Stop failed after configuration change",s,"force"))}};Wt.SettingMonitor=rf;function ki(n,e){return n===null?Promise.reject(e):new Promise((t,r)=>{n.on("error",i=>{r(`${e} ${i}`)}),setImmediate(()=>r(e))})}});var cC=E(Te=>{"use strict";var aS=Te&&Te.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),cS=Te&&Te.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&aS(e,n,t)};Object.defineProperty(Te,"__esModule",{value:!0});Te.currentLabsVersion=Te.middleware=Te.getTsdk=Te.activateTsVersionStatusItem=Te.activateTsConfigStatusItem=Te.activateReloadProjects=Te.activateFindFileReferences=Te.activateWriteVirtualFiles=Te.activateDocumentDropEdit=Te.activateAutoInsertion=void 0;Te.parseServerCommand=xi;Te.createLabsInfo=gS;var rr=require("vscode"),uS=Zg();Object.defineProperty(Te,"activateAutoInsertion",{enumerable:!0,get:function(){return uS.activate}});var lS=em();Object.defineProperty(Te,"activateDocumentDropEdit",{enumerable:!0,get:function(){return lS.activate}});var dS=tm();Object.defineProperty(Te,"activateWriteVirtualFiles",{enumerable:!0,get:function(){return dS.activate}});var fS=lm();Object.defineProperty(Te,"activateFindFileReferences",{enumerable:!0,get:function(){return fS.activate}});var hS=dm();Object.defineProperty(Te,"activateReloadProjects",{enumerable:!0,get:function(){return hS.activate}});var pS=pm();Object.defineProperty(Te,"activateTsConfigStatusItem",{enumerable:!0,get:function(){return pS.activate}});var aC=_m();Object.defineProperty(Te,"activateTsVersionStatusItem",{enumerable:!0,get:function(){return aC.activate}});Object.defineProperty(Te,"getTsdk",{enumerable:!0,get:function(){return aC.getTsdk}});cS(sf(),Te);Te.middleware={async provideCodeActions(n,e,t,r,i){let s=await i(n,e,t,r);return s=s?.map(o=>o instanceof rr.CodeAction?(o.command&&(o.command=xi(o.command)),o):xi(o)),s},async resolveCodeAction(n,e,t){let r=await t(n,e);return r?.command&&(r.command=xi(r.command)),r},async provideCodeLenses(n,e,t){let r=await t(n,e);return r=r?.map(i=>(i.command&&(i.command=xi(i.command)),i)),r},async resolveCodeLens(n,e,t){let r=await t(n,e);return r?.command&&(r.command=xi(r.command)),r}};function xi(n){return n.command==="editor.action.rename"&&n.arguments?{...n,arguments:[[rr.Uri.parse(n.arguments[0]),new rr.Position(n.arguments[1].line,n.arguments[1].character)]]}:n.command==="editor.action.showReferences"&&n.arguments?{...n,arguments:[rr.Uri.parse(n.arguments[0]),new rr.Position(n.arguments[1].line,n.arguments[1].character),n.arguments[2].map(e=>new rr.Location(rr.Uri.parse(e.uri),new rr.Range(e.range.start.line,e.range.start.character,e.range.end.line,e.range.end.character)))]}:n}Te.currentLabsVersion="2.3.1";function gS(n){let e=new rr.EventEmitter,t={volarLabs:{version:Te.currentLabsVersion,languageClients:[],languageServerProtocol:n,onDidAddLanguageClient:e.event}};return{extensionExports:t,addLanguageClient(r){t.volarLabs.languageClients.push(r),e.fire(r)}}}});var lC=E((ZP,uC)=>{"use strict";uC.exports=sf()});var bS={};vC(bS,{activate:()=>vS,deactivate:()=>yS});module.exports=yC(bS);var ua=Ii(require("node:path")),mS=Ii(_r()),Ut=Ii(cC()),ir=Ii(require("vscode")),ms=Ii(lC()),Er;async function vS(n){let e=ir.workspace.getConfiguration("astro.language-server"),{workspaceFolders:t}=ir.workspace,r=t?.[0].uri.fsPath,i=await CS(n.workspaceState);typeof i=="string"&&i.trim()!==""&&typeof r=="string"?(i=ua.isAbsolute(i)?i:ua.join(r,i),console.info(`Using language server at ${i}`)):i=void 0;let s=i?require.resolve(i):ir.Uri.joinPath(n.extensionUri,"dist/node/server.js").fsPath,o={execArgv:[]},a={execArgv:["--nolazy","--inspect="+Math.floor(Math.random()*2e4+1e4)]},u={run:{module:s,transport:ms.TransportKind.ipc,options:o},debug:{module:s,transport:ms.TransportKind.ipc,options:a}},l=e.get("runtime");l&&(u.run.runtime=l,u.debug.runtime=l,console.info(`Using ${l} as runtime`));let p=ir.workspace.getConfiguration("astro").get("content-intellisense"),m={typescript:{tsdk:(await(0,Ut.getTsdk)(n)).tsdk},contentIntellisense:p},g={documentSelector:[{language:"astro"},...p?[{language:"markdown"},{language:"mdx"},{language:"markdoc"}]:[]],initializationOptions:m};Er=new ms.LanguageClient("astro","Astro Language Server",u,g),await Er.start(),(0,Ut.activateAutoInsertion)("astro",Er),(0,Ut.activateFindFileReferences)("astro.findFileReferences",Er),(0,Ut.activateReloadProjects)("astro.reloadProjects",Er),(0,Ut.activateTsConfigStatusItem)("astro","astro.openTsConfig",Er),(0,Ut.activateTsVersionStatusItem)("astro","astro.selectTypescriptVersion",n,y=>y);let D=(0,Ut.createLabsInfo)(mS);return D.addLanguageClient(Er),D.extensionExports}function yS(){return Er?.stop()}async function CS(n){let e="astro.language-server",t=ir.workspace.getConfiguration(e).inspect("ls-path"),r=t?.globalLanguageValue||t?.defaultLanguageValue||t?.globalValue||t?.defaultValue,i=t?.workspaceFolderLanguageValue||t?.workspaceLanguageValue||t?.workspaceFolderValue||t?.workspaceValue,s=`${e}.useLocalLS`,o=n.get(s);if(o===void 0&&i!==void 0){let a="This workspace contains an Astro Language Server version. Would you like to use the workplace version?",u="Allow",l="Dismiss",p="Never in This Workspace",m=await ir.window.showInformationMessage(a,u,l,p);m===u?(await n.update(s,!0),o=!0):m===p&&await n.update(s,!1)}return o===!0&&i||r}0&&(module.exports={activate,deactivate});