Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest changes to language_server.sh break startup on macOS #470

Closed
2 tasks done
optikfluffel opened this issue Feb 2, 2021 · 6 comments · Fixed by #471 or #473
Closed
2 tasks done

Latest changes to language_server.sh break startup on macOS #470

optikfluffel opened this issue Feb 2, 2021 · 6 comments · Fixed by #471 or #473

Comments

@optikfluffel
Copy link

Environment

  • Elixir & Erlang versions (elixir --version): Elixir 1.11.3 & Erlang 23.2.3
  • Operating system: macOS 10.15.7
  • Editor or IDE name (e.g. Emacs/VSCode): Sublime Text 3.2.2
  • Editor Plugin/LSP Client name: LSP-elixir

Troubleshooting

  • Restart your editor (which will restart ElixirLS) sometimes fixes issues
  • Stop your editor, remove the entire .elixir_ls directory, then restart your editor
    • NOTE: This will cause you to have to re-run the dialyzer build for your project

If you're experiencing high CPU usage, it is most likely Dialyzer building the PLTs; after it's done the CPU usage should go back to normal. You could also disable Dialyzer in the settings.

Logs

  1. If using a client other than VS Code, please try VSCode's "ElixirLS: Elixir support and debugger" extension. Does it reproduce your failure?
  2. Create a new Mix project with mix new empty, then open that project with VS Code and open an Elixir file. Is your issue reproducible on the empty project? If not, please publish a repo on Github that does reproduce it.
  3. Check the output log by opening View > Output and selecting "ElixirLS" in the dropdown. Please include any output that looks relevant. (If ElixirLS isn't in the dropdown, the server failed to launch.)
  4. Check the developer console by opening Help > Toggle Developer Tools and include any errors that look relevant.

Hey everyone, it seems your recent changes to language_server.sh broke something on macOS. If I revert those changes everything works fine again.

See sublimelsp/LSP-elixir#14 for details.

@lukaszsamson
Copy link
Collaborator

@optikfluffel can you try to debug wich call to dirname actually failing? I cannot reproduce that on macOS 10.15.7

@jtrees do you have an idea what may be broken in your PR?

@optikfluffel
Copy link
Author

optikfluffel commented Feb 2, 2021

@lukaszsamson when I put something like echo "in readlink_f" on top of the readlink_f function it never shows up, so my best guess would be that dir=$(dirname $(readlink_f "$0")) at the bottom is the one failing

sh-3.2$ readlink_f () {
>         echo "in readlink_f"
>   cd "$(dirname "$1")" > /dev/null
>   filename="$(basename "$1")"
>   if [ -h "$filename" ]; then
>     readlink_f "$(readlink "$filename")"
>   else
>     echo "$(pwd -P)/$filename"
>   fi
> }
sh-3.2$ dir=$(dirname $(readlink_f "$0"))
usage: dirname path
sh-3.2$ echo $dir

sh-3.2$ readlink_f
in readlink_f
/Users/me/

@axelson
Copy link
Member

axelson commented Feb 2, 2021

FYI, I'm going to just revert #471 for now. Then we can re-implement it in a more cross-platform compatible way.

@jtrees
Copy link
Contributor

jtrees commented Feb 2, 2021

@optikfluffel Where is elixir-ls in your filesystem? Does the path contain a space by any chance? Looks like I missed some important quotes in my previous PR. If that's the issue, then it should be fixed with #473.

@optikfluffel
Copy link
Author

@jtrees yes, there is a space in there. I just gave #473 a spin and it seems fine to me, thanks for the quick fix! :)

@jtrees
Copy link
Contributor

jtrees commented Feb 3, 2021

Great! And thanks for the speedy feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants