java - Auto-generate Android Log TAG in Android Studio/Intellij idea -
in intellij idea when typing psfs , press ctrl+j ide getting me dialog :

and when press enter

i know can customize own output

but can't doc's how can write own live template.
in end want next result :
typing : psfst -> press ctrl+j -> press enter
result :
public static final string tag = <currentclassname>.class.getsimplename();
it helpfull, because have habit log classes.
i find solution
1) create new live template in plain group
2) in template text :
private static final string tag = $class_name$.class.getsimplename(); 3) define usage scope :

4) choose shortcut :

finally click on edit variables , change expression value classname()

click ok , apply, ok , use.
Comments
Post a Comment