File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -319,7 +319,10 @@ impl<'a> Formatter<'a> {
319319 TokenKind :: LineComment ,
320320 ] ;
321321
322+ const ADD_WHITESPACE_BETWEEN : & [ TokenKind ] = & [ TokenKind :: CloseParen , TokenKind :: Reserved ] ;
323+
322324 let inlined = self . inline_block . begin_if_possible ( self . tokens , self . index ) ;
325+ let previous_non_whitespace_token = self . previous_non_whitespace_token ( 1 ) ;
323326 let fold_in_top_level = !inlined
324327 && self . options . max_inline_top_level . is_some ( )
325328 && self
@@ -341,6 +344,11 @@ impl<'a> Formatter<'a> {
341344 self . trim_spaces_end ( query) ;
342345 }
343346
347+ if previous_non_whitespace_token. is_some_and ( |t| ADD_WHITESPACE_BETWEEN . contains ( & t. kind ) ) {
348+ self . trim_spaces_end ( query) ;
349+ query. push ( ' ' ) ;
350+ }
351+
344352 let value = match (
345353 self . options . uppercase ,
346354 self . options . ignore_case_convert . as_ref ( ) ,
Original file line number Diff line number Diff line change @@ -768,7 +768,7 @@ mod tests {
768768 id_registration
769769 ) (
770770 SELECT
771- IF(
771+ IF (
772772 dq.id_discounter_shopping = 2,
773773 dq.value,
774774 dq.value / 100
You can’t perform that action at this time.
0 commit comments