Commit graph

142 commits

Author SHA1 Message Date
hkalbasi
a481e004b0 Lower const params with a bad id 2023-06-11 00:39:28 +03:30
Lukas Wirth
ecb8616870 fix: Don't duplicate sysroot crates in rustc workspace 2023-05-31 15:37:35 +02:00
bors
e8dbb8e2e0 Auto merge of #14911 - Veykril:config-cfg, r=Veykril
Allow setting cfgs

Fixes https://github.com/rust-lang/rust-analyzer/issues/14365
2023-05-30 12:00:14 +00:00
Lukas Wirth
cea84427e0 Allow setting cfgs 2023-05-28 13:43:21 +02:00
Lukas Wirth
35b208aaa7 Filter out unused cargo features from config 2023-05-26 22:16:34 +02:00
Lukas Wirth
f47caa666e Add AbsPath::absolutize 2023-05-13 11:51:28 +02:00
Lukas Wirth
939ebb4454 Forbid canonicalization of paths and normalize all rust-project.json paths 2023-05-04 14:51:35 +02:00
Laurențiu Nicola
7197a27028 Use triomphe Arc 2023-05-02 20:02:43 +03:00
bors
a7168a8c6f Auto merge of #14712 - Veykril:metadata-extra-args, r=Veykril
fix: Only pass unstable flags to cargo metadata from extra args config
2023-05-02 16:34:39 +00:00
Lukas Wirth
16b3febcf5 Only pass unstable flags to cargo metadata from extra args config 2023-05-02 17:33:58 +02:00
Ddystopia
fc888b583d
Add target_directory path to CargoWorkspace 2023-05-02 17:06:31 +02:00
Bruno Ortiz
072f69e4c1 fixing ts linting and rust test 2023-05-02 11:01:53 -03:00
Bruno Ortiz
66fe84d936 accepting review suggestions 2023-05-02 11:01:41 -03:00
Bruno Ortiz
c372fb3495 fixing tests for windows 2023-05-02 10:59:31 -03:00
Bruno Ortiz
a3081a6774 Adding crate_root_path to crate_graph 2023-05-02 10:59:31 -03:00
wackbyte
01c59812ae
fix grammar 2023-04-28 23:04:08 -04:00
bors
797c2f1dde Auto merge of #14659 - Veykril:dedup-crates, r=Veykril
Deduplicate crates when extending crate graphs

This is quadratic in runtime per deduplication attempt, but I don't think that'll be a problem for the workload here. Don't be scared of the diff, the actual diff is +42 -22, the rest is tests and test data.
Fixes https://github.com/rust-lang/rust-analyzer/issues/14476
2023-04-26 09:44:27 +00:00
Lukas Wirth
968850d7bf Deduplicate crates when extending crate graphs 2023-04-26 11:44:11 +02:00
Lukas Wirth
c21860bd6a Remove proc-macro server command from the rust-analyzer binary 2023-04-26 08:19:28 +02:00
bors
943d2a8a1c Auto merge of #14642 - jakhh8:master, r=Veykril
minor: Use `CargoConfig.extra_args` for fetching metadata

Fixes #14510
2023-04-25 12:46:29 +00:00
Lukas Wirth
10d7d7304b
Revert "Handle dev-dependency cycles" 2023-04-25 14:29:26 +02:00
Lukas Wirth
e205af259d Prefer test duped crates for ide features 2023-04-25 11:39:58 +02:00
Lukas Wirth
a4c7a87755 Handle dev-dependency cycles 2023-04-25 10:57:25 +02:00
Lukas Wirth
980c75bc91 Add more complex project-model test 2023-04-25 10:49:48 +02:00
wtj
59c4cc36c4 fix: remove extra argument "rustc" 2023-04-25 02:46:09 +08:00
jakhh8
62c9d96c67 fix 2023-04-24 10:13:29 +02:00
jakhh8
f502169f1c minor: use extra_args for fetching workspace 2023-04-23 21:19:40 +02:00
bors
0289dfa261 Auto merge of #14599 - HKalbasi:dev2, r=HKalbasi
Detect sysroot dependencies using symlink copy

cc #7637

It is currently in a proof of concept stage, and it doesn't generates a copy. You need to provide your own sysroot copy in `/tmp/ra-sysroot-hack` in a way that `/tmp/ra-sysroot-hack/library/std/lib.rs` exists and `/tmp/ra-sysroot-hack/Cargo.toml` is [the one from this comment](https://github.com/rust-lang/rust-analyzer/issues/7637#issuecomment-1495008329). I will add the symlink code if we decide that this approach is not a dead end.

It seems to somehow work on my system. Go to definition into std dependencies works, type checking can look through fields if I make them public and `cfg_if` appears to work (I tested it by hovering both sides and seeing that the correct one is enabled). Though finding layout of `HashMap` didn't work.

