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

Add source method declaration lookups to the workspace symbol search. #1688

Merged
merged 1 commit into from
Apr 28, 2021

Conversation

rgrunber
Copy link
Contributor

Signed-off-by: Roland Grunberg rgrunber@redhat.com

I think the term "symbol" can include more than just type declarations. Pretty much any member should be included. With that said, including declarations from non-sources could bring up too many matches, so I've included just method declarations from source files.

method_decl_search

@rgrunber rgrunber marked this pull request as draft March 12, 2021 20:04
@rgrunber rgrunber self-assigned this Mar 12, 2021
@rgrunber rgrunber force-pushed the source-decl-lookups branch 2 times, most recently from b473195 to 4dbaa96 Compare March 21, 2021 20:49
@rgrunber rgrunber marked this pull request as ready for review March 21, 2021 20:49
@testforstephen
Copy link
Contributor

It looks good, but i want to know the impact on the performance since it will return more results with methods included. It's better to have some perf comparison on small, medium, large projects.

@rgrunber
Copy link
Contributor Author

I tried the following queries out on the eclipse.jdt.ls project. I cleaned the workspace between each new query and started only after all diagnostics were loaded. There were a lot of errors but seems like a good example to try.

The data is basically collected by timing the the 2 search engine calls.

query=i, 2476 type matches, 723 source method matches

Attempt Type Search Method (Source) Search
1st 651 ms 923 ms
2nd 226 ms 397 ms
3rd 170 ms 419 ms

query=is, 117 type matches, 540 source method matches

Attempt Type Search Method (Source) Search
1st 851 ms 559 ms
2nd 51 ms 342 ms
3rd 65 ms 467 ms

query=get, 54 type matches, 1858 source method matches

Attempt Type Search Method (Source) Search
1st 341 ms 2391 ms
2nd 52 ms 1827 ms
3rd 52 ms 1822 ms

The 1st request is the one taking longest, so once some initialization happens, most queries end up taking a lot less. The exception seems to be when there's just a large amount of source method matches.

- Use property java.symbols.includeSourceMethodDeclarations
- Add testcase

Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
@rgrunber rgrunber merged commit 58a0153 into eclipse-jdtls:master Apr 28, 2021
@rgrunber rgrunber deleted the source-decl-lookups branch April 28, 2021 17:40
@rgrunber rgrunber added this to the End April 2021 milestone Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants