[ANN] CamouflagePlugin Plugin v0.4
Caution : tested only on build 929 :
http://www.intellij.org/twiki/bin/view/Main/CamouflagePlugin
Quickstart:
-
After installation, and IDEA restarting,
place the caret in the class name, and press .
Recommendation :
-
For optimal result, *you should change IDEA's folding foreground and
background colours, to match the examples illustrated on the wiki*.
The default colours don't work well with this plugin, as it (ab)uses the
folding system to shortcut the standard code displaying system.
v0.4 : added
-
4 Intentions that _camouflage _:
- all *constructors *
- all accessors (getters, setters) (**1)
- all *canonicals *(equals(), hashCode(), toString)
- all *parameters list *
1 Intention that folds
- all 1-liners
experiment : if
-
1 intention that camouflages
if (condition)
return true ;
if (condition2)
return false;
into
°°return true : if (condition)
°°return false : if (condition2)
**1 : the plugin only 'camouflages' real and certified getters, and setters.
It detects errors like :
public setA (int val) { val = val ;}
public setA (int val) { a = a ;}
public setA (int val) { val = a ;}
public setA (int val) { val = a ;}
etc..
idem for the getters.
Have fun. :)
Alain
请先登录再写评论。
I've implemented a few of those ideas through the camouflage plugin :
http://www.intellij.org/twiki/bin/view/Main/CamouflagePlugin
idea 1: analyse, certify and fold well formed accessors.
-
idea 3 : recognize complex patterns, and "massage" the display result
-
for (int i=1; 19>i;i+=1)
becomes
for (int i in 1..18)
idea 4 : idea 4 : hides castings,
-
PsiIfStatement ifs = (PsiIfStatement) e
becomes
PsiIfStatement ifs = »« e ;
, and more ...
http://www.intellij.org/twiki/bin/view/Main/CamouflagePlugin
related requests :
-
Openapi-folding : allow 1 color per folding region
http://www.intellij.net/tracker/idea/viewSCR?publicId=17500
Openapi-folding : allow icons(image?) as placeholders
http://www.intellij.net/tracker/idea/viewSCR?publicId=17503
Alain