Format only what has changed (and not the whole file)
I frequently work in files that have parts which do not follow the current formatting rules. In these cases, I'd like the formatter to only run strictly for the parts of code that I have actually changed between now and the last time that I hit save. I imagine that this is also an optimization that would make the formatting faster as the formatter does not have to parse the entire file. Even though this _may_ cause inconsistency in the formatting, it would be a useful option to have. Perhaps one could get around the issue of formatting inconsistency at the boundaries of what has changed by formatting the minimum surrounding scope of the changed text.
This is just an idea and I'm posting this because I'd like to know the maintainer's thoughts on it.
0 条评论