From 69f09e013b76b4fef4f7cec3a946e8f768cf6e39 Mon Sep 17 00:00:00 2001 From: yeshan333 <1329441308@qq.com> Date: Tue, 11 Jun 2024 13:53:20 +0800 Subject: [PATCH] feat: Support vfox(version-fox) (#1096) --- apps/elixir_ls_utils/priv/launch.sh | 9 +++++++++ guides/incomplete-installation.md | 2 +- scripts/launch.fish | 9 +++++++++ scripts/launch.sh | 9 +++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/apps/elixir_ls_utils/priv/launch.sh b/apps/elixir_ls_utils/priv/launch.sh index b1358535e..7cbdc365f 100755 --- a/apps/elixir_ls_utils/priv/launch.sh +++ b/apps/elixir_ls_utils/priv/launch.sh @@ -58,6 +58,15 @@ else eval "$($(which rtx) activate "$preferred_shell")" else >&2 echo "rtx not found" + + >&2 echo "Looking for vfox executable" + if which vfox >/dev/null + then + >&2 echo "vfox executable found in $(which vfox), activating" + eval "$($(which vfox) activate "$preferred_shell")" + else + >&2 echo "vfox not found" + fi fi fi fi diff --git a/guides/incomplete-installation.md b/guides/incomplete-installation.md index 21d3daffe..3d8ae5500 100644 --- a/guides/incomplete-installation.md +++ b/guides/incomplete-installation.md @@ -3,7 +3,7 @@ Incomplete installations is a frequent cause of ElixirLS failures. Generally this is resolved by: -* Installing elixir and erlang via [ASDF](https://github.com/asdf-vm/asdf) or [MISE](https://github.com/jdx/mise) +* Installing elixir and erlang via [ASDF](https://github.com/asdf-vm/asdf) or [vfox (version-fox)](https://github.com/version-fox/vfox) or [MISE](https://github.com/jdx/mise) (recommended) * Installing a full version of Erlang/OTP via the package manager diff --git a/scripts/launch.fish b/scripts/launch.fish index ad0385f4c..b63c4fb0b 100644 --- a/scripts/launch.fish +++ b/scripts/launch.fish @@ -39,6 +39,15 @@ else "$rtx" env -s fish | source else echo "rtx not found" >&2 + + set vfox (which vfox) + if test -n "$vfox" + echo "vfox executable found in $vfox, activating" >&2 + + "$vfox" activate fish | source + else + echo "vfox not found" >&2 + end end end end diff --git a/scripts/launch.sh b/scripts/launch.sh index 10870ac70..5bc6d9cee 100755 --- a/scripts/launch.sh +++ b/scripts/launch.sh @@ -64,6 +64,15 @@ else eval "$($(which rtx) env -s "$preferred_shell")" else >&2 echo "rtx not found" + + >&2 echo "Looking for vfox executable" + if which vfox >/dev/null + then + >&2 echo "vfox executable found in $(which vfox), activating" + eval "$($(which vfox) activate "$preferred_shell")" + else + >&2 echo "vfox not found" + fi fi fi fi