Skip to content

Commit

Permalink
fix :move panic when starting a new language server (#11387)
Browse files Browse the repository at this point in the history
* fix move panic

* change location of is initialized check
  • Loading branch information
TheoCorn authored Jul 31, 2024
1 parent 86aecc9 commit 63953e0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions helix-view/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,11 @@ impl Editor {
}
let is_dir = new_path.is_dir();
for ls in self.language_servers.iter_clients() {
// A new language server might have been started in `set_doc_path` and won't
// be initialized yet. Skip the `did_rename` notification for this server.
if !ls.is_initialized() {
continue;
}
if let Some(notification) = ls.did_rename(old_path, &new_path, is_dir) {
tokio::spawn(notification);
};
Expand Down

0 comments on commit 63953e0

Please sign in to comment.