Skip to content

Completion provide same results multple time #905

Closed

Description

@camilledejoye

image

As we can see the method doFoo is present twice, this appends with $second too.

Activity

  1. dantleech commented on Mar 8, 2020

    @dantleech
    Collaborator

    code is here

    Could possibly use a decorator to filter dupliate entries.

  2. camilledejoye commented on Mar 9, 2020

    @camilledejoye
    ContributorAuthor

    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.

    Not sure of what would be best...

  3. dantleech commented on Mar 9, 2020

    @dantleech
    Collaborator

    We can still use yield? It does mean tracking the suggestions and blocking those which are duplicates.

  4. dantleech commented on Mar 9, 2020

    @dantleech
    Collaborator

    Also not sure if this is a problem with WorseReflection providing the same method twice...

  5. camilledejoye commented on Mar 9, 2020

    @camilledejoye
    ContributorAuthor

    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.

  6. dantleech commented on Apr 13, 2020

    @dantleech
    Collaborator

    Fixed in #958

  7. mamazu commented on Feb 19, 2023

    @mamazu
    Contributor

    Should also be fixed.

  8. dantleech commented on Feb 19, 2023

    @dantleech
    Collaborator

    have not seen this behavior in a long time.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions