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 @@ -326,7 +326,10 @@ impl<'a> Formatter<'a> {
326326 TokenKind :: LineComment ,
327327 ] ;
328328
329+ const ADD_WHITESPACE_BETWEEN : & [ TokenKind ] = & [ TokenKind :: CloseParen , TokenKind :: Reserved ] ;
330+
329331 let ( inlined, block_len) = self . inline_block . begin_if_possible ( self . tokens , self . index ) ;
332+ let previous_non_whitespace_token = self . previous_non_whitespace_token ( 1 ) ;
330333 let fold_in_top_level = !inlined
331334 && self . options . max_inline_top_level . is_some ( )
332335 && self
@@ -348,6 +351,11 @@ impl<'a> Formatter<'a> {
348351 self . trim_spaces_end ( query) ;
349352 }
350353
354+ if previous_non_whitespace_token. is_some_and ( |t| ADD_WHITESPACE_BETWEEN . contains ( & t. kind ) ) {
355+ self . trim_spaces_end ( query) ;
356+ query. push ( ' ' ) ;
357+ }
358+
351359 let value = match (
352360 self . options . uppercase ,
353361 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