Eclipse 以这种方式格式化我的代码,这意味着它将参数放在不同的行中:
nearByLocationsArray = getAddress( currentLocation.getLatitude(),
currentLocation.getLongitude(), 10).toArray(
new String[nearbyLocations.size()]);
nearbyLocations = gCoder.getFromLocation(latitude, longitude,
maxResults);
但是,我真的不喜欢这样,我想在一行中保持简单:
nearByLocationsArray = getAddress(currentLocation.getLatitude(),currentLocation.getLongitude(), 10).toArray(new String[nearbyLocations.size()]);
nearbyLocations = gCoder.getFromLocation(latitude, longitude,maxResults);
我尝试在格式设置中寻找适当的选项,但找不到,有人可以帮我进行设置吗?
最佳答案
据我所知,不要使用 Ctrl+Shift+F
来格式化在新行中给出每个参数的代码,如果您想将其放在单行中,请检查以下步骤,
简单选择要在单行中显示的行和用户快捷键
Ctrl+Alt+J
希望对你有帮助
关于java - Eclipse 将每个参数放在新行中,如何停止这种格式化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23591731/