Skip to content

Support for choices in snippets #17545

@thekalinga

Description

@thekalinga
  • VSCode Version:

Version 1.9.0-insider
Commit 32222e2
Date 2016-12-16T07:18:07.856Z
Shell 1.4.6
Renderer 53.0.2785.143
Node 6.5.0

  • OS Version:

Ubuntu 14.04

Currently there is no way to specify a simple choices in the templates which makes developers life easy when expanding templates

For eg.,

For bootstrap buttons, there are almost 6 types. If we need to support templates for bootstrap button, we need to add either 6 templates/a single template with the template variable class's default value as

<button class="btn btn-${1:default|primary|secondary|info|warning|danger}">$2</button>

While selecting this template, the user needs to delete the complete selection & type the required choice/selectively delete portions of this default value.

Instead, if snippets consider any value with pipe| separators to be choice & display a dropdown, then the user just need to use his up & down arrows in the keyboard/mouse click to select the actual choice.

This will improve the user experience for expanding templates significantly & improve developer productivity.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions