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.9k stars 783 forks source link

Enums not completing in match expressions in VS 17.8.2 #16553

Open charlesroddie opened 9 months ago

charlesroddie commented 9 months ago
  1. type in this code, with the last character the .:
fsharp
type E =
    | Aaa = 0
    | Bbb = 1
    | Ccc = 2

let f(t: E) =
    match t with
    | E.

Expected behaviour: a tooltip pops up allowing the user to select from Aaa, Bbb or Ccc.

  1. Type A

Expected behaviour: a tooltip popups up allowing the user to select Aaa.

Actual behaviour: no completion list shows at either point.

image

Discriminated unions do not have this problem.

Enums defined in dotnet code and consumed in F# seem to have problem 1 but not problem 2. But I only tested one example (SqlDataType).

psfinaki commented 9 months ago

Well I wouldn't classify this as a bug but rather as a missing feature :)

AFAIR @kerams implemented IntelliSense for DUs somewhen last year. Maybe it's not hard to implement this functionality on top of that.

charlesroddie commented 9 months ago

There must be something which removed this as we had these DU/enum completions for a very long time, perhaps since F# 1.0. So DU completions were definitely not implemented last year unless it was a reimplementation.

I know there was work done to avoid showing irrelevant completions recently so perhaps this was a regression resulting from that.