{"version":"2.0.33","anchor":"lsp-file-lifecycle-management","canonical_anchor":"lsp-file-lifecycle-management","heading":"LSP File Lifecycle Management","tier":null,"area":null,"scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.0.33\/e\/lsp-file-lifecycle-management","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.0.33","markdown":"### LSP File Lifecycle Management\n\n**What:** Four new methods for synchronizing file state with Language Server Protocol servers **How to use:**\n\n`\/\/ These methods are called automatically by Claude Code's LSP integration \/\/ Manual use in custom integrations: const lspManager = createLSPManager(); await lspManager.initialize(); \/\/ Notify server when opening a file await lspManager.openFile('\/path\/to\/file.js', fileContent); \/\/ Sync content changes await lspManager.changeFile('\/path\/to\/file.js', newContent); \/\/ Notify server when closing await lspManager.closeFile('\/path\/to\/file.js'); \/\/ Inspect available servers const servers = lspManager.getAllServers();` **Details:**\n\n- `getAllServers()` returns Map of all initialized LSP servers for monitoring\n- `openFile(path, content)` sends `textDocument\/didOpen` with proper languageId mapping\n- `changeFile(path, content)` sends `textDocument\/didChange`, falls back to openFile if server not running\n- `closeFile(path)` sends `textDocument\/didClose` for cleanup\n- Configuration changed from `fileExtensions` array to `extensionToLanguage` object mapping for proper language ID support\n- Better error messages in shutdown that include actual error details instead of generic \"check logs\"\n- **Evidence**: New methods added to return object at line 446455-446465, `openFile()` implementation at line 446408, `changeFile()` at line 446428, `closeFile()` at line 446442, `getAllServers()` at line 446405"}