Perl-LanguageServer
Perl-LanguageServer copied to clipboard
Support vscode specific variables in settings
Hi there,
today i tried to set additional include directories via settings.json this way:
{
"perl.perlInc": [
"${workspaceFolder}/lib"
],
}
But it turns out, that the ${workspaceFolder}
variable is not substituted with it's actual value. Instead it is forwarded literally to the LanguageServer, so i get a Can't locate My/Module.pm
error:
Can't locate My/Module.pm in @INC (you may need to install the My::Module module)
(@INC contains: ${workspaceFolder}/lib
/home/MyUser/perl5/perlbrew/perls/perl-5.33.6/lib/site_perl/5.33.6/x86_64-linux
/home/MyUser/perl5/perlbrew/perls/perl-5.33.6/lib/site_perl/5.33.6
/home/MyUser/perl5/perlbrew/perls/perl-5.33.6/lib/5.33.6/x86_64-linux
/home/MyUser/perl5/perlbrew/perls/perl-5.33.6/lib/5.33.6
I am actually not sure if this is either something you need to enable/fix/implement or if VSCode is messing this up. Nevertheless it would be a cool feature for more portable workspaces. And at least for the setting perl.ignoreDirs
this would come in handy too.
Unfortunately vscode does resolving of variables only inside of the program
setting. For all other settings this must be done by the extention manualy. I will add the patch from @ecos-ps in the next release, so this work at lease for the workspaceFolder
variable
Just ran into this myself. Do you know when the next release will happen, @richterger?
See also #25 , #44
Unfortunately, the patch does not work for me.
${workspaceFolder}
is not replaced by the workspace folder in perlInc, the error message still is:
Can't locate xxx.pm in @INC (you may need to install the xxx module) (@INC contains: ${workspaceFolder}/yyy ...) at - line 7.