Start R language server only when needed and stop after 30s.#1708
Start R language server only when needed and stop after 30s.#1708Fred-Wu wants to merge 1 commit into
Conversation
…vity - Start the language server only when an R file is opened. - Stop the server automatically 30 seconds after the last R file is closed. - Cancel the shutdown timer if a new R file is opened within those 30 seconds. - Fix "server disconnected" errors by double-checking that no R files are open exactly when the 30-second timer finishes, preventing the server from being accidentally killed while in use.
|
Thanks for the contribution. I love the idea, but there are quite some change. Overall Review I did notice a few issues during review—one critical bug regarding Quarto documents and two smaller edge cases—that should be addressed before merging: 1. The Multi-Server Quarto Bug (Critical)In This introduces a cross-document bug:
Suggested Fix: 2. Dropped
|
Summary
This PR updates the R language server lifecycle so that the server starts only when an R-related document is opened, and shuts down after all R-related documents are closed.
This avoids keeping the language server running unnecessarily while still preserving the existing session if another R-related file is opened shortly after the last one is closed.
Main Changes