How do I get Inlay Hints to show?

Hi! I have Inlay Hints to show always. If I type Debug.Log(), it will not add the inlay hint. I'm trying to achieve the following:

1
9 comments

Can you give an example of where the inlay hints not working as you expect? It seems the inlay hints are working in the image provided.

0

Sure, for example in the screenshot below Inlay Hints are working except for "message:" in the Debug.Log. I know the m has to be enclosed with “” but if I do that, the “message:” inlay hint disappears and doesn't stay as you can see in the first screenshot above.

 

 

 

0

Interesting. I wrote a little function:

void Log(string message)
{
	throw new NotImplementedException();
}

Calling this won't show an inlay hint, but if you change the name from Log to Send (or whatever you want), it will show the inlay hint. I'm assuming this is some kind of exception made for methods with certain names, like “Log”, where the purpose of the parameter is very clear and understood.

Disclaimer: I do not work for JetBrains so this is all speculation.

0

I tried it but it still doesn't work. I unchecked “hide” options and changed everything to always show in settings.

0

I did some digging in settings and found:

Editor → Inlay Hints → C# → Parameter Name Hints →

  • Hide if intention of first parameter is clear from method name
  • Hide if intention of argument is clear from usage

I would think one of those settings would affect this functionality, but they do not.

EDIT: I just saw your comment about going down this same path.

0

I have these excluded:

0

I was looking at that exclusion list as well, but nothing matches Log*(string message).

0

Yeah. I am not sure what I am missing or doing wrong.

0

Suddenly this is a hardcoded behaviour for Log*(String,
If there is a method Log* with the first argument of type String, inlay hint will never be shown for this first parameter.

https://youtrack.jetbrains.com/issue/RIDER-115589/Inlay-hint-is-not-shown-for-the-first-argument-with-the-type-String-for-method-Log

0

Please sign in to leave a comment.