summaryrefslogtreecommitdiff
path: root/src/lsp/lsp.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-31 00:52:02 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:08 -0300
commita77e342eb7fa4add700a96a661226649e8c4763f (patch)
tree3ad4978cca350090463e58840dc94404ea8a1a33 /src/lsp/lsp.zig
parentea228d1b832401db8efe33a5db4099ba41d42509 (diff)
downloadpardes-a77e342eb7fa4add700a96a661226649e8c4763f.tar.gz
pardes-a77e342eb7fa4add700a96a661226649e8c4763f.zip
output panes remember the command that opened them
An output buffer was a file pane with a flag, and everything special about it was re-derived from outside by asking the wrong question: the buffer NAME ("+Search", "+Help"), a parallel search_kind field, and f.output predicates sprinkled through kind-agnostic code. Now it carries its Origin — the Builtin, or the lsp.Kind for the five gotos helix binds as motions rather than words — plus that command's argument, and one Traits table answers every question the scattered code used to ask: what it is called, whether n/N steps it, whether it is a doc for layout, whether Esc dismisses it, whether it saves. The name is derived FROM the command instead of being the thing that identifies it. Adding a kind of output pane is adding a row. No golden moved.
Diffstat (limited to 'src/lsp/lsp.zig')
-rw-r--r--src/lsp/lsp.zig26
1 files changed, 4 insertions, 22 deletions
diff --git a/src/lsp/lsp.zig b/src/lsp/lsp.zig
index 610c5604..abb91874 100644
--- a/src/lsp/lsp.zig
+++ b/src/lsp/lsp.zig
@@ -17,7 +17,6 @@
//! implementations are measured against each other: same core, same harness,
//! same rows, different `query`.
const std = @import("std");
-const config = @import("../config.zig");
/// 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.
@@ -62,27 +61,10 @@ pub const Kind = enum {
/// away from what `gd` actually did.
explain,
- /// Whether an answer of exactly one row should JUMP rather than open a
- /// results buffer. Helix: the five gotos jump on a single location and
- /// show a picker on several; a symbol list is always a picker.
- pub fn jumpsWhenSingle(k: Kind) bool {
- return switch (k) {
- .definition, .declaration, .type_definition, .implementation, .references => true,
- else => false,
- };
- }
-
- /// The buffer an answer opens. Kept distinct from `+Search` only where the
- /// content is not a list of locations — n/N over prose is nonsense.
- pub fn bufferName(k: Kind) []const u8 {
- return switch (k) {
- .hover => config.hover_buffer,
- .code_action, .format, .rename => config.lsp_buffer,
- // prose about the backend, never a list of locations
- .status, .explain => config.lsp_buffer,
- else => config.search_buffer,
- };
- }
+ // What an ANSWER becomes — which buffer it opens, whether a single row
+ // jumps instead, whether n/N walk it — is not here: it is one row per Kind
+ // in output_pane.traits, beside the same questions asked of `/`, Find,
+ // Grep and Help. A Kind added above will not compile until it has one.
};
/// One question. `source` is a snapshot of the buffer taken by the shell