Promote Variable
Is there a command or shortcut to promote a variable?
for example
public function test():void{
var testVar:String = "hello";
}
I would like to promote it to a class variable
private var testVar:String;
public function test():void{
testVar= "hello";
}
thanks,
-ross
请先登录再写评论。
Put the caret on the variable and press Ctrl-Alt-F (Refactor : Introduce Field).
hmmmm that doesnt seem to work
I place a caret on the variable and hit CTRL-ALT-F i get "Cannot Introduce field. Selection does not form an expression"
Though if i select the variable (highligh it all) and hit CTRL-ALT-F I do get the dialog but my only option is Current Method.
this is what i am using to test
var test:String = new String();
Thanks
-ross
I guess it must be language-specific. It works for me with Java.
yes, it's different per plugin
Soooo am i outta luck on this for Actionscript right now?
-ross
YouTrack is your friend:
http://youtrack.jetbrains.net/issues/IDEA