Open WardenGnaw opened 6 months ago
We should not do this with IVsTextViewFilter. It's already problematic how that API works (using legacy VS concepts in a synchronous, non-cancellable fashion). New feature work should be done with modern approaches, including:
We could also consider this being an IAsyncEnumerable if the debugger would find it valuable to consume values one at a time. But returning an array of results is also fine.
we are asking for IVsTextViewFilter.GetDataTipText to be extended to include the function and its parameters in the returned pbstrText.
I don't think the result should be a string. We can just return an array of spans, indicating the sub-expressions of the total expression that could be independently invoked to get results to present in some fashion. This will also prevent unnecessary allocations (which could likely be very large given normal user expressions).
(Triaging) @WardenGnaw what is the priority on this from the debugger side?
Background and Motivation
In order to improve the experience of hovering over expressions in Visual Studio, the proposal here is for Roslyn to provide us the text that includes the full expression and potentially the whole statement with subexpressions that we could use to evaluate.
Proposed API
we are asking for
IVsTextViewFilter.GetDataTipText
to be extended to include the function and its parameters in the returnedpbstrText
.For example, hovering over the
F
in inbar.Foo("a", 1, 0x20).Bar('x', 3, Baz())
, should return the textbar.Foo("a", 1, 0x20)
.If we have chained method, we are looking for a new API building on top of
IVsTextViewFilter.GetDataTipText
that will give us the function call chain.For example, hovering over the
F
in inbar.Foo("a", 1, 0x20).Bar('x', 3, Baz())
, should return the textbar.Foo("a", 1, 0x20).Bar('x', 3, Baz())
.Usage Examples
Alternative Designs
None
Risks
Not sure