| 119 | * @returns Promise that resolves when initialization is complete |
| 120 | */ |
| 121 | export async function waitForInitialization(): Promise<void> { |
| 122 | // If already initialized or failed, return immediately |
| 123 | if (initializationState === 'success' || initializationState === 'failed') { |
| 124 | return |
| 125 | } |
| 126 | |
| 127 | // If pending and we have a promise, wait for it |
| 128 | if (initializationState === 'pending' && initializationPromise) { |
| 129 | await initializationPromise |
| 130 | } |
| 131 | |
| 132 | // If not started, return immediately (nothing to wait for) |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * Initialize the LSP server manager singleton. |