我已經從Eclipse中導入了一個項目到IntelliJ中,我想配置代碼樣式設置。但是我在聲明數組時遇到了一個問題。IntelliJ中的代碼樣式設置(縮進)
月食格式格式化代碼如下:
@Before
public void prepareData() throws Exception //NOPMD
{
LOG.info("Preparing setup data");
new CoreBasicDataCreator().createEssentialData(null, null);
CatalogManager.getInstance().createEssentialData(Collections.EMPTY_MAP, null);
serviceLayerDataSetup.createJobPerformables();
impExSystemSetup.createAutoImpexEssentialData(new SystemSetupContext(Collections.EMPTY_MAP, Type.ESSENTIAL,
CuppyConstants.EXTENSIONNAME));
cuppySystemSetup.importBasics(new SystemSetupContext(Collections.singletonMap(CuppyConstants.PARAM_BASICS, new String[]
{ CuppyConstants.PARAM_BASICS_PLAYERS }), Type.NOTDEFINED, CuppyConstants.EXTENSIONNAME));
cuppySystemSetup.importWC2002(new SystemSetupContext(Collections.singletonMap(CuppyConstants.PARAM_WC2002, new String[]
{ CuppyConstants.PARAM_WC2002_SETUP, CuppyConstants.PARAM_WC2002_RESULTS_PRELIMINARIES,
CuppyConstants.PARAM_WC2002_RESULTS_FINALS, CuppyConstants.PARAM_WC2002_BETS_PRELIMINARIES,
CuppyConstants.PARAM_WC2002_BETS_FINALS }), Type.NOTDEFINED, CuppyConstants.EXTENSIONNAME));
LOG.info("Finished preparation of setup data");
LOG.info("Preparing session");
JaloSession.getCurrentSession().setUser(UserManager.getInstance().getUserByLogin("sternthaler"));
LOG.info("Finished preparation of session");
}
和IntelliJ重新格式化代碼爲:
@Before
public void prepareData() throws Exception //NOPMD
{
LOG.info("Preparing setup data");
new CoreBasicDataCreator().createEssentialData(null, null);
CatalogManager.getInstance().createEssentialData(Collections.EMPTY_MAP, null);
serviceLayerDataSetup.createJobPerformables();
impExSystemSetup.createAutoImpexEssentialData(new SystemSetupContext(Collections.EMPTY_MAP, Type.ESSENTIAL,
CuppyConstants.EXTENSIONNAME));
cuppySystemSetup.importBasics(new SystemSetupContext(Collections.singletonMap(CuppyConstants.PARAM_BASICS, new String[]
{ CuppyConstants.PARAM_BASICS_PLAYERS }), Type.NOTDEFINED, CuppyConstants.EXTENSIONNAME));
cuppySystemSetup.importWC2002(new SystemSetupContext(Collections.singletonMap(CuppyConstants.PARAM_WC2002, new String[]
{ CuppyConstants.PARAM_WC2002_SETUP, CuppyConstants.PARAM_WC2002_RESULTS_PRELIMINARIES,
CuppyConstants.PARAM_WC2002_RESULTS_FINALS, CuppyConstants.PARAM_WC2002_BETS_PRELIMINARIES,
CuppyConstants.PARAM_WC2002_BETS_FINALS }), Type.NOTDEFINED, CuppyConstants.EXTENSIONNAME));
LOG.info("Finished preparation of setup data");
LOG.info("Preparing session");
JaloSession.getCurrentSession().setUser(UserManager.getInstance().getUserByLogin("sternthaler"));
LOG.info("Finished preparation of session");
}
如果你是一個的IntelliJ用戶,您可以用這裏面的代碼示例發揮代碼風格編輯器。你 希望任何人能想出解決辦法:)
你能描述intellij格式化有什麼問題嗎?這是件好事,你把代碼在這裏,但它會更好地形容它完全代替了「把工作做好」的問題... – zenbeni
我不太知道如何來形容它。唯一的問題是這個新的線陣列標識(從這個例子看)。 我無法找到的IntelliJ相應參數來設置這個 – ZeDonDino