Skip to content

Commit 904a3d1

Browse files
authored
fix(runtime): use correct path for bundled elixir (#448)
fix(runtime): remove unused variable warnings
1 parent fb8b005 commit 904a3d1

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

lib/next_ls/runtime.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ defmodule NextLS.Runtime do
131131
bindir = System.get_env("BINDIR")
132132
path = System.get_env("PATH")
133133
new_path = String.replace(path, bindir <> ":", "")
134+
new_path = elixir_bin_path <> ":" <> new_path
134135

135136
with dir when is_list(dir) <- :code.priv_dir(:next_ls) do
136137
exe =

priv/monkey/_next_ls_private_compiler.ex

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,7 @@ if Version.match?(System.version(), ">= 1.17.0-dev") do
12931293
{{:^, meta, [arg]}, state, %{env | context: context}}
12941294
end
12951295

1296-
defp expand({:->, _, [params, block]} = ast, state, env) do
1296+
defp expand({:->, _, [params, block]}, state, env) do
12971297
{_, state, penv} =
12981298
for p <- params, reduce: {nil, state, env} do
12991299
{_, state, penv} ->
@@ -1328,12 +1328,12 @@ if Version.match?(System.version(), ">= 1.17.0-dev") do
13281328

13291329
# self calling anonymous function
13301330

1331-
defp expand({{:., dmeta, [func]}, callmeta, args}, state, env) when is_list(args) do
1331+
defp expand({{:., _dmeta, [func]}, _callmeta, args}, state, env) when is_list(args) do
13321332
{res, state, _env} = expand(func, state, env)
13331333
{res, state, env}
13341334
end
13351335

1336-
defp expand({:in, meta, [left, right]} = ast, state, %{context: :match} = env) do
1336+
defp expand({:in, meta, [left, right]}, state, %{context: :match} = env) do
13371337
{left, state, env} = expand_pattern(left, state, env)
13381338
{{:in, meta, [left, right]}, state, env}
13391339
end
@@ -1471,7 +1471,7 @@ if Version.match?(System.version(), ">= 1.17.0-dev") do
14711471
{Enum.reverse(blocks), put_in(state.functions, functions), env}
14721472
end
14731473

1474-
defp expand_macro(_meta, Kernel, type, [{name, _, params}, blocks], _callback, state, env)
1474+
defp expand_macro(_meta, Kernel, type, [{_name, _, params}, blocks], _callback, state, env)
14751475
when type in [:def, :defp] and is_list(params) and is_list(blocks) do
14761476
{_, state, penv} =
14771477
for p <- params, reduce: {nil, state, env} do
@@ -1486,8 +1486,6 @@ if Version.match?(System.version(), ">= 1.17.0-dev") do
14861486
{[{type, res} | acc], state}
14871487
end
14881488

1489-
arity = length(List.wrap(params))
1490-
14911489
{Enum.reverse(blocks), state, env}
14921490
end
14931491

@@ -1574,7 +1572,7 @@ if Version.match?(System.version(), ">= 1.17.0-dev") do
15741572
{Enum.reverse(acc), state, env}
15751573
end
15761574

1577-
defp expand_list([h | t] = list, state, env, acc) do
1575+
defp expand_list([h | t], state, env, acc) do
15781576
{h, state, env} = expand(h, state, env)
15791577
expand_list(t, state, env, [h | acc])
15801578
end

0 commit comments

Comments
 (0)