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

marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
JulienCorb
I am trying to implement my new.html.eex file to create new posts on my website. new.html.eex: &lt;h1&gt;Create Post&lt;/h1&gt; &lt;%= ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
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

Other popular topics Top

marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 42920 311
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
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
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52341 488
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement