about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-06-09 18:37:25 +0000
committerbors <bors@rust-lang.org>2023-06-09 18:37:25 +0000
commit425619dd28a7fa56b894091b5797afedecaf3a8e (patch)
treeb37fa28c023f7ac8b2832848469d40392e9efc77
parent2796851961e90166ce93894ddba461935c49bbf6 (diff)
parent5da14237eb2994a73e8864cf88359bc2308d4864 (diff)
downloadrust-425619dd28a7fa56b894091b5797afedecaf3a8e.tar.gz
rust-425619dd28a7fa56b894091b5797afedecaf3a8e.zip
Auto merge of #15014 - Wilfred:document_sysroot, r=Veykril
Document the sysroot field in JsonProject

rust-analyzer supports both `sysroot` and `sysroot_src` in `rust-project.json`. Document `sysroot` and show example values for both fields.
-rw-r--r--docs/user/manual.adoc19
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc
index 5b9db10b093..98d99bae92a 100644
--- a/docs/user/manual.adoc
+++ b/docs/user/manual.adoc
@@ -653,9 +653,28 @@ However, if you use some other build system, you'll have to describe the structu
 [source,TypeScript]
 ----
 interface JsonProject {
+    /// Path to the sysroot directory.
+    ///
+    /// The sysroot is where rustc looks for the
+    /// crates that are built-in to rust, such as
+    /// std.
+    ///
+    /// https://doc.rust-lang.org/rustc/command-line-arguments.html#--sysroot-override-the-system-root
+    ///
+    /// To see the current value of sysroot, you
+    /// can query rustc:
+    ///
+    /// ```
+    /// $ rustc --print sysroot
+    /// /Users/yourname/.rustup/toolchains/stable-x86_64-apple-darwin
+    /// ```
+    sysroot?: string;
     /// Path to the directory with *source code* of
     /// sysroot crates.
     ///
+    /// By default, this is `lib/rustlib/src/rust/library`
+    /// relative to the sysroot.
+    ///
     /// It should point to the directory where std,
     /// core, and friends can be found:
     ///