feat: WIP start work on goto_definition LSP command
This commit is contained in:
parent
eb94bf5258
commit
2e8fd58ba5
5 changed files with 121 additions and 82 deletions
|
@ -9,6 +9,7 @@ const ripgrep = @import("ripgrep");
|
|||
const tracy = @import("tracy");
|
||||
const text_manip = @import("text_manip");
|
||||
const syntax = @import("syntax");
|
||||
const project_manager = @import("project_manager");
|
||||
|
||||
const scrollbar_v = @import("scrollbar_v.zig");
|
||||
const editor_gutter = @import("editor_gutter.zig");
|
||||
|
@ -3146,6 +3147,13 @@ pub const Editor = struct {
|
|||
try self.send_editor_jump_destination();
|
||||
}
|
||||
|
||||
pub fn goto_definition(self: *Self, _: command.Context) tp.result {
|
||||
const file_path = self.file_path orelse return;
|
||||
const primary = self.get_primary();
|
||||
const file_type = (self.syntax orelse return).file_type.name;
|
||||
return project_manager.goto_definition(file_path, file_type, primary.cursor.row, primary.cursor.col);
|
||||
}
|
||||
|
||||
pub fn select(self: *Self, ctx: command.Context) tp.result {
|
||||
var sel: Selection = .{};
|
||||
if (!try ctx.args.match(.{ tp.extract(&sel.begin.row), tp.extract(&sel.begin.col), tp.extract(&sel.end.row), tp.extract(&sel.end.col) }))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue