Why isn't atom-beautify working?


#1

I’m trying to make the switch from Sublime to Atom. I installed atom-beautify because I’m trying to get the same awesome beautifying functionality as the BeautifyRuby package for ST.

But it doesn’t work. So I looked closer at the Language Support section for atom-beautify and found that Ruby requires Ruby Beautify which I installed with gem install ruby-beautify but it still doesn’t work, as shown below:

Messy ruby code before atom-beautify:

enter image description here

About to run Atom Beautify:

enter image description here

After atom-beautify but it still looks bad:

enter image description here

Going back to sublime to fix the situation, this is after atom-beautify but before BeautifyRuby:

enter image description here

After BeautifyRuby, notice how the class, def, and end tags are lining up as expected:

enter image description here

So how would I go about mimicking the BeautifyRuby functionality with atom-beautify?

Thanks :slight_smile:

Edit:
Console output:

Window load time: 421ms
/Applications/Atom.app/Contents/Resources/app.asar/src/workspace-element.js:26 ::shadow pseudo-element is deprecated. See https://www.chromestatus.com/features/6750456638341120 for more details.
/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-component.js:1010 /deep/ combinator is deprecated. See https://www.chromestatus.com/features/6750456638341120 for more details.
/Users/max/.atom/packages/atom-beautify/node_modules/universal-analytics/lib/index.js:451 [universal-analytics] Logging enabled
/Users/max/.atom/packages/atom-beautify/node_modules/universal-analytics/lib/index.js:451 [universal-analytics] Enqueued event ({"ec":"0.29.9","ea":"Beautify","el":"Ruby","v":"1","tid":"UA-52729731-2","cid":"cfa6e44e-d361-4dd1-8aab-3b7bfc384d7c","t":"event"})
/Users/max/.atom/packages/atom-beautify/node_modules/universal-analytics/lib/index.js:451 [universal-analytics] Sending 1 tracking call(s)
/Users/max/.atom/packages/atom-beautify/node_modules/universal-analytics/lib/index.js:451 [universal-analytics] 1: {"ec":"0.29.9","ea":"Beautify","el":"Ruby","v":"1","tid":"UA-52729731-2","cid":"cfa6e44e-d361-4dd1-8aab-3b7bfc384d7c","t":"event"}
/Users/max/.atom/packages/atom-beautify/node_modules/universal-analytics/lib/index.js:451 [universal-analytics] Enqueued event ({"ec":"0.29.9","ea":"Beautify:Manual","el":"Ruby","v":"1","tid":"UA-52729731-2","cid":"cfa6e44e-d361-4dd1-8aab-3b7bfc384d7c","t":"event"})
/Users/max/.atom/packages/atom-beautify/node_modules/universal-analytics/lib/index.js:451 [universal-analytics] Sending 1 tracking call(s)
/Users/max/.atom/packages/atom-beautify/node_modules/universal-analytics/lib/index.js:451 [universal-analytics] 1: {"ec":"0.29.9","ea":"Beautify:Manual","el":"Ruby","v":"1","tid":"UA-52729731-2","cid":"cfa6e44e-d361-4dd1-8aab-3b7bfc384d7c","t":"event"}
2/Users/max/.atom/packages/atom-beautify/node_modules/universal-analytics/lib/index.js:451 [universal-analytics] Finished sending tracking calls
/Users/max/.atom/packages/atom-beautify/node_modules/universal-analytics/lib/index.js:451 [universal-analytics] Enqueued timing ({"utc":"Beautify","utv":"Ruby","utt":1525,"utl":"0.29.9","v":"1","tid":"UA-52729731-2","cid":"cfa6e44e-d361-4dd1-8aab-3b7bfc384d7c","t":"timing"})
/Users/max/.atom/packages/atom-beautify/node_modules/universal-analytics/lib/index.js:451 [universal-analytics] Sending 1 tracking call(s)
/Users/max/.atom/packages/atom-beautify/node_modules/universal-analytics/lib/index.js:451 [universal-analytics] 1: {"utc":"Beautify","utv":"Ruby","utt":1525,"utl":"0.29.9","v":"1","tid":"UA-52729731-2","cid":"cfa6e44e-d361-4dd1-8aab-3b7bfc384d7c","t":"timing"}
/Users/max/.atom/packages/atom-beautify/node_modules/universal-analytics/lib/index.js:451 [universal-analytics] Finished sending tracking calls

#2

Personally, I would try using the ruby-beautify gem from the command line to see if it produces the same results as you see in Atom. If so, then there is a bug in ruby-beautify. If not, there is a bug in atom-beautify. Either way, the bug should probably be reported to the appropriate repository :grinning:

The Atom FAQ has information on how to contact the maintainers of any Atom community package or theme.


#3

Thanks for the recommendation. Here’s the repo issue for any who is interested :slight_smile:


#4

Make sure that the atom-beautify package is really using ruby-beautify and not rubocop:
enter image description here
See issue #1038