vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Implementation CodeLens (`ImpLens`)

Open Number-3434 opened this issue 1 year ago • 5 comments

The Issue

When implementing an interface / abstract class, it can be very obscure which members are actually implementing it.

Describe the solution you would like

Add a CodeLens above the member implementing the interface.

Here is an example of a CodeLens (the CodeLens is the small text saying references):

CodeLens References Example

The CodeLens ideally should have a special symbol next to it.


Example of desired CodeLens:

    Implements IEnumerable<int>

public bool MoveNext() => position < _people.Length;

Applicable Scenarios

Ideally, there should be a setting for this (disabled by default).

This will apply to any member that is an implementation of an interface / abstract class.

Number-3434 avatar Feb 10 '24 13:02 Number-3434

This feature is similar in spirit to a feature we implemented on the VS side - inheritance margin. image

VSCode unfortunately does not allow us to add that information in the margin, so we'd have to put it somewhere else (codelens being a potential option).

While I don't think we'll be tackling this in the short term, I'll leave this issue open to collect feedback as its definitely an interesting feature request.

dibarbet avatar Feb 13 '24 00:02 dibarbet

Implement the Type Hierarchy provider! https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_prepareTypeHierarchy

JoeRobich avatar Feb 13 '24 00:02 JoeRobich

Implement the Type Hierarchy provider!

What does that do?

Does it provide CodeLens?

Number-3434 avatar Feb 13 '24 13:02 Number-3434

What does that do?

The Java extension implements it and it provides links to go to Super/Sub-class from the quick info popup.

Image

JoeRobich avatar Feb 13 '24 17:02 JoeRobich

Okay, but I would still prefer a CodeLens as well, since I'm after a visual indication without having to use the hover.

Number-3434 avatar Feb 13 '24 19:02 Number-3434