Hello everyone,
I just can't stop sharing ideas, as even a small chance of them being implemented is well worth it.
This one is a slight modification of existing add member functionality in VAX.
Consider the following project. We've got the Banana and Kitchen classes. Right now we're working on the Kitchen::prepareShake() function, using Banana class:
void Kitchen::prepareShake() {
Banana banana;
banana.peel();
int pieces = 10;
Knife knife;
// peel() function is defined in Banana class, everything's OK.
// But cutToPieces is not yet defined...
// We're going to write this:
vector<EatableHandle> pieces = banana.cutToPieces(knife, pieces);
}
Now we'd click over cutToPieces and pick "add declaration"
and Visual Assist X will thoughtfully add the right signature to Banana.h file (possibly with a stub):
// in Banana.h
vector<EatableHandle> cutToPieces(Knife & knife, int pieces);
Then one could use the great "Create implementation" feature to implement the banana-cutting routine.
Being able to check output and input parameters as passed by reference and being const would also be a great feature.
Suppose now our project contains Worker class for people working in the kitchen, containing the Worker::taste(Tastable & food) function.
Now we continue working on our Kitchen::makeShake() method and do this:
void Kitchen::prepareShake() {
// Previous code as before.... shake variable contains the prepared shake.
// We type this:
worker.taste(shake);
}
Now clicking over worker we can use "Add field" or existing "create declaration"
This would add a Worker worker; member to the Kitchen class. Letting VAX figure the type of worker using the methods we used on this would be of tremendous help. If it couldn't resolve the type, a pop-up might be use where user can pick the type for the new field.
Same could be used for "Add local" / "Add parameter" features, being able to specify if we want to add Worker worker as a parameter to the current function (maybe by reference, as const?) or as a local variable initialized somewhere before.
ADD: While we're at it, can we make change signature also work by context? So if the caret is over the function banana.pe[]el() VA would recognize and let use change the signature of the peel function for the banana class.
This is essentially my vision of it, the goal is to let the editor figure most of the information about the symbol on its own, essentially letting the user focus on his code logic and not the technical details.
Hope that wasn't too long...
Thanks for reading,
Gennadiy