summaryrefslogtreecommitdiff
path: root/src/ninep
diff options
context:
space:
mode:
Diffstat (limited to 'src/ninep')
-rw-r--r--src/ninep/ctl.zig15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index 3393c851..4cb4728f 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -18,6 +18,7 @@ const exec_line = @import("../exec.zig");
const tree = @import("tree.zig");
const pane_files = @import("pane.zig");
const keys = @import("../keys.zig");
+const Ask = @import("../lsp/Ask.zig");
const Pardes = pardes.Pardes;
const Pane = pardes.Pane;
@@ -2118,22 +2119,22 @@ test "a language server question that finds nothing, cannot be answered, or is a
p.fs.late_failure_len = 0;
p.lspRequest(id, .incoming_calls, "");
try testing.expect(p.lsp_wait != null);
- p.lspResponse(p.lsp_wait.?.id, "");
+ Ask.lspResponse(p, p.lsp_wait.?.id, "");
try testing.expectEqualStrings("Callers: callers not found", p.fs.late_failure[0..p.fs.late_failure_len]);
// A backend that cannot answer says why.
p.fs.late_failure_len = 0;
p.lspRequest(id, .outgoing_calls, "");
- p.lspResponse(p.lsp_wait.?.id, "@none zls does not answer call hierarchy\n");
+ Ask.lspResponse(p, p.lsp_wait.?.id, "@none zls does not answer call hierarchy\n");
try testing.expectEqualStrings("Callees: zls does not answer call hierarchy", p.fs.late_failure[0..p.fs.late_failure_len]);
// No answer at all.
p.fs.late_failure_len = 0;
p.lspRequest(id, .hover, "");
- p.lspResponse(p.lsp_wait.?.id, null);
+ Ask.lspResponse(p, p.lsp_wait.?.id, null);
try testing.expectEqualStrings("Hover: the language server did not answer", p.fs.late_failure[0..p.fs.late_failure_len]);
// No diagnostics is no failure.
p.fs.late_failure_len = 0;
p.lspRequest(id, .diagnostics, "");
- p.lspResponse(p.lsp_wait.?.id, "");
+ Ask.lspResponse(p, p.lsp_wait.?.id, "");
try testing.expectEqual(@as(u16, 0), p.fs.late_failure_len);
// An image's body takes no write.
const slot = p.freeSlot().?;
@@ -2802,7 +2803,7 @@ test "a Rename that reaches other files previews them, says so, and is the pane
const id = p.active;
p.fs.lsp_result = null;
p.lspRequest(id, .rename, "sum");
- p.lspResponse(p.lsp_wait.?.id, "lib.rs:2:8 sum\nmain.rs:4:13-15 sum\n");
+ Ask.lspResponse(p, p.lsp_wait.?.id, "lib.rs:2:8 sum\nmain.rs:4:13-15 sum\n");
const preview = p.panes[p.panes[id].?.search_pane.?].?;
try testing.expectEqual(preview.serial, p.fs.lsp_result.?);
try testing.expect(th.logHas(p, "Rename: 2 edit(s) across files, previewed, not applied"));
@@ -2849,7 +2850,7 @@ test "a Rename the server answered for this file alone, with other open files sa
const p = try withFile(testing.allocator, "x\n");
defer p.deinit();
p.lspRequest(p.active, .rename, "sum");
- p.lspResponse(p.lsp_wait.?.id, "util.zig:1:8 sum\nmain.zig: also says add, which the server did not rename\n");
+ Ask.lspResponse(p, p.lsp_wait.?.id, "util.zig:1:8 sum\nmain.zig: also says add, which the server did not rename\n");
try testing.expect(th.logHas(p, "Rename: previewed, not applied: the server renamed in this file only, and 1 other open file(s) say the name"));
}
@@ -2889,7 +2890,7 @@ test "Lspinfo's answer is the +Lsp pane it fills, as a Rename preview's is its +
defer p.deinit();
p.fs.lsp_result = null;
p.lspRequest(p.active, .status, "");
- p.lspResponse(p.lsp_wait.?.id, "language servers:\n");
+ Ask.lspResponse(p, p.lsp_wait.?.id, "language servers:\n");
const shown = p.paneBySerial(p.fs.lsp_result.?).?;
try testing.expect(std.mem.endsWith(u8, p.panes[shown].?.file.?.path, "+Lsp"));
}