Perltidy extension for Visual Studio Code.
More perltidy, then pertidy extension by sfodje.
This perltidy has some extended features:
- It has github repository (now sfodje perltidy has repository too).
- It can format large perl files (in my case sfodje extension had 10 or 20 KB file limit. I don't know why it happened).
- It can format selected text.
- Partial support for virtual filesystems like SSH FS (without support of .perltidyrc from virtual fs).
- Option to enable perltidy only with existing .perltidyrc in project.
- FormatOnType support (you can enable it in settings).
- Support for relative path to perltidy binary. Set perltidy-more.executable to relative path and it will be search it in workspace folder.
Alternatives
- sfodje perltidy.
- henriiik intelligence extension (it can format, but I couldn't get it work).
VS Code can have multiple formatting extensions for same language installed, but only one of them (selected by some magical "score") will be using for formatting by formatting key.
If this extension does not work:
- Try to use it with command (F1 or Ctrl+Shift+P: perltidy).
- Try to disable other perl formatting extensions.
- Try to install perltidy binary from your OS repository.
A: Use "perltidy-more.profile" option and set it to ".../.perltidyrc". Three dots is perltidy specific option to indicates that the file should be searched for starting in the current directory and working upwards. This makes it easier to have multiple projects each with their own .perltidyrc in their root directories.
A: Use shell script like this and set it as perltidy-more.executable in options
#!/usr/bin/env sh
exec docker run --rm -i -v "$PWD":/app -w /app avastsoftware/perltidy "$@"