Skip to content

Commit

Permalink
Supports parsing macro expansion as a function branch
Browse files Browse the repository at this point in the history
  • Loading branch information
shuying2244 committed Dec 9, 2024
1 parent b8724fb commit 1e547b7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/els_lsp/src/els_parser.erl
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,13 @@ analyze_function(FunName, Clauses0) ->

-spec function_args(tree()) -> {arity(), els_arg:args()}.
function_args(Clause) ->
Patterns = erl_syntax:clause_patterns(Clause),
Patterns =
case Clause of
{_, macro, _, _} ->
erl_syntax:macro_arguments(Clause);
_ ->
erl_syntax:clause_patterns(Clause)
end,
Arity = length(Patterns),
Args = args_from_subtrees(Patterns),
{Arity, Args}.
Expand Down

0 comments on commit 1e547b7

Please sign in to comment.