You are running flatpak version of Helix. This version is running inside of a container and is therefore not able to access tools on your host system.
You can open issues related to this flatpak at https://github.com/flathub/com.helix_editor.Helix/issues
To run commands on the host system from inside of the sandbox, you can use flatpak-spawn:
flatpak-spawn --host <COMMAND>
If you want to use a language server installed on your host system, you
will need to edit languages.toml
file. For example:
# ~/.var/app/com.helix_editor.Helix/config/helix/languages.toml
[language-server.rust-analyzer-host]
command = "flatpak-spawn"
args = ["--host", "rust-analyzer"]
[[language]]
name = "rust"
language-servers = [
{ name = "rust-analyzer-host" }
]
This will allow you to use rust-analyzer installed on your host system from within the Flatpak container. For full documentation on how to configure language servers, see https://docs.helix-editor.com/languages.html
By default, this flatpak has access to standard development environment
provided by org.freedesktop.Sdk
with programs such as GCC and Python.
However, if you need support for additional languages (including
language servers), you will need to install SDK extensions. For example:
flatpak install flathub org.freedesktop.Sdk.Extension.rust-stable
flatpak install flathub org.freedesktop.Sdk.Extension.llvm16
This will install the Rust and LLVM SDK extensions. After this you will
have your extensions at /usr/lib/sdk/<extension-name>
. But they won't
be added to $PATH
.
To enable SDK extensions you will need to set FLATPAK_ENABLE_SDK_EXT
environment variable to a comma-separated list of extension names.
For example:
FLATPAK_ENABLE_SDK_EXT=rust-stable,llvm16 flatpak run com.helix_editor.Helix
This will add compilers, language servers, debug adapters, and other
tools to your $PATH
.
To check which language servers have been detected, run Helix with the
--health
option:
FLATPAK_ENABLE_SDK_EXT=rust-stable,llvm16 flatpak run com.helix_editor.Helix --health
You can also get information about a specific language:
FLATPAK_ENABLE_SDK_EXT=rust-stable,llvm16 flatpak run com.helix_editor.Helix --health rust
To set environment variables persistently, use flatpak override
:
flatpak override --user com.helix_editor.Helix --env=FLATPAK_ENABLE_SDK_EXT="rust-stable,llvm16"
To find other SDK extensions, use flatpak search
:
flatpak search <TEXT>