refactor: allow mocking of root module functions for easier unittesting

This commit is contained in:
CJ van den Berg 2025-10-08 14:12:53 +02:00
parent 5d760f1d84
commit 3c55ed876b
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
28 changed files with 187 additions and 30 deletions

View file

@ -4,9 +4,10 @@ const tp = @import("thespian");
const cbor = @import("cbor");
const log = @import("log");
const project_manager = @import("project_manager");
const root = @import("root");
const root = @import("soft_root").root;
const tracy = @import("tracy");
const builtin = @import("builtin");
const file_link = @import("file_link");
pub const renderer = @import("renderer");
const command = @import("command");
@ -1151,10 +1152,10 @@ const cmds = struct {
pub fn open_file(self: *Self, ctx: Ctx) Result {
if (get_active_selection(self.allocator)) |text| {
defer self.allocator.free(text);
const link = try root.file_link.parse(text);
const link = try file_link.parse(text);
switch (link) {
.file => |file| if (file.exists)
return root.file_link.navigate(tp.self_pid(), &link),
return file_link.navigate(tp.self_pid(), &link),
else => {},
}
}