summaryrefslogtreecommitdiff
path: root/src/lsp/lsp.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/lsp/lsp.zig')
-rw-r--r--src/lsp/lsp.zig34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/lsp/lsp.zig b/src/lsp/lsp.zig
index 29e82968..255a8200 100644
--- a/src/lsp/lsp.zig
+++ b/src/lsp/lsp.zig
@@ -22,7 +22,10 @@
const std = @import("std");
/// What the caller wants to know. The helix command each one backs is named
-/// alongside, because the keymap is helix's and these are its verbs.
+/// alongside, because the keymap is helix's and these are its verbs — helix's
+/// bare `<space>X` spelled `SPC l X` here, because `d`, `k`, `s` and `h` were
+/// already pardes's own most-pressed leader keys and the rest follow them into
+/// the group rather than splitting the menu (see config.leader_path).
pub const Kind = enum {
/// gd
definition,
@@ -34,23 +37,23 @@ pub const Kind = enum {
implementation,
/// gr
references,
- /// SPC k
+ /// SPC l k
hover,
- /// SPC s
+ /// SPC l s
document_symbols,
- /// SPC S (arg = the query)
+ /// SPC l S (arg = the query)
workspace_symbols,
- /// SPC d, and the list that ]d / [d step
+ /// SPC l d, and the list that ]d / [d step
diagnostics,
- /// SPC D
+ /// SPC l D
workspace_diagnostics,
- /// SPC r (arg = the new name)
+ /// SPC l r (arg = the new name)
rename,
- /// SPC a
+ /// SPC l a
code_action,
/// =
format,
- /// SPC h
+ /// SPC l h
select_refs,
/// Tab in insert mode, with a `.` immediately before the cursor. NOT an
/// autocomplete popup — the seam returns locations, so this answers "what
@@ -196,9 +199,12 @@ pub fn query(gpa: std.mem.Allocator, arena: std.mem.Allocator, req: Req, out: *s
}
/// ZLS, linked in as a module and called directly — no subprocess, no
-/// JSON-RPC. See `lsp_zls.zig`. The web shell has no threads, never emits the
-/// effect, and cannot build ZLS anyway, so there it is the empty backend the
-/// base tree shipped with.
+/// JSON-RPC. See `lsp_zls.zig`. The web shell cannot build ZLS (no threads,
+/// freestanding wasm), so there it is the empty backend the base tree shipped
+/// with — and empty means SILENT rather than failing: `supports` below is then
+/// an empty set, `lspRequest` returns on it before emitting, and the effect
+/// never leaves the core. `web.zig`'s prong for it is waiting for a host that
+/// links a backend, not dead weight for one that never will.
const backend = if (@import("pardes_config").zls_backend) @import("lsp_zls.zig") else struct {
pub fn query(_: std.mem.Allocator, _: std.mem.Allocator, _: Req, _: *std.Io.Writer) void {}
pub fn speaks(_: []const u8) bool {
@@ -221,5 +227,7 @@ pub const supports: std.EnumSet(Kind) = backend.supports;
/// knowing, so the list of extensions stays the backend's business.
pub const speaks = backend.speaks;
-/// Name shown by the harness and in `SPC ?`. Each implementation renames it.
+/// Name shown by the harness and in `SPC ?`. This is the SEAM's, not the
+/// backend's: a backend does not declare it, so renaming a backend means
+/// editing this line.
pub const backend_name = "zls-inproc";