我正在使用 rubymine 7.1.4,我发现我无法创建新的实时模板。我尝试使用以下步骤创建实时模板
1. 转到首选项 -> 编辑器 -> 实时模板
2. 我选择“用户”组并单击右上角的“+”图标,然后选择“1 . 实时模板”
3. 我用“method_missing for decorators”填写“缩写”字段mmfd
和“描述字段”,然后用“模板文本”字段填写
def method_missing?(method_name, *args, &block)
@tweet.send(method_name, *args, &block)
end
def respond_to_missing?(method_name, include_private=false)
@tweet.respond_to?(method_name, include_private=false) || super
end
- 我单击“定义”并选择 Ruby 作为上下文。然后我点击确定按钮。然后我去了一个 ruby 文件编辑器并输入缩写“mmfd”,没有任何反应。我重新打开“实时模板”首选项页面,我创建的模板不见了。我也试过在编辑器中选择代码,然后执行“另存为实时模板”,填写缩写,这种方式也不起作用。