Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please provide documentation how to use perltidy in Visual Studio Code #147

Open
horshack opened this issue Oct 16, 2024 · 1 comment
Open

Comments

@horshack
Copy link

I try to format my perl-code with perltidy in Visual Studio Code. This can be done because mentioned in

https://github.com/bscan/PerlNavigator/

Currently Implemented Features: Code formatting via Perl::Tidy

Ok, but how can I do this? I tried it with the VSCode extension "Perl Simple" described in https://stackoverflow.com/questions/79089661/how-to-use-perltidy-to-reformat-code-in-visual-studio-code/79093098#79093098 like this:

+++
VSCode has a beautifier way for every kind of file.

A VSCode extension must get installed to use it. I installed the extension: Simple Perl. After that I highlighted some perl code in some perl file. Right-click - Menue: Format selection. The code gets formatted.
+++

I tried the same with PerlNavigator, but this changes nothing in the code. perltidy seems not to get called.

Could you please describe in

https://github.com/bscan/PerlNavigator/

how I can reformat code in Visual Studio Code with the extension PerlNavigator?

@bscan
Copy link
Owner

bscan commented Oct 16, 2024

Hi @horshack, thanks for filing the issue. Additional documentation sounds good to me, especially since Perl Navigator supports both "Format Selection" and "Format Document" options, as shown below.

284102994-55f58d48-7c0f-4d80-bfca-98180208ffe2

I'm surprised it works in "Simple Perl", but not in "Perl Navigator". Neither of them have perltidy bundled, so it must already be installed in your version of perl. Are you using the system install of Perl? If you need to point to a different installation of Perl, you can set the params "perlnavigator.perlPath". Did you provide any settings to simple-perl?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants