rust-analyzer/crates
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
..
base-db address PR comments 2023-03-29 15:29:32 -04:00
cfg ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
flycheck Bump Cargo.lock 2023-03-25 15:12:39 +01:00
hir Simplify 2023-03-30 09:21:10 +02:00
hir-def fix: Properly handle local trait impls 2023-03-28 08:34:29 +02:00
hir-expand Auto merge of #14407 - Veykril:rename-fix, r=Veykril 2023-03-25 18:35:13 +00:00
hir-ty Simplify 2023-03-30 09:21:10 +02:00
ide fix: Add missing autoborrow adjustment for index expressions 2023-03-29 16:11:48 +02:00
ide-assists Simplify 2023-03-28 16:32:26 +02:00
ide-completion Auto merge of #13789 - feniljain:fix_enum_completion, r=Veykril 2023-03-18 07:06:27 +00:00
ide-db Auto merge of #14407 - Veykril:rename-fix, r=Veykril 2023-03-25 18:35:13 +00:00
ide-diagnostics Fix mutability_error::overloaded_index test 2023-03-29 18:07:25 +02:00
ide-ssr ⬆️ rust-analyzer 2023-03-13 10:42:24 +02:00
intern ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
limit ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
mbe ⬆️ rust-analyzer 2023-02-20 10:14:12 +02:00
parser Add signature help for tuple struct patterns 2023-03-15 10:17:30 +01:00
paths Canonicalize rust-project.json manifest path 2023-03-27 21:55:02 +02:00
proc-macro-api Remove client side proc-macro version check 2023-03-25 15:43:58 +01:00
proc-macro-srv ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
proc-macro-srv-cli ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
proc-macro-test ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
profile Bump Cargo.lock 2023-03-25 15:12:39 +01:00
project-model Auto merge of #14427 - davidbarsky:davidbarsky/allow-subsequent-workspaces-to-have-proc-macros, r=Veykril 2023-03-30 07:50:27 +00:00
rust-analyzer Auto merge of #14427 - davidbarsky:davidbarsky/allow-subsequent-workspaces-to-have-proc-macros, r=Veykril 2023-03-30 07:50:27 +00:00
sourcegen ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
stdx ⬆️ rust-analyzer 2023-02-20 10:14:12 +02:00
syntax Auto merge of #14403 - Veykril:dependencies, r=Veykril 2023-03-25 14:15:10 +00:00
test-utils Support overloaded deref MIR lowering 2023-03-17 14:02:55 +03:30
text-edit internal: Coalesce adjacent Indels 2023-03-21 11:48:32 -04:00
toolchain ⬆️ rust-analyzer 2023-03-13 10:42:24 +02:00
tt ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
vfs ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
vfs-notify ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00