Skip to content

InputList allow multi selection #771

Closed

Description

@camilledejoye

Hi,
I think it would be great to be able to select multiple items in a list in some cases.
For example, when we want to override a method we can only choose one.
On the contrary when we want to add a use statement we want to only select one item.

My idea here is to add a parameter to the ListInput' class which will tell if the list accepts multiple items to be selected. So in the OverrideMethodHandler`, for example, we could set it to true.
Then in the Vim plugin we can pass another argument to the list functions to let them know about it.

It will have no impact on the vim inputlist but with fzf we can allow multiple selection.
The way fzf works, it will call the sink function for each selected item.
So one RPC call for each item.

Which allow to reuse existing handlers since we wouldn't have to modify them to accept multiple results.

I already have a proposal for the implementation:
https://github.com/elythyr/phpactor/tree/list-multi-selection
https://github.com/elythyr/rpc-extension/tree/list-multi-selection

Activity

  1. dantleech commented on Jun 8, 2019

    @dantleech
    Collaborator

    Yes, this would be really great!

    Do you want to make a PR for those changes? We can then take it further (I guess should be simple to support multiple ops in most in the RPC handlers).

  2. camilledejoye commented on Jun 8, 2019

    @camilledejoye
    ContributorAuthor

    The PR is ready on my forks.
    For the handlers, I guess it's just making a loop going through the parameters and reusing the new SourceCode object every time.

    I didn't want to change to many things at first, if you prefer this way I will do it, just let me know.
    Plus I don't have a global vision of all the handlers and if it's applicable to all of them.

    I will open a PR on this repository and the rpc-extension reposioty, and we can discuss this there.

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