Skip to content

Commit ac49272

Browse files
authored
fix(completions): handle macro edge cases (#495)
1 parent 3236e14 commit ac49272

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

priv/monkey/_next_ls_private_compiler.ex

+3-3
Original file line numberDiff line numberDiff line change
@@ -1440,21 +1440,21 @@ if Version.match?(System.version(), ">= 1.17.0-dev") do
14401440
# collect the environment from the parameters
14411441
# parameters are always patterns
14421442
{_, state, penv} =
1443-
for p <- params, reduce: {nil, state, env} do
1443+
for p <- List.wrap(params), reduce: {nil, state, env} do
14441444
{_, state, penv} ->
14451445
expand_pattern(p, state, penv)
14461446
end
14471447

14481448
# expand guards, which includes the env from params
14491449
{_, state, _} =
1450-
for guard <- guards, reduce: {nil, state, penv} do
1450+
for guard <- List.wrap(guards), reduce: {nil, state, penv} do
14511451
{_, state, env} ->
14521452
expand(guard, state, env)
14531453
end
14541454

14551455
# expand the blocks, there could be `:do`, `:after`, `:catch`, etc
14561456
{blocks, state} =
1457-
for {type, block} <- blocks, reduce: {[], state} do
1457+
for {type, block} <- List.wrap(blocks), reduce: {[], state} do
14581458
{acc, state} ->
14591459
{res, state, _env} = expand(block, state, penv)
14601460
{[{type, res} | acc], state}

0 commit comments

Comments
 (0)