Kotlin: show inferred parameter type hint hotkey?
已回答
Is there an hotkey to quickly toggle inferred parameter types hints? That'd be very useful!
请先登录再写评论。
Currenlty it's possible to switch off all hints via "Help | Find Action". Type needed option (e.g. parameter hints) and change on/off value
I want to see inferred tipes with an hotkey:
val str = "something"
it shows at the hit of an hotkey this:
var str:String = "something"
Is this possible?
You could use "View | Quick Documentation" or "View | Expression Type" on "str" variable.
ctrl-shift-P is the short-cut I use for this on OS X
Note, for some reason the keyboard shortcut works, but the going via menu "View | Expression Type" does not for me
Configure the parameter hints exception list
By default, the exception list contains a number of pre-defined methods. You can remove a method from the list to see the hints for it, or add new methods hide their hints in the editor.
In the Settings/Preferences dialog (Ctrl+Alt+S), go to Editor | General | Appearance.
Next to the Show parameter name hints option, click Configure.
Select the necessary language from the Language list.
Add methods for which you don't want to see the hints to the Blacklist section.
You can also enable additional options for the hints at the bottom of the dialog. Then apply the changes and close the dialog.
go there and check all the checkbox in options
now i have
val i: Int = 10
Int is a hint
some time its not working and its because its so clear that 10 is int so it wont be specified
I think you people will love this: https://stackoverflow.com/questions/54851861/how-do-i-activate-type-annotations-hints-in-kotlin-like-depicted/54852497#54852497