FsAutoComplete icon indicating copy to clipboard operation
FsAutoComplete copied to clipboard

Type test operator (:?) is unrecognized

Open jcmrva opened this issue 2 years ago • 1 comments

open System

type Example () =
    inherit Attribute ()

let attrs : Attribute list = 
    [ Example (); ObsoleteAttribute () ]

attrs |> List.filter (fun a -> a :? Example) |> List.length
_________________________________^^___ :(

No compile error / red squiggles, but the highlighting doesn't match and the tooltip request fails with the usual:

[Error - 11:28:38 PM] Request textDocument/hover failed. Message: No tooltip information Code: -32603

jcmrva avatar May 10 '22 03:05 jcmrva

There ended up being two parts to this:

  • we need to do some fallbacks to check if the thing being hovered is a keyword, and use the FCS-provided tooltips for those, and
  • FCS needs to learn about :? and provide a tooltip for it like it does many other sigils.

baronfel avatar Aug 07 '22 20:08 baronfel