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
It is common in editors to highlight a specific line or region of code, pass it through a formatter, and replace the highlighted region with the output of the formatter. If sqlformat-rs can support preserving the leading indentation of an expression, then it'd be possible to format nested subsections of a larger block of code without touching the rest of the file. This would make it easier to edit SQL where there are structural elements that sqlformat-rs doesn't support as well.
I am a pretty new rust programmer, but it looks like implementing this would involve adding a preserve_indent flag to FormatOptions, have the parser read in the amount of whitespace on the first line, and call increase_top_level with the right amount of indentation when reading the first line. Would that be correct?
The text was updated successfully, but these errors were encountered:
It is common in editors to highlight a specific line or region of code, pass it through a formatter, and replace the highlighted region with the output of the formatter. If sqlformat-rs can support preserving the leading indentation of an expression, then it'd be possible to format nested subsections of a larger block of code without touching the rest of the file. This would make it easier to edit SQL where there are structural elements that sqlformat-rs doesn't support as well.
I am a pretty new rust programmer, but it looks like implementing this would involve adding a
preserve_indent
flag toFormatOptions
, have the parser read in the amount of whitespace on the first line, and callincrease_top_level
with the right amount of indentation when reading the first line. Would that be correct?The text was updated successfully, but these errors were encountered: