mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-05 18:25:57 +00:00
Do not remove worktrees after the headless server removal (#19556)
Release Notes: - N/A Co-authored-by: Conrad Irwin <conrad@zed.dev>
This commit is contained in:
parent
291ca2c32c
commit
edda149d75
5 changed files with 12 additions and 4 deletions
|
@ -831,7 +831,7 @@ impl AllLanguageSettings {
|
|||
|
||||
let editorconfig_properties = location.and_then(|location| {
|
||||
cx.global::<SettingsStore>()
|
||||
.editorconfg_properties(location.worktree_id, location.path)
|
||||
.editorconfig_properties(location.worktree_id, location.path)
|
||||
});
|
||||
if let Some(editorconfig_properties) = editorconfig_properties {
|
||||
let mut settings = settings.clone();
|
||||
|
|
|
@ -1029,6 +1029,7 @@ impl LspStore {
|
|||
})
|
||||
.detach()
|
||||
}
|
||||
WorktreeStoreEvent::WorktreeReleased(..) => {}
|
||||
WorktreeStoreEvent::WorktreeRemoved(_, id) => self.remove_worktree(*id, cx),
|
||||
WorktreeStoreEvent::WorktreeOrderChanged => {}
|
||||
WorktreeStoreEvent::WorktreeUpdateSent(worktree) => {
|
||||
|
|
|
@ -2223,9 +2223,11 @@ impl Project {
|
|||
cx.emit(Event::WorktreeAdded);
|
||||
}
|
||||
WorktreeStoreEvent::WorktreeRemoved(_, id) => {
|
||||
self.on_worktree_removed(*id, cx);
|
||||
cx.emit(Event::WorktreeRemoved(*id));
|
||||
}
|
||||
WorktreeStoreEvent::WorktreeReleased(_, id) => {
|
||||
self.on_worktree_released(*id, cx);
|
||||
}
|
||||
WorktreeStoreEvent::WorktreeOrderChanged => cx.emit(Event::WorktreeOrderChanged),
|
||||
WorktreeStoreEvent::WorktreeUpdateSent(_) => {}
|
||||
}
|
||||
|
@ -2261,7 +2263,7 @@ impl Project {
|
|||
cx.notify();
|
||||
}
|
||||
|
||||
fn on_worktree_removed(&mut self, id_to_remove: WorktreeId, cx: &mut ModelContext<Self>) {
|
||||
fn on_worktree_released(&mut self, id_to_remove: WorktreeId, cx: &mut ModelContext<Self>) {
|
||||
if let Some(dev_server_project_id) = self.dev_server_project_id {
|
||||
let paths: Vec<String> = self
|
||||
.visible_worktrees(cx)
|
||||
|
|
|
@ -62,6 +62,7 @@ pub struct WorktreeStore {
|
|||
pub enum WorktreeStoreEvent {
|
||||
WorktreeAdded(Model<Worktree>),
|
||||
WorktreeRemoved(EntityId, WorktreeId),
|
||||
WorktreeReleased(EntityId, WorktreeId),
|
||||
WorktreeOrderChanged,
|
||||
WorktreeUpdateSent(Model<Worktree>),
|
||||
}
|
||||
|
@ -394,6 +395,10 @@ impl WorktreeStore {
|
|||
|
||||
let handle_id = worktree.entity_id();
|
||||
cx.observe_release(worktree, move |this, worktree, cx| {
|
||||
cx.emit(WorktreeStoreEvent::WorktreeReleased(
|
||||
handle_id,
|
||||
worktree.id(),
|
||||
));
|
||||
cx.emit(WorktreeStoreEvent::WorktreeRemoved(
|
||||
handle_id,
|
||||
worktree.id(),
|
||||
|
|
|
@ -968,7 +968,7 @@ impl SettingsStore {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn editorconfg_properties(
|
||||
pub fn editorconfig_properties(
|
||||
&self,
|
||||
for_worktree: WorktreeId,
|
||||
for_path: &Path,
|
||||
|
|
Loading…
Reference in a new issue