This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Steps to reproduce: - create Args sample - open args.c - right-click on "i" variable and call Find Usages for it Result: FindUsages finds all occurences of "i" in the source file except its declaration (int i;).
But 'Find Usages' works same in Java pack. Is it bug? P2?
This is expected behavior. To be consistent with Java. Declaration is not Usages.
I believe that Java also behaves wrongly and we should file an issue against Find Usages in Java because in both C/C++ and Java a variable can be initialized within the declaration statement, e.g. int i = 0; or even int i = getVal(); where getVal() is a function returning int value.
I agree, that in Java you always have only one declaration and easily navigate to it by Ctrl-Click. In C/C++ there are could be a lot of declarations of the same function and it could be valid query to show all declarations as well. I think, we can introduce additional search criteria like: ... [ ] Find Usages [ ] Find Declarations ...
fixed. You are right for C++ the declaration is quite important, because they could be multiple or contains important initialization information. log: http://hg.netbeans.org/main?cmd=changeset;node=0002582302b4
Integrated into 'main-golden', available in NB_Trunk_Production #206 build Changeset: http://hg.netbeans.org/main/rev/0002582302b4 User: Vladimir Voskresensky <vv159170@netbeans.org> Log: fixed IZ#132571: Find Usages does not find variable declaration - Show C++ the declaration in Find Usages