這裏是我想將Eclipse的模板:在IntelliJ IDEA的創建import語句新活模板
${:import(org.apache.log4j.Logger)}
private static final Logger LOG = Logger.getLogger(${enclosing_type}.class);
我現在的版本在思路如下:
private static final Logger LOG = Logger.getLogger($CLASS_NAME$.class);$END$
其中$CLASS_NAME$
被配置爲使用className()
作爲其表達式。
不幸的是,我沒有找到關於添加import語句的任何文檔。有沒有相當於Eclipse ${:import(...)}
?
這裏我因爲我無法弄清楚爲什麼IntelliJ不是_magically_生成適當的導入。你的建議不僅能夠實現我所嘗試的目標,這比我所希望的要好。這樣,它就更加明確,沒有模棱兩可的餘地。太好了! –