Perl-LanguageServer icon indicating copy to clipboard operation
Perl-LanguageServer copied to clipboard

needs to use taint switch if used on the shebang line

Open gtataranni opened this issue 2 years ago • 1 comments

just like https://github.com/vim-syntastic/syntastic/issues/422 Perl complains if you edit a script with the following shebang line:

#!/usr/bin/perl -T

with the message:

"-T" is on the #! line, it must also be used on the command line at - line 1.

So, if these flags are present on the shebang line, PLS should invoke perl with -t or -T. This is especially important because Perl will not go further than this and will not check for any other errors.

Setting the flag in the config does not work:

    "perl.perlCmd": "perl -T",
[Error - 3:09:35 PM] Starting client failed
Launching server using command perl -T failed.

gtataranni avatar May 24 '22 13:05 gtataranni

silly attempt to make it work by modifying line https://github.com/richterger/Perl-LanguageServer/blob/master/lib/Perl/LanguageServer/SyntaxChecker.pm#L243 seem to work

            $ret = run_cmd ([$self -> perlcmd, '-T', '-c', @inc],

gtataranni avatar May 24 '22 14:05 gtataranni

For debugging: Adding a config option runtimeArgs like in https://code.visualstudio.com/docs/nodejs/nodejs-debugging would be easy.

You asked for syntax checking: Maybe your proposal is not stupid. I can't see, why not doing so. :-) Since taint mode should work only when running a program and not only checking.

wielandp avatar Feb 08 '23 17:02 wielandp

Of course debugging is still open and has the same problem. But the same fix is not good.

wielandp avatar Feb 09 '23 08:02 wielandp

Syntax check and taint is fix in pull request #172

richterger avatar May 14 '23 11:05 richterger