使IntelliJ标记所有参数而不仅仅是String参数 [英] Make IntelliJ label all arguments rather than just String arguments

查看:209
本文介绍了使IntelliJ标记所有参数而不仅仅是String参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IntelliJ 2017有一个很好的功能,它使用方法声明中的变量名称标记传递的参数/参数。但IntelliJ似乎只对文本( String )参数执行此操作。

IntelliJ 2017 has a nice feature where it labels the arguments/parameters being passed using the variable’s name from the method declaration. But IntelliJ seems to do this only for textual (String) arguments.

在这个例子中,注意第一个参数是如何进行无标记的(一对 Instant 对象和一个 UUID ),而第4&字符串文字的第五个参数标记为摘要:& 详细信息:

In this example, notice how the first there arguments go unlabeled ( a pair Instant objects and a UUID), while the 4th & 5th arguments of String literals are labeled summary: & detail:.

➠为什么只有一些参数而不是所有参数?逻辑逃脱了我。

➠ Why only some arguments rather than all arguments? The logic escapes me.

➠是否有人为所有参数制作IntelliJ显示标签?

➠ Is there someway to make IntelliJ display labels for all the arguments?

推荐答案

参数提示可在设置(Mac上的首选项)中配置编辑 | 一般 | 外观显示参数名称提示 - > 配置

Parameter hints are configurable in Settings (Preferences on Mac) | Editor | General | Appearance, Show parameter name hints -> Configure:

对于一些只会污染编辑器的基本方法(如getter,setter,equals,打印和记录):

They are intentionally disabled for some basic methods where they will only pollute the editor (like getters, setters, equals, printing and logging):

针对具体情况启用在具有相同类型选项的多个参数的情况下显示非文字。

For your specific case enable the Show for non-literals in case of multiple params with the same type option.

这篇关于使IntelliJ标记所有参数而不仅仅是String参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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