tfausak / purple-yolk

:hatching_chick: A Haskell IDE for Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=taylorfausak.purple-yolk
MIT License
26 stars 2 forks source link

Support code formatting #4

Closed tfausak closed 3 years ago

tfausak commented 4 years ago

I often want to run my code through a formatter, whether that's Brittany, Ormolu, hindent, or something else. Purple Yolk should be able to do that for me, either on save or through a command. My preference is a command, but I can imagine that people want it done on save. I think VSCode even supports formatting as you type; I should see if I can support that.

tfausak commented 4 years ago

For starters I think it would be best to add a command to format the current file. The formatting command could be specified as an option, just like GHCi. I'm not sure if it should work directly on the file or deal with STDIN/STDOUT instead.

tfausak commented 3 years ago

https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting