dsherret/code-block-writer

Add ability to specify max line length

dsherret opened this issue · 1 comments

This would be some way to specify a max length for the line and then signify where line breaks should occur.

I've decided that a full proof solution to this problem would impact the performance too much. This kind of enhancement is best left to code formatters and code block writer should be viewed as a printer instead.

For example, the solution I was thinking of would be to redesign this library to be completely lazy and construct a tree. Then at the end, the tree would be evaluated to decide how newlines should occur. Yeah, no way that's going to be fast and the consuming code would be very complicated.

Closing this.