vscode-java
vscode-java copied to clipboard
Search classes by partial name
The goal is to search a class by partial name through find symbol.
Steps To Reproduce
- Create a class named UserInfo
- Find by symbol and type "Info", actual on the command input will be "#Info"
Current Result
Doesn't return the UserInfo class
Expected Result
UserInfo class available for selection
You should be able to do *Info or UInfo
The UInfo worked, thanks for sharing.
But the *Info didn't worked, don't know if is a configuration.
You can try to add the following JDT property:
org.eclipse.jdt.core.codeComplete.subwordMatch = enabled
See https://github.com/redhat-developer/vscode-java/wiki/Formatter-settings
Thanks for the suggestion, but it also didn't worked.
I created a file with the content
org.eclipse.jdt.core.codeComplete.subwordMatch=enabled org.eclipse.jdt.core/org.eclipse.jdt.core.codeComplete.subwordMatch=enabled
And set the java.settings.url property pointing to that file.
@raulvaldoleiros could you attach your log - Enable Logging
@snjeza thanks for the help, the files you requested: Archive.zip
I think this might be a bug. For *info
My logs clearly show the language server returning ~300 symbols of which a class I declared as "UserInfo", would be in the results. However, the client shows nothing.
[Trace - 2:16:12 p.m.] Sending request 'workspace/symbol - (185)'.
Params: {
"query": "*info"
}
...
...
[Info - 2:16:12 p.m.] May 9, 2022, 2:16:12 p.m. Symbol Search found 302 symbols.
[Trace - 2:16:12 p.m.] Received response 'workspace/symbol - (185)' in 31ms.
Result: [
...
...
I opened https://github.com/microsoft/vscode/issues/149144 upstream
@fbricon That issue is closed as a duplicate. Not sure what has become of the current status for this issue right now.
For two years, I thought I didn't have this function. When I promoted vscode-Java, it was also a suspected object, which was mistaken for not powerful enough. To sum up, this bug is a big obstacle.
In https://github.com/eclipse/eclipse.jdt.ls/issues/2084 , I've implemented wildcard, and qualfied searching. The problem is VS Code won't display any of the returned results :\ Even something like java.util.arr
doesn't show despite plenty of valid candidates.
I can merge it so that it's at least supported for any other clients but VS Code needs to relax the constraints on what's returned.
Anything that can be done here? 😢
@rgrunber @jdneo Could you help me to reach someone in vscode team to review this change https://github.com/microsoft/vscode/pull/159377. This change actually adds support for * in the search query. It passes the raw query into LS and then compare the results by trying to fix the score if the other side doesn't have a *.
@rgrunber any update on this? :(
Searching for partial class names works well as long as you don't use *
in the serach term. That's still a problem with how VS Code handles the results. I don't think we have any control over that. I just did :
[Trace - 07:47:16] Sending request 'workspace/symbol - (83)'.
Params: {
"query": "*list"
}
The language server responded with ~100 entries, but VS Code's workspace symbol search showed nothing.
ok, thanks for sharing
It feels we will never have it solved :(