From b835b44dc5dbc66a53be0e0ec5df3dc2393b1559 Mon Sep 17 00:00:00 2001 From: daniel-lxs Date: Thu, 30 Oct 2025 12:41:01 -0500 Subject: [PATCH] fix: make code index initialization non-blocking at activation Fixes #8777 Extension activation no longer waits for Code Index embedder validation, preventing UI hangs when embedders are unreachable or slow to respond. --- src/extension.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 6281f5d447e..bf0ceec02c2 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -110,13 +110,13 @@ export async function activate(context: vscode.ExtensionContext) { if (manager) { codeIndexManagers.push(manager) - try { - await manager.initialize(contextProxy) - } catch (error) { + // Initialize in background; do not block extension activation + void manager.initialize(contextProxy).catch((error) => { + const message = error instanceof Error ? error.message : String(error) outputChannel.appendLine( - `[CodeIndexManager] Error during background CodeIndexManager configuration/indexing for ${folder.uri.fsPath}: ${error.message || error}`, + `[CodeIndexManager] Error during background CodeIndexManager configuration/indexing for ${folder.uri.fsPath}: ${message}`, ) - } + }) context.subscriptions.push(manager) }