roslyn icon indicating copy to clipboard operation
roslyn copied to clipboard

CodeLens: References to local functions are not displayed

Open vsfeedback opened this issue 1 year ago • 6 comments

This issue has been moved from a ticket on Developer Community.


Local functions inside methods doesn't display references in code as it will normally do with normal methods. Additionally, descriptions or summaries too doesn't work properly.

Here you can see the normal behaviour image.png

On the local function, no reference is displayed, neither is the summary. image.png

This makes the local functions not very user friendly if you have several of them.


Original Comments

Feedback Bot on 5/20/2024, 01:57 AM:

(private comment, text removed)

vsfeedback avatar May 23 '24 18:05 vsfeedback

This is a request for codelens to support local functions.

CyrusNajmabadi avatar May 23 '24 18:05 CyrusNajmabadi

@CyrusNajmabadi whom should we reach out to for this?

genlu avatar Jun 05 '24 20:06 genlu

Reached out to Luke and Chad (not sure of their github aliases)

ToddGrun avatar Jun 12 '24 21:06 ToddGrun

I looked a bit more and this is a feature request. I took a quick stab here (https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_git/VS/commit/862d6ae5f63873d5236269aa23ceb4f817f906ce), but I'm unsure whether to proceed as there are concerns that we should expose this as a tools->options flag to allow users to not have this behavior for local functions. Looked into the tools->options support, and hooking into the current location would not be trivial, that list is built up programatically, and doesn't have the concept of provider based options.

ToddGrun avatar Jun 13 '24 17:06 ToddGrun

Hello, is there any update about the progress on this feature request?

Ouro17 avatar Aug 28 '24 10:08 Ouro17

I talked with a couple team members, and there were reservations expressed as we have added (and later removed) similar functionality in the past due to negative feedback. The codelens support is unfortunately implemented across several codebases, and thus supporting features like this that would require tools->options support requires an effort we aren't yet ready to commit to for this feature.

ToddGrun avatar Aug 28 '24 13:08 ToddGrun

I'm adding my +1 vote for this. Local functions are a great tool, when used properly, and CodeLens would make them more usable.

cdg191 avatar Apr 08 '25 22:04 cdg191