Search code examples
webstorm

Creating WebStorm 2016 live template with restricted list of inputs


While experimenting with Live Templates in WebStorm I found it impossible to create a live template which will give a restricted list of suggestions for a input variable:

For example:

console.$logTypes$("$message$");

$logTypes$ - can it be restricted to a list ['log', 'info', ...] ?


Solution

  • Tnx LazyOne, I have found a solution using the enum(...) template expression.

    Example:

    enum("log","info")