Search code examples
phpexpressionphpstormlive-templates

How to use expressions in PhpStorm Live Templates?


I would like to speed up my coding using PhpStorm's Live Templates. I am a bit frustrated, because it seems to have a bug (at least on my system), as I can not make use of variable expressions, as described in the manual and other tutorials.

Here are my 2 issues:

  1. I add an expression to a variable, then I want to delete it. I select it, delete it, hit Tab and it's back again => I don't know how to empty the expression field.

    enter image description here

  2. I would like to enter an item name once and use the capitalize expression to fill out another variable. I have seen this done in a LaraCast tutorial, but when I enter the variable name it just disappears (I press Tab after entering the variable - if I press Enter, it just closes the dialog box, but the variable is still not saved).

    enter image description here

Does anybody know what I am doing wrong or if this is actually a bug?


Solution

  • It's a known bug.

    https://youtrack.jetbrains.com/issue/IDEA-132965 -- watch this ticket (star/vote/comment) to get notified on progress.

    Right now instead of hitting Enter you should use "OK" or re-arange buttons -- this way the new value will be preserved.