Skip to content

Commit

Permalink
Get Zed to compile
Browse files Browse the repository at this point in the history
  • Loading branch information
RemcoSmitsDev committed Feb 14, 2025
1 parent b7c79a8 commit 7b698d3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 27 deletions.
31 changes: 18 additions & 13 deletions crates/editor/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ use language::{point_to_lsp, BufferRow, CharClassifier, Runnable, RunnableRange}
use linked_editing_ranges::refresh_linked_ranges;
use mouse_context_menu::MouseContextMenu;
use project::{
debugger::dap_store::{BreakpointEditAction, DapStoreEvent},
debugger::breakpoint_store::{BreakpointEditAction, BreakpointStoreEvent},
ProjectPath,
};
pub use proposed_changes_editor::{
Expand Down Expand Up @@ -136,7 +136,10 @@ use multi_buffer::{
};
use parking_lot::Mutex;
use project::{
debugger::dap_store::{Breakpoint, BreakpointKind, DapStore},
debugger::{
breakpoint_store::{Breakpoint, BreakpointKind},
dap_store::DapStore,
},
lsp_store::{FormatTrigger, LspFormatTarget, OpenLspBufferHandle},
project_settings::{GitGutterSetting, ProjectSettings},
CodeAction, Completion, CompletionIntent, DocumentHighlight, InlayHint, Location, LocationLink,
Expand Down Expand Up @@ -5546,7 +5549,7 @@ impl Editor {

let snapshot = self.snapshot(window, cx);

let breakpoints = dap_store.read(cx).breakpoints();
let breakpoints = &dap_store.read(cx).breakpoint_store().read(cx).breakpoints;

if let Some(buffer) = self.buffer.read(cx).as_singleton() {
let buffer = buffer.read(cx);
Expand Down Expand Up @@ -7356,12 +7359,12 @@ impl Editor {
.summary_for_anchor::<Point>(&breakpoint_position)
.row;

let bp = self.dap_store.clone()?.read_with(cx, |dap_store, _cx| {
dap_store
.breakpoint_store()
.update(cx, |breakpoint_store, cx| {
breakpoint_store.breakpoint_at_row(row, &project_path, buffer_snapshot);
});
let bp = self.dap_store.clone()?.read_with(cx, |dap_store, cx| {
dap_store.breakpoint_store().read(cx).breakpoint_at_row(
row,
&project_path,
buffer_snapshot,
)
})?;

Some((bp.active_position?, bp.kind))
Expand Down Expand Up @@ -14729,10 +14732,12 @@ impl Editor {

if let Some(dap_store) = &self.dap_store {
if let Some(project_path) = self.project_path(cx) {
dap_store.update(cx, |_, cx| {
cx.emit(DapStoreEvent::BreakpointsChanged {
project_path,
source_changed: true,
dap_store.update(cx, |dap_store, cx| {
dap_store.breakpoint_store().update(cx, |_, cx| {
cx.emit(BreakpointStoreEvent::BreakpointsChanged {
project_path,
source_changed: true,
});
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion crates/editor/src/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use multi_buffer::{
RowInfo, ToOffset,
};
use project::{
debugger::dap_store::{Breakpoint, BreakpointKind},
debugger::breakpoint_store::{Breakpoint, BreakpointKind},
project_settings::{GitGutterSetting, ProjectSettings},
};
use settings::{KeyBindingValidator, KeyBindingValidatorRegistration, Settings};
Expand Down
26 changes: 13 additions & 13 deletions crates/workspace/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4703,23 +4703,23 @@ impl Workspace {
workspace.update(&mut cx, |workspace, cx| {
workspace.project().update(cx, |project, cx| {
project.dap_store().update(cx, |dap_store, cx| {
for worktree in project.worktrees(cx) {
let (worktree_id, worktree_path) =
worktree.read_with(cx, |tree, _cx| (tree.id(), tree.abs_path()));

if let Some(serialized_breakpoints) =
serialized_workspace.breakpoints.remove(&worktree_path)
{
dap_store
.breakpoint_store()
.update(cx, |breakpoint_store, _| {
dap_store
.breakpoint_store()
.update(cx, |breakpoint_store, cx| {
for worktree in project.worktrees(cx) {
let (worktree_id, worktree_path) = worktree
.read_with(cx, |tree, _cx| (tree.id(), tree.abs_path()));

if let Some(serialized_breakpoints) =
serialized_workspace.breakpoints.remove(&worktree_path)
{
breakpoint_store.deserialize_breakpoints(
worktree_id,
serialized_breakpoints,
);
});
}
}
}
}
})
});
})
})?;
Expand Down

0 comments on commit 7b698d3

Please sign in to comment.