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.
#47 (nbextras) ------------------------- 1) create ruby app 2) generate new unit tests 3) invoke Goto declaration on assert method; assert(false, 'Assertion was false.') 4) repeat it several times, sometimes you are navigated to breakpoint.rb, sometimes to asserions.rb cannot guess severity, did not found any other case, but P2 for sure..feel free to downgrade if you evaluate as a rare case...
Probably pop-up with possible destinations should be offered when it is not possible to infer exact type. Similarly to code-completion.
The difficulty here is that since Ruby has open classes, there are many declaration points for the same class - and while the method definitions may wary, with *restargs it's hard to know which method is the best fit. I've improved the algorithm a bit such that at least matches which are documented are preferred over undocumented ones. That still doesn't help choose between breakpoint.rb and assertions.rb. I have plans for additional heuristics to make this smarter, such as looking at the transitive closure of require statements to see which declaration is most likely the relevant one.
I might find some more heuristics which may help, but solving this in general probably won't happen for 6.0.
Reassigning this issue to newly created 'ruby' component.
I've improved things about as far as I can take it with the current approach (picking the "best" location which is heuristics based). The next step would be to offer a set of locations to the user when you try to go to declaration (a completion popup of some sort) showing all the matches. That's feature work though so marking as Enhancement.
Any chance the completion popup will make 6.0? I love this product, but so far for me this is its biggest shortcoming! (and BTW, Ruby DLTK handles this nicely...)
I have started some work on this that I will now take through the late UI changes process. To test, run with -J-Druby.show_all_decls=true IDE:------------------------------------------------- IDE: [10/21/07 10:25 AM] Committing started cvs server: scheduling file `PopupUtil.java' for addition cvs server: scheduling file `DeclarationPopup.java' for addition cvs server: scheduling file `DeclarationPopup.form' for addition cvs server: scheduling file `Bundle.properties' for addition cvs server: use 'cvs commit' to add these files permanently IDE: [10/21/07 10:25 AM] Diffing finished Checking in gsf/src/org/netbeans/modules/retouche/editor/hyperlink/GoToSupport.java; /cvs/ruby/gsf/src/org/netbeans/modules/retouche/editor/hyperlink/GoToSupport.java,v <-- GoToSupport.java new revision: 1.4; previous revision: 1.3 done RCS file: /cvs/ruby/gsf/src/org/netbeans/modules/retouche/editor/hyperlink/PopupUtil.java,v done Checking in gsf/src/org/netbeans/modules/retouche/editor/hyperlink/PopupUtil.java; /cvs/ruby/gsf/src/org/netbeans/modules/retouche/editor/hyperlink/PopupUtil.java,v <-- PopupUtil.java initial revision: 1.1 done RCS file: /cvs/ruby/gsf/src/org/netbeans/modules/retouche/editor/hyperlink/Bundle.properties,v done Checking in gsf/src/org/netbeans/modules/retouche/editor/hyperlink/Bundle.properties; /cvs/ruby/gsf/src/org/netbeans/modules/retouche/editor/hyperlink/Bundle.properties,v <-- Bundle.properties initial revision: 1.1 done RCS file: /cvs/ruby/gsf/src/org/netbeans/modules/retouche/editor/hyperlink/DeclarationPopup.form,v done Checking in gsf/src/org/netbeans/modules/retouche/editor/hyperlink/DeclarationPopup.form; /cvs/ruby/gsf/src/org/netbeans/modules/retouche/editor/hyperlink/DeclarationPopup.form,v <-- DeclarationPopup.form initial revision: 1.1 done RCS file: /cvs/ruby/gsf/src/org/netbeans/modules/retouche/editor/hyperlink/DeclarationPopup.java,v done Checking in gsf/src/org/netbeans/modules/retouche/editor/hyperlink/DeclarationPopup.java; /cvs/ruby/gsf/src/org/netbeans/modules/retouche/editor/hyperlink/DeclarationPopup.java,v <-- DeclarationPopup.java initial revision: 1.1 done Checking in editing/src/org/netbeans/modules/ruby/Bundle.properties; /cvs/ruby/editing/src/org/netbeans/modules/ruby/Bundle.properties,v <-- Bundle.properties new revision: 1.11; previous revision: 1.10 done Checking in editing/src/org/netbeans/modules/ruby/DeclarationFinder.java; /cvs/ruby/editing/src/org/netbeans/modules/ruby/DeclarationFinder.java,v <-- DeclarationFinder.java new revision: 1.20; previous revision: 1.19 done Checking in stubs/indexhelper/nbproject/build-impl.xml; /cvs/ruby/stubs/indexhelper/nbproject/build-impl.xml,v <-- build-impl.xml new revision: 1.2; previous revision: 1.1 done Checking in stubs/indexhelper/nbproject/genfiles.properties; /cvs/ruby/stubs/indexhelper/nbproject/genfiles.properties,v <-- genfiles.properties new revision: 1.2; previous revision: 1.1 done IDE: [10/21/07 10:25 AM] Committing finished
This is now resolved as part of issue 119586. While the actual "best guess" that the IDE comes up with can still vary it should be more stable now that it's sorting by filenames and more importantly sorting the alternatives by some heuristics and then asking the user which reference to go to.
Dude, you're totally awesome. Thanks!