You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: manual.adoc
+51-1
Original file line number
Diff line number
Diff line change
@@ -232,6 +232,27 @@ The `rust-analyzer` binary can be installed via https://brew.sh/[Homebrew].
232
232
$ brew install rust-analyzer
233
233
----
234
234
235
+
=== VS Code or VSCodium in Flatpak
236
+
237
+
Setting up `rust-analyzer` with a Flatpak version of Code is not trivial because of the Flatpak sandbox.
238
+
While the sandbox can be disabled for some directories, `/usr/bin` will always be mounted under `/run/host/usr/bin`.
239
+
This prevents access to the system's C compiler, a system-wide installation of Rust, or any other libraries you might want to link to.
240
+
Some compilers and libraries can be acquired as Flatpak SDKs, such as `org.freedesktop.Sdk.Extension.rust-stable` or `org.freedesktop.Sdk.Extension.llvm15`.
241
+
242
+
If you use a Flatpak SDK for Rust, there should be no extra steps necessary.
243
+
244
+
If you want to use Flatpak in combination with `rustup`, the following steps might help:
245
+
246
+
- both Rust and `rustup` have to be installed using https://rustup.rs. Distro packages _will not_ work.
247
+
- you need to launch Code, open a terminal and run `echo $PATH`
248
+
- using https://flathub.org/apps/details/com.github.tchx84.Flatseal[Flatseal], you must add an environment variable called `PATH`.
249
+
Set its value to the output from above, appending `:~/.cargo/bin`, where `~` is the path to your home directory.
250
+
You must replace `~`, as it won't be expanded otherwise.
251
+
- while Flatseal is open, you must enable access to "All user files"
252
+
253
+
A C compiler should already be available via `org.freedesktop.Sdk`.
254
+
Any other tools or libraries you will need to acquire from Flatpak.
255
+
235
256
=== Emacs
236
257
237
258
Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
@@ -520,13 +541,42 @@ There is a package named `ra_ap_rust_analyzer` available on https://crates.io/cr
520
541
521
542
For more details, see https://github.com/rust-lang/rust-analyzer/blob/master/.github/workflows/publish.yml[the publish workflow].
522
543
523
-
=== Visual Studio IDE
544
+
=== Visual Studio 2022
545
+
546
+
There are multiple rust-analyzer extensions for Visual Studio 2022 on Windows:
Support for Rust development in the Visual Studio IDE is enabled by the link:https://marketplace.visualstudio.com/items?itemName=kitamstudios.RustAnalyzer[rust-analyzer] package. Either click on the download link or install from IDE's extension manager.
526
557
For now link:https://visualstudio.microsoft.com/downloads/[Visual Studio 2022] is required. All editions are supported viz. Community, Professional & Enterprise.
527
558
The package aims to provide 0-friction installation and therefore comes loaded with most things required including rust-analyzer binary. If anything it needs is missing, appropriate errors / warnings will guide the user. E.g. cargo.exe needs to be in path and the package will tell you as much.
528
559
This package is under rapid active development. So if you encounter any issues please file it at link:https://github.com/kitamstudios/rust-analyzer/[rust-analyzer.vs].
529
560
561
+
==== VS_RustAnalyzer
562
+
563
+
(License: GPL)
564
+
565
+
https://marketplace.visualstudio.com/items?itemName=cchharris.vsrustanalyzer[Visual Studio Marketplace]
0 commit comments