From 02a8e68577bcfde60c76f8e3ade6812536aad7db Mon Sep 17 00:00:00 2001 From: delphinus Date: Mon, 11 Nov 2024 13:36:07 +0900 Subject: [PATCH] fix: show absolute paths Without this, it builds elements ([here][]) with odd paths for local modules. [here]: https://github.com/bscan/PerlNavigator/blob/de1344a97c883698d5630b01d8299a17a9d95148/server/src/parseTags.ts#L61 For example, code contains `use Foo::Bar;` and it imports `lib/Foo/Bar.pm`. This makes `Uri.file(path).toString()` => `/lib/Foo/Bar.pm` -- This file does not exist. --- server/src/perl/Inquisitor.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/perl/Inquisitor.pm b/server/src/perl/Inquisitor.pm index 960f6f3..8c9804f 100644 --- a/server/src/perl/Inquisitor.pm +++ b/server/src/perl/Inquisitor.pm @@ -4,6 +4,7 @@ package Inquisitor; use strict; use attributes; no warnings; +use File::Spec; my @preloaded; # Check what's loaded before we pollute the namespace @@ -356,7 +357,7 @@ sub dump_loaded_mods { foreach my $key_to_print (@$filtered_modules) { my $path = $displays->{$key_to_print}; next if !$path; # If we don't have a path, the modHunter module would be better - print_tag("$key_to_print", "m", "", $path, $key_to_print, 0, ""); + print_tag("$key_to_print", "m", "", File::Spec->rel2abs($path), $key_to_print, 0, ""); } return; }