itowlson / fsharp-vs-commands

Commands for working with F# in Visual Studio
5 stars 2 forks source link

Selected methods disappear after formatting #4

Closed vasily-kirichenko closed 11 years ago

vasily-kirichenko commented 11 years ago
module M

type T () = 
    let items = []
    member x.Reorder () = 
        items |> List.iter ignore

If I format the following selection: image The method entirely disappears: image

dungpa commented 11 years ago

I think I understand the reason.

Fantomas can't parse the method alone and produce an empty parse tree, leading to empty results.

Tentative solution (which I will try to implement next week):

I think there are other scenarios which require certain heuristics to be processed correctly. Your bug reports help a lot in this regard.

dungpa commented 11 years ago

@vasily-kirichenko Thanks for reporting this. I published Fantomas v0.9.6 which should fix the bug and the other one in #5. Can you please check?

vasily-kirichenko commented 11 years ago

Fixed in Fantomas 0.9.6