Search code examples
intellij-ideaphpstormwebstormlive-templates

PhpStorm Live Templates: variables that are in contact


I'm trying do define this live template:

/*jslint browser:true*/
/*global $module$, jQuery, angular*/
(function () {

    'use strict';

    angular.module('$module$').directive('$module$$name$', function () {
        return {
            restrict: 'A',
            templateUrl: '/$module$/views/$name$/$name$.html',
            controller: ['$scope',
                function ($scope) {
                    $END$
                }]
        };
    });

}());

But $module$$name expression couses silent error.

How to concatenate two variables in PhpStorm's Live Template?


Solution

  • Please watch/vote for http://youtrack.jetbrains.com/issue/IDEA-89020.

    You could also try to change the variable sequence so that you enter $module$ and $name$ in the place where they're separate, and the concatenated place is filled automatically. For that, you can define separate variables for the concatenation (Always stop at=false) and make their expressions equal to the values of $module$ and $name$ respectively.