Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Potentially fix hang when opening LSP menu (#49046)

John Turbd724849944f
diff --git a/crates/language_tools/src/lsp_button.rs b/crates/language_tools/src/lsp_button.rs
index 1589947d9e7..54aae61a696 100644
--- a/crates/language_tools/src/lsp_button.rs
+++ b/crates/language_tools/src/lsp_button.rs
@@ -125,7 +125,11 @@ impl ProcessMemoryCache {
fn is_descendant_of(&self, pid: Pid, root_pid: Pid, parent_map: &HashMap<Pid, Pid>) -> bool {
let mut current = pid;
+ let mut visited = HashSet::default();
while current != root_pid {
+ if !visited.insert(current) {
+ return false;
+ }
match parent_map.get(&current) {
Some(&parent) => current = parent,
None => return false,