fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Enums not completing in match expressions in VS 17.8.2

Open charlesroddie opened this issue 2 years ago • 2 comments

  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).

charlesroddie avatar Jan 18 '24 20:01 charlesroddie

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.

psfinaki avatar Jan 19 '24 11:01 psfinaki

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.

charlesroddie avatar Jan 19 '24 13:01 charlesroddie