fix: make code index initialization non-blocking at activation (#8933)

This commit is contained in:
Daniel 2025-10-30 15:01:40 -05:00 committed by GitHub
parent f9d6fe7985
commit 9dfa496659
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
}