For now, Zed + LSP defaults are nice for my simple setup
Me too.
It has all that I need to write elixir applications.
And is fast as light!
2 posts were split to a new topic: How to configure function/variable signature for Elixir in the Zed editor?
I used Zed for a few months, but recently the update messed up UI fonts (it now uses system fonts). To fix I had to add:
"ui_font_family": "Zed Sans",
Any idea how can I point Zed to where my Elixir installation is? It isn’t on the default path, and it can’t be, since I have many Elixir versions compiled in different directories.
On fresh install in mac, zed couldn’t find Elixir syntax highlighter. But afair it was there in previous versions.
You could set up direnv
with an .envrc
file in the root of each elixir project to prefix your PATH
with the desired elixir destination.
I’m curious why, it seems, you’re not using a tool like asdf
to manage your different versions?
I assume zed can handle environment changes like these.
Anyone that uses mise (alternative to asdf) on MacOS that could make it work with Zed?
Zed clearly doesn’t use the env vars from the path, not even when starting it from the CLI, not even creating shims seem to work.
Never had a problem with VS Code.
On Linux
it works without any zed
-specific configuration. Do you have which
command? You can check if specified executable is in path:
$ which elixir
$HOME/.asdf/shims/elixir
Also “it does not work” never helps. Find logs and let us know if there was an error or just it couldn’t locate elixir
.
In some cases people do mistakes in shell configuration like early-returning for non-interactive shells and calling script files that sets PATH environment after said check.
# Don't move it below interactive shell check!
. ~/.asdf/asdf.sh
. ~/.asdf/plugins/java/set-java-home.bash
# Test for an interactive shell. There is no need to set anything
# past this point for scp and rcp, and it's important to refrain from
# outputting anything in those cases.
if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi
What works fine here, starting from the CLI. Only for tasks I had to call eval $(mise env)
before the task commands to make it prime the env.
You should do that or similar method recommended by mise
documentation (never tried it) in some shell profile file. The path could be different depending on the shell and an OS/distribution. .bashrc
, .tcshrc
, .zshrc
etc. As mentioned above make sure that the shell profile is used in non-interactive mode and use the eval
or similar solution before said interactive shell check.
I mention interactive vs non-interactive as some shells (Bash
for sure, no idea about others) are using profile files for both interactive and non-interactive mode. If remember correctly .zshrc
works only for interactive shells, so you don’t have to worry about the order of code as it’s not important in that case.
Did anyone manage to get autocomplete for heex
and tailwind
classes?
It works for me. How about putting this in settings?
"languages": {
"Elixir": {
"language_servers": ["elixir-ls", "tailwindcss-language-server"]
}
},
Could you be so kind to share entire settings file? As for me it still doesn’t work for some reason.
Oh, maybe this one as by default it’s false
:
"inlay_hints": {
"enabled": true
},
The rest of configuration is not related to hints, LSP
or Elixir
at all.
Here is a documentation for those settings:
Zed now supports Heex files
Unfortunately didn’t help, those I already had in settings.
Then I have no idea as that’s all I have. The rest are editor stuff like a font, disabling assistant, auto update, copilot, telemetry and so on … Did you pulled latest changes? I have always up-to-date as I’m pulling changes daily. If nothing helps please open an issue as it’s most probably not related to settings.
Do you have the tailwind setting for classRegex?
I found this online for Phoenix:
experimental = {
classRegex = {
[[class= "([^"]*)]],
[[class: "([^"]*)]],
'~H""".*class="([^"]*)".*"""',
'~F""".*class="([^"]*)".*"""',
}
I jump back and forth between Zed and Zed Preview and both work without any issues. Which version of Zed are you using? Do you have elixir-ls installed? Via asdf
?