FsAutoComplete icon indicating copy to clipboard operation
FsAutoComplete copied to clipboard

Show underlying Types of alias Types

Open faldor20 opened this issue 3 years ago • 1 comments

This is a mirror of my issue for the ionide vscode extension. I was told here would be a more appropriate place to ask https://github.com/ionide/ionide-vscode-fsharp/issues/1417

Its very annoying when i make types alias's for ease of documentation/domain modeling and it then completely obscures what the underlying type actually is.

I would like an option to show the underlying types of aliases both in intellisense popups/hovering and also in the inline auto-generated type annotations

Example

type id = int
type location= id list
type hierarchy= Dictionary<location,item>

I think a good idea for type annotations and intellisene displaying would be something along these lines

|    alias   |{ underlying type alias v    alias v       }
hierarchy{Dictionary<location{id {int} list},item>}

or even just one level deep like:

| alias     | {   underlying type            }   
hierarchy{Dictionary<location,item>}

faldor20 avatar Sep 24 '20 04:09 faldor20

This is possible, but would be a lot of work. Currently, all tooltips are derived from the results of the checkResults.GetTooltipText API from FCS, which is pretty opinionated about resolving type aliases/abbreviations down to what their fully-resolved types are.

This could either be changed in FCS itself for this API (possibly with some kind of flag?) or we could shift our tooltip generation away from this all-in-one API and into a more custom tooltip generation logic, which is what Visual Studio does.

baronfel avatar May 08 '21 17:05 baronfel