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

Consider token to limit the chains that are searched #2835

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gayanper
Copy link
Contributor

@gayanper gayanper commented Sep 5, 2023

This draft use a copy of ChainFinder to tryout using token to limit the number of chain produced by the the chain finder. Instead of increasing the chain size which could potentially go into more deeper search, this approach provides the capability to user to filter by the token to find the most relevant chains the user is searching for.

@gayanper gayanper marked this pull request as draft September 5, 2023 18:55
@gayanper
Copy link
Contributor Author

gayanper commented Sep 5, 2023

@rgrunber @jdneo @testforstephen @snjeza what do you think about this change ?

@rgrunber
Copy link
Contributor

rgrunber commented Sep 5, 2023

We could increase this, but as mentioned in #2730 (comment), I think we'll be limited by the performance of the chain search. Increasing the maximum chains might not necessarily mean more chains if we're always hitting the timeout, and returning no results. Part of the reason I kept it so small, is I felt there would be a limited number of chains that are useful.

@gayanper
Copy link
Contributor Author

gayanper commented Sep 6, 2023

I will have a look at that root cause to see if we can improve the type resolution over there in jdt.

@gayanper gayanper changed the title Increase the context entrypoint chain size Consider token to limit the chains that are searched Nov 13, 2023
@gayanper
Copy link
Contributor Author

@rgrunber Can you check my new way of tackling the same issue ? if it looks good, I can add the changes to jdt chain finder and use it in JDT LS, while we keep that open for JDT project adapt if there is any contributor for JDT.UI.

Copy link
Contributor

@rgrunber rgrunber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot from 2023-11-15 12-56-53

This would eliminate EMPTY_LIST. Are you ok with that for now ?

@gayanper
Copy link
Contributor Author

Screenshot from 2023-11-15 12-56-53

This would eliminate EMPTY_LIST. Are you ok with that for now ?

What if we make the token match case insensitive and let the completion filter handle the rest ? So if I type empty I should get both.

@gayanper
Copy link
Contributor Author

@rgrunber WDYT about latest changes ? If this looks good, would you prefer adding this changes to jdt.ui or should we keep a copy of ChainFinder in jdt.ls and evolve further here ?

- simplify the code by reusing CompletionProposalRequestor to create items
- add support for javadoc for chain completions
@gayanper gayanper force-pushed the increase-context-chain-size branch from c02861e to c214002 Compare March 21, 2024 17:23
@gayanper gayanper force-pushed the increase-context-chain-size branch from c214002 to a0d6d1e Compare March 21, 2024 17:42
@rgrunber
Copy link
Contributor

Could we use ChainFinder directly from jdt.core.manipulation. I'd be fine with merging directly in there if anything extra is needed.

@gayanper
Copy link
Contributor Author

Depends on eclipse-jdt/eclipse.jdt.ui#1282

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.

None yet

2 participants