无法将变量传递给RubyMine Live模板中的预定义函数 [英] Can't pass variable to predefined function in RubyMine Live Template

查看:117
本文介绍了无法将变量传递给RubyMine Live模板中的预定义函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个实时模板,其中第二个变量只是第一个变量的大写版本.预定义的函数capitalize(String)似乎正是我所需要的,但是我对如何实际传递变量一无所知.每次尝试在表达式中设置参数时,它都会重置为String.

模板格式:

我认为应该有效的方法:

但是,每次我跳出该字段时,它都会恢复为:

我如何获取class并将instance用作输入并将其大写?

解决方案

解决方案是在设置该字段后使用鼠标单击确定"按钮.请勿按Enter或Tab.

信用: https://youtrack.jetbrains.com/issue/IDEA-132965#comment = 27-850938

I am trying to create a live template where the second variable is simply an uppercased version of the first variable. The predefined function capitalize(String) seems like exactly what I need but I am at a loss as to how to actually pass the variable in. Every time I try to set the parameter in the expression, it just resets to String.

Template Format:

What I think should work:

But every time I tab out of the field, it just reverts to:

How do I get class to take instance as input and capitalize it?

解决方案

The solution is to hit the OK button with your mouse after setting the field. Do not hit enter or tab.

Credit: https://youtrack.jetbrains.com/issue/IDEA-132965#comment=27-850938

这篇关于无法将变量传递给RubyMine Live模板中的预定义函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