feat: fetch lsp symbols on user demand
This commit is contained in:
parent
cc4ef5da2c
commit
368b139688
2 changed files with 9 additions and 1 deletions
|
|
@ -228,7 +228,7 @@
|
||||||
["space g", "show_vcs_status"],
|
["space g", "show_vcs_status"],
|
||||||
["space b", "switch_buffers"],
|
["space b", "switch_buffers"],
|
||||||
["space j", "jumplist_picker"],
|
["space j", "jumplist_picker"],
|
||||||
["space s", "symbol_picker"],
|
["space s", "show_symbols"],
|
||||||
["space d", "show_diagnostics"],
|
["space d", "show_diagnostics"],
|
||||||
["space a", "code_action"],
|
["space a", "code_action"],
|
||||||
["space '", "last_picker"],
|
["space '", "last_picker"],
|
||||||
|
|
|
||||||
|
|
@ -5730,6 +5730,14 @@ pub const Editor = struct {
|
||||||
}
|
}
|
||||||
pub const completion_meta: Meta = .{ .description = "Language: Show completions at cursor" };
|
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 {
|
pub fn rename_symbol(self: *Self, _: Context) Result {
|
||||||
const file_path = self.file_path orelse return;
|
const file_path = self.file_path orelse return;
|
||||||
const root = self.buf_root() catch return;
|
const root = self.buf_root() catch return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue