Skip to content

Commit

Permalink
Revert "Use paths for code reloading"
Browse files Browse the repository at this point in the history
This reverts commit 9a542e1.
  • Loading branch information
the-mikedavis committed Jul 2, 2024
1 parent 9a542e1 commit ada3773
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions apps/els_lsp/src/els_code_reload.erl
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,25 @@ maybe_compile_and_load(Uri) ->
#{"node" := NodeOrNodes} when Ext == <<".erl">> ->
Nodes = get_nodes(NodeOrNodes),
Module = els_uri:module(Uri),
Path = els_utils:to_list(els_uri:path(Uri)),
[rpc_code_reload(Node, Module, Path) || Node <- Nodes],
[rpc_code_reload(Node, Module) || Node <- Nodes],
ok;
_ ->
ok
end.

-spec rpc_code_reload(atom(), module(), string()) -> ok.
rpc_code_reload(Node, Module, Path) ->
-spec rpc_code_reload(atom(), module()) -> ok.
rpc_code_reload(Node, Module) ->
case rpc:call(Node, code, is_sticky, [Module]) of
true ->
ok;
_ ->
Options = options(Node, Module),
?LOG_INFO(
"[code_reload] code_reload ~p (~p) on ~p with ~p",
[Module, Path, Node, Options]
"[code_reload] code_reload ~p on ~p with ~p",
[Module, Node, Options]
),
handle_rpc_result(
rpc:call(Node, c, c, [Path, Options]), Module
rpc:call(Node, c, c, [Module, Options]), Module
)
end.

Expand Down

0 comments on commit ada3773

Please sign in to comment.