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

merge action selector with action preview #2

Open
pidgeon777 opened this issue Mar 28, 2024 · 4 comments
Open

merge action selector with action preview #2

pidgeon777 opened this issue Mar 28, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@pidgeon777
Copy link

In the current implementation, when running a code action with preview, first you have to select the wished action, then you have another Telescope prompt displaying the preview. Finally, you have to press Enter to confirm the action.

It would be nice to add an option so that, as soon as you run the code action with preview command, the preview is displayed directly for each of the available actions, and pressing Enter would confirm the selected action.

Regarding the rename command, you could maybe use the Telescope prompt as new name input, showing the preview in Telescope:

  • On every keystroke (maybe non optimal)
  • When exiting insert mode
@jan-xyz
Copy link
Owner

jan-xyz commented Mar 28, 2024

That's necessary because most workspaceEdits consist of a list of TextEdits and you can select and choose to apply with <tab>. It will become more useful once I figure out how to best do the UX for displaying, previewing and selecting the individual TextEdits.

See also my comment here: #1 (comment)

@pidgeon777
Copy link
Author

A Neovim UI library has recently been released here, in case you find it useful:

https://www.reddit.com/r/neovim/comments/1bkb981/introducing_nuicomponents_a_library_that/

@jan-xyz
Copy link
Owner

jan-xyz commented Mar 28, 2024

Yes! That looks much more flexible than telescope! I will have a look, I was mostly running into telescope's limitations when working on the TextEdit selection. Let's see.

For later reference the documentation: https://nui-components.grapp.dev/

@jan-xyz
Copy link
Owner

jan-xyz commented Mar 28, 2024

Another note: I am planning to stay as close as possible for now to the standard implementation in Neovim for those functions to benefit from upstream bug fixes and improvements. It also means that I don't have control over the UX for inputting the new name in rename or the list of code actions. That all comes from Neovim. Currently, I'm only patching an internal method that would apply all changes and TextEdits without asking the user for selection. I might also change that to gain more control in the future for now my main concern is getting the preview and TextEdit selection right.

@jan-xyz jan-xyz changed the title [Enhancement] Merge action selector with action preview merge action selector with action preview Apr 6, 2024
@jan-xyz jan-xyz added the enhancement New feature or request label Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants