fiv

fiv

I really like the Zed editor but recently code completion just stopped working. I still get syntax highlighting just no code completion. Is anybody having the same issue or know what the problem might be.

First 10 of 17 Posts Switch mode

LostKobrakai

LostKobrakai

The first step should always be looking at the lsp logs, which you can open via the command palette in zed.

fiv

fiv OP

Not exactly sure what I’m looking for in Logs but this is what my logs look like. I wonder if this line is the problem

server "elixir-ls": failed to spawn command. path: "/Users/jamesavery/Library/Application 
2024-07-25T18:12:24.636696Z [INFO] starting language server "elixir-ls", path: "/Users/jamesavery/Dev/otp_apps/delta", id: 5
2024-07-25T18:12:24.753174Z [INFO] starting language server. binary path: "/Users/jamesavery/Library/Application Support/Zed/extensions/work/elixir/elixir-ls-v0.22.1/language_server.sh", working directory: "/Users/jamesavery/Dev/otp_apps/delta", args: []
2024-07-25T18:12:24.753329Z [ERROR] failed to start language server "elixir-ls": failed to spawn command. path: "/Users/jamesavery/Library/Application Support/Zed/extensions/work/elixir/elixir-ls-v0.22.1/language_server.sh", working directory: "/Users/jamesavery/Dev/otp_apps/delta", args: []
2024-07-25T18:12:24.753386Z [ERROR] server stderr: Some("")
2024-07-25T18:12:24.753434Z [ERROR] Hit 4 reinstallation attempts for "elixir-ls"
2024-07-25T19:40:44.760385Z [INFO] Initializing default prettier with plugins {}
2024-07-25T19:40:44.762037Z [INFO] starting language servers for Elixir: elixir-ls
2024-07-25T19:40:44.762262Z [INFO] starting language servers for Elixir: elixir-ls
2024-07-25T19:40:44.762322Z [INFO] starting language servers for Elixir: elixir-ls
2024-07-25T19:40:44.819125Z [INFO] Initializing default prettier with plugins {}
2024-07-25T19:40:44.819226Z [INFO] starting language servers for Elixir: elixir-ls
2024-07-25T19:40:44.820365Z [INFO] Initializing default prettier with plugins {}
2024-07-25T19:40:44.820426Z [INFO] starting language servers for Elixir: elixir-ls
2024-07-25T19:40:44.820646Z [INFO] Initializing default prettier with plugins {}
2024-07-25T19:40:44.820701Z [INFO] starting language servers for Elixir: elixir-ls
2024-07-25T19:40:44.820832Z [INFO] Initializing default prettier with plugins {}
2024-07-25T19:40:44.820881Z [INFO] starting language servers for Elixir: elixir-ls
anderkonzen

anderkonzen

I was getting this error too, but I did not know when it started on my mac (maybe a zed update?).

I tried to uninstall zed, compared releases of elixir-ls, etc, but I finally made it work by making the elixir-ls scripts that zed downloads to be executable. Comparing the version between VSCode and zed, I noticed that the elixir-ls release files were not marked as executable:

By running chmod +x ... things started to work again.

larshei

larshei

Nice, that solved it for me.

Also, I added the following overall config for Elixir, maybe it is useful for someone :slight_smile:

Selects the language server and configures format on save.

Most of it was taken from the zed manual

{
  "languages": {
    "Elixir": {
      "show_inline_completions": true,
      "language_servers": ["elixir-ls"],
      "format_on_save": {
        "external": {
          "command": "mix",
          "arguments": ["format", "--stdin-filename", "{buffer_path}", "-"]
        }
      }
    }
  }
}
soyjeansoy

soyjeansoy

this worked on my problem :pray:t5:

jam

jam

I ran into this as well. Fwiw, I had to add this to my settings.json

"lsp": {
    "elixir-ls": {},
    ...
}
larshei

larshei

Just ran across this, might be helpful for someone:
Zed has builtin tailwind support, which can be enabled as well.

Adjust to config as follows:

-     "language_servers": ["elixir-ls"],
+     "language_servers": ["elixir-ls", "tailwindcss-language-server"],

theagilecoder

theagilecoder

I have just installed Zed with the elixir official extension. It should work by default right in the .heex files ?

Code completion works for me in .ex file but doesn’t in .heex

If I create a regular .html file in zed, then the HTML autocomplete works as expected.

katafrakt

katafrakt

To be honest I’m not sure what you expect here. There is no Elixir code in the screenshot where the code completion could happen. Could you elaborate?

theagilecoder

theagilecoder

Providing more details:

In heex files I dont get autocomplete of HTML tags. For ex. if I type ```<div>``` then the div autoclosing tags should be autogenerated like in .html files in zed.

In .html files its working as expected.

Zed claims HEEX support in its elixir support is on by default. Elixir | Elixir

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
rahultumpala
Hello, I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New

We're in Beta

About us Mission Statement