mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-02 21:44:34 +00:00
fix: server restarting issue
This commit is contained in:
parent
170a0c99c9
commit
f6959ecca7
2 changed files with 3 additions and 1 deletions
|
@ -84,6 +84,7 @@ impl FileCache {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn clear(&self) {
|
||||
self.files.borrow_mut().clear();
|
||||
self.editing.borrow_mut().clear();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue