简体   繁体   English

Android Studio / Intellij Idea:等同于选定方法提案的实时模板

[英]Android studio/Intellij Idea: live template equivalent for choosen methods proposal

For Toast , there's a live template (callable by CTRL+J) wich create this line of code: 对于Toast ,有一个实时模板(可通过CTRL + J调用)来创建以下代码行:

Toast.makeText(MyClass.this, "mytext", Toast.LENGTH_SHORT).show();

Where MyClass.this and "mytext" are easily editable by typing Enter (it's the principle of LiveTemplates in Android Studio/Intellij IDEA). 可以通过输入Enter轻松编辑MyClass.this"mytext" (这是Android Studio / Intellij IDEA中LiveTemplates的原理)。

Is there similar shortcut that "transform" methods proposition into "live templates" ? 是否有类似的捷径将“方法”命题转化为“实时模板”? For example, if i choose the second signature of append : 例如,如果我选择append的第二个签名:

<code>追加</ code>的方法列表

is it possible to get the same mechanism of live template for quickly typing parameters ? 是否可以使用相同的实时模板机制来快速键入参数?

Now i've found a keyboard shortcut that is approaching : Ctrl + P : show the parameters (and bold the current one). 现在,我发现了一个接近键盘快捷键:Ctrl + P:显示参数(并以粗体显示当前参数)。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM