I have found that SE is not finding all references when there is bad indenting in C++ code.
I have attached example code and also show it at the bottom of this message.
If "isPucCur" is highlighted and press "Ctrl+/", then in the first function, calc1(), only the declaration is found, the other uses are not found!
But if I change the indenting of the "if", as done in calc2(), highlight "isPucCurr" and press Ctrl+/, now it finds all references.
This is very annoying. I suppose I could beautify the file as a workaround, however there are many complications doing so.
The complication is that I am not responsible for this code, it is written and maintained by other developers who do not use SlickEdit. So I'm not able to commit the changes myself. However, I am a consumer of this code, and when I think it has a bug I make local modifications (but I cannot commit them, but I can suggest to the developers how to change). If I beautify the code as a workaround, then when I do a comparison of my changed file vs the reference file, so that I can show the developers the required changes, then all the beautification changes are also introduced. I could use my diff tool, Beyond Compare, to do the compare, as it can ignore minor differences, but then when I present the developers with my suggested changes, I will need to make another copy of the reference file with only my modifications, so kind of annoying.
I also work on a large code base that is modified by hundreds of developers who do not always indent properly. We use clearcase so all files are write-protected. I would need to perform large checkouts in order to beautify all source files, and if I deliver them into clearcase, the change of indenting can cause rebase conflicts when other developers rebase, so it is not really a good solution. I need to be able to browse the existing code base without having to beautify it.
This also happens in SE 20.0.1.3.
It would be best if SE's find references functionality did not trip up with bad indenting.
Below is the example code, and it is also attached.
// Example of not found with poorly indented if statement
int calc1(const int uid)
{
// HIGHLIGHT the "isPucCur" and press Ctrl+/
// only the declaration is found, the other uses are not found.
const bool isPucCur = true;
#ifdef DEBUG
if( uid == 4 )
{
printf ("\n\n=============================================================\n");
printf ("=============================================================\n");
}
#endif
if ( isPucCur )
{
isPucCur = false;
}
}
// Example of references found when if properly indented.
int calc2(const int uid)
{
// HIGHLIGHT the "isPucCur" and press Ctrl+/
// now all references are found
const bool isPucCur = true;
#ifdef DEBUG
if( uid == 4 )
{
printf ("\n\n=============================================================\n");
printf ("=============================================================\n");
}
#endif
if ( isPucCur )
{
isPucCur = false;
}
}