Closed johnhuichen closed 8 months ago
The first one was because sometimes i would get code that changed formatting if you formatted more than once (i.e. some bug in stylua that made it not 100% completely formatted). I found running it twice made that never happen haha.
The second would probably work, I'd have to go check the code again to be sure though
I see, thanks TJ
Hello @tjdevries, I am digging around in this repo to see how I can help contribute to the Neovim project.
In foramt::lua, it calls stylua_lib::format_code twice to format the input string reference.
I don't really understand why format_code has to be called twice. When I removed the second call, the function still works fine.
Another minor question is the stylua_config. If it's always the same config, would it make more sense to use a constant instead of a function generator?