bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.62k stars 94 forks source link

Set line length for formatting #2517

Open schabau opened 1 year ago

schabau commented 1 year ago

Hello,

I like "PHP Intelephense" and I'm even considering whether it's worth buying a license for me as a little hobbyist.

I have a problem with a point that is very important to me, the formatting of code. PHP Intelephense states, "Lossless PSR-12 compatible document/range formatting. Formats combined HTML/PHP/JS/CSS files too.". When I let "PHP Intelephense" format a PHP file that contains HTML code, the PHP code is formatted well, but the HTML code is formatted half-heartedly because the line length in paragraphs is not taken into account. There is a line break after a </p> but the text within the paragraph does not wrap. Is there a way to set the line length for formatting?

Currently I always have to use "Format HTML in PHP" and then "PHP Intelephense" to format a PHP file with HTML code.

Best regards Schabau

schabau commented 1 year ago

Hello,

I have now found a possibility. If I put a file ".jsbeautifyrc" with the formatting options I need in the document root, formatting works better. The thing has a big disadvantage for me. Why does the file ".jsbeautifyrc" have to be stored in the DocumentRoot? VSCode has already created the ".vscode" directory in the DocumentRoot, in which the individual options can be stored. I would also like to put the file ".jsbeautifyrc" there.

Is there any option with which I can specify a different path to ".jsbeautifyrc"?

Best regards Schabau

DamianSuess commented 6 months ago

@schabau I agree with with your statement. Frankly, our project folder has too many individual config files. I really enjoy how regular Visual Studio and some authors are starting to normalize the use of .editorconfig to be a one-stop-shop.

This suggestion would be better fitting over at, https://github.com/beautifier/js-beautify