tweag / topiary

https://topiary.tweag.io/
MIT License
558 stars 27 forks source link

Automated reformatting on change in the playground #357

Closed torhovland closed 1 year ago

torhovland commented 1 year ago

Is your feature request related to a problem? Please describe. The playground currently uses a button to trigger reformatting. This could instead be triggered on change of input or query.

Make sure this behaves well when the user types quickly and the formatting is slow.

It's probably a good idea to use throttling here.

Describe the solution you'd like Interactive reformatting as I type in the input box.

Describe alternatives you've considered The current solution with a button is a simpler alternative. This could be combined with a keyboard shortcut, such as Ctrl+Enter, the way https://nickel-lang.org/playground does.

Additional context See https://ormolu-live.tweag.io, https://tree-sitter.github.io/tree-sitter/playground, and https://regex101.com for inspiration.

aspiwack commented 1 year ago

:thinking: maybe on-the-fly formatting in the playground would be an application of #363 .