Currently the closest refactoring we have is "Add member". You click on a class name an type in the type and name. You can use the clipboard to make it even faster.
Do you use this type of promotion often enough to make it worth doing a separate refactoring for this?
Objections? If I think about edge cases, what about initializations and constructors?
int apple = 5;
here, we have 3 options: 1. Apple = 5; 2. Delete the line, and move initialization to the constructor (what if there are any, what if there are more constructors, user maybe use a shared function and call it from other constructors, etc.) 3. Move the initialization to the initializer list(s).
Constructors like:
cSomeClass obj("SomeString");
or what if there is a local reference like
int banana=5; int apple=banana+5; // we would like to use the promote refactoring on apple
We can leave the initialization like
int apple=5;
becomes
Apple=5;
which makes sense from this point of view but it may seems odd. Another possibility is to disable the refactoring on symbols with initialization, but it would make more questions :)
I don't want to say it is impossible, but it may not as easy as you might suppose.