Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
I did work with VS2019 (C#) until last week.
The editor displayed the number of references to a property or method definition. Clicking the name of the property or method showed a clickable list of references.
I thought that to be a quite convenient feature.
Now I changed to VS2022 and I'm missing this feature. Does VS2022 no longer provide this feature or is it still available and needs only to enabled?
If so how to do it?

What I have tried:

I searched the MS documentaion but without success. I only did find the "Find All References"-command which I know and use(ed) when appropriate.
Posted
Updated 26-Apr-22 22:09pm

What you're loking for is called CodeLens. Enable it in Tools/Options and pick which sub-items you want.
I found it annoying at first in VS2019 but then I got used to it and found it very useful. Then I had to go and find in in VS2022 because it was off by default.
 
Share this answer
 
Comments
Member 13566383 27-Apr-22 4:26am    
That's exactly what I was looking for. Did solve my problem.
Member 13683075 22-Sep-22 6:50am    
FYI it's full path to settings:
Tools(from ribbon)->Options->Text Editor->All Languages->CodeLens->Enable CodeLens[Checkbox]
Member 13947949 24-Apr-23 16:48pm    
It fixed my issue in VS2022. Worked nicely! Thanks for it
It's still there: right click the name and select "Find All References" (or SHIFT+F12)

I don't remember a list ever coming up in the edit window as a popover with a name click in 2019 - perhaps it was an extension you had installed?
 
Share this answer
 
Comments
Member 13566383 27-Apr-22 4:26am    
Sorry OriginalGriff, that was not the answer I was looking for. As I already mentioned in my question I know the "Find All References" command and use it.
But often the feature I wanted to enable (and which is called CodeLens as I know now thanks to Phil J Pearsons's answer) is sufficient and more convenient.

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