From 5bfde38179997c80be4075d2bc9dcbf6c45e4b7c Mon Sep 17 00:00:00 2001 From: Ryan Holinshead <> Date: Fri, 23 Feb 2024 11:14:17 -0500 Subject: [PATCH] [vscode] Fix Setting editorServer --- vscode-extension/src/aiConfigEditor.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/vscode-extension/src/aiConfigEditor.ts b/vscode-extension/src/aiConfigEditor.ts index b47181516..bdbf14686 100644 --- a/vscode-extension/src/aiConfigEditor.ts +++ b/vscode-extension/src/aiConfigEditor.ts @@ -107,29 +107,33 @@ export class AIConfigEditorProvider implements vscode.CustomTextEditorProvider { // Start the AIConfig editor server process. Don't await at the top level here since that blocks the // webview render (which happens only when resolveCustomTextEditor returns) - this.startEditorServer(document).then(async (editorServer) => { - editorServer = editorServer; + this.startEditorServer(document).then(async (startedServer) => { + editorServer = startedServer; this.aiconfigEditorManager.addEditor( new AIConfigEditorState( document, webviewPanel, - editorServer, + startedServer, this.aiconfigEditorManager ) ); // Wait for server ready - await waitUntilServerReady(editorServer.url); + await waitUntilServerReady(startedServer.url); // Now set up the server with the latest document content - await this.startServerWithRetry(editorServer.url, document, webviewPanel); + await this.startServerWithRetry( + startedServer.url, + document, + webviewPanel + ); // Inform the webview of the server URL if (!isWebviewDisposed) { webviewPanel.webview.postMessage({ type: "set_server_url", - url: editorServer.url, + url: startedServer.url, }); } });