File Coverage

blib/lib/PLS.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package PLS;
2              
3 1     1   1070 use strict;
  1         2  
  1         28  
4 1     1   4 use warnings;
  1         1  
  1         57  
5              
6             our $VERSION = '0.905';
7              
8             =head1 NAME
9              
10             PLS - Perl Language Server
11              
12             =head1 DESCRIPTION
13              
14             The Perl Language Server implements a subset of the Language Server Protocol
15             for the Perl language. Features currently implemented are:
16              
17             =over
18              
19             =item * Go to definition (for packages, subroutines, and variables)
20              
21             =item * Listing all symbols in a document
22              
23             =item * Hovering to show documentation
24              
25             =item * Signature help (showing parameters for a function as you type)
26              
27             =item * Formatting
28              
29             =item * Range Formatting
30              
31             =item * Auto-completion
32              
33             =item * Syntax checking
34              
35             =item * Linting (using perlcritic)
36              
37             =item * Sorting imports
38              
39             =back
40              
41             =head1 OPTIONS
42              
43             This application does not take any command line options.
44             The following settings may be configured using your text editor:
45              
46             =over
47              
48             =item pls.cmd - path to pls
49              
50             Make sure that C<pls.cmd> is set to the path to the C<pls> script on your system.
51             If you rely on your C<$PATH>, ensure that your editor is configured with the correct
52             path, which may not be the same one that your terminal uses.
53              
54             =item pls.args - args to pass to the pls command
55              
56             Add any additional arguments needed to execute C<pls> to the C<pls.args> setting.
57             For example, if you run C<pls> in a docker container, C<pls.cmd> would be C<docker>, and
58             C<pls.args> would be C<< ["run", "--rm", "-i", "<image name>", "pls"] >>.
59              
60             =item pls.inc - a list of paths to add to C<@INC>
61              
62             You can use the C<$ROOT_PATH> mnemonic to stand in for your project's root directory,
63             for example C<$ROOT_PATH/lib>. If you are using multiple workspace folders and use
64             C<$ROOT_PATH>, the path will be multiplied by the number of workspace folders,
65             and will be replaced that many times. This is useful if you use SVN and check out
66             each branch to a different directory.
67              
68             =item pls.cwd - the working directory to use for pls
69              
70             If you use C<$ROOT_PATH>, it will be replaced by your workspace's first
71             or only folder.
72              
73             =item pls.perltidy.perltidyrc - the location of your C<.perltidyrc> file.
74              
75             Defaults to C<~/.perltidyrc> if not configured.
76              
77             =item pls.perlcritic.enabled - whether to enable linting using L<perlcritic>.
78              
79             =item pls.perlcritic.perlcriticrc - the location of your C<.perlcriticrc> file.
80              
81             Defaults to C<~/.perlcriticrc> if not configured.
82              
83             =item pls.syntax.enabled - whether to enable syntax checking.
84              
85             =item pls.syntax.perl - path to an alternate C<perl> to use for syntax checking.
86              
87             Defaults to the C<perl> used to run PLS.
88              
89             =item pls.syntax.args - additional arguments to pass when syntax checking.
90              
91             This is useful if there is a BEGIN block in your code that changes
92             behavior depending on the contents of @ARGV.
93              
94             =back
95              
96             You may configure a .plsignore file in your project's root directory, with
97             a list of Perl glob patterns which you do not want pls to index.
98              
99             By default, PLS will index all files ending with `.pl`, `.pm`,
100             or have `perl` in the shebang line that are not `.t` files.
101              
102             =head1 CAVEATS
103              
104             pls is known to be compatible with Visual Studio Code, Neovim, and BBEdit.
105              
106             pls will perform much better if you have an XS JSON module installed.
107             If you install L<Cpanel::JSON::XS> or L<JSON::XS>, it will use one of those
108             before falling back to L<JSON::PP>, similar to L<JSON::MaybeXS>.
109              
110             =head1 NOTES
111              
112             Refer to this README for instructions on configuring your specific editor:
113             L<https://marketplace.visualstudio.com/items?itemName=FractalBoy.pls>
114              
115             =head1 COPYRIGHT
116              
117             Copyright 2022 Marc Reisner
118              
119             =head1 LICENSE
120              
121             This library is free software; you may redistribute it and/or
122             modify it under the same terms as Perl itself.
123              
124             =cut
125              
126             1;