简体   繁体   中英

How can I keep array elements with specific arrangement in formatter style [eclipse]

I tried to find in formatter style preferences on eclipse to keep my array elements like that image:

在此处输入图像描述

Where can I find that style to modify it? 在此处输入图像描述

You can configure this in Line Wrapping > Wrapping settings > Other expressions > Array initializers .

By the way, ... = new String[] {... can be shorten here to ... = {... (Eclipse provides a clean-up for that: Unnecessary Code > Create array with curly when possible ).

As the following image shown: 在此处输入图像描述

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