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

VSCode debugger does not start #12

Closed
hjalet opened this issue Sep 20, 2017 · 9 comments
Closed

VSCode debugger does not start #12

hjalet opened this issue Sep 20, 2017 · 9 comments

Comments

@hjalet
Copy link

hjalet commented Sep 20, 2017

Hi,

I have a problem with debugging in vscode using elixir-ls. I have setup the launch.json config as described in your post:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "mix_task",
            "name": "mix run",
            "task": "run",
            "request": "launch",
            "projectDir": "${workspaceRoot}"
        },
        {
            "type": "mix_task",
            "name": "mix test",
            "request": "launch",
            "task": "test",
            "taskArgs": ["--trace"],
            "projectDir": "${workspaceRoot}",
            "requireFiles": [
                "test/**/test_helper.exs",
                "test/**/*_test.exs"
            ]
        }
    ]
}

I use elixir 1.4.5:

$ elixir --version
Erlang/OTP 19 [erts-8.3] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

Elixir 1.4.5

I suspect that it is somehow caused by the fact that I have installed asdf, since it has worked an an earlier point in time before I installed it.

When trying to start the debugger it simply hangs and nothing happens. The debugger goes into wait mode, waiting for the launch action, but it simply stays there. The output from elixir ls does not provide much info I think:

[Info  - 8:50:02 AM] Child Logger.ErrorHandler of Supervisor Logger.Supervisor started
Pid: #PID<0.77.0>
Start Call: Logger.Watcher.watcher(:error_logger, Logger.ErrorHandler, {true, true, 500})
Restart: :permanent
Shutdown: 5000
Type: :worker
[Info  - 8:50:02 AM] Application logger started at :nonode@nohost
[Info  - 8:50:02 AM] Child ElixirLS.LanguageServer.Builder of Supervisor ElixirLanguageServer.Supervisor started
Pid: #PID<0.82.0>
Start Call: ElixirLS.LanguageServer.Builder.start_link(ElixirLS.LanguageServer.Builder)
Restart: :permanent
Shutdown: 5000
Type: :worker
[Info  - 8:50:02 AM] Child ElixirLS.LanguageServer.Server of Supervisor ElixirLanguageServer.Supervisor started
Pid: #PID<0.83.0>
Start Call: ElixirLS.LanguageServer.Server.start_link(ElixirLS.LanguageServer.Server)
Restart: :permanent
Shutdown: 5000
Type: :worker
[Info  - 8:50:02 AM] Child ElixirLS.IOHandler of Supervisor ElixirLanguageServer.Supervisor started
Pid: #PID<0.84.0>
Start Call: ElixirLS.IOHandler.start_link(ElixirLS.LanguageServer.Server, [name: ElixirLS.LanguageServer.IOHandler])
Restart: :permanent
Shutdown: 5000
Type: :worker
[Info  - 8:50:02 AM] Application language_server started at :nonode@nohost

Any good ideas would be appreciated.
Thanks

@teamon
Copy link

teamon commented Sep 28, 2017

Hi,

I have the exact same case with elixir installed via homebrew

λ elixir --version
Erlang/OTP 20 [erts-9.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Elixir 1.5.1

ElixirLS output

[Info  - 2:03:29 PM] Child Logger.ErrorHandler of Supervisor Logger.Supervisor started
Pid: #PID<0.80.0>
Start Call: Logger.Watcher.start_link({:error_logger, Logger.ErrorHandler, {true, true, 500}})
Restart: :permanent
Shutdown: 5000
Type: :worker
[Info  - 2:03:29 PM] Application logger started at :nonode@nohost
[Info  - 2:03:30 PM] Child ElixirLS.LanguageServer.Builder of Supervisor ElixirLanguageServer.Supervisor started
Pid: #PID<0.85.0>
Start Call: ElixirLS.LanguageServer.Builder.start_link(ElixirLS.LanguageServer.Builder)
Restart: :permanent
Shutdown: 5000
Type: :worker
[Info  - 2:03:30 PM] Child ElixirLS.LanguageServer.Server of Supervisor ElixirLanguageServer.Supervisor started
Pid: #PID<0.86.0>
Start Call: ElixirLS.LanguageServer.Server.start_link(ElixirLS.LanguageServer.Server)
Restart: :permanent
Shutdown: 5000
Type: :worker
[Info  - 2:03:30 PM] Child ElixirLS.IOHandler of Supervisor ElixirLanguageServer.Supervisor started
Pid: #PID<0.87.0>
Start Call: ElixirLS.IOHandler.start_link(ElixirLS.LanguageServer.Server, [name: ElixirLS.LanguageServer.IOHandler])
Restart: :permanent
Shutdown: 5000
Type: :worker
[Info  - 2:03:30 PM] Application language_server started at :nonode@nohost

Anything that could point to direction where to look for solution/explanation would be highly appreciated.

@teamon
Copy link

teamon commented Sep 28, 2017

Ok, I got it working with homebrew elixir 🎉

The issue was another debugger process running inside Atom.

@jayjun
Copy link
Contributor

jayjun commented Oct 23, 2017

Debugger does not start in 0.2.2 (same symptoms). Tried with Elixir 1.5.2 and 1.6.0 master installed via Homebrew and kiex.

@idyll
Copy link

idyll commented Oct 23, 2017

I am having the same issues as well in VS Code 1.17.2.

I am using homebrew and Elixir 1.6.0 pre

@JakeBecker
Copy link
Owner

Apologies everyone! This was a stupid bug I caused in the latest release. Please update the extension to 0.2.3 in the VS Code marketplace and that should fix it.

It's hard to catch bugs in the launcher code with the ExUnit tests, since Mix starts the apps automatically in development. I'm working on more robust ways of packaging and launching the language server and debugger.

@jayjun
Copy link
Contributor

jayjun commented Oct 25, 2017

@JakeBecker Fixed! Not stupid at all, appreciate your great work.

@hjalet
Copy link
Author

hjalet commented Oct 25, 2017

@JakeBecker Thanks for looking into this. I am however having the exact same problems as before updating to version 0.2.3 (see the original issue report).
Only difference is that I have changed Elixir version to 1.5.1 and Erlang OTP version to 20.1.
I am using asdf for elixir version managment.

Any ideas would be appreciated.

@JakeBecker
Copy link
Owner

@hjalet Unfortunately, asdf installs are plagued by a different problem. Right now, the debugger is packaged as an escript that doesn't embed Elixir, and then we use a shell script to locate your Elixir install and set ERL_LIBS. Asdf, however, wraps your Elixir binary in an additional shell script which means it's harder to find the Elixir install.

This isn't a good way of packaging it, and I've nearly finished refactoring it to build a set of .ez archives instead. I'm closing this ticket but I'll create a new one for asdf installs.

@JakeBecker
Copy link
Owner

Here's the issue to track that: JakeBecker/elixir-ls#12

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

No branches or pull requests

5 participants