Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search classes by partial name #2443

Open
raulvaldoleiros opened this issue May 5, 2022 · 16 comments
Open

Search classes by partial name #2443

raulvaldoleiros opened this issue May 5, 2022 · 16 comments

Comments

@raulvaldoleiros
Copy link

The goal is to search a class by partial name through find symbol.

Steps To Reproduce
  1. Create a class named UserInfo
  2. 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

@fbricon
Copy link
Collaborator

fbricon commented May 5, 2022

You should be able to do *Info or UInfo

@raulvaldoleiros
Copy link
Author

The UInfo worked, thanks for sharing.
image

But the *Info didn't worked, don't know if is a configuration.
image

@snjeza
Copy link
Contributor

snjeza commented May 5, 2022

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

@raulvaldoleiros
Copy link
Author

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.

@snjeza
Copy link
Contributor

snjeza commented May 5, 2022

@raulvaldoleiros could you attach your log - Enable Logging

@raulvaldoleiros
Copy link
Author

@snjeza thanks for the help, the files you requested:
Archive.zip

@rgrunber
Copy link
Member

rgrunber commented May 9, 2022

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: [
...
...

@fbricon
Copy link
Collaborator

fbricon commented May 10, 2022

I opened microsoft/vscode#149144 upstream

@tommai78101
Copy link

@fbricon That issue is closed as a duplicate. Not sure what has become of the current status for this issue right now.

@mozhuanzuojing
Copy link

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.

@rgrunber
Copy link
Member

In eclipse-jdtls/eclipse.jdt.ls#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.

@raulvaldoleiros
Copy link
Author

Anything that can be done here? 😢

@gayanper
Copy link
Contributor

gayanper commented Sep 7, 2022

@rgrunber @jdneo Could you help me to reach someone in vscode team to review this change microsoft/vscode#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 *.

@raulvaldoleiros
Copy link
Author

@rgrunber any update on this? :(

@rgrunber
Copy link
Member

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.

@raulvaldoleiros
Copy link
Author

ok, thanks for sharing

It feels we will never have it solved :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants