Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can I turn on such a thing when the parameter names of the called method are displayed?

I use VS2019. May be it is built-in or some extension needed?

Screenshot:
https://yadi.sk/i/Gl1KEL3XkdrEKw[^]

What I have tried:

I suggest Resharper can do it, but may be some other ways exists?

When I code by myself, I do something like:
C#
TimeSpan ts = new TimeSpan(hours:0, minutes:10, seconds:0)
.
So, in my code it is easy to view what this values for.
But when I read other codes it is not so easy :)
Posted
Updated 2-Dec-21 5:44am
v2

Just use intellisense: if you don't have it enabled by default, just type the first bit:
TimeSpan ts = new TimeSpan(
And use CTRL+SHIFT+SPACE to bring it up. It'll show you each of the possible parameter sets you can call it with (5 in this case) with their names - but you only need the names if you must use name:value syntax to provide them "out of order".
TimeSpan ts = new TimeSpan(hours:0, minutes:10, seconds:0)
is the same as saying
TimeSpan ts = new TimeSpan(0, 10, 0)
as the parameters are supplied in the order shown by intellisense: hours first, then minutes, then seconds.
 
Share this answer
 
Comments
Михаил Солодков 2-Dec-21 17:41pm    
Thanks, but I asked about how to see such names in code that already exists.
Richard Deeming answered already.

Tools > Options > Text Editor > C# or Basic > Advanced
Select Display inline parameter name hints (experimental).
If you don't have ReSharper, you'll need at least VS2019 v16.8 or later:
Tools > Options > Text Editor > C# or Basic > Advanced
Select Display inline parameter name hints (experimental).
 
Share this answer
 
Comments
Михаил Солодков 2-Dec-21 17:37pm    
Thanks alot!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900