PerlNavigator icon indicating copy to clipboard operation
PerlNavigator copied to clipboard

Support configuration with .vscode/settings.json

Open clarkadamp opened this issue 2 years ago • 1 comments

The ability to provide persistent configuration outside of the editor is super helpful

Aligning the format with Perl::LanguageServer would also make changing out from PLS more trivial.

clarkadamp avatar Oct 10 '23 03:10 clarkadamp

So I've tried using the .vscode/settings.json file, it seems to kinda work? I have a custom perl binary for each package baked-in because we have a complicated build setup with all the library paths. The binary sets its own PATH and PERL5LIB.

when I have this in the settings.json

{
    "perlnavigator.perlPath": "/local/home/gseddon/local-workplace/REDACTED/build-tools/bin/perl"
}

I see in the LSP logs that it does pick up the path correctly

Starting perl compilation check with the equivalent of: /local/home/gseddon/local-workplace/REDACTED/build-tools/bin/perl -c -Mwarnings -M-warnings=redefine -I /local/home/gseddon/local-workplace/REDACTED/lib -I /local/home/gseddon/.vscode-server/extensions/bscan.perlnavigator-0.8.15/server/src/perl -MInquisitor ...

However it doesn't use the INC path from that binary more generally. It looks like it's trying to use the system perl. Here's an example error message trying to load Readonly.pm:

Syntax: Can't locate Readonly.pm in @INC (@INC contains: /local/home/gseddon/local-workplace/REDACTED/lib /local/home/gseddon/.vscode-server/extensions/bscan.perlnavigator-0.8.15/server/src/perl /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) 

The exact same binary works 100% perfectly when specified in the global vscode settings.json. What's the gap to make this work in the local repository settings?

{
 ...
"perlnavigator.perlPath": "/local/home/gseddon/local-workplace/REDACTED/build-tools/bin/perl",
}

gseddon avatar Jan 24 '25 11:01 gseddon