You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The thing is that we use yield so we never have all the results at once.
Also with the the ChainCompletor or something like that we could have other issues of duplicates later on.
So maybe a decorator at the end of the chain can ensure that all Suggestion are unique.
But we would still need to stop using yield for this decorator.
We can still use yield? It does mean tracking the suggestions and blocking those which are duplicates.
So we will have an internal collection of suggestions and do something like:
if (!$this->suggestionAlreadySent($suggestion)) {
yield$suggestion;
}
I guess so because suggestions will still be retrieved "as they come", my bad.
Also not sure if this is a problem with WorseReflection providing the same method twice...
I don't know and that's pretty much why I suggested to add the decorator at the last possible moment, so no matter which completor(s) is used the final result will be unique.
Activity
dantleech commentedon Mar 8, 2020
code is here
Could possibly use a decorator to filter dupliate entries.
camilledejoye commentedon Mar 9, 2020
The thing is that we use
yieldso we never have all the results at once.Also with the the
ChainCompletoror something like that we could have other issues of duplicates later on.So maybe a decorator at the end of the chain can ensure that all
Suggestionare unique.But we would still need to stop using
yieldfor this decorator.Not sure of what would be best...
dantleech commentedon Mar 9, 2020
We can still use
yield? It does mean tracking the suggestions and blocking those which are duplicates.dantleech commentedon Mar 9, 2020
Also not sure if this is a problem with WorseReflection providing the same method twice...
camilledejoye commentedon Mar 9, 2020
So we will have an internal collection of suggestions and do something like:
I guess so because suggestions will still be retrieved "as they come", my bad.
dantleech commentedon Apr 13, 2020
Fixed in #958
dantleech commentedon Apr 13, 2020
(https://github.com/phpactor/completion/blob/master/lib/Core/Completor/DedupeCompletor.php)
mamazu commentedon Feb 19, 2023
Should also be fixed.
dantleech commentedon Feb 19, 2023
have not seen this behavior in a long time.