"Go to symbol" should prioritize local classes
I have local Start class in my source code. When I use "Go to symbol" dialog to navigate to that class and type "Start" I have a bunch of Start classes from different libs on the top of the list and my class on the bottom. The assumption should be that by default I am interested in my own class, so that class should be on the top of the list.
I think the client itself (VS Code ) is controlling this. We have had issues in the past simply getting the client to show certain symbols we felt should be included (eg. *) that the client interpreted literally. See also issues like https://github.com/microsoft/vscode/issues/98125 .
Here's the order of elements from the language server for a given example :
sun.security.tools.jarsigner.Main
com.sun.tools.script.shell.Main
jdk.jfr.internal.tool.Main
sun.net.httpserver.simpleserver.Main
com.sun.tools.jdeps.Main
sun.security.tools.keytool.Main
javax.swing.colorchooser.DefaultSwatchChooserPanel.MainSwatchListener
jdk.jpackage.main.Main
com.sun.tools.javac.Main
jdk.internal.misc.MainMethodFinder
com.sun.tools.javac.main.Main
com.sun.tools.javap.Main
jdk.tools.jlink.internal.Main
javax.swing.colorchooser.DefaultSwatchChooserPanel.MainSwatchKeyListener
com.sun.tools.javac.launcher.Main
jdk.tools.jimage.Main
jdk.tools.jmod.Main
sun.tools.jar.Main
org.example.Main
jdk.javadoc.internal.tool.Main
org.example.Main.main
sun.jvm.hotspot.utilities.WorkerThread.MainLoop
javax.swing.colorchooser.MainSwatchPanel
com.sun.tools.jdeprscan.Main
com.sun.tools.javac.launcher.Main.MainClassListener
and here's the actual displayed order :
I would love to see this corrected. It's waste of extra keystrokes, plus you end up with glassy eyes when what you expect is not sorted closes to the top, and you need to scan the entire unsorted list.
I use symbol lookup frequently to see other class APIs.
@rajinder-yadav Is it still an issue? It seems to work fine for me. My local com.example.deno.Start class comes 1st.
I even tried changing the package name to xom.* and it still shows on top.
@fbricon yes, the sorting looks correct, thanks!
@rajinder-yadav your screenshot is not showing local classes 1st. But if you think this is no longer an issue, I'll close this one.
@fbricon I think it's safe to close, there was no local Arrays in the project I did a check in. However I try again with a local class #Student and it seems to be sorted and appears at the top correctly.