Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the debugger (elixir-editors#143)
* Fix the debugger The debugger was inadvertantly broken in elixir-editors#93 which the change from the deprecated ([2]) `Code.load_file/1` to `Code.require_file/1`. The compatability docs for 1.10 [1] list both `Code.require_file/1` and `Code.compile_file/1` as possible replacements for `Code.load_file/1`. In our case we need `Code.compile_file/1` instead of `Code.require_file/1` since `Code.require_file/1` tracks which files have been required and compiled and does not compile them more than once. Specifically the docs state: > If require_file/2 is called more than once with a given file, that file will > be compiled only once So since `Code.load_file/1` would always compile the file we need to use `Code.compile_file/1` rather than `Code.require_file/1`. When `Code.require_file/1` was used, the call in `ElixirLS.Debugger.Server.change_env/1` would have no effect because the file was previously required. By changing to `Code.compile_file/1` the project will always be reloaded by compiling it's `mix.exs` file. [1] https://hexdocs.pm/elixir/1.10.2/compatibility-and-deprecations.html#table-of-deprecations [2] elixir-lang/elixir#7201 * Add comments about usage of compile_file vs require_file
- Loading branch information