omnisharp-roslyn icon indicating copy to clipboard operation
omnisharp-roslyn copied to clipboard

Add support for InlineValues

Open 333fred opened this issue 3 years ago • 4 comments

Adds support for calculating expressions for language clients to have debuggers show values inline. As part of this, I've added a few test helper utilities from roslyn to make test diffing much better for things that use AssertEx instead of Xunit's Assert, as it adds diffing and full text display.

InlineValues suffers from a small limitation in generic contexts: static fields and properties cannot be determined. We need to give an expression for the debugger to evaluate, and since we don't know the current generic type parameters we can't know how to do this.

API shape is based on https://code.visualstudio.com/api/references/vscode-api#InlineValuesProvider.

333fred avatar May 23 '21 01:05 333fred

In action:

InlineValues

333fred avatar May 23 '21 01:05 333fred

Currently, I return references on every line they occur. It might be a better design to only return the first instance of the reference that occurs inside the current viewport, or perhaps try to find the closest instance to the current line. The main concern with doing so would be that it's much harder to cache such results.

333fred avatar May 23 '21 04:05 333fred

@JoeRobich did you have any opinions on the design question around how many things to return?

333fred avatar Jun 09 '21 17:06 333fred

@JoeRobich did you have any opinions on the design question around how many things to return?

@333fred other implementations provide the values for each occurrence which seems like a fine place to start from.

JoeRobich avatar Jun 09 '21 21:06 JoeRobich

Closing this out as stale and not going to be implemented.

333fred avatar Jun 13 '23 21:06 333fred