Aptana 3 - JavaScript 格式化程序

发布于 2024-12-24 21:17:08 字数 662 浏览 4 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

中二柚 2024-12-31 21:17:08

是的。这是一个错误,我刚刚在 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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文