rust-analyzer/crates
bors[bot] 314e2e75c0
Merge #9752
9752: feature: Declare proc-macro dependent crates in `rust-project.json` r=matklad a=tobywf

This adds the `is_proc_macro` flag in `rust-project.json`. By default, this is `false` and not required, so existing projects won't break/have the same behavior as before this change. If the flag is true, a dependency to the `proc_macro` sysroot crate is added (if it exists), so that rust-analyzer can resolve those imports.

This fixes #9726 .

I've also added some tests in the second commit. The first is a smoke test for a basic, minimal `rust-project.json` file. The second is a more targeted test for the flag. Both tests depend on the fake sysroot (a bunch of directories in the correct layout with empty `lib.rs` files), and also on `env!("CARGO_MANIFEST_DIR")` being an absolute path. I'm not sure if the later assumption is valid on all platforms. I wanted to at least try and add tests, but I'm happy to rework them or remove them if you don't think that's the way to go.

(You can license/relicense my contribution in any way you wish without contacting me.)

Co-authored-by: Toby Fleming <sourcecode@tobywf.com>
2021-08-02 13:14:22 +00:00
..
base_db Complete editable private items 2021-07-23 19:57:16 +02:00
cfg internal: add simple smoke test for project model 2021-07-20 16:23:57 +03:00
flycheck internal: a bit more of cwd safety for flycheck 2021-07-17 18:13:35 +03:00
hir Merge #9758 2021-08-02 13:00:07 +00:00
hir_def internal: explain that we don't ref in style.md 2021-08-02 15:59:28 +03:00
hir_expand internal: add API to check what are the max limits in practice 2021-07-31 18:26:43 +03:00
hir_ty internal: explain that we don't ref in style.md 2021-08-02 15:59:28 +03:00
ide Merge #9758 2021-08-02 13:00:07 +00:00
ide_assists Merge #9739 2021-07-31 15:08:29 +00:00
ide_completion simplify 2021-08-02 14:27:11 +03:00
ide_db Wrap inner tail expressions in MissingOkOrSomeInTailExpr 2021-07-31 20:00:09 +02:00
ide_diagnostics Wrap inner tail expressions in MissingOkOrSomeInTailExpr 2021-07-31 20:00:09 +02:00
ide_ssr minor: drop dummy authors field 2021-07-05 14:19:41 +03:00
limit internal: add API to check what are the max limits in practice 2021-07-31 18:26:43 +03:00
mbe minor: drop dummy authors field 2021-07-05 14:19:41 +03:00
parser Simplify 2021-07-30 13:12:52 +02:00
paths Fix AbsPath::ends_with 2021-07-18 10:25:14 +03:00
proc_macro_api Replace useless types 2021-07-31 14:29:15 +02:00
proc_macro_srv Bump deps 2021-07-31 11:25:03 +03:00
proc_macro_test cargo_metadata 0.14 2021-07-09 11:01:55 -04:00
profile internal: make non-zero times stand out in profile 2021-07-31 16:22:03 +03:00
project_model Rust project project model smoke tests 2021-08-01 15:00:34 -07:00
rust-analyzer feat: gate custom clint-side commands behind capabilities 2021-07-30 19:16:33 +03:00
sourcegen minor: make sure that project_root works correctly 2021-07-13 15:02:29 +03:00
stdx Remove proc macro management thread 2021-07-08 16:43:39 +02:00
syntax Wrap inner tail expressions in MissingOkOrSomeInTailExpr 2021-07-31 20:00:09 +02:00
test_utils Complete editable private items 2021-07-23 19:57:16 +02:00
text_edit minor: drop dummy authors field 2021-07-05 14:19:41 +03:00
toolchain minor: drop dummy authors field 2021-07-05 14:19:41 +03:00
tt minor: drop dummy authors field 2021-07-05 14:19:41 +03:00
vfs internal: make it easier to isolate IO 2021-07-17 17:55:16 +03:00
vfs-notify Bump notify to 5.0.0-pre.11 2021-07-28 10:09:58 -07:00