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
We want to provide the option to set the maximal width of a line of code in the editor. A general consensus is that one line should not contain more than 80 characters.
As very long Expressions are not an exception in XQuery code, we need to provide line wrapping. We can do this either at the FormatWriter or CodeFormatter level. I.e., we either wrap on raw string input, or we insert extra newlines preemptively before nodes that would not fit on the current line anymore.
The former is easier to do but leaves less possibility to choose when to wrap.
The latter seems to be the way to go, but has several factors to take into consideration:
When "looking ahead" and checking whether the next node would need wrapping, it could be that the next node is huge and we should not wrap immediately before it, but somewhere inside it.
If no action is needed, the lookahead has already computed the formatting of the next node and we could use the result.
Recursive lookaheads can have a serious performance impact.
Usually the input is already wrapped in some way the user likes it - maybe the newlines in the input could also be considered when deciding where to wrap.
The text was updated successfully, but these errors were encountered:
We want to provide the option to set the maximal width of a line of code in the editor. A general consensus is that one line should not contain more than 80 characters.
As very long Expressions are not an exception in XQuery code, we need to provide line wrapping. We can do this either at the FormatWriter or CodeFormatter level. I.e., we either wrap on raw string input, or we insert extra newlines preemptively before nodes that would not fit on the current line anymore.
The former is easier to do but leaves less possibility to choose when to wrap.
The latter seems to be the way to go, but has several factors to take into consideration:
The text was updated successfully, but these errors were encountered: