You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As noted in #48, we seem to have some cases where a formatter's FormatRanges() will be invoked with an empty a:ranges. Either that, or we're unnecessarily checking for emptiness in the clang-format formatter.
Unless I'm missing something, this doesn't seem like it's useful; the interface with formatters should say that this is impossible, and we should remove the checks we have.
The text was updated successfully, but these errors were encountered:
I think I would want some kind of empty check in the clang-format code regardless, because otherwise there's a correctness issue: FormatRanges([X, Y]) means "format ranges X and Y", but FormatRanges([]) means "format entire buffer". Changing the empty check to a hard precondition and changing codefmt to never call with empty ranges should be fine.
As noted in #48, we seem to have some cases where a formatter's
FormatRanges()
will be invoked with an emptya:ranges
. Either that, or we're unnecessarily checking for emptiness in the clang-format formatter.Unless I'm missing something, this doesn't seem like it's useful; the interface with formatters should say that this is impossible, and we should remove the checks we have.
The text was updated successfully, but these errors were encountered: