Return back the guards when goto targets are queried for (#34340)
Closes https://github.com/zed-industries/zed/issues/34310 Follow-up of https://github.com/zed-industries/zed/pull/29359 Release Notes: - Fixed goto definition not working in remote projects in certain conditions
This commit is contained in:
@@ -3364,8 +3364,14 @@ impl Project {
|
|||||||
cx: &mut Context<Self>,
|
cx: &mut Context<Self>,
|
||||||
) -> Task<Result<Vec<LocationLink>>> {
|
) -> Task<Result<Vec<LocationLink>>> {
|
||||||
let position = position.to_point_utf16(buffer.read(cx));
|
let position = position.to_point_utf16(buffer.read(cx));
|
||||||
self.lsp_store.update(cx, |lsp_store, cx| {
|
let guard = self.retain_remotely_created_models(cx);
|
||||||
|
let task = self.lsp_store.update(cx, |lsp_store, cx| {
|
||||||
lsp_store.definitions(buffer, position, cx)
|
lsp_store.definitions(buffer, position, cx)
|
||||||
|
});
|
||||||
|
cx.spawn(async move |_, _| {
|
||||||
|
let result = task.await;
|
||||||
|
drop(guard);
|
||||||
|
result
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3376,8 +3382,14 @@ impl Project {
|
|||||||
cx: &mut Context<Self>,
|
cx: &mut Context<Self>,
|
||||||
) -> Task<Result<Vec<LocationLink>>> {
|
) -> Task<Result<Vec<LocationLink>>> {
|
||||||
let position = position.to_point_utf16(buffer.read(cx));
|
let position = position.to_point_utf16(buffer.read(cx));
|
||||||
self.lsp_store.update(cx, |lsp_store, cx| {
|
let guard = self.retain_remotely_created_models(cx);
|
||||||
|
let task = self.lsp_store.update(cx, |lsp_store, cx| {
|
||||||
lsp_store.declarations(buffer, position, cx)
|
lsp_store.declarations(buffer, position, cx)
|
||||||
|
});
|
||||||
|
cx.spawn(async move |_, _| {
|
||||||
|
let result = task.await;
|
||||||
|
drop(guard);
|
||||||
|
result
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3388,8 +3400,14 @@ impl Project {
|
|||||||
cx: &mut Context<Self>,
|
cx: &mut Context<Self>,
|
||||||
) -> Task<Result<Vec<LocationLink>>> {
|
) -> Task<Result<Vec<LocationLink>>> {
|
||||||
let position = position.to_point_utf16(buffer.read(cx));
|
let position = position.to_point_utf16(buffer.read(cx));
|
||||||
self.lsp_store.update(cx, |lsp_store, cx| {
|
let guard = self.retain_remotely_created_models(cx);
|
||||||
|
let task = self.lsp_store.update(cx, |lsp_store, cx| {
|
||||||
lsp_store.type_definitions(buffer, position, cx)
|
lsp_store.type_definitions(buffer, position, cx)
|
||||||
|
});
|
||||||
|
cx.spawn(async move |_, _| {
|
||||||
|
let result = task.await;
|
||||||
|
drop(guard);
|
||||||
|
result
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3400,8 +3418,14 @@ impl Project {
|
|||||||
cx: &mut Context<Self>,
|
cx: &mut Context<Self>,
|
||||||
) -> Task<Result<Vec<LocationLink>>> {
|
) -> Task<Result<Vec<LocationLink>>> {
|
||||||
let position = position.to_point_utf16(buffer.read(cx));
|
let position = position.to_point_utf16(buffer.read(cx));
|
||||||
self.lsp_store.update(cx, |lsp_store, cx| {
|
let guard = self.retain_remotely_created_models(cx);
|
||||||
|
let task = self.lsp_store.update(cx, |lsp_store, cx| {
|
||||||
lsp_store.implementations(buffer, position, cx)
|
lsp_store.implementations(buffer, position, cx)
|
||||||
|
});
|
||||||
|
cx.spawn(async move |_, _| {
|
||||||
|
let result = task.await;
|
||||||
|
drop(guard);
|
||||||
|
result
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3412,8 +3436,14 @@ impl Project {
|
|||||||
cx: &mut Context<Self>,
|
cx: &mut Context<Self>,
|
||||||
) -> Task<Result<Vec<Location>>> {
|
) -> Task<Result<Vec<Location>>> {
|
||||||
let position = position.to_point_utf16(buffer.read(cx));
|
let position = position.to_point_utf16(buffer.read(cx));
|
||||||
self.lsp_store.update(cx, |lsp_store, cx| {
|
let guard = self.retain_remotely_created_models(cx);
|
||||||
|
let task = self.lsp_store.update(cx, |lsp_store, cx| {
|
||||||
lsp_store.references(buffer, position, cx)
|
lsp_store.references(buffer, position, cx)
|
||||||
|
});
|
||||||
|
cx.spawn(async move |_, _| {
|
||||||
|
let result = task.await;
|
||||||
|
drop(guard);
|
||||||
|
result
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user