()
| 265 | * @returns Promise that resolves when shutdown completes (errors are swallowed) |
| 266 | */ |
| 267 | export async function shutdownLspServerManager(): Promise<void> { |
| 268 | if (lspManagerInstance === undefined) { |
| 269 | return |
| 270 | } |
| 271 | |
| 272 | try { |
| 273 | await lspManagerInstance.shutdown() |
| 274 | logForDebugging('LSP server manager shut down successfully') |
| 275 | } catch (error: unknown) { |
| 276 | logError(error as Error) |
| 277 | logForDebugging( |
| 278 | `Failed to shutdown LSP server manager: ${errorMessage(error)}`, |
| 279 | ) |
| 280 | } finally { |
| 281 | // Always clear state even if shutdown failed |
| 282 | lspManagerInstance = undefined |
| 283 | initializationState = 'not-started' |
| 284 | initializationError = undefined |
| 285 | initializationPromise = undefined |
| 286 | // Increment generation to invalidate any pending initializations |
| 287 | initializationGeneration++ |
| 288 | } |
| 289 | } |
| 290 |
nothing calls this directly
no test coverage detected