Open jonatanklosko opened 4 months ago
I'd like and would use this. Especially useful for libraries with macros usually used without parens that want to write documentation with Livebook. (Edit: I see this is the primary consideration talked about in the linked past discussion was well 😄)
I was the trigger for this issue over on slack a few days ago. I've been running into this with heex for building svg visualization in livebook, where the elixir code would format, but the heex markup wouldn't. Especially with tools like phoenix_playground components might become something more people build in livebook as well, even though this wasn't my usecase.
Currently Livebook formats the code without respecting any plugins or formatter options. We could add
Kino.formatter_options(...)
with options matching.formatter.exs
. The logic would be similar to themix format
task. In order to handle:import_deps
, we would need to traverse the dependencies and read their.formatter.exs
. There is no public API to do this for theMix.install/1
project, but we could possibly makeMix.in_install_dir/1
public in Elixir.For now this issue is mostly to track interest and use cases.
Also see prior discussion in #1212.