diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-06-21 14:41:27 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-06-21 14:41:27 +0100 |
commit | b48aba009025701c4adb45e2042f0bcdb9d949a7 (patch) | |
tree | 9c311ee5e9058a3db66134368c8b84c30ed94f81 /editors | |
parent | 4402f2b280f58896ed0696f4243d88a58fd970ca (diff) | |
parent | 8b77e2692cd97552b1b8d66eb51cec69695b3a5b (diff) |
Merge #9227
9227: Add a config setting to disable the 'test' cfg in specified crates r=matklad a=lf-
If you are opening libcore from rust-lang/rust as opposed to e.g.
goto definition from some other crate which would use the sysroot
instance of libcore, a `#![cfg(not(test))]` would previously have made
all the code excluded from the module tree, breaking the editor
experience.
Core does not need to ever be edited with `#[cfg(test)]` enabled,
as the tests are in another crate.
This PR puts in a slight hack that checks for the crate name "core" and
turns off `#[cfg(test)]` for that crate.
Fixes #9203
Fixes #9226
Co-authored-by: Jade <[email protected]>
Diffstat (limited to 'editors')
-rw-r--r-- | editors/code/package.json | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/editors/code/package.json b/editors/code/package.json index c077bd2c0..b20a39a95 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -452,6 +452,16 @@ | |||
452 | "default": false, | 452 | "default": false, |
453 | "type": "boolean" | 453 | "type": "boolean" |
454 | }, | 454 | }, |
455 | "rust-analyzer.cargo.unsetTest": { | ||
456 | "markdownDescription": "Unsets `#[cfg(test)]` for the specified crates.", | ||
457 | "default": [ | ||
458 | "core" | ||
459 | ], | ||
460 | "type": "array", | ||
461 | "items": { | ||
462 | "type": "string" | ||
463 | } | ||
464 | }, | ||
455 | "rust-analyzer.cargo.features": { | 465 | "rust-analyzer.cargo.features": { |
456 | "markdownDescription": "List of features to activate.", | 466 | "markdownDescription": "List of features to activate.", |
457 | "default": [], | 467 | "default": [], |