feat: add highlight_references command

This commit is contained in:
CJ van den Berg 2025-11-07 13:35:00 +01:00
parent c6da708250
commit ca47d27b76
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
2 changed files with 38 additions and 0 deletions

View file

@ -140,6 +140,15 @@ pub fn receive(self: *Self, from_: tp.pid_ref, m: tp.message) error{Exit}!bool {
}
self.find_in_files_state = .done;
return true;
} else if (try m.match(.{ "HREF", tp.extract(&path), tp.extract(&begin_line), tp.extract(&begin_pos), tp.extract(&end_line), tp.extract(&end_pos), tp.extract(&lines) })) {
if (self.get_active_editor()) |editor| editor.add_highlight_reference(.{
.begin = .{ .row = begin_line, .col = begin_pos },
.end = .{ .row = end_line, .col = end_pos },
});
return true;
} else if (try m.match(.{ "HREF", "done" })) {
if (self.get_active_editor()) |editor| editor.done_highlight_reference();
return true;
} else if (try m.match(.{ "hover", tp.extract(&path), tp.string, tp.extract(&lines), tp.extract(&begin_line), tp.extract(&begin_pos), tp.extract(&end_line), tp.extract(&end_pos) })) {
try self.add_info_content(lines);
if (self.get_active_editor()) |editor|