rust-analyzer/crates/project-model
bors a6ddf5fb80 Auto merge of #16961 - Wilfred:fix_crate_ids, r=Veykril
Fix crate IDs when multiple workspaces are loaded

Previously, we assumed that the crate numbers in a `rust-project.json` always matched the `CrateId` values in the crate graph. This isn't true when there are multiple workspaces, because the crate graphs are merged and the `CrateId` values in the merged graph are different.

This broke flycheck (see first commit), because we were unable to find the workspace when a file changed, so we every single flycheck, producing duplicate compilation errors.

Instead, use the crate root module path to look up the relevant flycheck. This makes `ProjectWorkspace::Json` consistenet with `ProjectWorkspace::Cargo`.

Also, define a separate JSON crate number type, to prevent bugs like this happening again.
2024-04-01 10:43:06 +00:00
..
src Auto merge of #16961 - Wilfred:fix_crate_ids, r=Veykril 2024-04-01 10:43:06 +00:00
test_data CrateOrigin::Local means local to the project workspace, not cargo workspace 2024-02-16 16:28:17 +01:00
Cargo.toml Move Edition into span crate 2024-03-21 10:21:44 +01:00