Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Reisner committed Jun 24, 2024
1 parent 73352af commit 0cac660
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 23 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ path, which may not be the same one that your terminal uses.
* 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"]`.
* Optionally, change the current working directory to run PLS in by modifying the `pls.cwd` setting. If you use `$ROOT_PATH` here, it will be replaced by the first or only workspace folder.
* Add paths to `@INC` by modifying the `pls.inc` setting. 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.
* Optionally, change the current working directory to run PLS in by modifying the `pls.cwd` setting. If you use `${workspaceFolder}` here, it will be replaced by the first or only workspace folder.
* Add paths to `@INC` by modifying the `pls.inc` setting. You can use the `${workspaceFolder}` variable to stand in for your project's root directory, for example `${workspaceFolder}/lib`. If you are using multiple workspace folders and use `${workspaceFolder}`, the path will be multiplied by the number of workspace folders, and will be replaced that many times.
* Configure the path to your `.perltidyrc` file using the `pls.perltidy.perltidyrc` setting. The default is `~/.perltidyrc` if not configured.
* Configure the path to your `.perlcriticrc` file using the `pls.perlcritic.perlcriticrc` setting. The default is `~/.perlcriticrc` if not configured.
* Disable `perlcritic` checking entirely by setting `pls.perlcritic.enabled` to
Expand Down
2 changes: 1 addition & 1 deletion client/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Marc Reisner
Copyright (c) 2024 Marc Reisner

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions server/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This software is copyright (c) 2022 by Marc Reisner.
This software is copyright (c) 2024 by Marc Reisner.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
Expand All @@ -12,7 +12,7 @@ b) the "Artistic License"

--- The GNU General Public License, Version 1, February 1989 ---

This software is Copyright (c) 2022 by Marc Reisner.
This software is Copyright (c) 2024 by Marc Reisner.

This is free software, licensed under:

Expand Down Expand Up @@ -272,7 +272,7 @@ That's all there is to it!

--- The Artistic License 1.0 ---

This software is Copyright (c) 2022 by Marc Reisner.
This software is Copyright (c) 2024 by Marc Reisner.

This is free software, licensed under:

Expand Down
28 changes: 21 additions & 7 deletions server/README.pod
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,47 @@ C<pls.args> would be C<< ["run", "--rm", "-i", "<image name>", "pls"] >>.

=item pls.inc - a list of paths to add to C<@INC>

You can use the C<$ROOT_PATH> mnemonic to stand in for your project's root directory,
for example C<$ROOT_PATH/lib>. If you are using multiple workspace folders and use
C<$ROOT_PATH>, the path will be multiplied by the number of workspace folders,
You can use the C<${workspaceFolder}> variable to stand in for your project's root directory,
for example C<${workspaceFolder}/lib>. If you are using multiple workspace folders and use
C<${workspaceFolder}>, 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.

=item pls.cwd - the working directory to use for pls

If you use C<$ROOT_PATH>, it will be replaced by your workspace's first
If you use C<${workspaceFolder}>, it will be replaced by your workspace's first
or only folder.

=item pls.perltidy.perltidyrc - the location of your C<.perltidyrc> file.

Defaults to C<~/.perltidyrc> if not configured.

If you use C<${workspaceFolder}>, it will be replaced by your workspace's first
or only folder.

=item pls.perlcritic.enabled - whether to enable linting using L<perlcritic>.

=item pls.perlcritic.perlcriticrc - the location of your C<.perlcriticrc> file.

Defaults to C<~/.perlcriticrc> if not configured.

=item pls.podchecker.enabled - whether to enable checking of POD using L<podchecker>.
If you use C<${workspaceFolder}>, it will be replaced by your workspace's first
or only folder.

If you have the RequireTidyCode policy enabled, it will be configured to use
the C<.perltidyrc> from pls.perltidy.perltidyrc.

=item pls.syntax.enabled - whether to enable syntax checking.

=item pls.syntax.perl - path to an alternate C<perl> to use for syntax checking.

Defaults to the C<perl> used to run PLS.

If you use C<${workspaceFolder}>, it will be replaced by your workspace's first
or only folder.

Globbing is also performed against this path.

=item pls.syntax.args - additional arguments to pass when syntax checking.

This is useful if there is a BEGIN block in your code that changes
Expand All @@ -97,7 +109,7 @@ or have `perl` in the shebang line that are not `.t` files.

=head1 CAVEATS

