From 2edfe5904b5505a7276557f7b75dda2fc5c0f96f Mon Sep 17 00:00:00 2001 From: Mitchell Hanberg Date: Sun, 17 Sep 2023 21:50:32 -0400 Subject: [PATCH] fix: ensure epmd is started (#221) --- lib/next_ls/application.ex | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/next_ls/application.ex b/lib/next_ls/application.ex index b250d7c9..135c6b2f 100644 --- a/lib/next_ls/application.ex +++ b/lib/next_ls/application.ex @@ -7,6 +7,16 @@ defmodule NextLS.Application do @impl true def start(_type, _args) do + case System.cmd("epmd", ["-daemon"], stderr_to_stdout: true) do + {_, 0} -> + :ok + + {output, code} -> + IO.warn("Failed to start epmd! Exited with code=#{code} and output=#{output}") + + raise "Failed to start epmd!" + end + Node.start(:"next-ls-#{System.system_time()}", :shortnames) children = [NextLS.LSPSupervisor]