summaryrefslogtreecommitdiff
path: root/runtime/session.zig
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/session.zig')
-rw-r--r--runtime/session.zig8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/session.zig b/runtime/session.zig
index 6f8ab4a3..c8b8dc25 100644
--- a/runtime/session.zig
+++ b/runtime/session.zig
@@ -7,7 +7,8 @@
//! (`file_watch.Watches`): a step, its unit to the clients and theirs
//! taken in, an Upgrade or a Restore between steps; and the order its
//! parts end in. Its other devices (the LSP's and the pipes' and addons'
-//! jobs, the session's own input) are still its frontend's (each `Shell`).
+//! jobs, the session's own input) are still its frontend's (each `Shell`);
+//! the language servers' answers come through its queue (`Inbox.startLsp`).
//! What a frontend does is:
//!
//! - `options(o)`: before the core: what it gives the core it starts (a
@@ -89,6 +90,9 @@ pub fn Loop(comptime Frontend: type) type {
l.peers = .{ .gpa = l.gpa, .io = l.io, .name = daemon.name() };
l.inbox = .{ .io = l.io, .gpa = l.gpa, .lsp_allocator = l.allocs.lsp };
defer l.inbox.deinit();
+ // The language servers' status lines, from the first effects on.
+ pardes.lsp.setStatusSink(&l.inbox, host_io.Inbox.lspStatus);
+ defer pardes.lsp.setStatusSink(null, null);
l.ptys = .{ .queue = &l.inbox, .prompt_rcs = &l.prompt_rcs };
defer l.ptys.deinit();
l.watches = .open(l.io, l.gpa, &l.inbox);
@@ -157,6 +161,8 @@ pub fn Loop(comptime Frontend: type) type {
fn restore(l: *L, path: []const u8) void {
const nc = host_io.restoreCore(l.gpa, l.core, path, &l.peers, l.watches.fd, &l.watches.table) orelse return;
l.fe.restoring(nc);
+ // An answer to the old core's query is turned away.
+ l.inbox.discardCompletions();
l.ptys.stop();
nc.host = l.host;
if (l.fs) |f| f.reset(nc);