Преглед изворни кода

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

Daniel пре 2 месеци
родитељ
комит
9dfa496659
1 измењених фајлова са 5 додато и 5 уклоњено
  1. 5 5
      src/extension.ts

+ 5 - 5
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)
 			}