Skip to content

Commit

Permalink
fix(javascript): function expression
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Apr 10, 2024
1 parent 3dd4973 commit 69ea21e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lua/splitjoin/languages/ecmascript/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ function ECMAScript.split_function(node, options)
local type = child:type()
if type == 'formal_parameters' then append(get_text(child))
elseif type == 'statement_block' then append(' {\n',indent, get_text(child):gsub('^{%s*', ''):gsub('%s*}$', ''), '\n}')
elseif type == 'function' then
append('function')
elseif type == 'function_expression' then
append('function_expression')
if node:type() == 'function_declaration' then
append(' ')
end
Expand Down
2 changes: 1 addition & 1 deletion queries/javascript/splitjoin.scm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

; functions
(function_declaration) @splitjoin.javascript.function.declaration
(function) @splitjoin.javascript.function.lambda
(function_expression) @splitjoin.javascript.function.lambda
(arrow_function) @splitjoin.javascript.function.arrow
(arguments) @splitjoin.javascript.function.arguments
(formal_parameters) @splitjoin.javascript.function.parameters
Expand Down

0 comments on commit 69ea21e

Please sign in to comment.