有没有办法自动填充参数名称? [英] Is there a way to auto-fill arguments names?
本文介绍了有没有办法自动填充参数名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我使用大量参数实例化类(或调用方法)时,我总是使用命名参数。但每次输入每个参数名称都很累:
When I instantiate classes (or call methods) with a large number of parameters I'm always using named arguments. But it's tiring to type each argument name every time:
data class User(val id: String,
val name: String,
val age: Int)
val user = User(id = "1", name = "John", age = 99)
IDEA可以预先填充这样的参数吗?
Can IDEA pre-fill parameters like this?
val user = User(
id = ,
name = ,
age =
)
推荐答案
请参阅以下请求:
- < a href =https://youtrack.jetbrains.com/issue/IDEABKL-6690\"rel =nofollow noreferrer> IDEABKL-6690 选择签名时自动完成代码
- IDEABKL-5496 自动填充实际的Java调用参数
- IDEABKL-6690 Automatic code completion when choosing a signature
- IDEABKL-5496 Auto-filling the actual Java call arguments
您可以通过添加 java.completion.argument.live.templat来启用实验性功能。 e = true
进入帮助|编辑自定义属性。
There is an experimental feature you can enable by adding java.completion.argument.live.template=true
into Help | Edit Custom Properties.
这篇关于有没有办法自动填充参数名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文