Aptana 3 - JavaScript 格式化程序
Aptana JS 格式化程序可以很好地处理这个问题:
Manage.init = function() {
--code here--
}
但它会将以下内容格式化
$('#tab1').click(function() {
$('li.voting.active').length === 0 ? Manage.loadTab(1) : Manage.loadVotingTab(1);
});
为:(
$('#tab1').click(function() {$('li.voting.active').length === 0 ? Manage.loadTab(1) : Manage.loadVotingTab(1);
});
格式化不仅会删除左大括号后面的换行符(如图所示),而且还会在块上方添加一个换行符,在块下方添加两个换行符(未显示)这里))。
我找不到任何可以更改此设置的格式化程序设置。这里正确的行为是让代码保持原样。有什么建议吗?
The Aptana JS formatter handles this fine:
Manage.init = function() {
--code here--
}
but it formats this:
$('#tab1').click(function() {
$('li.voting.active').length === 0 ? Manage.loadTab(1) : Manage.loadVotingTab(1);
});
into:
$('#tab1').click(function() {$('li.voting.active').length === 0 ? Manage.loadTab(1) : Manage.loadVotingTab(1);
});
(the formatting not only removes the line break after the opening brace (shown here), but it also adds one line break added above and two below the block (not shown here)).
I can't find any formatter settings that change this. The correct behavior here would be to leave the code as it is. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的。这是一个错误,我刚刚在 Appcelerator BTS 上提出了一个问题,网址为 http://jira.appcelerator。 org/browse/APSTUD-4064
将您自己添加为“观察者”,以便在完成时收到通知。
谢谢!
Yep. It's a bug, and I just opened an issue on the Appcelerator BTS at http://jira.appcelerator.org/browse/APSTUD-4064
Add yourself as a 'watcher' to be notified when it's done.
Thanks!