diff options
Diffstat (limited to 'dev/Inbox.zig')
| -rw-r--r-- | dev/Inbox.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/dev/Inbox.zig b/dev/Inbox.zig index bc7c7e8a..a0b9494d 100644 --- a/dev/Inbox.zig +++ b/dev/Inbox.zig @@ -67,6 +67,9 @@ gpa: std.mem.Allocator, lsp_allocator: std.mem.Allocator, /// The query in flight; the UI thread's alone (spawnLsp, teardown). lsp_task: ?Lsp.Task = null, +/// The server start a file's opening asked for (openLsp); the UI +/// thread's alone. +lsp_opener: Lsp.Opener = .{}, /// The `|` pipes' and the addons' jobs' and draws' workers in flight, each /// posting its answer here (`pushPipe`, `pushJob`); the loop's thread's /// alone: joined as their answers land (`land`), canceled at the end. @@ -290,6 +293,8 @@ pub fn deinit(q: *Inbox) void { // The workers in flight end first: what they still deliver is dropped. if (q.lsp_task) |*t| t.future.cancel(q.io); q.lsp_task = null; + if (q.lsp_opener.future) |*f| f.cancel(q.io); + q.lsp_opener.future = null; q.pipe_tasks.cancelAll(q.io); q.job_tasks.cancelAll(q.io); q.close(); @@ -343,6 +348,12 @@ 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); } +/// The language server of the file `pane` opened started, on a worker of +/// its own (Lsp.open). +pub fn openLsp(q: *Inbox, core: *const pardes.Pardes, pane: pardes.Pane.Id) void { + Lsp.open(q.io, q.lsp_allocator, core, &q.lsp_opener, pane); +} + /// A worker's answer taken off the queue, to the core (whichever frontend /// took it), its worker joined: a language server's answer or status line, /// a pipe's, a search's rows, an addon's job or draw, a handover's end. |
