When I am typing in new code and maybe make an error, I go back to correct my mistake and the red box around the change (from Clang I think) won’t go away until I close and reopen the file.
Is there some other way to get rid of that red box. Image attached.
This looks like the renaming smart tag that should normally appear when you rename a function declaration (it would let you automatically adjust the references). If it’s triggering on a function call, most likely you did not include the header file with the function declaration, so Clang treats your call as an implicit declaration. Please include the correct header file in your sources to fix this.
Thanks for the suggestion but that cannot be the problem because it happens when I type a function for the first time. As I said if I make a mistake typing the function name, then go back to correct it the red box appears and will not go away until I close the file and reopen it. At the time there is no header file that has the function name.
Easy to reproduce:
type “void aFuntion(void)
Before hitting enter go back and correct the function name to be “aFunction”
go to end of the line and hit enter
Now you have red box until closing and reopening the file.
I would accept the explanation if the red box could be removed without having to close the file, that does not seem like proper behavior and it counter-productive when one is writing code. Clicking on the “light bulb” options does not remove it.
This is by design – VisualGDB normally keeps automatic rename smart tags for 3 last edits. You can disable this by setting this limit to 0 as shown below:
Please note that you would need to reopen your project after changing this setting.
This will disable renaming triggered by editing the code. You will be still able to rename the functions and variables via Edit->Refactor->Rename (or by pressing Ctrl-R, R).