From 368b139688180a60ebb7efccddbf2d0d5fd0d4a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20T=C3=A1mara?= Date: Thu, 13 Nov 2025 13:18:03 -0500 Subject: [PATCH] feat: fetch lsp symbols on user demand --- src/keybind/builtin/helix.json | 2 +- src/tui/editor.zig | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/keybind/builtin/helix.json b/src/keybind/builtin/helix.json index fdfbbe0..0869eae 100644 --- a/src/keybind/builtin/helix.json +++ b/src/keybind/builtin/helix.json @@ -228,7 +228,7 @@ ["space g", "show_vcs_status"], ["space b", "switch_buffers"], ["space j", "jumplist_picker"], - ["space s", "symbol_picker"], + ["space s", "show_symbols"], ["space d", "show_diagnostics"], ["space a", "code_action"], ["space '", "last_picker"], diff --git a/src/tui/editor.zig b/src/tui/editor.zig index c00651c..2612f2e 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -5730,6 +5730,14 @@ pub const Editor = struct { } pub const completion_meta: Meta = .{ .description = "Language: Show completions at cursor" }; + pub fn show_symbols(self: *Self, _: Context) Result { + const file_path = self.file_path orelse return; + const mv = tui.mainview() orelse return; + mv.clear_symbols(file_path); + return project_manager.symbols(file_path); + } + pub const show_symbols_meta: Meta = .{ .description = "Language: Show available symbols on current file" }; + pub fn rename_symbol(self: *Self, _: Context) Result { const file_path = self.file_path orelse return; const root = self.buf_root() catch return;