summaryrefslogtreecommitdiff
path: root/dev/Inbox.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 04:01:55 -0300
committerGabriel Schneider <[email protected]>2026-11-20 04:07:22 -0300
commit6e8735895d04c0073eb28cc1a2f431a2ba587e9d (patch)
tree9641fb6bfaf29b9c2286e0feff1a4d6d9035d2c2 /dev/Inbox.zig
parent47649a2fe6884b660e57f8f7564c9a62128970e0 (diff)
parent680cfe1fa5a15be3770d310153258ba9ded13dd8 (diff)
downloadpardes-6e8735895d04c0073eb28cc1a2f431a2ba587e9d.tar.gz
pardes-6e8735895d04c0073eb28cc1a2f431a2ba587e9d.zip
integration: a session's file watches and its language servers' client once, on the attach that is always a client: pardes-services-2b (file_watch.Watches owned by the session loop, both frontends' readers deleted; the language client through the session's one queue, the terminal's own copy and its blocking post deleted) and pardes-merge29; one conflict, a doc comment in runtime/session.zig where both sides rewrote the frontend calls' list (the attach's words for note kept, the watched() line dropped: the watches' change deleted that call); tui core-test 856/1007 (151 skipped), shell-test 1047/1050, the window builds; the coordinator's gate in the ledger (reorg/merge30)
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'dev/Inbox.zig')
-rw-r--r--dev/Inbox.zig20
1 files changed, 20 insertions, 0 deletions
diff --git a/dev/Inbox.zig b/dev/Inbox.zig
index 4df02013..aac1f7a1 100644
--- a/dev/Inbox.zig
+++ b/dev/Inbox.zig
@@ -262,6 +262,9 @@ pub fn close(q: *Inbox) void {
}
pub fn deinit(q: *Inbox) void {
+ // The query in flight ends first: what it still delivers is dropped.
+ if (q.lsp_task) |*t| t.future.cancel(q.io);
+ q.lsp_task = null;
q.close();
std.debug.assert(q.waiting == 0);
}
@@ -308,6 +311,23 @@ pub fn startLsp(q: *Inbox, core: *pardes.Pardes, e: Lsp.Request) void {
Lsp.start(q.io, q.lsp_allocator, core, &q.lsp_task, e, q, pushLspRows);
}
+/// A language server's answer or status line taken off the queue, to the
+/// core (whichever frontend took it).
+pub fn landLsp(q: *Inbox, core: *pardes.Pardes, m: Msg) void {
+ switch (m) {
+ .lsp => |l| {
+ core.update(.{ .lsp_resp = .{ .id = l.id, .rows = l.rows } });
+ if (l.rows) |rows| q.lsp_allocator.free(rows);
+ },
+ .lsp_status => |text| {
+ var mbuf: [256]u8 = undefined;
+ core.setStatus(.at(core.view().active), pardes.Messages.Message.stamp(&mbuf, "lsp", text));
+ q.lsp_allocator.free(text);
+ },
+ else => unreachable,
+ }
+}
+
fn pushLspRows(ctx: ?*anyopaque, id: u32, rows: ?[]u8) void {
const q: *Inbox = @ptrCast(@alignCast(ctx orelse return));
q.push(.{ .lsp = .{ .id = id, .rows = rows } });