Open CrowdHailer opened 3 years ago
I think this would be a useful refactoring tool for sure.
I think I would want it not in the formatter for a couple reasons. The first is that the formatter uses the untyped AST, so we would need to have a reverse-compiler process of some kind to go from typed to untyped code.
The second thing is that my experience of this in Go can be frustrating, especially if you don't have some automatic import insertion tool. Here's how it goes:
But yes let's have this automation in future.
Gleam makes re-factoring much easier, which is a win. But when rapidly changing how things are structure a quite reasonable about of time is spent updating the imports, particuparly
import gleam/option.{Some, None}
Returning an option or an error just seems to be one thing I change a lot. I have a lot of warnings like this
Potentially a
gleam clean
or just part of gleam format would be nice to remove theese