FractalBoy / perl-language-server

101 stars 12 forks source link

Perl::Tidy will use -eos by default #92

Closed FractalBoy closed 2 years ago

FractalBoy commented 2 years ago

Steven Hancock, Perl::Tidy maintainer, sent this to me in an email:

I am the author of Perl::Tidy and am writing about an upcoming change in a default setting and want to be sure it does not cause problems for modules which use Perl::Tidy. The issue involves changing the default setting of a flag -eos in order to make perltidy behave better when used as a filter. I've put a document on github which describes the issue:

https://github.com/perltidy/perltidy/blob/master/docs/eos_flag.md

I plan to make this change sometime later this year, possibly this summer, and want to be sure that it doesn't cause data corruption for any existing modules. I have looked through all modules on CPAN which use Perl::Tidy, and found that most will not have a problem, but for a couple, including PLS, I wasn't sure and need help in checking.

One way to check for problems would be to run PLS on the current CPAN release of Perl::Tidy with -eos set, using files with wide characters.

Another way to check would be to install tagged version 20220217.02 at

https://github.com/perltidy/perltidy/releases/tag/20220217.02

which is basically the same as the latest CPAN release but which has -eos set as the default.

If problems occur (i.e. double encoding of text with wide characters), then a fix such as discussed in the above document could be made.

Please contact me if you have any questions.

FractalBoy commented 2 years ago

I don't see any issues when using -eos. I did find an issue with how we are handling multi-byte characters, and this is fixed in 28d69c20c609209cee350b46b27a678183f79916