lukebelbina

lukebelbina

VSCode ElixirLS no code compeltion using asdf and i3 window manager Ubuntu

I have attempted to debug this for a while but had no luck. I am running Ubutnu 20.04 using i3 for a window manager. This problem is occurring if I use the dmenu to launch VSCode or if I launch VSCode from the terminal.

I have installed Erlang / Elixir using asdf. asdf current says:

elixir 1.13.0-rc.1-otp-24 /home/luke/.tool-versions
erlang 24.1.6 /home/luke/.tool-versions

I am using i3 for a window manager and launch vscode using the dmenu. In a terminal within VSCode elixir --version yields:

Erlang/OTP 24 [erts-12.1.5] [source] [64-bit] [smp:32:32] [ds:32:32:10] [async-threads:1] [jit]
Elixir 1.13.0-rc.1 (2765e0f) (compiled with Erlang/OTP 24)

ElixirLS is detecting problems with the code however code completion is not working, and when I press ctrl-space I get the following error:

Failed to run ‘elixir’ command. ElixirLS will probably fail to launch. Logged PATH to Development Console.

echo $PATH in VSCode terminal shows:

home/luke/.asdf/shims:/home/luke/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

Finally, here’s the ElixirLS output:

Started ElixirLS v0.8.1
Elixir version: "1.13.0-rc.1 (2765e0f) (compiled with Erlang/OTP 24)"
Erlang version: "24"
ElixirLS compiled with Elixir 1.10.4 and erlang 22
MIX_ENV: test
MIX_TARGET: 
[Error - 5:28:45 PM] Request textDocument/foldingRange failed.
  Message: an exception was raised:
    ** (CaseClauseError) no case clause matching: {:ok, 63, 1, [], [{:identifier, {1, 1, nil}, :defmodule}, {:alias, {1, 11, nil}, :Resourceq}, {:., {1, 20, nil}}, {:alias, {1, 21, nil}, :Schema}, {:., {1, 27, nil}}, {:alias, {1, 28, nil}, :Command}, {:do, {1, 36, nil}}, {:eol, {1, 38, 1}}, {:identifier, {2, 3, nil}, :use}, {:alias, {2, 7, nil}, :Ecto}, {:., {2, 11, nil}}, {:alias, {2, 12, nil}, :Schema}, {:eol, {2, 18, 2}}, {:identifier, {4, 3, nil}, :import}, {:alias, {4, 10, nil}, :Ecto}, {:., {4, 14, nil}}, {:alias, {4, 15, nil}, :Changeset}, {:eol, {4, 24, 2}}, {:identifier, {6, 3, nil}, :alias}, {:alias, {6, 9, nil}, :Resourceq}, {:., {6, 18, nil}}, {:alias, {6, 19, nil}, :Utils}, {:., {6, 24, nil}}, {:alias, {6, 25, nil}, :SchemaValidation}, {:eol, {6, 41, 1}}, {:identifier, {7, 3, nil}, :alias}, {:alias, {7, 9, nil}, :Resourceq}, {:., {7, 18, nil}}, {:alias, {7, 19, nil}, :Schema}, {:., {7, 25, nil}}, {:alias, {7, 26, nil}, :Command}, {:eol, {7, 33, 1}}, {:at_op, {10, 3, nil}, :@}, {:identifier, {10, 4, nil}, :primary_key}, {:"{", {10, 16, nil}}, {:atom, {10, 17, nil}, :uuid}, {:",", {10, 22, 0}}, {:atom, {10, 24, nil}, :binary_id}, {:",", {10, 34, 0}}, {:"[", {10, 36, nil}}, {:"]", {10, 37, ...}}, {:"}", {10, ...}}, {:eol, {...}}, {:at_op, ...}, {...}, ...]}
        (elixir_sense 2.0.0) lib/elixir_sense/core/normalized/tokenizer.ex:16: ElixirSense.Core.Normalized.Tokenizer.do_tokenize_1_7/1
        (language_server 0.8.1) lib/language_server/providers/folding_range/token.ex:18: ElixirLS.LanguageServer.Providers.FoldingRange.Token.format_string/1
        (language_server 0.8.1) lib/language_server/providers/folding_range.ex:119: ElixirLS.LanguageServer.Providers.FoldingRange.convert_text_to_input/1
        (language_server 0.8.1) lib/language_server/providers/folding_range.ex:97: ElixirLS.LanguageServer.Providers.FoldingRange.do_provide/1
        (language_server 0.8.1) lib/language_server/server.ex:808: anonymous fn/3 in ElixirLS.LanguageServer.Server.handle_request_async/2
  Code: -32000 

