File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -441,6 +441,46 @@ $ COMPILETEST_FORCE_STAGE0=1 x test --stage 0 tests/run-make/<test-name>
441
441
442
442
Of course, some tests will not successfully *run* in this way.
443
443
444
+ #### Using rust-analyzer with `rmake.rs`
445
+
446
+ Like other test programs, the `rmake.rs` scripts used by run-make tests do not
447
+ have rust-analyzer integration by default.
448
+
449
+ To work around this when working on a particular test, temporarily create a
450
+ `Cargo.toml` file in the test's directory
451
+ (e.g. `tests/run-make/sysroot-crates-are-unstable/Cargo.toml`)
452
+ with these contents:
453
+
454
+ <div class="warning">
455
+ Be careful not to add this `Cargo.toml` or its `Cargo.lock` to your actual PR!
456
+ </div>
457
+
458
+ ```toml
459
+ # Convince cargo that this isn't part of an enclosing workspace.
460
+ [workspace]
461
+
462
+ [package]
463
+ name = "rmake"
464
+ version = "0.1.0"
465
+ edition = "2021"
466
+
467
+ [dependencies]
468
+ run_make_support = { path = "../../../src/tools/run-make-support" }
469
+
470
+ [[bin]]
471
+ name = "rmake"
472
+ path = "rmake.rs"
473
+ ```
474
+
475
+ Then add a corresponding entry to `"rust-analyzer.linkedProjects"`
476
+ (e.g. in `.vscode/settings.json`):
477
+
478
+ ```json
479
+ "rust-analyzer.linkedProjects": [
480
+ "tests/run-make/sysroot-crates-are-unstable/Cargo.toml"
481
+ ],
482
+ ```
483
+
444
484
#### Using Makefiles (legacy)
445
485
446
486
<div class="warning">
You can’t perform that action at this time.
0 commit comments