PLS - Perl Language Server
The Perl Language Server implements a subset of the Language Server Protocol for the Perl language. Features currently implemented are:
Go to definition (for packages, subroutines, and variables)
Listing all symbols in a document
Hovering to show documentation
Signature help (showing parameters for a function as you type)
Formatting
Range Formatting
Auto-completion
Syntax checking
Linting (using perlcritic)
Sorting imports
This application does not take any command line options. The following settings may be configured using your text editor:
Make sure that pls.cmd is set to the path to the pls script on your system. If you rely on your $PATH, ensure that your editor is configured with the correct path, which may not be the same one that your terminal uses.
pls.cmd
pls
$PATH
Add any additional arguments needed to execute pls to the pls.args setting. For example, if you run pls in a docker container, pls.cmd would be docker, and pls.args would be ["run", "--rm", "-i", "<image name>", "pls"].
pls.args
docker
["run", "--rm", "-i", "<image name>", "pls"]
@INC
You can use the $ROOT_PATH mnemonic to stand in for your project's root directory, for example $ROOT_PATH/lib. If you are using multiple workspace folders and use $ROOT_PATH, the path will be multiplied by the number of workspace folders, and will be replaced that many times. This is useful if you use SVN and check out each branch to a different directory.
$ROOT_PATH
$ROOT_PATH/lib
If you use $ROOT_PATH, it will be replaced by your workspace's first or only folder.
.perltidyrc
Defaults to ~/.perltidyrc if not configured.
~/.perltidyrc
.perlcriticrc
Defaults to ~/.perlcriticrc if not configured.
~/.perlcriticrc
perl
Defaults to the perl used to run PLS.
This is useful if there is a BEGIN block in your code that changes behavior depending on the contents of @ARGV.
You may configure a .plsignore file in your project's root directory, with a list of Perl glob patterns which you do not want pls to index.
By default, PLS will index all files ending with `.pl`, `.pm`, or have `perl` in the shebang line that are not `.t` files.
pls is known to be compatible with Visual Studio Code, Neovim, and BBEdit.
pls will perform much better if you have an XS JSON module installed. If you install Cpanel::JSON::XS or JSON::XS, it will use one of those before falling back to JSON::PP, similar to JSON::MaybeXS.
Refer to this README for instructions on configuring your specific editor: https://marketplace.visualstudio.com/items?itemName=FractalBoy.pls
Copyright 2022 Marc Reisner
This library is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
To install PLS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PLS
CPAN shell
perl -MCPAN -e shell install PLS
For more information on module installation, please visit the detailed CPAN module installation guide.