-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e549f7d
commit c5ccab5
Showing
14 changed files
with
205 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,3 @@ out | |
node_modules | ||
.vscode-test/ | ||
*.vsix | ||
|
||
# We store the build artifacts from ElixirLS here | ||
/elixir-ls-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@echo off & setlocal enabledelayedexpansion | ||
|
||
SET ELS_MODE=debugger | ||
IF EXIST "%APPDATA%\elixir_ls\setup.bat" ( | ||
CALL "%APPDATA%\elixir_ls\setup.bat" > nul | ||
) | ||
|
||
SET MIX_ENV=prod | ||
elixir "%~dp0\quiet_install.exs" > nul | ||
elixir --erl "+sbwt none +sbwtdcpu none +sbwtdio none" "%~dp0\debugger.exs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Mix.install([ | ||
# {:elixir_ls, github: "elixir-lsp/elixir-ls", ref: "7f7ba8ac7ad518945f7622369d13c16f48568b30"} | ||
# ]) | ||
|
||
Mix.install( | ||
[ | ||
{:elixir_ls, path: "#{__DIR__}/../elixir-ls"}, | ||
], | ||
config_path: "#{__DIR__}/../elixir-ls/config/config.exs", | ||
lockfile: "#{__DIR__}/../elixir-ls/mix.lock" | ||
) | ||
|
||
# Mix.install( | ||
# [ | ||
# {:elixir_ls_debugger, path: "#{__DIR__}/../elixir-ls/apps/elixir_ls_debugger"}, | ||
# ], | ||
# config_path: "#{__DIR__}/../elixir-ls/config/config.exs", | ||
# lockfile: "#{__DIR__}/../elixir-ls/mix.lock" | ||
# ) | ||
|
||
ElixirLS.Debugger.CLI.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
# Launches the debugger. This script must be in the same directory as mix install launch script. | ||
|
||
readlink_f () { | ||
cd "$(dirname "$1")" > /dev/null || exit 1 | ||
filename="$(basename "$1")" | ||
if [ -h "$filename" ]; then | ||
readlink_f "$(readlink "$filename")" | ||
else | ||
echo "$(pwd -P)/$filename" | ||
fi | ||
} | ||
|
||
if [ -z "${ELS_INSTALL_PREFIX}" ]; then | ||
dir="$(dirname "$(readlink_f "$0")")" | ||
else | ||
dir=${ELS_INSTALL_PREFIX} | ||
fi | ||
|
||
export ELS_MODE=debugger | ||
exec "${dir}/launch.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@echo off & setlocal enabledelayedexpansion | ||
|
||
SET ELS_MODE=language_server | ||
IF EXIST "%APPDATA%\elixir_ls\setup.bat" ( | ||
CALL "%APPDATA%\elixir_ls\setup.bat" > nul | ||
) | ||
|
||
SET MIX_ENV=prod | ||
elixir "%~dp0\quiet_install.exs" > nul | ||
elixir --erl "+sbwt none +sbwtdcpu none +sbwtdio none" "%~dp0\language_server.exs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Mix.install([ | ||
# {:elixir_ls, github: "elixir-lsp/elixir-ls", ref: "7f7ba8ac7ad518945f7622369d13c16f48568b30"} | ||
# ]) | ||
|
||
Mix.install( | ||
[ | ||
{:elixir_ls, path: "#{__DIR__}/../elixir-ls"}, | ||
], | ||
config_path: "#{__DIR__}/../elixir-ls/config/config.exs", | ||
lockfile: "#{__DIR__}/../elixir-ls/mix.lock" | ||
) | ||
|
||
# Mix.install( | ||
# [ | ||
# {:language_server, path: "#{__DIR__}/../elixir-ls/apps/language_server"}, | ||
# ], | ||
# config_path: "#{__DIR__}/../elixir-ls/config/config.exs", | ||
# lockfile: "#{__DIR__}/../elixir-ls/mix.lock" | ||
# ) | ||
|
||
ElixirLS.LanguageServer.CLI.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
# Launches the language server. This script must be in the same directory as mix install launch script. | ||
|
||
readlink_f () { | ||
cd "$(dirname "$1")" > /dev/null || exit 1 | ||
filename="$(basename "$1")" | ||
if [ -h "$filename" ]; then | ||
readlink_f "$(readlink "$filename")" | ||
else | ||
echo "$(pwd -P)/$filename" | ||
fi | ||
} | ||
|
||
if [ -z "${ELS_INSTALL_PREFIX}" ]; then | ||
dir="$(dirname "$(readlink_f "$0")")" | ||
else | ||
dir=${ELS_INSTALL_PREFIX} | ||
fi | ||
|
||
export ELS_MODE=language_server | ||
exec "${dir}/launch.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#!/bin/sh | ||
# Actual launcher. This does the hard work of figuring out the best way | ||
# to launch the language server or the debugger. | ||
# | ||
|
||
# Running this script is a one-time action per project launch, so we opt for | ||
# code simplicity instead of performance. Hence some potentially redundant | ||
# moves here. | ||
|
||
# First order of business, see whether we can setup asdf-vm | ||
|
||
did_relaunch=$1 | ||
|
||
ASDF_DIR=${ASDF_DIR:-"${HOME}/.asdf"} | ||
|
||
asdf_vm="${ASDF_DIR}/asdf.sh" | ||
if test -f "${asdf_vm}" | ||
then | ||
# asdf-vm does not support the plain posix shell. Figure out | ||
# which one we need and relaunch ourselves with that. | ||
case "${did_relaunch}" in | ||
"") | ||
if which bash >/dev/null | ||
then | ||
exec "$(which bash)" "$0" relaunch | ||
elif which zsh >/dev/null | ||
then | ||
exec "$(which zsh)" "$0" relaunch | ||
fi | ||
;; | ||
*) | ||
# We have an arg2, so we got relaunched. Therefore, we're running in a | ||
# shell that supports asdf-vm. | ||
. "${asdf_vm}" | ||
;; | ||
esac | ||
fi | ||
|
||
# In case that people want to tweak the path, which Elixir to use, or | ||
# whatever prior to launching the language server or the debugger, we | ||
# give them the chance here. ELS_MODE will be set for | ||
# the really complex stuff. Use an XDG compliant path. | ||
|
||
els_setup="${XDG_CONFIG_HOME:-$HOME/.config}/elixir_ls/setup.sh" | ||
if test -f "${els_setup}" | ||
then | ||
. "${els_setup}" | ||
fi | ||
|
||
# Setup done. Make sure that we have the proper actual path to this | ||
# script so we can correctly configure the Erlang library path to | ||
# include the local .ez files, and then do what we were asked to do. | ||
|
||
readlink_f () { | ||
cd "$(dirname "$1")" > /dev/null || exit 1 | ||
filename="$(basename "$1")" | ||
if [ -h "$filename" ]; then | ||
readlink_f "$(readlink "$filename")" | ||
else | ||
echo "$(pwd -P)/$filename" | ||
fi | ||
} | ||
|
||
if [ -z "${ELS_INSTALL_PREFIX}" ]; then | ||
SCRIPT=$(readlink_f "$0") | ||
SCRIPTPATH=$(dirname "$SCRIPT") | ||
else | ||
SCRIPTPATH=${ELS_INSTALL_PREFIX} | ||
fi | ||
|
||
export MIX_ENV=prod | ||
# Mix.install prints to stdout and stderr and reads from stdin | ||
# we need to make sure it doesn't interfere with LSP/DAP | ||
elixir "$SCRIPTPATH/quiet_install.exs" 1> /dev/null 2> /dev/null < /dev/zero || exit 1 | ||
|
||
exec elixir --erl "+sbwt none +sbwtdcpu none +sbwtdio none" "$SCRIPTPATH/$ELS_MODE.exs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Mix.install([ | ||
# {:elixir_ls, github: "elixir-lsp/elixir-ls", ref: "7f7ba8ac7ad518945f7622369d13c16f48568b30"} | ||
# ]) | ||
|
||
Mix.install( | ||
[ | ||
{:elixir_ls, path: "#{__DIR__}/../elixir-ls"}, | ||
], | ||
config_path: "#{__DIR__}/../elixir-ls/config/config.exs", | ||
lockfile: "#{__DIR__}/../elixir-ls/mix.lock" | ||
) | ||
|
||
# Mix.install( | ||
# [ | ||
# {:language_server, path: "#{__DIR__}/../elixir-ls/apps/language_server"}, | ||
# ], | ||
# config_path: "#{__DIR__}/../elixir-ls/config/config.exs", | ||
# lockfile: "#{__DIR__}/../elixir-ls/mix.lock" | ||
# ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters