Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make IntelliJ label all arguments rather than just String arguments

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.

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:.

screens shot of a line of code with several arguments being passed in a constructor call

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

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

like image 252
Basil Bourque Avatar asked Sep 14 '25 15:09

Basil Bourque


2 Answers

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

show hints

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

configure hints

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

like image 110
CrazyCoder Avatar answered Sep 17 '25 06:09

CrazyCoder


Go to:

  • Editor > General > Appearance > Show parameter name hints

Click Configure then tick:

  • Show for non-literals in case of multiple params with the same type

And you'll see hints for the repeated usages of UUID and Instance, here's an example screenshot:

enter image description here

In answer to your specific questions:

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

IntelliJ is suppressing hints for the for the repeated usages of UUID and Instance.

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

You can control how IntelliJ hints by using Editor > General > Appearance > Show parameter name hints > Configure

like image 21
glytching Avatar answered Sep 17 '25 05:09

glytching