bscan / PerlNavigator

Perl Language Server that includes syntax checking, perl critic, and code navigation
MIT License
207 stars 40 forks source link

Tidy formatting does not work "out of the box" (MacOS) #129

Open ohir opened 6 months ago

ohir commented 6 months ago

MacOS 12.7.4, VSCode Version: 1.85.2

Just installed PerlNavigator in a vanila perl environment (only system perl). Perltidy works from terminal (brewed).

Extension works: it hints, displays help - ie. PLS part is working ok - but it does not format on save (enabled globally).

It needed me to have Perl::Tidy installed separately:

export PERL5LIB=/Users/user/perl5/lib/perl5
brew install cpanm && cpanm install local::lib && \
cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
cpanm install Perl::Tidy

then add to settings.json appropriate items:

"perlnavigator.includePaths": [        "/Users/user/perl5/lib/perl5"   ]

"perlnavigator.perltidyProfile": "/Users/user/.ptrc"

Restart VSCode... wooha, now it formats on save.

It would be good to either bundle Tidy with extension or update docs accordingly.

TC, excelent work :)