fix: server restarting issue

This commit is contained in:
Shunsuke Shibayama 2025-02-24 22:42:01 +09:00
parent 170a0c99c9
commit f6959ecca7
2 changed files with 3 additions and 1 deletions

View file

@ -84,6 +84,7 @@ impl FileCache {
}
}
#[allow(unused)]
pub fn clear(&self) {
self.files.borrow_mut().clear();
self.editing.borrow_mut().clear();

View file

@ -741,10 +741,11 @@ impl<Checker: BuildRunnable, Parser: Parsable> Server<Checker, Parser> {
}
/// Restart the server. Clear caches and close & reopen channels.
/// The server does not erase client-dependent information because it cannot notify the client of the restart and receive resources (such as workspace files) again.
#[allow(unused)]
pub(crate) fn restart(&mut self) {
lsp_log!("restarting ELS");
self.file_cache.clear();
// self.file_cache.clear();
self.comp_cache.clear();
if let Some(chan) = self.channels.as_ref() {
chan.close();