fsprojects / fsharp-language-server

Other
218 stars 37 forks source link

Hovering over DU types in match statement's does not produce a hover popup #106

Closed faldor20 closed 2 years ago

faldor20 commented 2 years ago
type A=
    |Potato of int
    |Apple of string
let a = Potato(2)
let c=
    match a with
    |Potato b-> b 
    // ^^ Should have hover popup

ionide does have these popups. Could be related to the reason that method definitions in classes also have no hover popups

faldor20 commented 2 years ago

This occurs only when the type is defined in the same file. I would guess this means the function we using to find the object we are hovering over only using typecheck data from other files.

That's wrong. The actual fix is to add a space between the '|' and the name eg

type A=
    |Potato of int
    |Apple of string

->

type A=
    | Potato of int
    | Apple of string
faldor20 commented 2 years ago

There is another related issue with renaming:

let a=(fun x-> x+1)

if you rename at the first instance of x it grabs the '-' as part of the name This appears to be because the - char isn't properly considered a seperator. eg x+1 renaming only grabs x x-1 grabs "x-1" as the original name

--edit After a little research this problem is entirely on the vscode side, no rename call is made to the LS untill the rename operation is completed

faldor20 commented 2 years ago

Fixed as of https://github.com/fsprojects/fsharp-language-server/commit/fb2ac39ef1f7239429942988e2615d1d81e8e6e3