Please try it and let me know if I should go forward in this direction or not.
2023-04-20 22:26:17 +00:00
hkalbasi
39715ce26f Add RA_UNSTABLE_SYSROOT_HACK 2023-04-20 22:55:39 +03:30
Ryo Yoshida
4db87f9346
Fix release channel detection
See bootstrap code in rust-lang/rust for versioning details: e49122fb1c/src/bootstrap/lib.rs (L1244)
2023-04-18 02:12:17 +09:00
Lukas Wirth
dd5c3c30b6 internal: Warn when loading sysroot fails to find the core library 2023-04-13 08:40:14 +02:00
Lukas Wirth
72d47144e8 fix: Fix receiver adjustments for extract_variable assist 2023-04-11 14:01:23 +02:00
Lukas Wirth
7f0fbf7f9d Switch crate graph to use an Arena instead of a hashmap 2023-04-05 10:32:02 +02:00
Lukas Wirth
b3919ea80d Cleanup crate_graph construction 2023-03-31 14:14:04 +02:00
Lukas Wirth
31db1fc75f internal: Refine CrateOrigin variants 2023-03-31 10:36:13 +02:00
bors
b915eb32fa Auto merge of #14427 - davidbarsky:davidbarsky/allow-subsequent-workspaces-to-have-proc-macros, r=Veykril
fix: allow new, subsequent `rust-project.json`-based workspaces to get proc macro expansion

As detailed in https://github.com/rust-lang/rust-analyzer/issues/14417#issuecomment-1485336174, `rust-project.json` workspaces added after the initial `rust-project.json`-based workspace was already indexed by rust-analyzer would not receive procedural macro expansion despite `config.expand_proc_macros` returning true. To fix this issue:
1. I changed `reload.rs` to check which workspaces are newly added.
2. Spawned new procedural macro expansion servers based on the _new_ workspaces.
    1. This is to prevent spawning duplicate procedural macro expansion servers for already existing workspaces. While the overall memory usage of duplicate procedural macro servers is minimal, this is more about the _principle_ of not leaking processes 😅.
3. Launched procedural macro expansion if any workspaces are `rust-project.json`-based _or_ `same_workspaces` is true. `same_workspaces` being true (and reachable) indicates that that build scripts have finished building (in Cargo-based projects), while the build scripts in `rust-project.json`-based projects have _already been built_ by the build system that produced the `rust-project.json`.

I couldn't really think of structuring this code in a better way without engaging with https://github.com/rust-lang/rust-analyzer/issues/7444.
2023-03-30 07:50:27 +00:00
David Barsky
25c59b8e92 address PR comments 2023-03-29 15:29:32 -04:00
David Barsky
6a42d7f627 fix: allow new, subsequent rust-project.json-based workspaces to get
proc macro expansion.
2023-03-28 09:17:16 -04:00
Lukas Wirth
f1de133820 Canonicalize rust-project.json manifest path 2023-03-27 21:55:02 +02:00
Lukas Wirth
b03a218b57 fix: Fix proc-macro paths using incorrect CrateId's for rust-project.json workspaces 2023-03-27 17:17:09 +02:00
Lukas Wirth
ee02213e65 Handle proc macro fetching via OpQueue 2023-03-26 09:33:41 +02:00
Lukas Wirth
607375dc20 Load proc-macros asynchronously 2023-03-25 18:06:06 +01:00
Lukas Wirth
d154ea88f9 Split out proc-macros from the CrateGraph 2023-03-25 16:46:44 +01:00
bors
992a0fc074 Auto merge of #14403 - Veykril:dependencies, r=Veykril
internal: Bump Cargo.lock
2023-03-25 14:15:10 +00:00
Lukas Wirth
39e86e78c3 Bump Cargo.lock 2023-03-25 15:12:39 +01:00
Lukas Wirth
c01ba4a310 Reject symlinks in project-json 2023-03-25 14:22:05 +01:00
Lukas Wirth
d9c7d28e0d Report sysroot and rustc crate loading errors 2023-03-15 11:35:34 +01:00
Lukas Wirth
8b8cd04825 fix: Don't pass feature flags to rustc private crates metadata invocation 2023-03-15 10:52:50 +01:00
bors
6f297b9076 Auto merge of #14348 - Veykril:rustc-proc, r=Veykril
fix: Fix rustc proc-macro handling being broken on the rustc workspace itself

Also addresses https://github.com/rust-lang/rust-analyzer/issues/13591#issuecomment-1466966952
2023-03-14 10:34:23 +00:00
Lukas Wirth
88f0fe784f fix: Fix rustc proc-macro handling being broken on the rustc workspace itself 2023-03-14 11:33:40 +01:00