Quite often I get into top-down programming mode, that is I write the code calling functions that don't exist yet, until I get my logic laid out ok, then go to implement the "helpers".
So I had in my code a call like this:
PrepareRequests(RequestArray,
BufferArray,
uRequests,
uRequestsPerFrame,
uMaxPacketsPerIsoRequest,
uRequestsWithMaxPackets);
I right clicked on the function name in the hope that VA would help me save some time by creating the function for me, but no luck; no refactorings were available on this name.
Then I selected the whole call and was happy to see that "Extract Method" was available. I imagined what would happen and indeed it played out exactly as such.
I gave the "new" function the same name (which was the intended name for me) and after clicking OK I got a new function created with a recursive call to itself and my original call stayed the same modulo the formatting... (I hated that).
It got all the parameter types perfectly (since all variables were declared properly) and it kept the exact same parameter order, which was *almost* perfect.
The three minor things that prevented perfection were:
(1) The function body got created in the header file (?!?!) that corresponded to the CPP file I was working on.
(2) The formatting in the initial call was converted to a one-liner call extending offscreen to column 2938435 (did I say I hate that?)
(3) The recursive call that I had to delete.
I don't know if correctly "creating function bodies for unknown functions based on a function call signature" is a refactoring you could consider adding, even as a variation to extract method, but it would be nice to have.
Warm Regards,
Dimitris Staikos