简体   繁体   中英

Eclipse formatter to keep One-Liners

Can Eclipse Formatter be configured to keep:

public Long getId() { return this.id; }

And maybe to format small (one line) definitions as one-liners?

No: bug 205973 has been written to request such a formatter option.
3 years later, it doesn't seem likely to be implemented.


Edit May 2001:

maleki mentions, in response to orbfish 's comment, that at least you have some control over the zones of code which Eclipse may or may not format:

Java development user guide > Reference > Java Editor > Formatter Help page

This isn't a direct answer, but it can help:

格式化程序禁用启用标记

To my knowledge (and after a quick look), the default formatter does not provide this level of granularity for customization. If it's that important to the business, you might be able to find an Eclipse plugin (perhaps commercial) that can be configured with advanced rules like this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM