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.
Setup: - there is a c++ class (InterpreterGenerator) declared in a .hpp file (InterpreterGenerator.hpp) - there is a method (lock_method()) declared in another .hpp file (interpreterGenerator_x86_32.hpp) - the second .hpp file is included inside first one, effectively resulting in declaring method InterpreterGenerator::lock_method() - there is an implementation of the method in .cpp file (src/cpu/x86/vm/templateInterpreter_x86_32.cpp) The problem: The body of the method cannot be navigated to with "Go to definition/declaration" and is not listed in the "Go to symbol" window. Instead "Go to definition/declaration" contains two entries: the global function "lock_method()" declared in interpreterGenerator_x86_32.hpp and "InterpreterGenerator::lock_method()" method declared at the same place. Note that "Go to declaration/definition" works correctly when cursor is positioned at method body at src/cpu/x86/vm/templateInterpreter_x86_32.cpp so apparently code model has at least one-way correct relation between these two locations. The problem seem to be systematic - there are other methods declared in a similar way and all of them exhibit the same problem The code the problem is found in is OpenJDK 8 The problem is found in both Netbeans 8.1 and development version 20151124
As the fix I propose to make ctrl+click navigation and Go To Symbol navigation consistent: - when ident under cursor is method call => IDE jumps by ctrl+click to definition (InterpreterGenerator::lock_method()) which is OK Let's make Go To Symbol to behave similarly: - when selected item in dialog is method => open it's definition when exists and declaration only as backup
fixed in enum, change set: a9938d0650ca
Created attachment 157844 [details] jar to verify
Fixed mostly: - now only 2 lines are shown in "Go To Symbol", one for .hpp and another one for .cpp. That is correct - both of these lines native to proper places. Good - however the lines only list function name and file location. The class name is missing, so the info misleads the the symbol is a function rather than a class method. Bad
Additional fix for comment #4. Change set in enum: ff5c22eedf80
Integrated into 'main-silver', will be available in build *201512220002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/a488e9027414 User: Alexander Simon <alexvsimon@netbeans.org> Log: fixed Bug #257158 goto method definition does not work when declared not in the same file as class (transplanted from a9938d0650ca4689a1a4bb81dbaac76b2cdab589)
Integrated into 'main-silver', will be available in build *201601120002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/9588666d0999 User: Alexander Simon <alexvsimon@netbeans.org> Log: fixed Bug #257158 goto method definition does not work when declared not in the same file as class - fix regression: however the lines only list function name and file location. The class name is missing, so the info misleads the the symbol is a function rather than a class method. Bad (transplanted from ff5c22eedf80aba195991c3de5314615c5c2a8b9)
Fixes of this bug: http://hg.netbeans.org/releases/rev/a9938d0650ca http://hg.netbeans.org/releases/rev/ff5c22eedf80
Verified in NetBeans 8.1 patch1 Now same functions can be found in "Go to Symbol" dialog.