Perl-LanguageServer
Perl-LanguageServer copied to clipboard
minimum version of perl 5.16 not 5.18
I believe this works with perl 5.16 just fine. Just change 5.18 to 5.16 and remove the no experiential warnings. This will help people forced to be stuck in old perl (redhat/company policy/etc) Thoughts?
I've created a fork of this module with Perl v5.16 compatibility, if anyone unsure how to edit it for themselves:
https://github.com/finwarman/perl-5.16-Perl-LanguageServer/releases/tag/V2.3.0
I thought for a second this would work with 5.16
as well. Got it installed with @finwarman's fork. While it mostly works, I found that the debugger didn't actually work. It would claim that the DB::DB
subroutine was not defined.
The earliest version of perl I got working with the debugger was 5.26.3
( earlier versions may work, haven't tested many but 5.18
had the same issue as 5.16
).
What I ended up doing for working on an old el7 system with 5.16 that seems to have worked is...
Development Server Setup
- setup plenv
-
plenv install-cpanminus
-
cd /tmp/
-
plenv local 5.26.3
-
cpanm Perl::LanguageServer
-
cpanm URI::Escape
- installed this b/c the version available on el7 contains breaking changes when run under the 5.26.3 interpreter / if you're not using it you can skip this
VSCode / Client Setup
Now in the Settings for the VSCode Perl Extension...
- Change
Perl Cmd
to/home/$USER/.plenv/versions/5.26.3/bin/perl
- change
$USER
to your literal username; can't use VSCode variables at the moment; see 128
- change
- Change
perl.perlInc
to the following...- again changing
$USER
to your literal username due to 128
- again changing
"perl.perlInc": [
"/home/$USER/path-to-project/lib/",
"/home/$USER/.plenv/versions/5.26.3/lib/perl5/site_perl/5.26.3/x86_64-linux",
"/home/$USER/.plenv/versions/5.26.3/lib/perl5/site_perl/5.26.3",
"/home/$USER/.plenv/versions/5.26.3/lib/perl5/5.26.3/x86_64-linux",
"/home/$USER/.plenv/versions/5.26.3/lib/perl5/5.26.3",
"/usr/local/lib64/perl5",
"/usr/local/share/perl5",
"/usr/lib64/perl5/vendor_perl",
"/usr/share/perl5/vendor_perl",
"/usr/lib64/perl5",
"/usr/share/perl5"
],
- 1st line causes perl to prefer libs found in the project's
lib
dir - 2nd-5th lines causes perl to prefer libs found in the plenv environment after searching for them in the project's
lib
dir ( this will be your core libs, Perl::Language, and any other modules you need to install here b/c older versions can't run under the5.16
interpretter. - 6th-11th lines are what
@INC
is by default ( on an el7 system at least ); so then any modules not found in the project'slib
dir or the plenv environment will use the system libs
That seems to have gotten things working. Obviously this means that you're debugging with a different perl interpreter than the project would be using in production which could lead to interesting surprises.
Fixed in 2.5.0