PhpStorm 结合了多个预定义的实时模板函数

PhpStorm combine multiple Predefined Live Template functions

我有一个项目,我的文件在 "lisp-case"(连字符分隔)中,我想将文件名用作实时模板中的变量,但必须先将其转换为 CamelCase。

我发现您可以在 "Edit Template Variables" 下设置表达式 fileNameWithoutExtension(),还有一个名为 camelCase() 的函数应该可以将我的文件名转换为 CamelCase。但我无法弄清楚如何将这两者结合起来。我试过 camelCase(fileNameWithoutExtension()) 但不幸的是,那不起作用。

是否可以通过其他方式实现?

camelCase(fileNameWithoutExtension())

语法正确。

Is it possible to achieve this some other way?

请确保选中此变量的 Skip if defined 复选框。

If I try to wrap fileNameWithoutExtension() inside camelCase() and press enter to save the entry the window is closed but the change is not saved

这是一个 IDE 错误(https://youtrack.jetbrains.com/issue/IDEA-132965 -- 应该在当前 2017 年修复。1.x 版本)。

在任何情况下:要么在离开该字段之前按 Enter ... 或立即单击 OK 按钮(然后您可以重新打开此 window 做进一步的改变)。

Also, when editing the field it's rendered like a select box which is kind of weird. Maybe it's a bug in this specific version. I'm on PhpStorm 10.0.4 for Mac.

这里不是 Mac 用户..但它确实是一个可编辑的下拉框(它列出了所有可能的功能)。