Overview
The VSCode IDE implements it's language support via the Language Server Protocol which is designed to cleanly separate language...
For further actions, you may consider blocking this person and/or reporting abuse
Nice article!
I've got VSC working from my Mac remoting into a virtualbox Linux VM.
Perl::LanguageServer was requiring perl 5.18.
We are using Centos/RHEL 7 with system perl 5.16.3 and I have modified Perl::LanguageServer so it will run on 5.16.
github.com/richterger/Perl-Languag...
Might of interest @davehodg.
This nearly got me there. Getting the perl language server installed was a pain point for me. For others stumbling on this page, on ubuntu linux 20.04 LTS, the process for me was:
(The following three may not be necessary if you've already got your computer configutred for development, but for a fresh isntall I was helping someone else with, this was necessary).
sudo apt update
sudo apt upgrade
sudo apt install build-essential
The missing library I needed was installed with:
sudo apt install libanyevent-perl libio-aio-perl
I found this from the following source if you would like more details:
github.com/richterger/Perl-Languag...
Then I could successfully install the language server with:
sudo cpan Perl::LanguageServer
VS code would then successfully install the plugin and run as expected.
Thank you!
There are two grant proposals in the area of Perl IDEs which have been bouncing around. If anyone's interested in working on one of these, please get in touch!
If on Windows, this can be run on WSL to debug Perl programs.
Basically what it does, provides an easy way to view your Local, Global, Special, Arguments and variables.
marketplace.visualstudio.com/items...
wsl --install Ubuntu
Great guide, thank you.
I followed this guide to get this working on a Ubuntu 22 VM.
At first many errors with Perl, LanguageServer, and many modules due to using a custom local perl instance installed in /opt/perl.
Here's what the settings.json file looks like to fix:
{
"perl.perlInc": [
"/opt/perl/lib/5.34.1",
"/opt/perl/lib/5.34.1/x86_64-Linux",
"/opt/perl/lib/site_perl/5.34.1",
"/opt/perl/lib/site_perl/5.34.1/x86_64-linux"
],
"perl.perlCmd": "/opt/perl/bin/perl"
}
Obvious, now, but hopefully this helps someone in the future.
There are markdown typos in two links and the article says "cpan Perl::LanguageServer" instead of "cpanm Perl::LanguageServer"
Fixed. Thanks
Some of the links still show the markdown.
I think i have got them all now.
cpanm is still in the post.
Perl::LanguageServer must be rather persnickety to install. I have not had success installing this for either my primary macos system, or my client's centos machnine. Sad.
The problem for me, Ubuntu 22.04, was that I didn't have the libperl-dev package installed. I found this by looking in the config.log for IO-AIO-4.76:
Apparently libperl does not get installed unless you install the dev package for libperl. Kinda makes sense since this LanguageServer is about debugging your Perl scripts thus you're a dev.
I could not install on my Macbook M1 neither with Perl base install nor MacPorts but it installed without problem with Homebrew Perl... (once I made sure perlbrew was the new default perl).
Hope it will help someone...
Of course, explain it to our customers too. One is List X MOD. Maybe they will welcome your insight.
Within 30 minutes of posting I had another person replying they were trying my fix.
It doesn't do to assume everyone else has the freedom and expert knowledge you have to implement solutions.
One of the reasons perl is going down is no-one thinks about these "hygiene factors" [Henry Mintzberg] which actually put a lot of people off perl because they are: too unread, too stupid, too lazy. We should address that. Using the system perl is part of making people's lives easy. We don't really have a choice, unfortunately.
Your customers are Security Cleared and require RedHat security releases.
Which include patches to perl modules to make the yum rpm modules safe?
So no to using stock CPAN perl modules. Thought not.
BTW hope you are keeping well ;^)
Love VSCode with Perl (even with Windows 10) , but can't get language server to work with Windows 10,(strawberry Perl) seems to be a known problem with running on windows platform
github.com/richterger/Perl-Languag...
I dont personally use windows, so i have made an assumption that turns out to be wrong. Your best bet might be to develop in a remote linux or bsd vm. Be that actually remotely or on a vm running locally
Great article. Now I'd like a recipe book of useful things you can do with it. I've also got perl-toolbox installed which has a nice interface to perlcritic.
You can also install the extension by using the command palette and selecting "Extensions: Install from VSIX...".
I did not know this, thanks!
You are very welcome.
I've tried the steps above in Widows11 both with VsCode and with VsCodium. Yet (in both), when I try to debug a Perl script it just shows the debug toolbar for a few seconds and nothing else happens. The VsCode version is 1.74.3 and the VsCodium is at the same version.
Jus to be sure I did not make any stuid errors, I uninstalled thr perl, VsCode and VsCodium and repeated whole procedure again, sadly with same result.
As I can run/debug perl scripts in Activestate Komodo I think perl is not the culprit.
Any ideas how should I troubleshoot?
I have successfully run the Perl::LanguageServer but not able to get the code-autocompletion feature