aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorTeymour Aldridge <notifications@reasoning.page>2022-01-20 18:46:37 +0000
committerTeymour Aldridge <notifications@reasoning.page>2022-01-20 18:46:37 +0000
commitc25822d88665ba4b91e328e8fa8d555d4fe81b28 (patch)
tree917f377ca315f887da7298ffff78efea43f51f69 /docs
parent4401622eb11a4719c17446bec19d3a80fa585d28 (diff)
downloadservo-c25822d88665ba4b91e328e8fa8d555d4fe81b28.tar.gz
servo-c25822d88665ba4b91e328e8fa8d555d4fe81b28.zip
Add vscode/rust-analyzer info.
Diffstat (limited to 'docs')
-rw-r--r--docs/HACKING_QUICKSTART.md43
1 files changed, 43 insertions, 0 deletions
diff --git a/docs/HACKING_QUICKSTART.md b/docs/HACKING_QUICKSTART.md
index d91f4f0678d..4f0027f93ea 100644
--- a/docs/HACKING_QUICKSTART.md
+++ b/docs/HACKING_QUICKSTART.md
@@ -134,6 +134,49 @@ Both will tell any cargo project to not use the online version of the dependency
For more details about overriding dependencies, see [Cargo's documentation](https://doc.crates.io/specifying-dependencies.html#overriding-dependencies).
+## Editor support
+
+### Visual Studio Code
+
+Running plain `cargo` will cause problems! This is because the rustflags (flags passed to the rust compiler) that
+standard `cargo` provides are different to what `./mach` uses, and so every time Servo is built using `cargo` it will
+undo all the work done by `./mach` (and vice versa).
+
+You can override this in a `.vscode/settings.json` file:
+
+```
+{
+ "rust-analyzer.checkOnSave.overrideCommand": [
+ "./mach",
+ "check",
+ "--message-format=json",
+ ],
+ "rust-analyzer.rustfmt.overrideCommand": [
+ "./mach",
+ "fmt"
+ ],
+}
+```
+
+If that still causes problems, then supplying a different target directory should fix this (although it will increase
+the amount of disc space used).
+
+```
+{
+ "rust-analyzer.checkOnSave.overrideCommand": [
+ "./mach",
+ "check",
+ "--message-format=json",
+ "--target-dir",
+ "target/lsp"
+ ],
+ "rust-analyzer.rustfmt.overrideCommand": [
+ "./mach",
+ "fmt"
+ ],
+}
+```
+
## Debugging
### Logging: