简体   繁体   中英

Eclipse: auto format XML files on save

Is it possible to somehow auto-format when saving XML files in Eclipse?

I know it's possible to do it for Java files, but I would like it to happen for XML files as well.

Specifically, I'm using and loving the auto format feature for XML files while developing for Android, as Android is quite heavy on using XML files.

I'm going to answer my own question using my own article about the fix that's about to be rolled out to ADT: http://www.androidpolice.com/2010/11/09/for-android-developers-next-version-of-eclipse-adt-to-include-auto-formatting-of-xml/

Update : since r14, ADT can now finally do this. http://tools.android.com/recent/xmlformatter

对于日食自动格式化,请尝试按Ctrl + Shift + F

WTP中已要求使用它(错误221696),但目前提高格式化程序的质量和速度通常具有更高的优先级。

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