I find myself commonly doing the following operation.
- Feel the need for a new function in a class.
- Provide a basic declaration in header file. Start function definition in implementation file with the same signature.
- As the function gets built, realize the need for an additional argument to get the function to work.
- Update the signature in the implementation file. At this stage, since the function signatures don't match between header and implementation file, VSCode correctly points out a red squiggly about the mismatch.
As a result, all autocompletion and intellisense operations in the function for the new parameter stop.(Just checked on 1.60.0. While a red squiggly line continues to appear indicating mismatch, the intellisense for new arguments continues to be available in the implementation file.) - To fix this, go to header file and sync the signatures between declaration and definition.
An example of steps 3, 4 and 5 is presented in the gif below:
Steps 3, 4 and 5 are quite repetitive and predictable. Is there any way to get VSCode to simultaneously update the declaration as the function definition changes in terms of the arguments needed? So that Step 5 can be avoided atleast temporarily?
I do not know if there is a special name to this code writing process (Steps 3, 4 and 5). Is there any other way this process can be made more efficient/productive?
ETA: As mentioned above, I just checked on 1.60.0. While a red squiggly line continues to appear indicating mismatch, the intellisense for new arguments continues to be available in the implementation file. All of the class members continue to also be available. So, perhaps the best solution is to continue developing/coding the function in implementation file, and once, finally update the header file. Still, I do not know if doing so would break anything else in the meantime. For one, going from class header file declaration to definition will not work.
