Inline Hints not working properly?
Answered
Why are some inline hints not working? For example: in Classes it doesn't work var test = new myClass("......"), it's not showing :myClass in front of "test"
Please sign in to leave a comment.
Hi, this is intended.
The IDEA shows inlay hints for the local variables declared with the var keyword when the inferred type may not be clear from the right part of the assignment.
In your case, we can clearly see the `hist` is the `StringBuilder` from the right side.
Also showing the `var hist: StringBuilder = new StringBuilder("xxx)` seems unnecessary which shows the `StringBuilder` twice.
If you prefer to see the type on the left in this case too, you could try `File | Settings | Editor | General | Code Folding | Java | Replace 'var' with inferred type` and reopen this file again to see the applied effect.
Hi Lejia Chen, thanks a lot for your help. I enabled the option it told me, but it still doesn't work (I already restarted Computer/Intellij/File). I would really like this option to appear for me, it really helps me a lot!
@Lobotechtfm Hi, sorry for the delayed reply. That option should work directly from my testing.
What's your current IDEA version? Can you share a sample of that code file for reproducing? You could upload it here https://uploads.jetbrains.com/browse and share us the upload id.
Please also try to disable all downloaded plugins from `Settings/Preferences | Plugins | gear icon in the right of the "Installed" Tab | Disable All Downloaded Plugins` and restart the IDEA to see whether a plugin causes this problem. (You could reenable them all together in the same place)
Thanks.
