a6ddf5fb80
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. |
||
---|---|---|
.. | ||
src | ||
test_data | ||
Cargo.toml |