dotnet / fsharp

The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
https://dotnet.microsoft.com/languages/fsharp
MIT License
3.84k stars 777 forks source link

tooltip for enums show `[<Struct>] type` instead of `enum` #16923

Open smoothdeveloper opened 4 months ago

smoothdeveloper commented 4 months ago

I noticed minor issue with tooltips, that affects both VS & Rider:

type Foo = 
| F = 1
| G = 2

Visual Studio (Version 17.10.0 Preview 1.0):

image

Rider (2024.1 EAP 8):

image

VS Code+Ionide (v7.18.2):

image

I believe it should show the same as in Ionide, or at least, not show struct.

vzarytovskii commented 4 months ago

Well, to be fair, enum is struct:

public abstract partial class Enum : ValueType ...

And since in F# we don't have a special keyword or shape for enums (apart from its declaration), it's not entirely incorrect to show it as struct type.