17:28:45.597 [error] Process #PID<0.123.0> raised an exception
** (CaseClauseError) no case clause matching: {:ok, 63, 1, [], [{:identifier, {1, 1, nil}, :defmodule}, {:alias, {1, 11, nil}, :Resourceq}, {:., {1, 20, nil}}, {:alias, {1, 21, nil}, :Schema}, {:., {1, 27, nil}}, {:alias, {1, 28, nil}, :Command}, {:do, {1, 36, nil}}, {:eol, {1, 38, 1}}, {:identifier, {2, 3, nil}, :use}, {:alias, {2, 7, nil}, :Ecto}, {:., {2, 11, nil}}, {:alias, {2, 12, nil}, :Schema}, {:eol, {2, 18, 2}}, {:identifier, {4, 3, nil}, :import}, {:alias, {4, 10, nil}, :Ecto}, {:., {4, 14, nil}}, {:alias, {4, 15, nil}, :Changeset}, {:eol, {4, 24, 2}}, {:identifier, {6, 3, nil}, :alias}, {:alias, {6, 9, nil}, :Resourceq}, {:., {6, 18, nil}}, {:alias, {6, 19, nil}, :Utils}, {:., {6, 24, nil}}, {:alias, {6, 25, nil}, :SchemaValidation}, {:eol, {6, 41, 1}}, {:identifier, {7, 3, nil}, :alias}, {:alias, {7, 9, nil}, :Resourceq}, {:., {7, 18, nil}}, {:alias, {7, 19, nil}, :Schema}, {:., {7, 25, nil}}, {:alias, {7, 26, nil}, :Command}, {:eol, {7, 33, 1}}, {:at_op, {10, 3, nil}, :@}, {:identifier, {10, 4, nil}, :primary_key}, {:"{", {10, 16, nil}}, {:atom, {10, 17, nil}, :uuid}, {:",", {10, 22, 0}}, {:atom, {10, 24, nil}, :binary_id}, {:",", {10, 34, 0}}, {:"[", {10, 36, nil}}, {:"]", {10, 37, ...}}, {:"}", {10, ...}}, {:eol, {...}}, {:at_op, ...}, {...}, ...]}
    (elixir_sense 2.0.0) lib/elixir_sense/core/normalized/tokenizer.ex:16: ElixirSense.Core.Normalized.Tokenizer.do_tokenize_1_7/1
    (language_server 0.8.1) lib/language_server/providers/folding_range/token.ex:18: ElixirLS.LanguageServer.Providers.FoldingRange.Token.format_string/1
    (language_server 0.8.1) lib/language_server/providers/folding_range.ex:119: ElixirLS.LanguageServer.Providers.FoldingRange.convert_text_to_input/1
    (language_server 0.8.1) lib/language_server/providers/folding_range.ex:97: ElixirLS.LanguageServer.Providers.FoldingRange.do_provide/1
    (language_server 0.8.1) lib/language_server/server.ex:808: anonymous fn/3 in ElixirLS.LanguageServer.Server.handle_request_async/2
[Info  - 5:28:45 PM] Compile took 401 milliseconds
[Info  - 5:28:45 PM] [ElixirLS WorkspaceSymbols] Indexing...
[Info  - 5:28:45 PM] [ElixirLS Dialyzer] Checking for stale beam files
[Info  - 5:28:46 PM] [ElixirLS WorkspaceSymbols] Module discovery complete
[Info  - 5:28:46 PM] [ElixirLS WorkspaceSymbols] 22 callbacks added to index
[Info  - 5:28:46 PM] [ElixirLS WorkspaceSymbols] 197 modules added to index
[Info  - 5:28:46 PM] [ElixirLS Dialyzer] Found 2 changed files in 73 milliseconds
[Info  - 5:28:46 PM] [ElixirLS Dialyzer] Analyzing 8 modules: [Resourceq.Application, Resourceq.CommandWorker, Resourceq.Commands, Resourceq.Schema.Command, ResourceqWeb.CommandController, ResourceqWeb.Endpoint, ResourceqWeb.EventsChannel, ResourceqWeb.Router]
[Info  - 5:28:46 PM] [ElixirLS WorkspaceSymbols] 285 types added to index
[Info  - 5:28:46 PM] [ElixirLS Dialyzer] Analysis finished in 333 milliseconds
[Info  - 5:28:46 PM] Dialyzer analysis is up to date

First Post!

lukebelbina

lukebelbina

Ok, looks like this is a red herring and it is not working for Elixir version 1.13.0-rc.1

I have reproduced on my Windows machine and also verified code completion works for Elixir version 1.12.x on my Ubuntu install.

Where Next?

Popular in Questions Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New

Other popular topics Top

albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

We're in Beta

About us Mission Statement