DragosMocrii

DragosMocrii

VSCode & ElixirLS intellisense

I’m using the ElixirLS extension with VSCode and so far so good. However, my only nuisance is that I don’t get intellisense or jump to definition for functions that are imported from a use. For example, in a live view module (the one that has the mount/render/etc) that uses Phoenix.LiveView, I can’t jump to the definition of assign/2 or assign/3 . Hovering on it shows nothing either.

Additionally, my eex/leex templates have absolutely no intellisense. I am using the YAB for eex/leex extension to get the markup coloring. If I switch the language mode to Embedded Elixir (eex), then my code will have no coloring, no intellisense, basically it’s raw text editing.

So I’ve been working like this for a while, but I wonder if others have managed to get everything working nicely, in which case I’d have to figure out what’s wrong with my configuration. Thanks!

Marked As Solved

DragosMocrii

DragosMocrii

So I was able to finally fix the IntelliSense for imported functions and macros via use. Turns out the ElixirLS VSCode extension that ships on the marketplace comes with the language server that was built using Elixir 1.8 and Erlang 21, which are older versions than what my system has. Building the language server using my system’s Elixir and injecting that inside the extension did the trick. I wrote a quick post on my blog about all the steps https://dragoshmocrii.com/fix-vscode-elixirls-intellisense-for-code-imported-with-use/

Unfortunately, the eex/leex files still don’t have any IntelliSense.

@thiagomajesk for formatting you can try the “YAB for eex/leex” extension which works fine for me.

Also Liked

axelson

axelson

Scenic Core Team

That’s tracked in this issue:

As you found the workaround is to compile ElixirLS on a newer version. I believe there’s an issue for compiling the release on the end-user’s machine but no one has done work on that yet.

Unfortunately, the eex/leex files still don’t have any IntelliSense.

Yes, that currently isn’t supported (but a patch would be welcome).

PJUllrich

PJUllrich

Author of Building Table Views with Phoenix LiveView

May I ask whether you have created an Issue for this in the ElixirLS GitHub Repo already? If not, maybe it would be a good idea to do so and fix this for everybody who downloaded the extension :slight_smile:

Where Next?

Popular in Questions Top

dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
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
pgiesin
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database. Dep...
New
dokuzbir
Hello, I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these buyer = %{ id: ...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
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
mathew4509
I have a list say x = ["23gh", "56kh", "97mh"] I would like to pass each element to Val in each iteration. Say, in iteration 1 -------...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

Other popular topics Top

SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
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
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 Postg...
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
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New

We're in Beta

About us Mission Statement