9

Closed

Editor error tooltips on a code block hide type information

description

From https://github.com/fsharp/fsharp/issues/349#issuecomment-63088611

In this screenshot code sample, I've (intentionally for this report) misplaced a parenthesis. Hovering over it to get type information about the code with the aim to correctly fix the bug, I instead just get the error message in the tooltip which isn't all what I need to know.

Image

I can tell that the type inferencer still knows what the types are because I can make a . after certain values and the UI presents the correct autocomplete options.

Can you show the type information as well even when an error is shown?

Thanks!

Here's another example where I really need Seq.append but I can't read the signature or help snippet of Seq.concat to realize it (of course, the mouse cursor just isn't captured by these printscrns):

Image
Closed Jan 27, 2015 at 7:10 PM by KevinRansom
Manage at github

comments

dsyme wrote Nov 14, 2014 at 5:43 PM

As I mentioned on the GitHub thread, if you go to the end of Seq.concat and press Ctrl-Space (in Visual Studio) then you should see the completion and type information.

That's often a workaround, but I agree the red squigglies are too long :)

Looking at the code above, another workaround to consider is to routinely use more "let" bindings and piping. The expressions look somewhat big and nested, which can make this particular problem have a big impact.

GCATNM wrote Nov 14, 2014 at 7:48 PM

Another workaround is setting the caret to a specific identifier in the code and using QuickInfo (Ctrl+K, Ctrl+I) to show the type information. But in the end, that's only a workaround as well, because you need to do it for each element you need to look at while trying to figure out what the actual problem is, and you still have no idea where the type mismatch occurs.

Using piping more (which I do a lot) doesn't alleviate the issue; for the "right" error, it will just set the whole pipe chain "aflame" because it can't make sense of the overall expression, although (likely most) parts of it are fine.

This is one of the few really painful parts of the current F# experience in Visual Studio, because you often have to make significant changes, like breaking up the pipe chain into intermediate values, to find the one place where the actual type mismatch is located.

latkin wrote Nov 26, 2014 at 4:36 PM

In C# in situations like this I think they continue to show the normal helper tooltip for the member, but then include the error message below in the same tooltip. Maybe we could do something similar, if we have access to all the information.

vaskir wrote Dec 27, 2014 at 2:16 PM

Yes, it's really painful. I'm also for combined tooltip (member info + error message).