From 5556c6bc94fc6fc25ecc17b39397457914e74686 Mon Sep 17 00:00:00 2001 From: Ian Davies Date: Wed, 18 Jan 2017 21:49:47 -0800 Subject: [PATCH] Normalize the file before calling reload. Fixing: https://github.com/elixirkoans/elixir-koans/issues/138 By normalizing first we remove the IntelliJ specific suffix if it is present which allows the ".ex" extension to correctly match IntelliJ edited files. --- lib/watcher.ex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/watcher.ex b/lib/watcher.ex index 4d7aac1..bbfd390 100644 --- a/lib/watcher.ex +++ b/lib/watcher.ex @@ -3,7 +3,7 @@ defmodule Watcher do def callback(file, events) do if Enum.member?(events, :modified) do - reload(file) + file |> normalize |> reload if Tracker.complete? do Display.congratulate @@ -16,7 +16,6 @@ defmodule Watcher do if Path.extname(file) == ".ex" do try do file - |> normalize |> Code.load_file |> Enum.map(&(elem(&1, 0))) |> Enum.find(&Runner.koan?/1)