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

Feature Request: allow an option or selection list #265

Closed
sigzero opened this issue May 31, 2018 · 4 comments
Closed

Feature Request: allow an option or selection list #265

sigzero opened this issue May 31, 2018 · 4 comments
Assignees

Comments

@sigzero
Copy link

sigzero commented May 31, 2018

It would be nice to be to able to present multiple items to select from when the snippet section is called.

For example, for a shell script, I would define a TODO list like:

# ${1|TODO,FIXME,BUG,XXX|} - ${2:synopsis}

I've taken the construct from how vscode does it. So using the pipe character to enclose a comma delineated list gives a popup list to make a selection from.

@ajzafar
Copy link
Collaborator

ajzafar commented Aug 17, 2018

This is already implemented in the completion branch. There are just a couple bugs that need working out before it's merged to master.

@ajzafar ajzafar self-assigned this Jan 1, 2024
@yann-morin-1998
Copy link

@ajzafar Any update for this "selection list in tab-stop"?

I have rebased the completion branch on top of the current master branch (after
fixing a very few trivial conflict issues due to the rebase), and from what I can see,
the selection is working as expected, for example with this snippet:

snippet applied
    Applied to ${1|master|next|backports}, thanks.

which gives the behaviour I would expect and like to have:

applied<TAB>
Applied to master, thanks
          |>master   <|
          | next      |
          | backports |

(For readability, I replaced colours with bars for the menu, and with >< for the selection).

Is there something else I can help with, to get this merged?

Thanks!

@ajzafar
Copy link
Collaborator

ajzafar commented Jun 4, 2024

@yann-morin-1998 I fixed a few bugs over the weekend. There are a few left, but they're going to take a bit more effort to fix, and they only show up when you try to use a mirror or an evaluation inside a selection option. (Well one is actually a problem independent of selections, when using a mirror of a placeholder with a nested placeholder.) They may somewhat work, but I've decided to merge the branch with the caveat that those combinations are not currently supported.

I'm going to go ahead and close this as the major feature is implemented, and I'm going to open new issues for the remaining bugs.

@yann-morin-1998
Copy link

@ajzafar That's wonderful, thanks a lot! 👍

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

No branches or pull requests

3 participants