pls is known to be compatible with Visual Studio Code, Neovim, and BBEdit.
pls is known to be compatible with Visual Studio Code, Neovim, BBEdit, and emacs.

pls will perform much better if you have an XS JSON module installed.
If you install L<Cpanel::JSON::XS> or L<JSON::XS>, it will use one of those
Expand All @@ -110,9 +122,11 @@ L<https://marketplace.visualstudio.com/items?itemName=FractalBoy.pls>

=head1 COPYRIGHT

Copyright 2022 Marc Reisner
Copyright (c) 2024 Marc Reisner

=head1 LICENSE

This library is free software; you may redistribute it and/or
modify it under the same terms as Perl itself.

=cut
26 changes: 20 additions & 6 deletions server/lib/PLS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -59,33 +59,47 @@ C<pls.args> would be C<< ["run", "--rm", "-i", "<image name>", "pls"] >>.
=item pls.inc - a list of paths to add to C<@INC>
You can use the C<$ROOT_PATH> mnemonic to stand in for your project's root directory,
for example C<$ROOT_PATH/lib>. If you are using multiple workspace folders and use
C<$ROOT_PATH>, the path will be multiplied by the number of workspace folders,
You can use the C<${workspaceFolder}> variable to stand in for your project's root directory,
for example C<${workspaceFolder}/lib>. If you are using multiple workspace folders and use
C<${workspaceFolder}>, 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.
=item pls.cwd - the working directory to use for pls
If you use C<$ROOT_PATH>, it will be replaced by your workspace's first
If you use C<${workspaceFolder}>, it will be replaced by your workspace's first
or only folder.
=item pls.perltidy.perltidyrc - the location of your C<.perltidyrc> file.
Defaults to C<~/.perltidyrc> if not configured.
If you use C<${workspaceFolder}>, it will be replaced by your workspace's first
or only folder.
=item pls.perlcritic.enabled - whether to enable linting using L<perlcritic>.
=item pls.perlcritic.perlcriticrc - the location of your C<.perlcriticrc> file.
Defaults to C<~/.perlcriticrc> if not configured.
If you use C<${workspaceFolder}>, it will be replaced by your workspace's first
or only folder.
If you have the RequireTidyCode policy enabled, it will be configured to use
the C<.perltidyrc> from pls.perltidy.perltidyrc.
=item pls.syntax.enabled - whether to enable syntax checking.
=item pls.syntax.perl - path to an alternate C<perl> to use for syntax checking.
Defaults to the C<perl> used to run PLS.
If you use C<${workspaceFolder}>, it will be replaced by your workspace's first
or only folder.
Globbing is also performed against this path.
=item pls.syntax.args - additional arguments to pass when syntax checking.
This is useful if there is a BEGIN block in your code that changes
Expand All @@ -101,7 +115,7 @@ or have `perl` in the shebang line that are not `.t` files.
=head1 CAVEATS
pls is known to be compatible with Visual Studio Code, Neovim, and BBEdit.
pls is known to be compatible with Visual Studio Code, Neovim, BBEdit, and emacs.
pls will perform much better if you have an XS JSON module installed.
If you install L<Cpanel::JSON::XS> or L<JSON::XS>, it will use one of those
Expand All @@ -114,7 +128,7 @@ L<https://marketplace.visualstudio.com/items?itemName=FractalBoy.pls>
=head1 COPYRIGHT
Copyright 2022 Marc Reisner
Copyright (c) 2024 Marc Reisner
=head1 LICENSE
Expand Down
1 change: 0 additions & 1 deletion server/lib/PLS/Server/Request/Workspace/Configuration.pm
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ sub handle_response
my $index = PLS::Parser::Index->new();
my @inc;

# Replace $ROOT_PATH with actual workspace paths in inc
if (exists $config->{inc} and ref $config->{inc} eq 'ARRAY')
{
foreach my $inc (@{$config->{inc}})
Expand Down
5 changes: 2 additions & 3 deletions server/lib/PLS/Server/State.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ use strict;
use warnings;

our $INITIALIZED = 0;
our $ROOT_PATH;
our $CONFIG = {perltidy => {}, perlcritic => {}};
our $SHUTDOWN = 0;
our $CONFIG = {perltidy => {}, perlcritic => {}};
our $SHUTDOWN = 0;
our $CLIENT_CAPABILITIES;

=head1 NAME
Expand Down

0 comments on commit 0cac660

Please sign in to comment.