Handle application already started

Closes https://github.com/gleam-lang/gleam/issues/4740
This commit is contained in:
Louis Pilfold 2025-07-03 14:07:54 +01:00
parent 46daa055c9
commit 9b62167c94
2 changed files with 7 additions and 5 deletions

View file

@ -219,6 +219,10 @@
single-line "View Source" anchors emit `#Lx` instead of `#Lx-x`.
([Aayush Tripathi](https://github.com/aayush-tripathi))
- The build tool can now compile packages that will have already booted the
Erlang compiler application instead of failing.
([Louis Pilfold](https://github.com/lpil))
### Language server
- It is now possible to use the "Pattern match on variable" code action on

View file

@ -114,11 +114,9 @@ compile_elixir(Modules, Out) ->
case Modules of
[] -> {true, []};
_ ->
log({starting, "compiler.app"}),
ok = application:start(compiler),
log({starting, "elixir.app"}),
case application:start(elixir) of
ok -> do_compile_elixir(Modules, Out);
log({starting, "compiler.app,elixir.app"}),
case application:ensure_all_started([compiler, elixir]) of
{ok, _} -> do_compile_elixir(Modules, Out);
_ ->
io:put_chars(standard_error, [Error, $\n]),
{false, []}