Atom-beautify: Not beautifying on PHP

Created on 27 Jan 2018  Â·  5Comments  Â·  Source: Glavin001/atom-beautify

Description

When I hit beautify it shows a fast beautifying popup window but it does nothing. Working ok on CSS and HTML

Debug

Here is a link to the debug.md Gist: https://gist.github.com/rrrraul/af7dbc6b2c9b5d8235ca6845f48cb63e

Checklist

I have:

  • [x] Tried uninstalling and reinstalling Atom Beautify to ensure it installed properly
  • [x] Reloaded (or restarted) Atom to ensure it is not a caching issue
  • [x] Searched through existing Atom Beautify Issues at https://github.com/Glavin001/atom-beautify/issues
    so I know this is not a duplicate issue
  • [x] Filled out the Input, Expected, and Actual sections above or have edited/removed them in a way that fully describes the issue.
  • [x] Generated debugging information by executing Atom Beautify: Help Debug Editor command in Atom and added link for debug.md Gist to this issue

Most helpful comment

You're welcome. In the next major version we're looking to use beautifier pipelines that allows multiple beautifiers to be applied for a specific language. #457

All 5 comments

There's nothing for php-cs-fixer to format in your file. The majority of its contents is HTML, and isn't something php-cs-fixer really does, at least to my understanding. You're better off running the HTML beautifier against that file.

You can try this code and run php-cs-fixer against it to ensure it does work.

Before

if ($num>0) {  echo 'foo';
}else {  echo 'bar'; }

Should look like this after running:

if ($num>0) {
    echo 'foo';
} else {
    echo 'bar';
}

Sorry about confusion and thanks for your answer @szeck87 , HTML is not getting prettified on my PHP file. — PHP is it working after trying your example.

How can I make it HTML get formated?

You can either change the language to HTML via the bottom right menu and then run the beautify command, or open the command palette and run the atom beautify: beautify language html command.

thanks for your time @szeck87. Problem solved

You're welcome. In the next major version we're looking to use beautifier pipelines that allows multiple beautifiers to be applied for a specific language. #457

Was this page helpful?
0 / 5 - 0 ratings