Troubleshooting


Check the logs

When something seems wrong, the first thing you should do is check the logs!

Log File

You can tail the log file that lives at .elixir-tools/next-ls.log.

This log file contains the same logs that are output to the Output Panel in Visual Studio Code and Neovim, and also contains more robust language server logging with timings.

Visual Studio Code

In Visual Studio Code, the logs are available in the Output tab in the bottom panel. You'll want to select Next LS from the dropdown in that panel.

Nvim

In Nvim, there are several ways to check the LSP logs.

If you happen to also have nvim-lspconfig installed, you can run :LspLog and it will open a new tab with all of the LSP logs.

This is often hard to read, so I created a plugin called output-panel.nvim that closely resembles the Output Panel from Visual Studio Code.

Is epmd running?

epmd, or "Erlang Port Mapper Daemon", is used to cluster two Erlang nodes together. Next LS starts a runtime node for your project and communicates with it via clustering.

Linux/Mac:

pgrep -fl epmd

If epmd is not running, you might need to start it or ensure it starts automatically with your system. You can do this by running epmd -daemon.

Open Visual Studio Code from the terminal

To ensure that elixir is in your PATH, open Visual Studio Code from the terminal using the command-line tools.

Next LS will print the path of the elixir executable that it finds and will be using to start your runtime node.

Does it work in TCP mode?

All Platforms:

Start the language server in TCP mode and connect to it with your editor, as described above.

Both extensions install the Next LS executable to ~/.cache/elixir-tools/nextls/bin/nextls, so you can start the server with ~/.cache/elixir-tools/nextls/bin/nextls --port 9000.

Firewall Interference

Sometimes, the firewall can interfere with epmd and each Erlang node's ability to cluster. If you face connection issues, you might try turning off the firewall temporarily to see if it resolves the issue.

This is usually a problem on macOS, as you should see a popup asking if beam and epmd can accept incoming connections (which you should click "yes").

In future version, we plan to sign and notarize the darwin binaries, which should avoid this popups and make this a non-issue.