我正在尝试从Sublime切换到Atom。我安装了atom-beautify,因为我试图获得与ST的BeautifyRuby包相同的美妙功能。
但它不起作用。因此,我仔细查看了原子美化的语言支持部分,发现Ruby需要Ruby Beautify我使用gem install ruby-beautify
安装,但它仍然不起作用,如下所示:
在atom-beautify之前的凌乱红宝石代码:
即将运行Atom Beautify:
经过原子美化但它仍然看起来很糟糕:
回到崇高来解决问题,这是在原子美化之后,但在BeautifyRuby之前:
在BeautifyRuby之后,请注意class
,def
和end
标记按预期排列的方式:
那么我将如何使用atom-beautify来模仿BeautifyRuby功能呢?
谢谢:)
编辑: 控制台输出:
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: 对于有兴趣的人,请参阅repo issue和atom discussion。)