this is a question i got a few times, plus im demo-ing Builder in some of my videos and people are like “whats this editor!?”
in this post i will very quickly show you how to start with Rust and RLS (Rust Language Server) support in GNOME Builder. check out on links for official & updated documentation!
first you need to get GNOME Builder. it should be as easy as
sudo apt install gnome-builder
if you are comfortable with Flatpaks or if your Linux doesn’t ship GNOME 3.26, you can get Builder from Flathub
flatpak install --from https://flathub.org/repo/appstream/org.gnome.Builder.flatpakref
Rustup is Rust’s version manager. if you have Rust installed from your Linux repos, you need to uninstall it. then run
curl https://sh.rustup.rs -sSf | sh
that will prompt you some options. select
nightly. while you can still use stable Rust, RLS needs the nightly
if you already have Rustup installed, you can just
rustup install/update nightly
and default it -if you want!
rustup default nightly
to update (that will update both
Builder allows to update Rustup and Rust toolchains from within its interface, but it is better to check on Rustup Github and use CLI
once you have Rust nightly installed and updated, you can install RLS
rustup component add rls-preview --toolchain nightly
rustup component add rust-analysis --toolchain nightly
rustup component add rust-src --toolchain nightly
actually you dont need Racer for Builder, but you will need it for other code editors, like VSCode, so it is a good idea to have it
cargo install racer
however RLS needs
RUST_SRC_PATH which perhaps is a bug? anyway, to set it
export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src"
that in my case will be
you can add this on your
that was All!
btw Builder should also highlight Rust errors as you type, which for some reason it doesn’t work here :/