Nested Expressions
Hi,
I was trying to add Live Templates for javascript code (Angular.js) in Webstorm when I hit a roadblock. What I wanted to do was take the file name, which is snake-cased and convert it into a camelCase string, and set it to a Live Template variable. I tried setting the "Expression" for the variable as underscoresToCamelCase(fileNameWithoutExtension()). However, it did not work - I just got the snake-cased file name in the variable. Is it possible to nest expressions? If yes, what is the right way to do it? I have attached the screenshot of my preferences window for more context.
Thanks,
Prabin
Attachment(s):
Webstorm-LiveTemplate.png
请先登录再写评论。
Hi there,


Seems to be working just fine in PhpStorm v8.0.3 (build 139.1348) on Windows 7 -- should be equivalent of WebStorm v9.
I've tried this in .php and .js files with the same positive result.
Maybe it's specific to the Mac platform? Or maybe because it's too simple (only single variable as compared to yours)? Can you post your whole template body, please.
P.S.
I've got no Angular plugin installed .. in case if this can make any difference.
Thanks Andriy. I just noticed that I was doing something wrong. The filename in my case is snake cased with dashes not underscore. I did not see an expression which could replace dashes to camelCase. How can I add a custom expression?
In PhpStorm -- only via custom plugin coded in Java.
Similar kind of question: https://devnet.jetbrains.com/thread/461149