File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -121,8 +121,14 @@ export default class Formatter {
121121
122122 // Opening parentheses increase the block indent level and start a new line
123123 formatOpeningParentheses ( token , query ) {
124- // Take out the preceding space unless there was whitespace there in the original query or another opening parens
125- if ( this . previousToken ( ) . type !== tokenTypes . WHITESPACE && this . previousToken ( ) . type !== tokenTypes . OPEN_PAREN && this . previousToken ( ) . type !== tokenTypes . LINE_COMMENT ) {
124+ // Take out the preceding space unless there was whitespace there in the original query
125+ // or another opening parens or line comment
126+ const preserveWhitespaceFor = [
127+ tokenTypes . WHITESPACE ,
128+ tokenTypes . OPEN_PAREN ,
129+ tokenTypes . LINE_COMMENT ,
130+ ] ;
131+ if ( ! preserveWhitespaceFor . includes ( this . previousToken ( ) . type ) ) {
126132 query = trimEnd ( query ) ;
127133 }
128134 query += token . value ;
You can’t perform that action at this time.
0 commit comments