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