Skip to content

Commit a060d2b

Browse files
probably-nebSomeoneToIgnoreVeykril
authored andcommitted
Remote LSP logs (zed-industries#36709)
Enables LSP log tracing in both remote collab and remote ssh environments. Server logs and server RPC traces can now be viewed remotely, and the LSP button is now shown in such projects too. Closes zed-industries#28557 Co-Authored-By: Kirill <[email protected]> Co-Authored-By: Lukas <[email protected]> Release Notes: - Enabled LSP log tracing in both remote collab and remote ssh environments --------- Co-authored-by: Kirill Bulatov <[email protected]> Co-authored-by: Lukas Wirth <[email protected]>
1 parent 6245e32 commit a060d2b

File tree

29 files changed

+949
-342
lines changed

29 files changed

+949
-342
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/assistant_slash_command/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ parking_lot.workspace = true
2525
serde.workspace = true
2626
serde_json.workspace = true
2727
ui.workspace = true
28-
workspace.workspace = true
28+
workspace = { path = "../workspace", default-features = false }
2929
workspace-hack.workspace = true
3030

3131
[dev-dependencies]

crates/assistant_tool/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ serde.workspace = true
2828
serde_json.workspace = true
2929
text.workspace = true
3030
util.workspace = true
31-
workspace.workspace = true
31+
workspace = { path = "../workspace", default-features = false }
3232
workspace-hack.workspace = true
3333

3434
[dev-dependencies]

crates/breadcrumbs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ itertools.workspace = true
1919
settings.workspace = true
2020
theme.workspace = true
2121
ui.workspace = true
22-
workspace.workspace = true
22+
workspace = { path = "../workspace", default-features = false }
2323
zed_actions.workspace = true
2424
workspace-hack.workspace = true
2525

crates/collab/migrations.sqlite/20221109000000_test_schema.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ CREATE TABLE "language_servers" (
175175
"project_id" INTEGER NOT NULL REFERENCES projects (id) ON DELETE CASCADE,
176176
"name" VARCHAR NOT NULL,
177177
"capabilities" TEXT NOT NULL,
178+
"worktree_id" BIGINT,
178179
PRIMARY KEY (project_id, id)
179180
);
180181

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE language_servers
2+
ADD COLUMN worktree_id BIGINT;

crates/collab/src/db/queries/projects.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,7 @@ impl Database {
694694
project_id: ActiveValue::set(project_id),
695695
id: ActiveValue::set(server.id as i64),
696696
name: ActiveValue::set(server.name.clone()),
697+
worktree_id: ActiveValue::set(server.worktree_id.map(|id| id as i64)),
697698
capabilities: ActiveValue::set(update.capabilities.clone()),
698699
})
699700
.on_conflict(
@@ -704,6 +705,7 @@ impl Database {
704705
.update_columns([
705706
language_server::Column::Name,
706707
language_server::Column::Capabilities,
708+
language_server::Column::WorktreeId,
707709
])
708710
.to_owned(),
709711
)
@@ -1065,7 +1067,7 @@ impl Database {
10651067
server: proto::LanguageServer {
10661068
id: language_server.id as u64,
10671069
name: language_server.name,
1068-
worktree_id: None,
1070+
worktree_id: language_server.worktree_id.map(|id| id as u64),
10691071
},
10701072
capabilities: language_server.capabilities,
10711073
})

crates/collab/src/db/queries/rooms.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ impl Database {
809809
server: proto::LanguageServer {
810810
id: language_server.id as u64,
811811
name: language_server.name,
812-
worktree_id: None,
812+
worktree_id: language_server.worktree_id.map(|id| id as u64),
813813
},
814814
capabilities: language_server.capabilities,
815815
})

crates/collab/src/db/tables/language_server.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub struct Model {
1010
pub id: i64,
1111
pub name: String,
1212
pub capabilities: String,
13+
pub worktree_id: Option<i64>,
1314
}
1415

1516
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]

crates/collab/src/rpc.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,9 @@ impl Server {
476476
.add_request_handler(forward_mutating_project_request::<proto::GitChangeBranch>)
477477
.add_request_handler(forward_mutating_project_request::<proto::CheckForPushedCommits>)
478478
.add_message_handler(broadcast_project_message_from_host::<proto::AdvertiseContexts>)
479-
.add_message_handler(update_context);
479+
.add_message_handler(update_context)
480+
.add_request_handler(forward_mutating_project_request::<proto::ToggleLspLogs>)
481+
.add_message_handler(broadcast_project_message_from_host::<proto::LanguageServerLog>);
480482

481483
Arc::new(server)
482484
}

0 commit comments

Comments
 (0)