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
@@ -339,6 +342,11 @@ impl<'a> Formatter<'a> {
339342 self . trim_spaces_end ( query) ;
340343 }
341344
345+ if previous_non_whitespace_token. is_some_and ( |t| ADD_WHITESPACE_BETWEEN . contains ( & t. kind ) ) {
346+ self . trim_spaces_end ( query) ;
347+ query. push ( ' ' ) ;
348+ }
349+
342350 let value = match (
343351 self . options . uppercase ,
344352 self . options . ignore_case_convert . as_ref ( ) ,
Original file line number Diff line number Diff line change @@ -740,7 +740,7 @@ mod tests {
740740 id_registration
741741 ) (
742742 SELECT
743- IF(
743+ IF (
744744 dq.id_discounter_shopping = 2,
745745 dq.value,
746746 dq.value / 100
You can’t perform that action at this time.
0 commit comments