Description
Problem
variables created with the <-
operator in a for expression leak outside of the block
foos = []
for foo <- foos do
foo
end
f|
this will complete foo
and foos
.
Solution
This function inside _next_ls_private_compiler.ex
should be changed so that it treats the call more like def/defp in the case that the last argument is is a keywordlist that has :do
in it (has a do block)
In that case, the preceding 'args' are somewhat like parameters rather than arguments.
defp expand_local(meta, fun, args, state, env) do
# A compiler may want to emit a :local_function trace in here.
{args, state, env} = expand_list(args, state, env)
{{fun, meta, args}, state, env}
end