Skip to content

Commit

Permalink
Revert debugger branch merge
Browse files Browse the repository at this point in the history
  • Loading branch information
RemcoSmitsDev committed Jan 22, 2025
1 parent 898e613 commit 3d512f6
Show file tree
Hide file tree
Showing 15 changed files with 88 additions and 969 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ CREATE TABLE IF NOT EXISTS "debug_clients" (
project_id INTEGER NOT NULL,
session_id BIGINT NOT NULL,
capabilities INTEGER NOT NULL,
ignore_breakpoints BOOLEAN NOT NULL DEFAULT FALSE,
PRIMARY KEY (id, project_id, session_id),
FOREIGN KEY (project_id) REFERENCES projects (id) ON DELETE CASCADE
);
Expand Down

This file was deleted.

39 changes: 0 additions & 39 deletions crates/collab/src/db/queries/projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,40 +556,6 @@ impl Database {
.await
}

pub async fn ignore_breakpoint_state(
&self,
connection_id: ConnectionId,
update: &proto::IgnoreBreakpointState,
) -> Result<TransactionGuard<HashSet<ConnectionId>>> {
let project_id = ProjectId::from_proto(update.project_id);
self.project_transaction(project_id, |tx| async move {
let debug_clients = debug_clients::Entity::find()
.filter(
Condition::all()
.add(debug_clients::Column::ProjectId.eq(project_id))
.add(debug_clients::Column::SessionId.eq(update.session_id)),
)
.all(&*tx)
.await?;

for debug_client in debug_clients {
debug_clients::Entity::update(debug_clients::ActiveModel {
id: ActiveValue::Unchanged(debug_client.id),
project_id: ActiveValue::Unchanged(debug_client.project_id),
session_id: ActiveValue::Unchanged(debug_client.session_id),
capabilities: ActiveValue::Unchanged(debug_client.capabilities),
ignore_breakpoints: ActiveValue::Set(update.ignore),
})
.exec(&*tx)
.await?;
}

self.internal_project_connection_ids(project_id, connection_id, true, &tx)
.await
})
.await
}

pub async fn update_debug_adapter(
&self,
connection_id: ConnectionId,
Expand Down Expand Up @@ -681,7 +647,6 @@ impl Database {
project_id: ActiveValue::Set(project_id),
session_id: ActiveValue::Set(update.session_id as i64),
capabilities: ActiveValue::Set(0),
ignore_breakpoints: ActiveValue::Set(false),
};
new_debug_client.insert(&*tx).await?;
}
Expand Down Expand Up @@ -764,7 +729,6 @@ impl Database {
project_id: ActiveValue::Set(project_id),
session_id: ActiveValue::Set(update.session_id as i64),
capabilities: ActiveValue::Set(0),
ignore_breakpoints: ActiveValue::Set(false),
};
debug_client = Some(new_debug_client.insert(&*tx).await?);
}
Expand All @@ -778,7 +742,6 @@ impl Database {
project_id: ActiveValue::Unchanged(debug_client.project_id),
session_id: ActiveValue::Unchanged(debug_client.session_id),
capabilities: ActiveValue::Set(debug_client.capabilities),
ignore_breakpoints: ActiveValue::Set(debug_client.ignore_breakpoints),
})
.exec(&*tx)
.await?;
Expand Down Expand Up @@ -1123,7 +1086,6 @@ impl Database {

for (session_id, clients) in debug_sessions.into_iter() {
let mut debug_clients = Vec::default();
let ignore_breakpoints = clients.iter().any(|debug| debug.ignore_breakpoints); // Temp solution until client -> session change

for debug_client in clients.into_iter() {
let debug_panel_items = debug_client
Expand All @@ -1146,7 +1108,6 @@ impl Database {
project_id,
session_id: session_id as u64,
clients: debug_clients,
ignore_breakpoints,
});
}

Expand Down
1 change: 0 additions & 1 deletion crates/collab/src/db/tables/debug_clients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pub struct Model {
pub session_id: i64,
#[sea_orm(column_type = "Integer")]
pub capabilities: i32,
pub ignore_breakpoints: bool,
}

impl Model {
Expand Down
29 changes: 0 additions & 29 deletions crates/collab/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,13 +438,6 @@ impl Server {
.add_request_handler(forward_mutating_project_request::<proto::VariablesRequest>)
.add_message_handler(
broadcast_project_message_from_host::<proto::DapRestartStackFrameRequest>,
)
.add_message_handler(
broadcast_project_message_from_host::<proto::ToggleIgnoreBreakpoints>,
)
.add_message_handler(ignore_breakpoint_state)
.add_message_handler(
broadcast_project_message_from_host::<proto::DebuggerSessionEnded>,
);

Arc::new(server)
Expand Down Expand Up @@ -2162,28 +2155,6 @@ async fn shutdown_debug_client(
Ok(())
}

async fn ignore_breakpoint_state(
request: proto::IgnoreBreakpointState,
session: Session,
) -> Result<()> {
let guest_connection_ids = session
.db()
.await
.ignore_breakpoint_state(session.connection_id, &request)
.await?;

broadcast(
Some(session.connection_id),
guest_connection_ids.iter().copied(),
|connection_id| {
session
.peer
.forward_send(session.connection_id, connection_id, request.clone())
},
);
Ok(())
}

/// Notify other participants that a debug panel item has been updated
async fn update_debug_adapter(request: proto::UpdateDebugAdapter, session: Session) -> Result<()> {
let guest_connection_ids = session
Expand Down
Loading

0 comments on commit 3d512f6

Please sign in to comment.