Skip to content

improve commented placeholder ${number:#text} #106

@stardiviner

Description

@stardiviner

Sometimes I hope to add some description text into placeholder for placeholder default text. (Those description text should be auto removed, so use commented placeholder). But commented placeholder does not allow other formats.

The improved commented placeholder should can allow other placeholder format behind commented placeholder.
Here is an prototype: (The | is the cursor)

snippet if
    if ${1:#:condition:default text}
        ${2}
    endif

after expand the if snippet, it should looks like this:

if `<1:|#:condition:default text>`
    `<2>`
endif

If do not do anything, just jump to next placeholder, then the commented placeholder auto removed.

if default text
    |
endif

And I type something in placeholder 1. Then it becomes like this:

if typed text
    `<2>`
endif

Just like targeted placeholder ${1:TARGET:default text}.

What do you think ?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions