haskell / haskell/play-haskell
Button for running a code formatter
- Dominant language
- Haskell
- Stars
- 160
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
To make the playground double as a place for trying out different Haskell code formatters without having to download and build them all, it would be nice to have a UI element to run your code through one of a couple of high-profile code formatters (ormolu, brittany, stylish-haskell, maybe even configurable fourmolu?, others?). How exactly this UI element should look, I'm not sure. It definitely shouldn't take up a lot of space if you're not using it.
Some things to think about:
- If the formatter runs on the server (probably), doing a formatting operation should also count (a little bit) against your spam score. How much should depend on how long a formatter takes to process some file; hopefully this is not very long usually?
- We should verify for each formatter in question that they not have any risk of actually _running_ part of the code being formatted (I'm thinking about too-clever handling of CPP or TH), because then that would be unsafe.
- It should hook into the undo/redo functionality of the Ace editor so that the user can undo the formatting easily.
Contributor guide
Research direction
Start by mapping the playground's UI and server-side execution flow, then examine how the Ace editor currently handles undo and redo. Evaluate the proposed Haskell formatters for safe server-side use, spam-score accounting, and a compact UI; done requires an agreed design and implementation scope covering those concerns.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- full-stack
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100